Skip to content

Commit 1b4a1b6

Browse files
Merge pull request #771 from perdasilva/fixci414-2
[release-4.14] OCPBUGS-35230: Unblock CI
2 parents 5e8dd92 + 5c92683 commit 1b4a1b6

File tree

10,429 files changed

+85
-2937329
lines changed

Some content is hidden

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

10,429 files changed

+85
-2937329
lines changed

go.mod

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

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/blang/semver/v4 v4.0.0

staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,63 @@ jobs:
1919
- uses: actions/setup-go@v4
2020
with:
2121
go-version-file: "go.mod"
22-
- run: mkdir -p artifacts
23-
- run: make e2e-local E2E_TEST_CHUNK=${{ matrix.parallel-id }} E2E_TEST_NUM_CHUNKS=${{ strategy.job-total }} E2E_NODES=2 ARTIFACT_DIR=./artifacts/ SKIP='\[FLAKE\]'
24-
- name: Archive Test Artifacts # test results, failed or not, are always uploaded.
22+
23+
# load the olm image
24+
- name: Load OLM Docker image
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: olm-image.tar
28+
path: .
29+
- run: docker load < olm-image.tar
30+
31+
# set e2e environment variables
32+
# Set ginkgo output and parallelism
33+
- run: echo "GINKGO_OPTS=-output-dir ${ARTIFACT_DIR} -junit-report junit_e2e.xml -nodes ${E2E_NODES}" >> $GITHUB_ENV
34+
35+
# Setting -kubeconfig-root tells the e2e test suite to look for kubeconfigs
36+
# in <kubeconfig-root>/kubeconfig-<node-number>
37+
# This is used to run tests in parallel on multiple clusters as the current e2e
38+
# test suite does not support running tests in parallel on a single cluster
39+
- run: echo "E2E_OPTS=-kubeconfig-root=${E2E_KUBECONFIG_ROOT}" >> $GITHUB_ENV
40+
41+
# run e2e tests
42+
# create artifacts directory
43+
- run: mkdir -p ${ARTIFACT_DIR}
44+
45+
# deploy test clusters
46+
- name: Deploy test cluster(s)
47+
# create kubeconfig root and store the kubeconfig for each cluster within it as you create the clusters
48+
# Add kind and helm options to specify kubeconfig location
49+
# Deploy the new cluster and helm install olm for testing
50+
run: |
51+
mkdir -p ${E2E_KUBECONFIG_ROOT}
52+
for i in $(seq 1 ${E2E_NODES}); do
53+
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
54+
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
55+
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
56+
make kind-create deploy;
57+
done
58+
59+
# run non-flakes if matrix-id is not 'flakes'
60+
- name: Run e2e tests
61+
if: ${{ matrix.parallel-id != 'flakes' }}
62+
# calculate the number of chunks as the number of parallel jobs minus 1 (flakes job)
63+
# use the split tool to split the test suite into chunks and run the chunk corresponding to the matrix-id
64+
# focus on those tests and skip tests marked as FLAKE
65+
run: |
66+
E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} - 1 )) \
67+
GINKGO_OPTS="${GINKGO_OPTS} -focus '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \
68+
make e2e;
69+
70+
# run e2e tests for flakes if matrix-id is 'flakes'
71+
- name: Run flaky e2e tests
72+
if: ${{ matrix.parallel-id == 'flakes' }}
73+
# focus on tests marked as FLAKE
74+
run: |
75+
GINKGO_OPTS="${GINKGO_OPTS} -focus '\[FLAKE\]'" make e2e
76+
77+
# archive test results
78+
- name: Archive Test Artifacts
2579
if: ${{ always() }}
2680
uses: actions/upload-artifact@v3
2781
with:

staging/operator-lifecycle-manager/Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ ARCH := arm64
3434
else
3535
ARCH := 386
3636
endif
37+
38+
# Take operator registry tag from operator registry version in go.mod
39+
export OPERATOR_REGISTRY_TAG ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2)
40+
41+
# Pin operator registry images to the OPERATOR_REGISTRY_TAG
42+
export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG)
43+
export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG)
44+
3745
# Phony prerequisite for targets that rely on the go build cache to determine staleness.
3846
.PHONY: build test clean vendor \
3947
coverage coverage-html e2e \
@@ -227,31 +235,41 @@ verify-manifests: manifests
227235

