Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNS Topic resource remains healthy after spec.name is changed #2196

Open
daniduhnev1 opened this issue Oct 17, 2024 · 2 comments
Open

SNS Topic resource remains healthy after spec.name is changed #2196

daniduhnev1 opened this issue Oct 17, 2024 · 2 comments
Labels
service/sns Indicates issues or PRs that are related to sns-controller.

Comments

@daniduhnev1
Copy link

daniduhnev1 commented Oct 17, 2024

Describe the bug

We have observed that changing the spec.name of a resource such as an SNS topic has no effect on the resource. The topic name in AWS is not changed - this is expected as the topic name is immutable. But the k8s topic resource remains in a healthy state. For example, if the description of a “faulty” topic resource is edited, then the change is also seen on AWS. Is this behaviour expected? I believe a better behaviour here is for the resource to fail with a message saying that the spec.name is an immutable field so ACK cannot implement the change of name of the topic on AWS.

Steps to reproduce

Run kubectl apply to create an example topic:

apiVersion: sns.services.k8s.aws/v1alpha1
kind: Topic
metadata:
  name: my-ack-topic
spec:
  displayName: "Test topic"
  name: my-ack-topic

Run kubectl edit and change spec.name to something different such as my-ack-topic-edited. Resource remains as my-ack-topic on AWS as the name of a topic is immutable. However, the ACK Kubernetes resource remains healthy. If for example, spec.displayName is then changed to something different such as "Test topic edited", the description on AWS will be updated.

Expected outcome

The expected behaviour will be for the Kubernetes resource to error with a message saying that "the topic name cannot be updated because it is an immutable field".

Environment

  • Kubernetes version - 1.30
  • Using EKS (yes/no), if so version? - yes, eks.8
  • AWS service targeted (S3, RDS, etc.) - SNS Subscription
@a-hilaly a-hilaly added service/sqs Indicates issues or PRs that are related to sqs-controller. service/sns Indicates issues or PRs that are related to sns-controller. and removed service/sqs Indicates issues or PRs that are related to sqs-controller. labels Oct 21, 2024
@candonov
Copy link
Contributor

@a-hilaly, I was able to reproduce this with the latest sns controller 1.0.14 version.

ack-prow bot pushed a commit to aws-controllers-k8s/sns-controller that referenced this issue Oct 25, 2024
Issue [#2196](aws-controllers-k8s/community#2196)

Description of changes:
* Make topic name immutable
* Add e2e test checking for error after topic name change

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@a-hilaly
Copy link
Member

a-hilaly commented Oct 26, 2024

@daniduhnev1 @candonov this is fixed in the latest version of sns-controller. Now the controller treats spec.name as an immutable field, and will set a Terminal condition if a user modifies the field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/sns Indicates issues or PRs that are related to sns-controller.
Projects
None yet
Development

No branches or pull requests

3 participants