operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

(/api bump) bundle validate does not fail on invalid env in deployment spec

Open itroyano opened this issue 3 years ago • 2 comments

Bug Report

Given a CSV yaml with the following spec

deployments:
- name: controller-manager
   spec:
   .....
     template:
     .....
       spec:
         containers:
         .....
           env:
           - name: MY_IMAGE
             image: docker.io/foo:bar

operator-sdk bundle validate is successful, despite {name. image} not being a valid env spec in Deployment. it should be {name, value}.

What did you expect to see?

validation to fail on

env:
           - name: MY_IMAGE
              image: docker.io/foo:bar

What did you see instead? Under which circumstances?

INFO[0000] All validation tests have completed successfully

Environment

N/A

$ operator-sdk version

v1.21.0

$ go version (if language is Go)

go1.18.3

$ kubectl version

v1.20.1-5-g76a04fc

Possible Solution

validate each of the nested deployments in CSV, as a k8s deployment object. throw the underlying error (if any) to the validation output.

itroyano avatar Jun 20 '22 18:06 itroyano

I think that is definitely something that we need to do. However, the implementation must be done here: https://github.com/operator-framework/api/blob/master/pkg/validation/internal/csv.go

Would you like to contribute with?

c/c @ryantking

camilamacedo86 avatar Jun 21 '22 14:06 camilamacedo86

Once issue https://github.com/operator-framework/api/issues/248 is merged, we should bump to that version in operator-sdk to complete this ticket.

jmrodri avatar Jul 20 '22 18:07 jmrodri

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Dec 21 '22 09:12 openshift-bot

/remove-lifecycle stale

itroyano avatar Dec 21 '22 17:12 itroyano

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Mar 22 '23 01:03 openshift-bot

/remove-lifecycle stale

itroyano avatar Mar 22 '23 03:03 itroyano

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Jun 20 '23 09:06 openshift-bot

/remove-lifecycle stale

itroyano avatar Jun 20 '23 13:06 itroyano

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Sep 19 '23 01:09 openshift-bot

/remove-lifecycle stale

itroyano avatar Sep 19 '23 06:09 itroyano

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Dec 18 '23 09:12 openshift-bot

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot avatar Jan 18 '24 00:01 openshift-bot

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-bot avatar Feb 17 '24 08:02 openshift-bot

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

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.

openshift-ci[bot] avatar Feb 17 '24 08:02 openshift-ci[bot]