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

Workspace's with discoverable endpoints that share the same name cause endless reconcile loop #1342

Open
AObuchow opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AObuchow
Copy link
Collaborator

AObuchow commented Nov 5, 2024

Description

If a devworkspace's endpoint contains the discoverable: true attribute, then a service will be created for that specific endpoint. The endpoint's service will be given the same name as the endpoint. The intention behind the discoverable attribute is to allow endpoint services to have a static, predetermined name.

However, if 2 devworkspace's in the same namespace both have discoverable endpoints with the same name, then DWO will enter an endless reconcile loop as it tries to modify the same service for both devworkspaces.

I suggest having the devworkspacerouting controller check all discoverable endpoints for a given workspace, and see if a service already exists that shares the same name as one of the discoverable endpoints. If a service already exists with the same endpoint name, then the devworkspace should fail. This would alert the user that they need to modify their devfile/devworkspace to use a different discoverable endpoint name.

To reproduce this issue, you could create the following two devworkspace's and watch the devworkspace controller go into an endless reconcile loop:

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-dw-discoverable-endpoint-1
spec:
  started: true
  routingClass: 'basic'
  template:
    components:
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
          endpoints:
            - name: my-endpoint
              targetPort: 8080
              protocol: http
              attributes:
                discoverable: true
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-dw-discoverable-endpoint-2
spec:
  started: true
  routingClass: 'basic'
  template:
    components:
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
          endpoints:
            - name: my-endpoint
              targetPort: 8080
              protocol: http
              attributes:
                discoverable: true

Additional context

Upstream issue with further context.

@AObuchow AObuchow added the bug Something isn't working label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant