Skip to content

Commit 11bc858

Browse files
committed
In awsMachinePool tests added a AWSLaunchTemplate data
1 parent 99178e8 commit 11bc858

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ spec:
380380
- maxSize
381381
- minSize
382382
type: object
383+
x-kubernetes-validations:
384+
- message: spec.awsLaunchTemplate must be set (legacy objects missing
385+
it may remain unchanged)
386+
rule: has(self.awsLaunchTemplate) || (oldSelf == null || !has(oldSelf.awsLaunchTemplate))
383387
status:
384388
description: AWSMachinePoolStatus defines the observed state of AWSMachinePool.
385389
properties:

exp/controllers/awsmachinepool_controller_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
9898
Spec: expinfrav1.AWSMachinePoolSpec{
9999
MinSize: int32(0),
100100
MaxSize: int32(100),
101+
AWSLaunchTemplate: expinfrav1.AWSLaunchTemplate{
102+
Name: "test",
103+
},
101104
MixedInstancesPolicy: &expinfrav1.MixedInstancesPolicy{
102105
InstancesDistribution: &expinfrav1.InstancesDistribution{
103106
OnDemandAllocationStrategy: expinfrav1.OnDemandAllocationStrategyPrioritized,

0 commit comments

Comments
 (0)