Skip to content

Commit

Permalink
tests: set AllInstanceGroups alongside InstanceGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Nov 9, 2024
1 parent 1683894 commit ca61335
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/model/awsmodel/autoscalinggroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestRootVolumeOptimizationFlag(t *testing.T) {
KopsModelContext: &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: cluster},
SSHPublicKeys: k,
AllInstanceGroups: igs,
InstanceGroups: igs,
},
},
Expand Down Expand Up @@ -179,12 +180,14 @@ func TestAPIServerAdditionalSecurityGroupsWithNLB(t *testing.T) {
KopsModelContext: &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: cluster},
SSHPublicKeys: [][]byte{[]byte(sshPublicKeyEntry)},
AllInstanceGroups: igs,
InstanceGroups: igs,
},
},
BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
KopsModelContext: &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: cluster},
AllInstanceGroups: igs,
InstanceGroups: igs,
},
Lifecycle: fi.LifecycleSync,
Expand Down
1 change: 1 addition & 0 deletions pkg/model/azuremodel/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func newTestAzureModelContext() *AzureModelContext {
IAMModelContext: iam.IAMModelContext{
Cluster: cluster,
},
AllInstanceGroups: []*kops.InstanceGroup{ig},
InstanceGroups: []*kops.InstanceGroup{ig},
SSHPublicKeys: [][]byte{[]byte("ssh-rsa ...")},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/model/bootstrapscript_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func TestBootstrapUserData(t *testing.T) {
bs := &BootstrapScriptBuilder{
KopsModelContext: &KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: cluster},
AllInstanceGroups: []*kops.InstanceGroup{group},
InstanceGroups: []*kops.InstanceGroup{group},
},
NodeUpConfigBuilder: &nodeupConfigBuilder{cluster: cluster},
Expand Down
1 change: 1 addition & 0 deletions pkg/model/components/etcdmanager/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func LoadKopsModelContext(basedir string) (*model.KopsModelContext, error) {

kopsContext := &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: spec.Cluster},
AllInstanceGroups: spec.InstanceGroups,
InstanceGroups: spec.InstanceGroups,
}

Expand Down
1 change: 1 addition & 0 deletions pkg/model/components/kubeapiserver/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func LoadKopsModelContext(basedir string) (*model.KopsModelContext, error) {

kopsContext := &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: spec.Cluster},
AllInstanceGroups: spec.InstanceGroups,
InstanceGroups: spec.InstanceGroups,
}

Expand Down
1 change: 1 addition & 0 deletions pkg/model/components/kubescheduler/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func LoadKopsModelContext(basedir string) (*model.KopsModelContext, error) {

kopsContext := &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: spec.Cluster},
AllInstanceGroups: spec.InstanceGroups,
InstanceGroups: spec.InstanceGroups,
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/model/openstackmodel/servergroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ func createBuilderForCluster(cluster *kops.Cluster, instanceGroups []*kops.Insta

modelContext := &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: cluster},
AllInstanceGroups: instanceGroups,
InstanceGroups: instanceGroups,
SSHPublicKeys: [][]byte{sshPublicKey},
}
Expand Down Expand Up @@ -1570,6 +1571,7 @@ func RunGoldenTest(t *testing.T, basedir string, testCase serverGroupModelBuilde
bootstrapScriptBuilder := &model.BootstrapScriptBuilder{
KopsModelContext: &model.KopsModelContext{
IAMModelContext: iam.IAMModelContext{Cluster: testCase.cluster},
AllInstanceGroups: testCase.instanceGroups,
InstanceGroups: testCase.instanceGroups,
},
NodeUpConfigBuilder: &nodeupConfigBuilder{},
Expand Down
2 changes: 2 additions & 0 deletions upup/pkg/fi/cloudup/bootstrapchannelbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ func runChannelBuilderTest(t *testing.T, key string, addonManifests []string) {
},
}

kopsModel.AllInstanceGroups = kopsModel.InstanceGroups

tf := &TemplateFunctions{
KopsModelContext: kopsModel,
cloud: cloud,
Expand Down

0 comments on commit ca61335

Please sign in to comment.