-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[olm-cmd] Package SDK with a default version of OLM #3297
[olm-cmd] Package SDK with a default version of OLM #3297
Conversation
@estroz @camilamacedo86 @joelanford
|
ddaaa41
to
55c188b
Compare
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.
Can we include the generation of the bindata file in the normal build process? (e.g. with a new gen-bindata
target that the build/*
and install
targets depend on)?
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.
apart from Joe's comments, this tested out ok on my local dev box, seems to work...I guess the changelog fragment for this is all I can think of that might be necessary.
@@ -31,8 +31,10 @@ require ( | |||
github.com/spf13/viper v1.4.0 | |||
github.com/stretchr/testify v1.5.1 | |||
go.uber.org/zap v1.14.1 | |||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect |
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.
We do not need usually add the indirect. could you please remove and run go mod tidy
to check?
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.
I ran go mod tidy
, still they persist.
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.
The go mod tidy
sometimes do not remove. You can remove manually and then run go mod tidy
to ensure.
You can also run go mod why golang.org/x/lint v0.0.0-20200302205851-738671d3881b
. If its output contains (main module does not need package v0.0.0-20200302205851-738671d3881b) it can be removed safely.
This PR uses go-bindata to embed a default version of OLM, when user does not have any preference, so that SDK need not fetch the manifests from github everytime. The OLM manifests in this PR have the version "v0.15.1". With every release SDK the olm-bindata-vX.X.X.go intends to be updated with the most successful released version of OLM manifests.
55c188b
to
df0028c
Compare
@joelanford @camilamacedo86 @estroz Made modifications as suggested and added relevant documentation. Please have a look. |
df0028c
to
ae4a100
Compare
modify default OLM version and update manifests accordingly. | ||
kind: "addition" | ||
# Is this a breaking change? | ||
breaking: true |
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.
Why it is a breaking change? If yes, then it is missing the steps that should be used in the migration guide.
The default version which is installed in the cluster, can be specified in the `Makefile`. The OLM manifests for the default version specified in the Makefile are pre-fetched and present inside the SDK repository as Go source code. Modifying the `OLM_VERSION` variable in Makefile and running `make olm-manifests` will update the current source code file `internal/olm/olm-bindata-x.x.x`, where `x.x.x` refers to the specified version of OLM manifests. | ||
|
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.
The default version which is installed in the cluster, can be specified in the
Makefile
How users can specify in their project Makefile the default OLM version? It is specified in the SDK's project Makefile and shipped with its binary. Users have not the SDK Makefile.
Note that end-users have not the make olm-manifests
. It can be part of the contributions guide but not of the user-guide.
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.
Yeah, you're right. This doesn't seem to be the right place. Would it be suitable to include this in developers guide instead?
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.
The developer guide makes sense to me.
@@ -19,7 +19,7 @@ operator-sdk olm install [flags] | |||
-h, --help help for install | |||
--olm-namespace string namespace where OLM is to be installed. (default "olm") | |||
--timeout duration time to wait for the command to complete before failing (default 2m0s) | |||
--version string version of OLM resources to install (default "latest") | |||
--version string version of OLM resources to install; non-defaultversions are downloaded from GitHub. |
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.
It is not very clear for me.
--version string version of OLM resources to install; non-defaultversions are downloaded from GitHub. | |
--version string version of OLM resources to install. Note that, if this value is informed then the installation will be made via the manifests which are downloaded from the OLM repository E.g <add example>. |
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.
I'd rather keep this short:
--version string version of OLM resources to install; non-defaultversions are downloaded from GitHub. | |
--version string version of OLM resources to install (from a Github release); if not set, a pre-packaged OLM version will be installed |
Also we can set this default using the internally-set OLM version.
@@ -0,0 +1,7 @@ | |||
entries: | |||
- description: > | |||
Include a default version of OLM manifests with SDK. Add Makefile target to enable users to |
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.
The Makefile target
added is SDK and the user's projects scaffolded was not changed at all. So, this description is not accurate.
@@ -0,0 +1,35 @@ | |||
#!/usr/bin/env bash |
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.
the hack/lib/
is used to add libs which are valid for others scripts. E.g common.sh which is imported in other scripts and has methods which are helpers.
Otherwise, this script is used to gen/build the OLM manifests. Am I right?
So, it should not be in the /hack/lib/
. IMO it would be in hack/generate and might should not better a name as generate_olm_manifests.sh
?
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.
See the comments.
filename="olm-bindata-"$1.go | ||
echo $filename | ||
|
||
function get_olm_manifests() { |
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.
This function should default to getting the latest release of OLM. If a broken OLM release occurs, we can simply not update bindata or pin to a later non-broken release.
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.
@joelanford had suggested that instead of defaulting to the latest release always, it would be better if we could control the version of OLM which is going to get packaged with SDK. It would be a part of release process (an additional step) to run make olm-manifests
to update the latest release we want to include after checking that it isn't broken.
@varshaprasad96: 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. |
Closing this PR in favor of #3906 |
Description of the change:
This PR uses go-bindata to embed the default version (most recent successful release) of
OLM manifests when user does not have any preference, so that SDK need not fetch
the manifests from github everytime.
The OLM manifests in this PR have the version "v0.15.1". With every
release of SDK, olm-bindata-vX.X.X.go needs to be updated
with the most successful released version of OLM manifests.
Motivation for the change:
Packaging the most successful released version of OLM along with SDK,
so that for every install the manifests need not be fetched from GitHub. This
will also help in avoiding errors when the "latest" tagged version of OLM has some
problems after its release.