crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
137 stars 112 forks source link

fix(ec2): launchtemplate late init remove for defaultVersion #1377

Closed haarchri closed 4 days ago

haarchri commented 6 days ago

Description of your changes

fix update loop issue in ec2 launchtemplate when using spec.forProvider.updateDefaultVersion: true we need to skip late init for defaultVersion otherwise the manifest looks like:

apiVersion: ec2.aws.upbound.io/v1beta1
kind: LaunchTemplate
[...]
spec:
  deletionPolicy: Delete
  forProvider:
[...]
    defaultVersion: 1
[...]
    updateDefaultVersion: true
[...]
status:
  atProvider:
[...]
    defaultVersion: 7
[...]
    latestVersion: 7
[...]
  conditions:
    - lastTransitionTime: "2024-06-05T14:17:20Z"
      reason: Available
      status: "True"
      type: Ready
    - lastTransitionTime: "2024-06-05T17:59:25Z"
      reason: ReconcilePaused
      status: "False"
      type: Synced
    - lastTransitionTime: "2024-06-05T14:17:18Z"
      reason: Success
      status: "True"
      type: LastAsyncOperation

Fixes #

I have:

How has this code been tested

Uptest run: https://github.com/crossplane-contrib/provider-upjet-aws/actions/runs/9667399561

haarchri commented 6 days ago

/test-examples="examples/ec2/v1beta1/launchtemplate.yaml"