nginxinc / nginx-gateway-fabric

NGINX Gateway Fabric provides an implementation for the Gateway API using NGINX as the data plane.
Apache License 2.0
501 stars 97 forks source link

add controller to snippetsFilter status #2570

Closed salonichf5 closed 1 month ago

salonichf5 commented 1 month ago

Proposed changes

Write a clear and concise description that helps reviewers understand the purpose and impact of your changes. Use the following format:

Problem: Users want to ensure controller name is added when condition is added to SnippetsFilter.

Solution: Modify the SnippetsFilterStatus to include controller name writing status.

Testing: Unit tests

Manual Testing with two installations of NGF using different controllers

k describe snippetsfilters.gateway.nginx.org access-control
Name:         access-control
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  gateway.nginx.org/v1alpha1
Kind:         SnippetsFilter
Metadata:
  Creation Timestamp:  2024-09-18T16:05:05Z
  Generation:          2
  Resource Version:    599427
  UID:                 0da2968d-396e-4677-bf5f-b17be5ca4e12
Spec:
  Snippets:
    Context:  http
    Value:    limit_req_zone $binary_remote_addr zone=myzone:10m rate=1r/s;
    Context:  http.server.location
    Value:    limit_req zone=myzone burst=3;
Status:
  Controllers:
    Conditions:
      Last Transition Time:  2024-09-18T20:42:58Z
      Message:               SnippetsFilter is accepted
      Observed Generation:   2
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
    Controller Name:         gateway.nginx.org/nginx-gateway-controller
    Conditions:
      Last Transition Time:  2024-09-18T20:43:20Z
      Message:               SnippetsFilter is accepted
      Observed Generation:   2
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
    Controller Name:         gateway.nginx.org/nginx-gateway-controller-2
Events:                      <none>
sa.choudhary@N9939CQ4P0 ~ %

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide specific feedback, add them here.

Closes #2542

Checklist

Before creating a PR, run through this checklist and mark each as complete.

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes, please add a brief note that summarizes the change.

kate-osborn commented 1 month ago

@salonichf5 did you manually test this?

salonichf5 commented 1 month ago

@salonichf5 did you manually test this?

working on it :)

bjee19 commented 1 month ago

LGTM!

Just make sure to follow Kate's comment and add the issue number to the PR.