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

User-provided Name tag on subnets get overwritten #3989

Closed
AverageMarcus opened this issue Jan 17, 2023 · 1 comment · Fixed by #3991
Closed

User-provided Name tag on subnets get overwritten #3989

AverageMarcus opened this issue Jan 17, 2023 · 1 comment · Fixed by #3991
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@AverageMarcus
Copy link
Member

AverageMarcus commented Jan 17, 2023

/kind bug

What steps did you take and what happened:

Specify a subnet on an AWSCluster CR that has a Name tag defined. E.g.

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSCluster
metadata:
  name: example
spec:
  network:
    subnets:
    - availabilityZone: eu-north-1a
      cidrBlock: 10.0.0.0/24
      isPublic: false
      tags:
        Name: example-custom-subnet-name

This Name tag will be instead replaced with one built in code and instead become Name: example-subnet-private-eu-north-1a

What did you expect to happen:

If a Name tag is provided by the user it is what should be used when creating / updating the subnet. If not provided CAPA should default to the current generated format.

Anything else you would like to add:

Block of code building the Name value: https://github.com/giantswarm/cluster-api-provider-aws/blob/70373384dc117ea387d28a8548d49ecc58e7cca0/pkg/cloud/services/network/subnets.go#L426-L441

Block of code overwriting any user-provided Name tag: https://github.com/giantswarm/cluster-api-provider-aws/blob/70373384dc117ea387d28a8548d49ecc58e7cca0/api/v1beta1/tags.go#L198-L200

As far as I can see, that tag isn't used anywhere in the codebase for matching or looking up of subnets. It seem purely for display.

Multiple subnets can end up with the same Name value.

Environment:

  • Cluster-api-provider-aws version: >= 1.5
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 17, 2023
@dlipovetsky
Copy link
Contributor

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority labels Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
3 participants