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

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

Conversation

hc-github-team-consul-core

Backport

This PR is auto-generated from #3597 to be assessed for backporting due to the inclusion of the label backport/1.4.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/scarcely-fair-sole branch from 443e71d to 633d3a4 Compare February 13, 2024 19:52
@missylbytes missylbytes force-pushed the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/scarcely-fair-sole branch from 633d3a4 to 551d4c8 Compare February 14, 2024 14:47
@missylbytes missylbytes force-pushed the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/scarcely-fair-sole branch from 551d4c8 to 2c46409 Compare February 14, 2024 14:57
@hc-github-team-consul-core hc-github-team-consul-core merged commit 7c45471 into release/1.4.x Feb 14, 2024
22 of 46 checks passed
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/mg-fix-logic-on-apigateway-that-ignores-current-annotations-on-services/scarcely-fair-sole branch February 14, 2024 15:20
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