Skip to content

Conversation

@nmvk
Copy link
Contributor

@nmvk nmvk commented May 20, 2021

Add an advisory condition if an immutable field is modified.

  Conditions:
    Status:     False
    Type:       ACK.Terminal
    Status:     True
    Type:       ACK.ResourceSynced
    Status:     False
    Type:       ACK.Recoverable
    Message:    Immutable Spec fields have been modified : AtRestEncryptionEnabled,TransitEncryptionEnabled
    Status:     True
    Type:       ACK.Advisory
  Description:  Reinvent replication group

Clears the status upon fixing the field in the manifest

  Conditions:
    Status:     False
    Type:       ACK.Terminal
    Status:     True
    Type:       ACK.ResourceSynced
    Status:     False
    Type:       ACK.Recoverable
  Description:  Reinvent replication group

This commit allows one to specify immutable fields in generator.yaml.

      TransitEncryptionEnabled:
        is_immutable: true
      AtRestEncryptionEnabled:
        is_immutable: true

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@surajkota
Copy link
Contributor

how about making the message available in ACK.Recoverable itself?

because it looks like the controller will never be able to reach the desired state/spec so customer should revert the fields

@jaypipes
Copy link
Collaborator

how about making the message available in ACK.Recoverable itself?

because it looks like the controller will never be able to reach the desired state/spec so customer should revert the fields

ACK.ConditionTypeRecoverable was mainly for communicating with the user that an external dependency or failure happened and that the controller would be able to reconcile the resource if those external things were fixed. In this case, we want to indicate to the user that they've made a modification to the desired state that we're going to ignore and they should revert their changes to get rid of the message. Subtly different, IMHO.

ack-bot pushed a commit to aws-controllers-k8s/runtime that referenced this pull request May 31, 2021
New condition ACK.Advisory to set the condition
when any immutable field is modified.

This is needed for aws-controllers-k8s/code-generator#70
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @nmvk 👍

Can you please change the PR description (Change ACKWarning to ACKAdvisory)?

@ack-bot will squash/commit using the PR TItle/description

Comment on lines 291 to 293
}
// handleImmutableFieldsChangedCondition validates the immutable fields and set appropriate condition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space between functions needed

@nmvk nmvk changed the title Immutable fields warning Immutable fields advisory May 31, 2021
Add an advisory condition if an immutable
field is modified.

This commit allows one to specify immutable
fields in generator.yaml.
@RedbackThomson
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 1, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, nmvk, RedbackThomson, vijtrip2

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [A-Hilaly,RedbackThomson,vijtrip2]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit e625f74 into aws-controllers-k8s:main Jun 1, 2021
RedbackThomson pushed a commit to RedbackThomson/ack-runtime that referenced this pull request Jun 21, 2021
New condition ACK.Advisory to set the condition
when any immutable field is modified.

This is needed for aws-controllers-k8s/code-generator#70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants