test: Add Test Checks Wipe Disks List#99
Open
irishgordo wants to merge 1 commit into
Open
Conversation
* we are adding more mock data and a test that checks the wipe disks list gets brought in correctly, we previously did not know that seeder needed to parse content as install.wipediskslist and thought rather, it was supposed to be install.wipe_disks_list , this test just adds baseline sanity to show that it is parsing now how we have configuration set for some internal systems that depend on seeders provisioning process Resolves: investigation/seeder-unmarshalls-not-like-installer Signed-off-by: Mike Russell <michael.russell@suse.com>
khushboo-rancher
approved these changes
May 18, 2026
There was a problem hiding this comment.
Pull request overview
Adds a regression test plus a new testdata fixture (customized-create.yaml) to confirm that seeder/Harvester parses install.wipediskslist (the actual key used by harvester-installer) rather than the previously assumed install.wipe_disks_list.
Changes:
- New test
Test_createModeCloudConfigCheckWipeDisksListWorksBecauseSpecClusterConfigWipeDisksDeprecatedexercisesgenerateCloudConfigagainst the new fixture and assertshc.WipeDisksListis populated. - New
pkg/tink/testdata/customized-create.yamlfixture containing aninstall.wipediskslistwith four disks and other realistic settings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/tink/tink_test.go | Adds new test verifying wipediskslist parsing from YAML config. |
| pkg/tink/testdata/customized-create.yaml | New fixture supplying an install.wipediskslist with four entries. |
Comments suppressed due to low confidence (2)
pkg/tink/tink_test.go:67
- Most arguments passed to
generateCloudConfighere are empty strings/zero values, includingmode, which differs from the other two tests in this file that exercise meaningful values. This makes it hard to tell what configuration is actually being tested, and the unusualvlanIDvalue of2021appears arbitrary. Consider passing the same realistic inputs used byTest_createModeCloudConfig(withmode = "create"to match the test name) so the test reflects howgenerateCloudConfigis actually called in production, and replace2021with a documented or shared constant.
cloudConfig, err := generateCloudConfig("file:///testdata/customized-create.yaml", "", "", "", "", "", "", "", "", nil, nil, nil, "", "", "", "", "", false, false, 2021, "", "", "")
pkg/tink/tink_test.go:72
- The assertion only checks the length of
hc.WipeDisksListbut not its contents. Since the purpose of this test is to verify thatinstall.wipediskslistis parsed correctly (vs. the previously assumedinstall.wipe_disks_list), it would be more meaningful to also assert the actual disk entries (e.g.,/dev/vda,/dev/nvme0n1,/dev/sda,/dev/sdb) are present. A length-only check would still pass if the entries were silently misparsed into the wrong slots.
assert.Len(hc.WipeDisksList, 4)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert.Contains(hc.WipeDisksList, "/dev/vda", "expected to find /dev/vda in wipeDisksList") | ||
| } | ||
|
|
||
| func Test_createModeCloudConfigCheckWipeDisksListWorksBecauseSpecClusterConfigWipeDisksDeprecated(t *testing.T) { |
Contributor
Author
|
Thoughts on possibly removing, seeder/pkg/api/v1alpha1/cluster_types.go Line 58 in 63401ba ? Since our OS level changes break that functionality in Harvester. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: investigation/seeder-unmarshalls-not-like-installer