mirror of https://github.com/kubernetes/kops.git
Merge pull request #15526 from justinsb/remove_duplicate_cluster
Remove duplicate Cluster field in BootstrapScriptBuilder
This commit is contained in:
commit
dcdbec93e1
|
@ -72,6 +72,8 @@ func TestRootVolumeOptimizationFlag(t *testing.T) {
|
||||||
},
|
},
|
||||||
BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
|
BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
|
||||||
Lifecycle: fi.LifecycleSync,
|
Lifecycle: fi.LifecycleSync,
|
||||||
|
KopsModelContext: &model.KopsModelContext{
|
||||||
|
IAMModelContext: iam.IAMModelContext{
|
||||||
Cluster: &kops.Cluster{
|
Cluster: &kops.Cluster{
|
||||||
Spec: kops.ClusterSpec{
|
Spec: kops.ClusterSpec{
|
||||||
CloudProvider: kops.CloudProviderSpec{
|
CloudProvider: kops.CloudProviderSpec{
|
||||||
|
@ -82,6 +84,8 @@ func TestRootVolumeOptimizationFlag(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
Cluster: cluster,
|
Cluster: cluster,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +188,6 @@ func TestAPIServerAdditionalSecurityGroupsWithNLB(t *testing.T) {
|
||||||
InstanceGroups: igs,
|
InstanceGroups: igs,
|
||||||
},
|
},
|
||||||
Lifecycle: fi.LifecycleSync,
|
Lifecycle: fi.LifecycleSync,
|
||||||
Cluster: cluster,
|
|
||||||
},
|
},
|
||||||
Cluster: cluster,
|
Cluster: cluster,
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ import (
|
||||||
"k8s.io/kops/pkg/apis/kops"
|
"k8s.io/kops/pkg/apis/kops"
|
||||||
"k8s.io/kops/pkg/model"
|
"k8s.io/kops/pkg/model"
|
||||||
"k8s.io/kops/pkg/model/defaults"
|
"k8s.io/kops/pkg/model/defaults"
|
||||||
|
"k8s.io/kops/pkg/model/iam"
|
||||||
"k8s.io/kops/upup/pkg/fi"
|
"k8s.io/kops/upup/pkg/fi"
|
||||||
"k8s.io/kops/upup/pkg/fi/fitasks"
|
"k8s.io/kops/upup/pkg/fi/fitasks"
|
||||||
)
|
)
|
||||||
|
@ -35,12 +36,16 @@ func TestVMScaleSetModelBuilder_Build(t *testing.T) {
|
||||||
AzureModelContext: newTestAzureModelContext(),
|
AzureModelContext: newTestAzureModelContext(),
|
||||||
BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
|
BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
|
||||||
Lifecycle: fi.LifecycleSync,
|
Lifecycle: fi.LifecycleSync,
|
||||||
|
KopsModelContext: &model.KopsModelContext{
|
||||||
|
IAMModelContext: iam.IAMModelContext{
|
||||||
Cluster: &kops.Cluster{
|
Cluster: &kops.Cluster{
|
||||||
Spec: kops.ClusterSpec{
|
Spec: kops.ClusterSpec{
|
||||||
Networking: kops.NetworkingSpec{},
|
Networking: kops.NetworkingSpec{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
c := &fi.CloudupModelBuilderContext{
|
c := &fi.CloudupModelBuilderContext{
|
||||||
Tasks: make(map[string]fi.CloudupTask),
|
Tasks: make(map[string]fi.CloudupTask),
|
||||||
|
|
|
@ -52,7 +52,6 @@ type BootstrapScriptBuilder struct {
|
||||||
Lifecycle fi.Lifecycle
|
Lifecycle fi.Lifecycle
|
||||||
NodeUpAssets map[architectures.Architecture]*mirrors.MirroredAsset
|
NodeUpAssets map[architectures.Architecture]*mirrors.MirroredAsset
|
||||||
NodeUpConfigBuilder NodeUpConfigBuilder
|
NodeUpConfigBuilder NodeUpConfigBuilder
|
||||||
Cluster *kops.Cluster
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type BootstrapScript struct {
|
type BootstrapScript struct {
|
||||||
|
|
|
@ -180,7 +180,6 @@ func TestBootstrapUserData(t *testing.T) {
|
||||||
Hash: hashing.MustFromString("e525c28a65ff0ce4f95f9e730195b4e67fdcb15ceb1f36b5ad6921a8a4490c71"),
|
Hash: hashing.MustFromString("e525c28a65ff0ce4f95f9e730195b4e67fdcb15ceb1f36b5ad6921a8a4490c71"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cluster: cluster,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := bs.ResourceNodeUp(c, group)
|
res, err := bs.ResourceNodeUp(c, group)
|
||||||
|
|
|
@ -43,6 +43,7 @@ type IAMModelContext struct {
|
||||||
// AWSPartition defines the partition of the AWS account, typically "aws", "aws-cn", or "aws-us-gov"
|
// AWSPartition defines the partition of the AWS account, typically "aws", "aws-cn", or "aws-us-gov"
|
||||||
AWSPartition string
|
AWSPartition string
|
||||||
|
|
||||||
|
// Cluster holds the cluster we are working with.
|
||||||
Cluster *kops.Cluster
|
Cluster *kops.Cluster
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1465,7 +1465,6 @@ func RunGoldenTest(t *testing.T, basedir string, testCase serverGroupModelBuilde
|
||||||
Hash: hashing.MustFromString("e525c28a65ff0ce4f95f9e730195b4e67fdcb15ceb1f36b5ad6921a8a4490c71"),
|
Hash: hashing.MustFromString("e525c28a65ff0ce4f95f9e730195b4e67fdcb15ceb1f36b5ad6921a8a4490c71"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cluster: testCase.cluster,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
builder := createBuilderForCluster(testCase.cluster, testCase.instanceGroups, clusterLifecycle, bootstrapScriptBuilder)
|
builder := createBuilderForCluster(testCase.cluster, testCase.instanceGroups, clusterLifecycle, bootstrapScriptBuilder)
|
||||||
|
|
|
@ -522,7 +522,6 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error {
|
||||||
Lifecycle: clusterLifecycle,
|
Lifecycle: clusterLifecycle,
|
||||||
NodeUpConfigBuilder: configBuilder,
|
NodeUpConfigBuilder: configBuilder,
|
||||||
NodeUpAssets: c.NodeUpAssets,
|
NodeUpAssets: c.NodeUpAssets,
|
||||||
Cluster: cluster,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue