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

fix: controller should list all virtualservicemerges, not just those in the same namespace #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dlemfh
Copy link

@dlemfh dlemfh commented Aug 20, 2023

Current behavior

The istio-virtualservice-merger controller watches for changes to VirtualServices.

For each VirtualService that changed, the controller triggers reconciliation for VirtualServiceMerges (that target the changed VirtualService) that are in the same namespace as the changed VirtualService.

This fails to account for VirtualServiceMerges deployed to a different namespace than its target VirtualService.

Ex)

# VirtualService
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: api-routes
  namespace: app-space
spec:
  gateways:
    - mesh
  hosts:
    - internal-api.monime.sl
---
# VirtualServiceMerge
apiVersion: istiomerger.monime.sl/v1alpha1
kind: VirtualServiceMerge
metadata:
  name: review-routes
  namespace: merge-space    # VSM namespace is different from VS namespace
spec:
  target:
    name: api-routes
    namespace: app-space
  patch:
    http:
      - match:
          - uri:
              prefix: /reviews
        route:
          - destination:
              host: review-service
              port:
                number: 8080

Proposed behavior

For each changed VirtualService, the controller should trigger reconciliation for all VirtualServiceMerges (that target the changed VirtualService) regardless of the VirtualServiceMerge's namespace.

Again, this is because VirtualServiceMerges and their target VirtualServices can be deployed to different namespaces.

Tests

We are currently using this edited version of the controller in production, and everything works as expected.

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.

1 participant