Skip to content

Backport of Fix logic on apigateway that ignores current annotations on services into release/1.3.x#3623

Merged
hc-github-team-consul-core merged 1 commit intorelease/1.3.xfrom
backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/personally-probable-sawfly
Feb 14, 2024
Merged

Backport of Fix logic on apigateway that ignores current annotations on services into release/1.3.x#3623
hc-github-team-consul-core merged 1 commit intorelease/1.3.xfrom
backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/personally-probable-sawfly

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #3597 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

The below text is copied from the body of the original PR.


Changes proposed in this PR

  • Fixes for NET-7113
  • Previously, any extra annotations added to a service controlled by an API Gateway would infinitely reconcile, as the Gateway would keep removing the extra annotations.
  • Logic was added to prevent this, as well as prevent the same issue with labels.

How I've tested this PR

Built a local image and installed onto a Kind cluster with the following values:

# values.yaml
global:
  name: consul
  imageK8S: consul-k8s-control-plane:local

connectInject:
  enabled: true
  apiGateway:
    managedGatewayClass:
      copyAnnotations:
        service:
          annotations: |
            - cupcake

Then I created an API Gateway with the following values:

# gateway.yaml
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: my-gateway
  annotations:
    cupcake: strawberry
spec:
  gatewayClassName: consul
  listeners:
  - protocol: HTTP
    port: 80
    name: http
    allowedRoutes:
      namespaces:
        from: "All"

These resulted in a service that looked like this:
image

---------- Testing Annotations -------------------------------------------------------------------------------------

I then edited the service to add an additional annotation

image

And after editing, I made sure this additional annotation was still there:

image

---------- Testing Labels -------------------------------------------------------------------------------------

I also tested for labels by editing the service and adding a label

image

Then looked at the service again to make sure the label stayed

image

How I expect reviewers to test this PR

Check out the tests, test manually

Checklist


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/personally-probable-sawfly branch from 4de3352 to 70089ab Compare February 13, 2024 19:51
@missylbytes missylbytes force-pushed the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/personally-probable-sawfly branch from 70089ab to 89ebac2 Compare February 14, 2024 14:24
@hc-github-team-consul-core hc-github-team-consul-core merged commit d9d91e3 into release/1.3.x Feb 14, 2024
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/personally-probable-sawfly branch February 14, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants