Skip to content

Commit 3e1dc5c

Browse files
Merge pull request #343 from timflannagan/ginkgo-v2
Sync 07/26
2 parents 404ac3c + c8ae912 commit 3e1dc5c

File tree

274 files changed

+13374
-10591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+13374
-10591
lines changed

api.blacklist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
decf74800a179da9f002ae2234204c7e6b866f9a

docs/downstream-ci.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,63 @@ The CI configuration for each release branch can be found [here](https://github.
44
From `4.11` (`master` as of this writing) we've updated the configuration to able to influence CI on a PR basis. An overview of the `ci-operator` (the system used for ci)
55
can be found [here](https://docs.ci.openshift.org/docs/architecture/ci-operator/).
66

7-
### Structure
7+
## Structure
88

9-
* `.ci-operator.yaml` defines the `build_root_image`. To be ART compliant, the image should come from the [ocp-build-data](https://github.com/openshift/ocp-build-data/) repo
10-
* [openshift-operator-framework-olm-master.yaml](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-master.yaml) defines the images that are used by ci, produced by ci, and the ci jobs the get executed.
11-
* `base.Dockerfile` defines the image used by ci to execute the ci jobs
9+
- `.ci-operator.yaml` defines the `build_root_image`. To be ART compliant, the image should come from the [ocp-build-data](https://github.com/openshift/ocp-build-data/) repo
10+
- [openshift-operator-framework-olm-master.yaml](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-master.yaml) defines the images that are used by ci, produced by ci, and the ci jobs the get executed.
11+
- `base.Dockerfile` defines the image used by ci to execute the ci jobs
1212

1313
From [openshift-operator-framework-olm-master.yaml](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-master.yaml), we see under the `images` stanza the `ci-image` definition.
1414
It goes from `src` (the `build_root_image`) to `ci-image` by building `base.Dockerfile` with `src` as the base image.
1515

16-
```
16+
```yaml
1717
- dockerfile_path: base.Dockerfile
1818
from: src
1919
to: ci-image
2020
```
2121
2222
The image is excluded from promotion, to never be posted up anywhere:
2323
24-
```
24+
```yaml
2525
promotion:
2626
excluded_images:
2727
- ci-image
2828
```
2929
3030
and each `test` references `ci-image` as the image to be used to the test, e.g.:
3131

32-
```
32+
```yaml
3333
tests:
3434
- as: verify
3535
commands: make verify
3636
container:
3737
from: ci-image
3838
```
3939

40-
### Updating go versions
40+
## Updating go versions
4141

42-
All we need to do is update the `build_root_image` referenced in `.ci-operator.yaml` and we may also need to update the `base_images` in [openshift-operator-framework-olm-master.yaml](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-master.yaml).
42+
All we need to do is update the `build_root_image` referenced in `.ci-operator.yaml` and we may also need to update the `base_images` in [openshift-operator-framework-olm-master.yaml](https://github.com/openshift/release/blob/master/ci-operator/config/openshift/operator-framework-olm/openshift-operator-framework-olm-master.yaml).
4343

4444
**NOTE**: I believe there is some automation that updates the base images, though I don't know. I'll leave this as a questions to the reviewer, and if no one knows, I'll go after it.
4545

46-
### Downstream sync
46+
## Downstream sync
4747

4848
The complete information about the downstreaming process can be found [here](https://docs.google.com/document/d/139yXeOqAJbV1ndC7Q4NbaOtzbSdNpcuJan0iemORd3g/edit).
4949

5050
TL;DR;
5151

5252
We sync three upstream repositories ([api](https://github.com/operator-framework/api), [registry](https://github.com/operator-framework/operator-registry), [olm](https://github.com/operator-framework/operator-lifecycle-manager)) to the downstream [olm mono-repo](https://github.com/openshift/operator-framework-olm). Commits from the upstream repositories are cherry-picked to the appropriate `staging` directory in the downstream repository. Because this is a monorepo in the `Openshift` GitHub organization, two things need to be remembered:
53-
- we don't pull in upstream `vendor` folder changes
54-
- we don't pull in changes to `OWNERS` files
55-
- after each cherry-pick we execute: `make vendor` and `make manifests` to ensure a) the downstream dependencies are updated b) to ensure any manifest changes are picked up downstream
56-
-- Note: `make manifests` requires [GNU sed](https://www.gnu.org/software/sed/)
5753

58-
While manual changes to the `staging` directory should be avoided, there could be instances where there drift between the downstream `staging` directory and the corresponding upstream repository. This can happen due to applying commits out-of-order, e.g. due to feature freeze, etc.
54+
- we don't pull in upstream `vendor` folder changes
55+
- we don't pull in changes to `OWNERS` files
56+
- after each cherry-pick we execute: `make vendor` and `make manifests` to ensure a) the downstream dependencies are updated b) to ensure any manifest changes are picked up downstream
57+
- Note: `make manifests` requires [GNU sed](https://www.gnu.org/software/sed/)
58+
59+
While manual changes to the `staging` directory should be avoided, there could be instances where there drift between the downstream `staging` directory and the corresponding upstream repository. This can happen due to applying commits out-of-order, e.g. due to feature freeze, etc.
5960

60-
Therefore, after a sync, it is important to manually verify the diff of `staging` and the upstream. Please note, though, that some downstream changes are downstream only. These are, however, few and far between and there are comments to indicate that a block of code is downstream only.
61+
Therefore, after a sync, it is important to manually verify the diff of `staging` and the upstream. Please note, though, that some downstream changes are downstream only. These are, however, few and far between and there are comments to indicate that a block of code is downstream only.
6162

62-
The downstream sync process is facilitated by two scripts: `scripts/sync_get_candidates.sh` and `scripts/sync_pop_candidate.sh`, which compare the upstream remote with the appropriate `staging` directory and gets a stack of commits to sync, and cherry-pick those commits in reverse order. What does this look like in practice:
63+
The downstream sync process is facilitated by two scripts: `scripts/sync_get_candidates.sh` and `scripts/sync_pop_candidate.sh`, which compare the upstream remote with the appropriate `staging` directory and gets a stack of commits to sync, and cherry-pick those commits in reverse order. What does this look like in practice:
6364

6465
```bash
6566
# Clone downstream
@@ -72,8 +73,8 @@ git remote add operator-lifecycle-manager [email protected]:operator-framework/oper
7273
7374
# Get upstream commit candidates: ./scripts/sync_get_candidates.sh <api|operator-registry|operator-lifecycle-manager> <branch>
7475
# The shas will be found in ./<api|operator-registry|operator-lifecycle-manager>.cherrypick
75-
./scripts/sync_get_candidates.sh api master
76-
./scripts/sync_get_candidates.sh operator-registry master
76+
./scripts/sync_get_candidates.sh api master
77+
./scripts/sync_get_candidates.sh operator-registry master
7778
./scripts/sync_get_candidates.sh operator-lifecycle-manager master
7879
7980
# Sync upstream commits: ./scripts/sync_pop_candidate.sh <api|operator-registry|operator-lifecycle-manager> [-a]
@@ -90,7 +91,7 @@ sync_pop_candidate.sh operator-registry -a
9091
# Depending on the changes being pulled in, the order of repos you sync _could_ matter and _could_ leave a commit in an unbuildable state
9192
```
9293

93-
Example:
94+
Example:
9495

9596
```bash
9697
$ sync_pop_candidate.sh operator-lifecycle-manager -a
@@ -117,7 +118,7 @@ hint: run "git cherry-pick --abort".
117118
118119
$ rm -rf staging/operator-lifecycle-manager/vendor
119120
120-
# make sure there are no conflics in
121+
# make sure there are no conflics in
121122
# staging/operator-lifecycle-manager/go.mod and go.sum
122123
$ cd staging/operator-lifecycle-manager
123124
$ go mod tidy
@@ -131,4 +132,4 @@ $ sync_pop_candidate.sh operator-lifecycle-manager -a
131132

132133
#### Running console test locally
133134

134-
The [console](https://github.com/openshift/console) repository contains all instructions you need to execute the console tests locally. The olm console tests can be found [here](https://github.com/openshift/console/tree/master/frontend/packages/operator-lifecycle-manager)
135+
The [console](https://github.com/openshift/console) repository contains all instructions you need to execute the console tests locally. The olm console tests can be found [here](https://github.com/openshift/console/tree/master/frontend/packages/operator-lifecycle-manager)

docs/local-testing-with-crc.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Local testing with CRC
22

3-
We can use CRC as an Openshift-like environment within which to test downstream OLM. [CRC](https://developers.redhat.com/products/codeready-containers/overview)
3+
We can use CRC as an Openshift-like environment within which to test downstream OLM. [CRC](https://developers.redhat.com/products/codeready-containers/overview)
44
is a tool for deploying a local Openshift cluster on your laptop.
55

66
TL;DR
@@ -10,16 +10,16 @@ TL;DR
1010
3. `export KUBECONFIG=~/.crc/machines/crc/kubeconfig`
1111
4. Execute e2e tests as you normally would, e.g., `make e2e/olm`
1212

13-
#### Gosh darn it, how does it work?
13+
## Gosh darn it, how does it work?
1414

1515
`./scripts/crc-start.sh` is used to provision a crc cluster. `./scripts/crc-deploy.sh` pushes the `olm:test` and `opm:test` to
1616
`image-registry.openshift-image-registry.svc:5000/openshift/olm:test` and `image-registry.openshift-image-registry.svc:5000/openshift/opm:test`
1717
images to the crc image registry under the global project `openshift` (to be independent from the olm namespace). It also generates an image stream
18-
from these images. Finally, using the istag for the image. It also generates the olm manifests by applying generated helm values file (`values-crc-e2e.yaml`)
18+
from these images. Finally, using the istag for the image. It also generates the olm manifests by applying generated helm values file (`values-crc-e2e.yaml`)
1919
and other generated yaml patches (`scripts/*.crc.e2e.patch.yaml`) to make sure the manifests point to the newly pushed images. The generated manifests are
2020
then applied to the cluster using `kubectl replace` in priority order (lexical sort).
2121

22-
#### Make targets
22+
## Make targets
2323

2424
1. `make crc-start`: provision a crc cluster, if necessary
2525
1. `FORCE_CLEAN=1 make crc-start`: nuke any current installation including cache and current cluster instance
@@ -29,7 +29,7 @@ then applied to the cluster using `kubectl replace` in priority order (lexical s
2929
2. `SKIP_WAIT_READY=1 make crc-deploy`: skip waiting for olm deployments to be available at the end
3030
4. `make crc`: the same as `make crc-start crc-build crc-deploy`
3131

32-
#### Manipulating Resources
32+
## Manipulating Resources
3333

3434
If new resources are introduced that require being updated for local deployment (e.g. updating the pod spec image) follow
35-
the pattern used in `scripts/crc-deploy.sh:make_manifest_patches`
35+
the pattern used in `scripts/crc-deploy.sh:make_manifest_patches`.

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/grpc-ecosystem/grpc-health-probe v0.4.11
1111
github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1
1212
github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37
13-
github.com/onsi/ginkgo v1.16.5
13+
github.com/onsi/ginkgo/v2 v2.1.3
1414
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
1515
github.com/operator-framework/api v0.15.0
1616
github.com/operator-framework/operator-lifecycle-manager v0.0.0-00010101000000-000000000000
@@ -124,6 +124,7 @@ require (
124124
github.com/google/gnostic v0.5.7-v3refs // indirect
125125
github.com/google/go-cmp v0.5.6 // indirect
126126
github.com/google/gofuzz v1.2.0 // indirect
127+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
127128
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
128129
github.com/google/uuid v1.2.0 // indirect
129130
github.com/gorilla/mux v1.8.0 // indirect
@@ -172,7 +173,6 @@ require (
172173
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
173174
github.com/morikuni/aec v1.0.0 // indirect
174175
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
175-
github.com/nxadm/tail v1.4.8 // indirect
176176
github.com/onsi/gomega v1.18.1 // indirect
177177
github.com/opencontainers/go-digest v1.0.0 // indirect
178178
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
@@ -239,7 +239,6 @@ require (
239239
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
240240
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
241241
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
242-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
243242
gopkg.in/warnings.v0 v0.1.2 // indirect
244243
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
245244
k8s.io/apiextensions-apiserver v0.24.0 // indirect

go.sum

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,10 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
635635
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
636636
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
637637
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
638+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
638639
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
639640
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
641+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
640642
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
641643
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
642644
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
@@ -951,7 +953,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
951953
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
952954
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
953955
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
954-
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
956+
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
957+
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
955958
github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE=
956959
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
957960
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=

operator-lifecycle-manager.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
604825027920cdc52a489669b22f51910cabfa69
21
fd3322a2bafedce1821ed45b8a9bcce429126af7
32
ef91a92858f22a2510e243efc2ae114272b6ad7b
43
c7b6534da9ec82b0266fdd69da8ade80d1a8ff80

operator-registry.blacklist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
0b2f43f426f9d621cab7a5224fc260ae3265be1c
2+
eb2e6393796f397e93618c4aa5038f6a366cdb31

staging/api/.github/workflows/go.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: 1.17
18+
go-version: 1.18
1919
id: go
2020
- name: Check out code into the Go module directory
2121
uses: actions/checkout@v2
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up Go
4040
uses: actions/setup-go@v2
4141
with:
42-
go-version: 1.17
42+
go-version: 1.18
4343
id: go
4444
- name: Print out Go env
4545
run: go env

staging/api/.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- uses: actions/setup-go@v2
1616
with:
17-
go-version: '~1.17'
17+
go-version: '~1.18'
1818
- name: Run the verify target
1919
run: |
2020
export GOPATH=$(go env GOPATH)

staging/api/Makefile

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,30 @@ test-unit: ## Run the unit tests
8686
verify: manifests generate format
8787
git diff --exit-code
8888

89-
###
90-
# Utilities.
91-
###
89+
################
90+
# Hack / Tools #
91+
################
92+
93+
GO_INSTALL_OPTS ?= "-mod=mod"
94+
95+
## Location to install dependencies to
96+
LOCALBIN ?= $(shell pwd)/bin
97+
$(LOCALBIN):
98+
mkdir -p $(LOCALBIN)
99+
100+
## Tool Binaries
101+
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
102+
YQ ?= $(LOCALBIN)/yq
103+
104+
## Tool Versions
105+
CONTROLLER_TOOLS_VERSION ?= v0.8.0
106+
107+
.PHONY: controller-gen
108+
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
109+
$(CONTROLLER_GEN): $(LOCALBIN)
110+
GOBIN=$(LOCALBIN) go install $(GO_INSTALL_OPTS) sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
92111

93-
# go-get-tool will 'go get' any package $2 and install it to $1.
94-
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
95-
define go-get-tool
96-
@[ -f $(1) ] || { \
97-
set -e ;\
98-
TMP_DIR=$$(mktemp -d) ;\
99-
cd $$TMP_DIR ;\
100-
go mod init tmp ;\
101-
echo "Downloading $(2)" ;\
102-
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
103-
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
104-
rm -rf $$TMP_DIR ;\
105-
}
106-
endef
107-
108-
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
109-
controller-gen: ## Download controller-gen locally if necessary.
110-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
111-
112-
YQ = $(shell pwd)/bin/yq
113-
yq:
114-
$(call go-get-tool,$(YQ),github.com/mikefarah/yq/v3)
112+
.PHONY: yq
113+
yq: $(YQ) ## Download yq locally if necessary.
114+
$(YQ): $(LOCALBIN)
115+
GOBIN=$(LOCALBIN) go install $(GO_INSTALL_OPTS) github.com/mikefarah/yq/v3@latest

staging/api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/operator-framework/api
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/blang/semver v3.5.1+incompatible

0 commit comments

Comments
 (0)