🐛 Default AWSMachine in admission controller instead of during reconciliation as it's not allowed to update the awsmachine.spec field after the initial creation - #5748
Conversation
|
Skipping CI for Draft Pull Request. |
7040319 to
5d1d25a
Compare
|
/test all |
|
/test pull-cluster-api-provider-aws-e2e-blocking |
|
/test pull-cluster-api-provider-aws-e2e |
|
/test pull-cluster-api-provider-aws-e2e-blocking |
| // If InstanceMetadataOptions is not set in the spec, don't modify the instance | ||
| // The webhook will set defaults on new resources, but we shouldn't force defaults on existing instances |
There was a problem hiding this comment.
| // If InstanceMetadataOptions is not set in the spec, don't modify the instance | |
| // The webhook will set defaults on new resources, but we shouldn't force defaults on existing instances | |
| // If InstanceMetadataOptions is not set in the spec, don't modify the AWSMachine. | |
| // The webhook will set defaults on new AWSMachines, but we cannot write defaults to existing objects | |
| // because validation doesn't allow changes to the spec. |
| Attribute: ec2types.NetworkInterfaceAttributeGroupSet, | ||
| })).Return(&ec2.DescribeNetworkInterfaceAttributeOutput{Groups: []ec2types.GroupIdentifier{{GroupId: aws.String("3")}}}, nil).MaxTimes(1) | ||
| m.ModifyNetworkInterfaceAttribute(context.TODO(), gomock.Any()).AnyTimes() | ||
| m.ModifyInstanceMetadataOptions(context.TODO(), gomock.Any()).MaxTimes(1) |
There was a problem hiding this comment.
That's IMO not expected while creating an instance. The metadata should be set once in RunInstances, and not modified afterwards.
There was a problem hiding this comment.
I think you're right. I gave it another shot, I completely removed ModifyInstanceMetadataOptions now, and rely only on the admission controller to change the metadata options.
9f2b6d6 to
7f241e1
Compare
|
/test all |
|
/test pull-cluster-api-provider-aws-e2e |
1 similar comment
|
/test pull-cluster-api-provider-aws-e2e |
|
I think we should retitle the PR and release note to show what the change fixes. For me, this looks fine but I'm not sure if it was intended that the full /lgtm |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
25 similar comments
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
Co-authored-by: Andreas Sommer <andreas.sommer87@googlemail.com>
69ca74b to
d212f53
Compare
What type of PR is this?
/kind bug
What this PR does / why we need it:
While reconciling newly created
AWSMachines, I noticed that this error usually happensThe problem is that we are setting the defaults on the existing
AWSMachinewhile reconciling it. I think it'd be better to use the defaulting admission controller instead, and avoid default during the reconciliation.Checklist:
Release note: