Skip to content
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

ENTESB-18466: Introduces control of OLM upgradeability using OLM OperatorCondition flag #9913

Merged
merged 6 commits into from Feb 25, 2022

Conversation

phantomjinx
Copy link
Contributor

@phantomjinx phantomjinx commented Feb 23, 2022

It looks horrendous but first commit is updating dependencies due to use of OperatorLib 0.9.0. Probably only need to review the go.mod and .lib.sh changes. Otherwise, the later 4 commits are more important.

* operator-lib provides factory functions for setting operator
  conditions
* Calling make test-catalog, the bundle will be built, pushed and
  added to a copy of the 4.11 catalog. The resulting image can be
  pushed and used as a catalogsource for testing the OLM install
  of the bundle metadata.
* The OLM bundle needs the kafka and public-api cluster roles as
  the operator install action applies the ClusterRoleBindings in
  assets/infrastructure. The bindings call for these roles by
  name so they must be installed by the OLM as well as by the
  syndesis install --cluster-setup
* When operator is installed via OLM, a separate OperatorCondition
  CR is created which can be updated with an "upgradeable"
  condition flagging whether the OLM can upgrade the operator

* Turn off upgradeable state when
 * operator is initializing
 * operator is upgrading

* Turn on upgradeable state when
 * operator has started
 * operator has completed an upgrade

* Finds the OperatorCondition using the deployment name, deployment
  owner (CSV) and the CSV name (OperatorCondition has same name as
  the CSV).

* Adds conditions tests but cannot completely implement due to
  operator-framework/operator-lib#103
@phantomjinx
Copy link
Contributor Author

Causing build action to fail. Will investigate ...

@claudio4j
Copy link
Contributor

I am getting the same build error as reported by CI

F0223 18:36:24.675564  922577 config.go:57] Failed loading boilerplate: open /home/claudio/alphaworks/go/src/k8s.io/kube-openapi/boilerplate/boilerplate.go.txt: no such file or directory
goroutine 1 [running]:
k8s.io/klog/v2.stacks(0xc0000bc001, 0xc00ba6de60, 0xbb, 0x10e)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:972 +0xb9
k8s.io/klog/v2.(*loggingT).output(0xb85180, 0xc000000003, 0x0, 0x0, 0xc0001cd500, 0x9c6f07, 0x9, 0x39, 0x0)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:921 +0x191
k8s.io/klog/v2.(*loggingT).printf(0xb85180, 0x3, 0x0, 0x0, 0x8a1f3c, 0x1e, 0xc00b687d28, 0x1, 0x1)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:733 +0x17a
k8s.io/klog/v2.Fatalf(...)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:1427
k8s.io/kube-openapi/pkg/generators.Packages(0xc0001cd490, 0xc0000c3d60, 0x87472f, 0xd, 0xc0001cd490)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/kube-openapi@v0.0.0-20211109043538-20434351676c/pkg/generators/config.go:57 +0x11e
k8s.io/gengo/args.(*GeneratorArgs).Execute(0xc0000c3d60, 0xc00b687e38, 0x87472f, 0xd, 0x8b8a08, 0x0, 0x0)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/gengo@v0.0.0-20200413195148-3a45101e95ac/args/args.go:206 +0x1b7
main.main()
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/kube-openapi@v0.0.0-20211109043538-20434351676c/cmd/openapi-gen/openapi-gen.go:50 +0x352

goroutine 18 [chan receive]:
k8s.io/klog/v2.(*loggingT).flushDaemon(0xb85180)
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:1107 +0x8b
created by k8s.io/klog/v2.init.0
        /home/claudio/alphaworks/go/pkg/mod/k8s.io/klog/v2@v2.0.0/klog.go:416 +0xd8

@zregvart
Copy link
Member

@phantomjinx see install/operator/.lib.sh, might good to base these changes on top of #9786

Copy link
Member

@zregvart zregvart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* By default, openapi-gen looks for a boilerplace.go.txt file in
  ${SRC}/go/src/kube-openapi/boilerplate but `go mod vendor`
  excludes this directory when vendoring dependencies.

* .lib.sh
 * Include our own boilerplate directory and use the
   --go-header-file switch to specify its location
 * Improve the brevity of the openapi-gen function

* boilerplate.go.txt
 * Reflects our licence header rather than kubernetes

* Makefile
 * Replace which with command as latter is posix compliant

* Update to kube-openapi version and generated api files
@phantomjinx phantomjinx merged commit 28dfcfe into syndesisio:1.14.x Feb 25, 2022
@@ -0,0 +1,16 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants