Skip to content

Commit

Permalink
fix(test): remove removed fields from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
budimanjojo committed Jan 20, 2024
1 parent 44f7711 commit cbdd779
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
18 changes: 1 addition & 17 deletions pkg/config/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ nodes:
ipAddress: 1.2.3.4.5
installDisk: /dev/sda
disableSearchDomain: true
extensions:
- image: hehe
nameservers:
- 8.8.8.8
networkInterfaces:
Expand All @@ -44,9 +42,6 @@ nodes:
routes:
- network: 0.0.0.0/0
gateway: 1.2.3.4.5.6
configPatches:
- op: del
path: /cluster
ingressFirewall:
defaultAction: block
rules:
Expand All @@ -73,7 +68,7 @@ nodes:
- test.yaml
`)

errs, warns, err := ValidateFromByte(data)
errs, _, err := ValidateFromByte(data)
if err != nil {
t.Fatal(err)
}
Expand All @@ -93,7 +88,6 @@ nodes:
"nodes[0].nameservers": false,
"nodes[0].ingressFirewall": false,
"nodes[0].networkInterfaces": true,
"nodes[0].configPatches": true,
"nodes[1].hostname": true,
"nodes[1].ipAddress": true,
"nodes[1].installDisk": true,
Expand All @@ -104,19 +98,9 @@ nodes:
"nodes[1].extraManifests": true,
}

expectedWarnings := map[string]bool{
"nodes[0].extensions": true,
}

for k, v := range expectedErrors {
if errs.HasField(k) != v {
t.Errorf("%s: got %t, want %t", k, errs.HasField(k), v)
}
}

for k, v := range expectedWarnings {
if warns.HasField(k) != v {
t.Errorf("%s: got %t, want %t", k, warns.HasField(k), v)
}
}
}
6 changes: 0 additions & 6 deletions pkg/talos/nodeconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ nodes:
expectedNode1Hostname := "node1"
expectedNode1InstallDisk := "/dev/sda"
expectedNode1DisableSearchDomain := true
expectedNode1Extensions := []v1alpha1.InstallExtensionConfig{
{
ExtensionImage: "ghcr.io/siderolabs/tailscale:1.44.0",
},
}
expectedNode1MachineFiles := []*v1alpha1.MachineFile{
{
FileContent: "TS_AUTHKEY=123456",
Expand Down Expand Up @@ -163,7 +158,6 @@ nodes:
compare(cpCfg.MachineNetwork.Hostname(), expectedNode1Hostname, t)
compare(cpCfg.MachineInstall.InstallDisk, expectedNode1InstallDisk, t)
compare(cpCfg.MachineNetwork.DisableSearchDomain(), expectedNode1DisableSearchDomain, t)
compare(cpCfg.MachineInstall.InstallExtensions, expectedNode1Extensions, t)
compare(cpCfg.MachineFiles, expectedNode1MachineFiles, t)
compare(cpCfg.MachineNetwork.NetworkInterfaces, expectedNode1NetworkInterfaces, t)
compare(cpCfg.MachineKernel, expectedNode1KernelModules, t)
Expand Down

0 comments on commit cbdd779

Please sign in to comment.