[WIP] bundle: fix bundle create, bump operator-registry v1.6.0#2715
[WIP] bundle: fix bundle create, bump operator-registry v1.6.0#2715estroz wants to merge 3 commits intooperator-framework:masterfrom
bundle create, bump operator-registry v1.6.0#2715Conversation
88abadb to
d0b6474
Compare
| Then, use the flag --operator-namespace to inform the namespace where the Operator will be "deployed" in and then, it will set the environment variable OPERATOR_NAMESPACE. If this value is not set, then it will be the namespace defined as default in the Kubeconfig. | ||
|
|
||
| NOTE: For more information check the PRs which are responsible for the above changes [#2617](https://github.com/operator-framework/operator-sdk/pull/2617). | ||
| - If you've run `operator-sdk bundle create --generate-only`, move your bundle Dockerfile at `<project-root>/deploy/olm-catalog/<operator-name>/Dockerfile` to `<project-root>/bundle.Dockerfile` and update the first `COPY` from `COPY /*.yaml manifests/` to `COPY deploy/olm-catalog/<operator-name>/<bundle-dir> manifests/`. [#2715](https://github.com/operator-framework/operator-sdk/pull/2715) |
There was a problem hiding this comment.
@kevinrizza the v1.6 update breaks --generate-only behavior, since the argument to --directory, which is for a named bundle dir ex deploy/olm-catalog/my-operator/0.0.1, is placed in a top-level bundle.Dockerfile. Running operator-sdk bundle create --directory deploy/olm-catalog/my-operator/0.0.2 after generating a metadata/Dockerfile for 0.0.1 results in a bundle for 0.0.1.
How does opm work with a directory structure like this?
There was a problem hiding this comment.
we had a weird implementation where the metadata/ folder was getting inserted inside the manifest folder and then the dockerfile had to extract it out. we modified it so that the scaffold matched what actually appeared on the directory structure in the container image.
that was one of the big purposes of this update. You shouldn't be creating versioned folders, instead you should have a single manifests/ folder and a matching metadata/ folder. the registry api update pushes the metadata/ folder to the same directory level as the manifest/ folder
There was a problem hiding this comment.
So users are expected to use a VCS to manage bundle versions going forward, and everything in manifests/ is always latest?
@joelanford @jmccormick2001 @dmesser we're going to have to make a serious breaking change to the CSV generator/dir structure unless we can come up with a middle ground.
There was a problem hiding this comment.
Yes, this is what i was trying to say for a while. The CI pipelines are going to be built around having just one bundle in your repository and when you want to push a change you just update that bundle -- this is for a few reasons, but the big one is because the operator bundles are just single versions, and if we didn't do it this way we would have to come up with a bunch of complex CI that would need to know that a new folder was generated in a specific subdirectory and know how to aggregate it. Also, the annotations.yaml file is aggregated at the specific bundle version and not at the package layer.
There was a problem hiding this comment.
Hi @kevinrizza,
move your bundle Dockerfile at
<project-root>/deploy/olm-catalog/<operator-name>/Dockerfileto<project-root>/bundle.Dockerfile
Note that what you are asking for the user does will break the commands for SDK cli.
if we didn't do it this way we would have to come up with a bunch of complex CI that would need to know that a new folder was generated in a specific subdirectory and know how to aggregate it.
Would not be possible to add flags there to pass the current location and the CI job looking for the files in the path informed and/or copy them for anyplace according to this needs?
There was a problem hiding this comment.
@kevinrizza #2746 helps users migrate to a manifests/ format while supporting versioned bundle dirs. Next is for generate csv to do the same.
|
/hold Waiting to resolve #2715 (comment) |
*Update operator-registry dependency to 1.6.0 *Adds fix for generated dockerfiles *Adds optional output-directory parameter *Update cleanup funcs to handle new structure
d0b6474 to
b0d9d75
Compare
bundle code, bump operator-registry v1.6.0bundle code, bump operator-registry v1.6.0
bundle code, bump operator-registry v1.6.0bundle create, bump operator-registry v1.6.0
|
/kind bug |
09c5515 to
1810754
Compare
operator-registry image builder but not generated by the SDK. In case deploy/olm-catalog/<operator-name>/manifests doesn't exist, create one and delete it after the image is done building. If --generate-only is set, do not remove manifests/. --version lets a user specify which operator version they want to build an image for, and --latest uses the highest semver'd operator in the bundle parent dir. hack/tests: add 'bundle create' test cases doc,website: update generated CLI docs CHANGELOG.md: --output-dir addition and breaking change for bundle.Dockerfile location doc/migration: add breaking change to migration guide
|
Now blocked by operator-framework/operator-registry#237 since we'll have to bump versions once a new one is released with this fix. |
1810754 to
accf2bf
Compare
|
Closing in favor of #2746 |
Description of the change: some cleanup of
bundlecode, bump operator-registry to v1.6.0, add--output-dir(from #2662), various other changes described in the motivation section.Motivation for the change: From #2662:
This PR fixes an issue where
manifests/is expected by the operator-registry image builder but not generated by the SDK. In casedeploy/olm-catalog/<operator-name>/manifestsdoesn't exist, create one and delete it after the image is done building. If--generate-onlyis set, do not removemanifests/.--versionlets a user specify which operator version they want to build an image for, and--latestuses the highest semver'd bundle.This change partially allows the SDK to support the new manifests format for bundles while being backwards-compatible with versioned bundle directories. Still some work to do on the CSV generation side of things, but at least
bundle createnow works with current projects.TODO:
bundle create [--generate-only]->bundle validate/area dependency