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

Missing lints for invalid DNS names #44

Open
Iristyle opened this issue Jun 9, 2020 · 0 comments
Open

Missing lints for invalid DNS names #44

Iristyle opened this issue Jun 9, 2020 · 0 comments

Comments

@Iristyle
Copy link

Iristyle commented Jun 9, 2020

This may be a problem downstream, but I noticed a couple of deployment failures on some YAML files that passed linting successfully:

  • Invalid name on Secret. YAML that passed linting:
apiVersion: v1
kind: Secret
metadata:
  name: object_store

value should be object-store, not object_store

Error from attempted deploy:

Error from server (Invalid): error when creating "/Users/iristyle/source/holodeck/holodeck-manifests/output/cd4pe/overlays/midstream": Secret "object_store" is invalid: metadata.name: Invalid value: "object_store": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
  • Related, invalid reference to this name from a Deployment (only relevant YAML shown):
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cd4pe
  namespace: 'cd4pe'
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: cd4pe
  template:
    metadata:
      labels:
        app.kubernetes.io/name: cd4pe
    spec:
      initContainers:
      - name: create-bucket
        image: minio/mc
        env:
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: object_store
              key: accessKey

value should be object-store, not object_store

Error message

Resource: "apps/v1, Resource=deployments", GroupVersionKind: "apps/v1, Kind=Deployment"
Name: "cd4pe", Namespace: "cd4pe"
for: "/Users/iristyle/source/holodeck/holodeck-manifests/output/cd4pe/overlays/midstream": Deployment.apps "cd4pe" is invalid: [spec.template.spec.containers[0].env[13].valueFrom.secretKeyRef.name: Invalid value: "object_store": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'),
  • Same basic problem with a preflight check
apiVersion: troubleshoot.replicated.com/v1beta1
kind: Preflight
metadata:
  name: cd4pe-preflight
spec:
  collectors:
  - run:
      name: object_store
      collectorName: object_store_credentials_valid
      image: minio/mc

object_store_credentials_valid should be object-store-credentials-valid

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

No branches or pull requests

1 participant