-
Notifications
You must be signed in to change notification settings - Fork 1.8k
internal/generator/olm-catalog: implement CSV generator #2407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
use CSV and package manifest generators internal/generate/olm-catalog: implement CSV and package manifest generators, moving most of the code from internal/scaffold/olm-catalog verbatim. Also removed CSV config doc: remove CSVConfig documentation, update CLI docs
hi @estroz I found these problems: 1. Need
|
@aliok thanks a bunch for testing this. Turns out that exposing 1 was introduced in #2322 to uphold assumptions the generator makes about where it is run. Perhaps we can relax this requirement to just having a I was not able to reproduce 4. Can you post your project's path? Does this affect our latest release (v0.15.0)? |
I see (2) and (3) are now fixed. That's really awesome!
That would be great I think.
It happens with 0.15.0 as well. I think that's probably a problem on my side. The project is at standard GOPATH (/home/aliok/go/src/knative.dev/eventing-operator) and is not a GoModules project (uses Thanks a lot again. Once we relax the rule for (1), we will be able to use the operator-sdk CLI with no problems at the Knative upstream operators. |
err = writeCRDsToDir(csvCfg.CRDCRPaths, filepath.Dir(input.Path)) | ||
if err != nil { | ||
return err | ||
bundleDir := filepath.Join(gencatalog.OLMCatalogDir, strings.ToLower(c.operatorName), c.csvVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estroz I might have missed this from previous PRs but if the CSV generator inputs are meant to be configurable i.e change g.inputs[DeployDirKey]
to point to another location deploy/production/
or in my case config
for Kubebuilder's layout, then updating the CRD manifest to that new location would fail.
While the CSV and package manifests are written out to the new location, OLMCatalogDir
is currently fixed to always be rooted at the deploy/
directory so it will try to update the CRDs there.
Is there any way we can stop using that constant, and instead use the generator's input for DeployDirKey
?
Not sure if any other cmds that need to have a configurable "deploy" directory are using this constant as well. That could be another thing to watch out for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to reconsider how inputs/filters are set up.
if typeMeta, err := GetTypeMetaFromBytes(b); err == nil { | ||
if typeMeta.Kind == "CustomResourceDefinition" { | ||
crdPaths = append(crdPaths, path) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @estroz,
It shows great. Just missing a rebase.
@@ -18,6 +19,8 @@ | |||
|
|||
### Removed | |||
|
|||
- **Breaking Change:** Removed CSV configuration file support in favor of including files as input to the generator using [`generate csv --include`](doc/cli/operator-sdk_generate_csv.md#options), defaulting to the `deploy/` directory. ([#2249](https://github.com/operator-framework/operator-sdk/pull/2249)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Breaking Change:** Removed CSV configuration file support in favor of including files as input to the generator using [`generate csv --include`](doc/cli/operator-sdk_generate_csv.md#options), defaulting to the `deploy/` directory. ([#2249](https://github.com/operator-framework/operator-sdk/pull/2249)) | |
- **Breaking Change:** Removed CSV configuration file support (Defaults to deploy/olm-catalog/csv-config.yaml) in favor of including files as input to the generator using [`generate csv --include`](doc/cli/operator-sdk_generate_csv.md#options), defaulting to the `deploy/` directory. ([#2249](https://github.com/operator-framework/operator-sdk/pull/2249)) |
@camilamacedo86 We discussed some necessary changes to the flags and generator config to better facilitate inputs/output for non-standard projects layout. |
@estroz: PR needs rebase. 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. |
/hold |
@hasbro17 let me know if you need somebody to give things a try |
Closing this in favor of #2511 although that's still a WIP so not quite ready for reviews yet. |
Description of the change:
cmd/operator-sdk/olmcatalog: remove config flag, add include flag, use CSV and package manifest generators
internal/generate/olm-catalog: implement CSV generator, moving most of the code from internal/scaffold/olm-catalog verbatim. Also removed CSV config
doc: remove CSVConfig documentation, update CLI docs
Motivation for the change: prepare CSV generator for plugin refactor. CSV config was removed in favor of the more flexible
--include
flag.