Skip to content

Bad error message when multiple containers defined #4706

Closed

Description

@dgerd

In what area(s)?

/area API

/area autoscale
/area build
/area monitoring
/area networking
/area test-and-release

What version of Knative?

0.2.x
0.3.x
Output of git describe --dirty
0.7

Expected Behavior

I get an error that only one container can be specified.

Actual Behavior

The defaulting logic to move v1alpha1 to v1beta1 ends up clearing both container images prior to validation in the webhook. The result is an empty rs.Containers with a length on 1 gets passed to validation giving the following error message:

Internal error occurred: admission webhook "webhook.serving.knative.dev" denied the request: mutation failed: missing field(s): spec.template.spec.containers[0].image

The bug looks to be in pkg/apis/serving/v1beta1/revision_defaults.go on line 48.

Steps to Reproduce the Problem

Apply a spec with 2 container defined.

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: test-svc
spec:
  template:
    spec:
      containers:
        - image: gcr.io/cloudsql-docker/gce-proxy
        - image: hub.docker.com/_/hello-world

Activity

  1. added
    kind/bug
    on Jul 10, 2019
  2. added
    area/API
    on Jul 10, 2019
  3. markusthoemmes commented on Jul 16, 2019

    @markusthoemmes
    Contributor

    /assign @nak3

  4. knative-prow-robot commented on Jul 16, 2019

    @knative-prow-robot
    Contributor

    @markusthoemmes: GitHub didn't allow me to assign the following users: nak3.

    Note that only knative members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.
    For more information please see the contributor guide

    Details

    In response to this:

    /assign @nak3

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIkind/bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions