Bug 1798894
Summary: | opm should NOT validate the Kind object for the package YAML format | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Jian Zhang <jiazha> |
Component: | OLM | Assignee: | Evan Cordell <ecordell> |
OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | medium | ||
Priority: | medium | CC: | bandrade, bluddy, kuiwang, scolange, tbuskey, vdinh |
Version: | 4.4 | Keywords: | Reopened |
Target Milestone: | --- | ||
Target Release: | 4.4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-05-04 11:34:15 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jian Zhang
2020-02-06 09:18:52 UTC
The manifest directory of a bundle image should only contain Kubernetes manifests. opm is reporting a valid error in this case. Hi, Ben Do you mean I should remove the package definition from the manifest? If so, the manifest cannot work as a bundle. And, the error opm reports here is confusing for the user. Yes, bundle images shouldn't contain a package YAML file. Package and channel name are present as key-value pairs in the required annotations.yaml file. The documentation for the new bundle image type is here: https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md and a sample is here: https://github.com/operator-framework/bundle-example. Do you have any suggestions for how to improve the validation error message? The validation tool doesn't know what a package file is, so it's not able to explain precisely why this is failing. It expects all manifests/*.yaml files to be valid Kubernetes manifests, which is why the error says that the required field "Kind" is missing. Hi, I would like to clarify couple things and reinstate the fact this is not a bug. The bundle manifest means Kubernetes manifests such as CRD or OLM internal type such as CSV and they are meant to be installed on the cluster. They need to have `Kind` and `apiVersion` in their YAML. The package.yaml is metadata manifest which contains information about the bundle itself and it is not installed on the cluster so technically speaking it should be in the metadata folder. For the new bundle format, we are moving away from package.yaml (deprecated) as all information regarding bundle is now in annotations.yaml. Those channel, default channel and package name are supplied via parameters on opm build command. So when you include the package.yaml in bundle manifests folder, it is expected that validation library will error out as this is not a valid/supported type. What we can do here is to improve the documentation to include which types are supported and make that information explicitly clear so users are aware. Would that be a good way to resolve this issue? Thanks, Vu Hi, Vu, Ben
> What we can do here is to improve the documentation to include which types are supported and make that information explicitly clear so users are aware. Would that be a good way to resolve this issue?
Yes, great! I see now, I think so too, thanks very much! Verify it first.
Now, the users are confused with "bundle image" in the output of the "opm alpha bundle validate".
It's not the image that stores the operator manifests. It's better if we can give more details on this output.
mac:operator-registry jianzhang$ ./opm alpha bundle validate --help
The "opm alpha bundle validate" command will validate bundle image
from a remote source to determine if its format and content information are
accurate.
Usage:
opm alpha bundle validate [flags]
Examples:
$ opm alpha bundle validate --tag quay.io/test/test-operator:latest --image-builder docker
Flags:
-h, --help help for validate
-b, --image-builder string Tool to build container images. One of: [docker, podman] (default "docker")
-t, --tag string The path of a registry to pull from, image name and its tag that present the bundle image (e.g. quay.io/test/test-operator:latest)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0581 |