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

[release-4.14] OCPBUGS-35230: Unblock CI #771

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/openshift/operator-framework-olm

go 1.19
go 1.20

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
60 changes: 57 additions & 3 deletions staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,63 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- run: mkdir -p artifacts
- 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\]'
- name: Archive Test Artifacts # test results, failed or not, are always uploaded.

# load the olm image
- name: Load OLM Docker image
uses: actions/download-artifact@v4
with:
name: olm-image.tar
path: .
- run: docker load < olm-image.tar

# set e2e environment variables
# Set ginkgo output and parallelism
- run: echo "GINKGO_OPTS=-output-dir ${ARTIFACT_DIR} -junit-report junit_e2e.xml -nodes ${E2E_NODES}" >> $GITHUB_ENV

# Setting -kubeconfig-root tells the e2e test suite to look for kubeconfigs
# in <kubeconfig-root>/kubeconfig-<node-number>
# This is used to run tests in parallel on multiple clusters as the current e2e
# test suite does not support running tests in parallel on a single cluster
- run: echo "E2E_OPTS=-kubeconfig-root=${E2E_KUBECONFIG_ROOT}" >> $GITHUB_ENV

# run e2e tests
# create artifacts directory
- run: mkdir -p ${ARTIFACT_DIR}

# deploy test clusters
- name: Deploy test cluster(s)
# create kubeconfig root and store the kubeconfig for each cluster within it as you create the clusters
# Add kind and helm options to specify kubeconfig location
# Deploy the new cluster and helm install olm for testing
run: |
mkdir -p ${E2E_KUBECONFIG_ROOT}
for i in $(seq 1 ${E2E_NODES}); do
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
make kind-create deploy;
done

# run non-flakes if matrix-id is not 'flakes'
- name: Run e2e tests
if: ${{ matrix.parallel-id != 'flakes' }}
# calculate the number of chunks as the number of parallel jobs minus 1 (flakes job)
# use the split tool to split the test suite into chunks and run the chunk corresponding to the matrix-id
# focus on those tests and skip tests marked as FLAKE
run: |
E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} - 1 )) \
GINKGO_OPTS="${GINKGO_OPTS} -focus '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \
make e2e;

# run e2e tests for flakes if matrix-id is 'flakes'
- name: Run flaky e2e tests
if: ${{ matrix.parallel-id == 'flakes' }}
# focus on tests marked as FLAKE
run: |
GINKGO_OPTS="${GINKGO_OPTS} -focus '\[FLAKE\]'" make e2e

# archive test results
- name: Archive Test Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
Expand Down
20 changes: 19 additions & 1 deletion staging/operator-lifecycle-manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ ARCH := arm64
else
ARCH := 386
endif

# Take operator registry tag from operator registry version in go.mod
export OPERATOR_REGISTRY_TAG ?= $(shell go list -m github.com/operator-framework/operator-registry | cut -d" " -f2)

# Pin operator registry images to the OPERATOR_REGISTRY_TAG
export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG)
export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG)

# Phony prerequisite for targets that rely on the go build cache to determine staleness.
.PHONY: build test clean vendor \
coverage coverage-html e2e \
Expand Down Expand Up @@ -227,31 +235,41 @@ verify-manifests: manifests

verify: verify-codegen verify-mockgen verify-manifests

.PHONY: pull-opm
pull-opm:
docker pull $(OPERATOR_REGISTRY_IMAGE)

# before running release, bump the version in OLM_VERSION and push to master,
# then tag those builds in quay with the version in OLM_VERSION
release: ver=v$(shell cat OLM_VERSION)
release: manifests
# pull the opm image to get the digest
release: pull-opm manifests
@echo "Generating the $(ver) release"
docker pull $(IMAGE_REPO):$(ver)
$(MAKE) target=upstream ver=$(ver) quickstart=true package

package: olmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(ver))
package: opmref=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE))
package:
ifndef target
$(error target is undefined)
endif
ifndef ver
$(error ver is undefined)
endif
@echo "Getting operator registry image"
docker pull $(OPERATOR_REGISTRY_IMAGE)
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml olm.image.ref $(olmref)
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml catalog.image.ref $(olmref)
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml package.image.ref $(olmref)
$(YQ_INTERNAL) w -i deploy/$(target)/values.yaml -- catalog.opmImageArgs "--opmImage=$(opmref)"
./scripts/package_release.sh $(ver) deploy/$(target)/manifests/$(ver) deploy/$(target)/values.yaml
ln -sfFn ./$(ver) deploy/$(target)/manifests/latest
ifeq ($(quickstart), true)
./scripts/package_quickstart.sh deploy/$(target)/manifests/$(ver) deploy/$(target)/quickstart/olm.yaml deploy/$(target)/quickstart/crds.yaml deploy/$(target)/quickstart/install.sh
endif


################################
# OLM - Install/Uninstall/Run #
################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ catalog:
setWorkloadUserID: true
replicaCount: 1
commandArgs: --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest
opmImageArgs: --opmImage=quay.io/operator-framework/opm:latest
image:
ref: quay.io/operator-framework/olm:master
pullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3993,7 +3993,7 @@ func TestUpdates(t *testing.T) {
csvsToSync = syncCSVs(csvsToSync, deletedCSVs(e.shouldBe))
current = csvsToSync[e.whenIn.name]
fmt.Printf("waiting for (when) %s to be %s\n", e.whenIn.name, e.whenIn.phase)
time.Sleep(1 * time.Millisecond)
time.Sleep(1 * time.Second)
}

// sync the other csvs until they're in the expected status
Expand Down
7 changes: 6 additions & 1 deletion staging/operator-lifecycle-manager/test/e2e/magic_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2e
import (
"context"
"fmt"
"os"

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

const (
image = "quay.io/operator-framework/opm"
readinessDelay int32 = 5
livenessDelay int32 = 10
volumeMountName string = "fbc-catalog"
)

var image = "quay.io/operator-framework/opm"
if os.Getenv("OPERATOR_REGISTRY_TAG") != "" {
image = fmt.Sprintf("quay.io/operator-framework/opm:%s", os.Getenv("OPERATOR_REGISTRY_TAG"))
}

return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: c.podName,
Expand Down

This file was deleted.

Loading