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

[BUG] - service has no selector specified raised when using Endpoint #746

Open
marcmognol opened this issue Mar 15, 2024 · 0 comments
Open

Comments

@marcmognol
Copy link

System info:

  • OS: [e.g. Linux? MaxOS? Windows?]

Describe the bug
If I use both Service and Endpoint manifests, Kube Linter raises :

/manifests/service-mt1.yaml: (object: service-mt1 /v1, Kind=Service) service has no selector specified (check: dangling-service, remediation: Confirm that your service's selector correctly matches the labels on one of your deployments.)

To Reproduce
Run Kube Linter with the below sample.

Sample YAML input
If applicable, sample YAML input which reproduces the issue.

---
kind: Endpoints
apiVersion: v1
metadata:
  name: service-mt1
subsets:
  - addresses:
      - ip: 10.1.2.3
    ports:
      - name: https
        port: 443

---
apiVersion: v1
kind: Service
metadata:
  name: service-mt1
spec:
  ports:
    - name: https
      port: 443
      targetPort: 443

Expected behavior
A clear and concise description of what you expected to happen.

Kube Linter should be aware that this Service is linked to the Endpoint and selector is not necessary, so no need to raise the error.

Screenshots
N/A

Additional context
N/A

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 a pull request may close this issue.

1 participant