228236
verify: verify-codegen verify-mockgen verify-manifests
229237

238+
.PHONY: pull-opm
239+
pull-opm:
240+
docker pull $(OPERATOR_REGISTRY_IMAGE)
241+
230242
# before running release, bump the version in OLM_VERSION and push to master,
231243
# then tag those builds in quay with the version in OLM_VERSION
232244
release: ver=v$(shell cat OLM_VERSION)
233-
release: manifests
245+
# pull the opm image to get the digest
246+
release: pull-opm manifests
234247
@echo "Generating the $(ver) release"
235248
docker pull $(IMAGE_REPO):$(ver)
236249
$(MAKE) target=upstream ver=$(ver) quickstart=true package
237250

238251
package: olmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(ver))
252+
package: opmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE))
239253
package:
240254
ifndef target
241255
$(error target is undefined)
242256
endif
243257
ifndef ver
244258
$(error ver is undefined)
245259
endif
260+
@echo "Getting operator registry image"
261+
docker pull $(OPERATOR_REGISTRY_IMAGE)
246262
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml olm.image.ref $(olmref)
247263
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml catalog.image.ref $(olmref)
248264
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml package.image.ref $(olmref)
265+
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml -- catalog.opmImageArgs "--opmImage=$(opmref)"
249266
./scripts/package_release.sh $(ver) deploy/$(target)/manifests/$(ver) deploy/$(target)/values.yaml
250267
ln -sfFn ./$(ver) deploy/$(target)/manifests/latest
251268
ifeq ($(quickstart), true)
252269
./scripts/package_quickstart.sh deploy/$(target)/manifests/$(ver) deploy/$(target)/quickstart/olm.yaml deploy/$(target)/quickstart/crds.yaml deploy/$(target)/quickstart/install.sh
253270
endif
254271

272+
255273
################################
256274
# OLM - Install/Uninstall/Run #
257275
################################

staging/operator-lifecycle-manager/deploy/chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ catalog:
4040
setWorkloadUserID: true
4141
replicaCount: 1
4242
commandArgs: --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest
43+
opmImageArgs: --opmImage=quay.io/operator-framework/opm:latest
4344
image:
4445
ref: quay.io/operator-framework/olm:master
4546
pullPolicy: Always

staging/operator-lifecycle-manager/pkg/controller/operators/olm/operator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3993,7 +3993,7 @@ func TestUpdates(t *testing.T) {
39933993
csvsToSync = syncCSVs(csvsToSync, deletedCSVs(e.shouldBe))
39943994
current = csvsToSync[e.whenIn.name]
39953995
fmt.Printf("waiting for (when) %s to be %s\n", e.whenIn.name, e.whenIn.phase)
3996-
time.Sleep(1 * time.Millisecond)
3996+
time.Sleep(1 * time.Second)
39973997
}
39983998

39993999
// sync the other csvs until they're in the expected status

staging/operator-lifecycle-manager/test/e2e/magic_catalog.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e
33
import (
44
"context"
55
"fmt"
6+
"os"
67

78
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
89
corev1 "k8s.io/api/core/v1"
@@ -257,12 +258,16 @@ func (c *MagicCatalog) makeCatalogSource() *operatorsv1alpha1.CatalogSource {
257258
func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
258259

259260
const (
260-
image = "quay.io/operator-framework/opm"
261261
readinessDelay int32 = 5
262262
livenessDelay int32 = 10
263263
volumeMountName string = "fbc-catalog"
264264
)
265265

266+
var image = "quay.io/operator-framework/opm"
267+
if os.Getenv("OPERATOR_REGISTRY_TAG") != "" {
268+
image = fmt.Sprintf("quay.io/operator-framework/opm:%s", os.Getenv("OPERATOR_REGISTRY_TAG"))
269+
}
270+
266271
return &corev1.Pod{
267272
ObjectMeta: metav1.ObjectMeta{
268273
Name: c.podName,

staging/operator-lifecycle-manager/vendor/github.com/AdaLogics/go-fuzz-headers/LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)