operator-framework / operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
https://sdk.operatorframework.io
Apache License 2.0
7.25k stars 1.75k forks source link

`operator-sdk bundle validate` doesn't check type correctness of all values #6168

Closed arewm closed 3 months ago

arewm commented 2 years ago

Bug Report

Bundle validation passes when values within the CSV do not have appropriate types.

This has been encountered multiple times. We traced down the suspected offending lines to when the spec.version was a string as well as when metadata.annotations.* were not strings, for example,

metadata:
  annotations:
    certified: true

What did you do?

Ran opm render and opm bundle add resulting in an error message

Error: unrecognized type: string

When trying to track the source of the issue, we ran operator-sdk bundle validate, but no errors were raised.

What did you expect to see?

An error message indicating which values have the wrong type

What did you see instead? Under which circumstances?

Validation passed without errors

Environment

Operator type:

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.25.1", commit: "162690ff23f3542c0565e1420223e30dfae5dd49", kubernetes version: "1.25.0", go version: "go1.19.2", GOOS: "linux", GOARCH: "arm64"

$ go version (if language is Go)

$ kubectl version

Possible Solution

Additional context

These issues were encountered when trying to add bundles to an index image. We traced it down to improper types which bundle validation did not catch.

Related image in operator-registry: https://github.com/operator-framework/operator-registry/issues/1039

varshaprasad96 commented 1 year ago

@theishshah would you be working on this before the next release (1.28). If its difficult to get in, please feel free to move it to the next one.

openshift-bot commented 1 year ago

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

lslebodn commented 1 year ago

/remove-lifecycle stale

varshaprasad96 commented 1 year ago

@theishshah would it be possible to get this in before the next release due on July 24 (1.31). If not, please feel free to bump it to the next one.

varshaprasad96 commented 1 year ago

@theishshah Is it fine if we unassign you from this issue, and add a help wanted label. It would helpful if you could mentor anyone working on this issue since you have knowledge on where the codebase lives.

openshift-bot commented 12 months ago

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

arewm commented 12 months ago

/remove-lifecycle stale

openshift-bot commented 9 months ago

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

skitt commented 8 months ago

/remove-lifecycle stale

openshift-bot commented 5 months ago

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 commented 4 months ago

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 commented 3 months ago

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-ci[bot] commented 3 months ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/operator-framework/operator-sdk/issues/6168#issuecomment-2240780384): >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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.