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 image field not flagged #193

Open
james-callahan opened this issue Apr 17, 2023 · 0 comments
Open

Missing image field not flagged #193

james-callahan opened this issue Apr 17, 2023 · 0 comments

Comments

@james-callahan
Copy link

With a bad patch I accidentally created an invalid deployment (I inserted an extra container to add resources rather than changing the existing one):

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: cert-manager
  name: cert-manager
  namespace: cert-manager
spec:
  selector:
    matchLabels:
      app.kubernetes.io/component: controller
      app.kubernetes.io/name: cert-manager
  template:
    metadata:
      labels:
        app.kubernetes.io/component: controller
        app.kubernetes.io/name: cert-manager
    spec:
      containers:
      - name: cert-manager
        resources:
          requests:
            memory: 35Mi
      - args:
        - --v=2
        - --cluster-resource-namespace=$(POD_NAMESPACE)
        - --leader-election-namespace=$(POD_NAMESPACE)
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: quay.io/jetstack/cert-manager-controller:v1.11.1@sha256:4f1782c8316f34aae6b9ab823c3e6b7e6e4d92ec5dac21de6a17c3da44c364f1
        name: cert-manager-controller
        .... more here

When I attempted to apply this to my cluster, I got the error from kubernetes:

Deployment.apps "cert-manager" is invalid: spec.template.spec.containers[0].image: Required value

I'm surprised that kubeconform didn't flag this problem; shouldn't it have?

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