Skip to content

Commit 78779bc

Browse files
Merge pull request #338 from dem4gus/dependabot-boilerplate
update boilerplate
2 parents 8c896f6 + 6cc78d0 commit 78779bc

File tree

23 files changed

+131
-91
lines changed

23 files changed

+131
-91
lines changed

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: boilerplate
33
namespace: openshift
4-
tag: image-v6.0.1
4+
tag: image-v7.2.0

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
schedule:
99
interval: "weekly"
1010
ignore:
11-
- dependency-name: "app-sre/boilerplate"
11+
- dependency-name: "redhat-services-prod/openshift/boilerplate"
1212
# don't upgrade boilerplate via these means
1313
- dependency-name: "openshift4/ose-operator-registry"
1414
# don't upgrade ose-operator-registry via these means

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
FIPS_ENABLED=true
22

3-
export LATEST_IMAGE_TAG=image-v6.0.1
4-
53
include boilerplate/generated-includes.mk
64

75
.PHONY: boilerplate-update

OWNERS_ALIASES

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ aliases:
1414
- theautoroboto
1515
- rhdedgar
1616
- katherinelc321
17-
- robotmaxtron
1817
- rojasreinold
19-
- hbhushan3
2018
- fsferraz-rh
2119
srep-functional-team-hulk:
2220
- a7vicky
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
image-v6.0.1
1+
image-v7.2.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5d599ff5771f30d4e09248ddcb116375b3a38102
1+
afc8fe6dee4d437d2e84faaf18019fbb97d8c266

boilerplate/openshift/golang-osd-operator-osde2e/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ openshift/golang-osd-operator-osde2e
1515

1616
## `make` targets and functions.
1717

18-
**Note:** Your repository's main `Makefile` needs to be edited to include the
19-
"nexus makefile include":
18+
**Note:** Your repository's main `Makefile` needs to be edited to include:
2019

2120
```
2221
include boilerplate/generated-includes.mk
@@ -30,11 +29,10 @@ following:
3029

3130
| `make` target | Purpose |
3231
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33-
| `e2e-harness-generate` | Generate scaffolding for an end to end test harness. The `test/e2e` directory is created where the tests and test runner reside. The harness has access to cloud client and harness passthrough secrets within the test job cluster. Add your operator related ginkgo e2e tests under the `test/e2e/<operator-name>_tests.go` file. See [this README](https://github.com/openshift/osde2e-example-test-harness/blob/main/README.md#locally-running-this-example) for more details on test harness. |
3432
| `e2e-harness-build`| Compiles ginkgo tests under test/e2e and creates the ginkgo binary. |
3533
| `e2e-image-build-push` | Builds e2e test harness image and pushes to operator's quay repo. Image name is defaulted to <operator-image-name>-test-harness. Quay repository must be created beforehand. |
3634

3735
#### E2E Harness Local Testing
3836

39-
Please follow [this README](https://github.com/openshift/osde2e-example-test-harness/blob/main/README.md#locally-running-this-example) to run your e2e tests locally
37+
Please follow [this README](https://github.com/openshift/ops-sop/blob/master/v4/howto/osde2e/operator-test-harnesses.md#using-ginkgo) to run your e2e tests locally
4038

boilerplate/openshift/golang-osd-operator-osde2e/standard.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ HARNESS_IMAGE_TAG=$(CURRENT_COMMIT)
1919
# invocation; otherwise it could collide across jenkins jobs. We'll use
2020
# a .docker folder relative to pwd (the repo root).
2121
CONTAINER_ENGINE_CONFIG_DIR = .docker
22+
JENKINS_DOCKER_CONFIG_FILE = /var/lib/jenkins/.docker/config.json
2223
export REGISTRY_AUTH_FILE = ${CONTAINER_ENGINE_CONFIG_DIR}/config.json
2324

2425
# If this configuration file doesn't exist, podman will error out. So
@@ -27,7 +28,7 @@ ifeq (,$(wildcard $(REGISTRY_AUTH_FILE)))
2728
$(shell mkdir -p $(CONTAINER_ENGINE_CONFIG_DIR))
2829
# Copy the node container auth file so that we get access to the registries the
2930
# parent node has access to
30-
$(shell cp /var/lib/jenkins/.docker/config.json $(REGISTRY_AUTH_FILE))
31+
$(shell if test -f $(JENKINS_DOCKER_CONFIG_FILE); then cp $(JENKINS_DOCKER_CONFIG_FILE) $(REGISTRY_AUTH_FILE); fi)
3132
endif
3233

3334
# ==> Docker uses --config=PATH *before* (any) subcommand; so we'll glue
@@ -69,7 +70,7 @@ e2e-harness-build: GOFLAGS_MOD=-mod=mod
6970
e2e-harness-build: GOENV=GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 GOFLAGS="${GOFLAGS_MOD}"
7071
e2e-harness-build:
7172
go mod tidy
72-
${GOENV} go test ./test/e2e -v -c --tags=osde2e -o harness.test
73+
go test ./test/e2e -v -c --tags=osde2e -o harness.test
7374

7475
# TODO: Push to a known image tag and commit id
7576
# push harness image

boilerplate/openshift/golang-osd-operator-osde2e/test-harness-template.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ apiVersion: template.openshift.io/v1
33
kind: Template
44
metadata:
55
name: osde2e-focused-tests
6-
76
parameters:
87
- name: OSDE2E_CONFIGS
98
required: true
@@ -46,6 +45,9 @@ objects:
4645
- /osde2e
4746
args:
4847
- test
48+
- --only-health-check-nodes
49+
- --skip-destroy-cluster
50+
- --skip-must-gather
4951
- --configs
5052
- ${OSDE2E_CONFIGS}
5153
securityContext:

boilerplate/openshift/golang-osd-operator-osde2e/update

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ source $CONVENTION_ROOT/_lib/common.sh
1010
# Expect POST
1111
[[ "$1" == "POST" ]] || err "Got a parameter I don't understand: '$1'. Did the infrastructure change?"
1212

13-
OPERATOR_NAME=$(sed -n 's/.*OperatorName .*"\([^"]*\)".*/\1/p' "${REPO_ROOT}/config/config.go")
1413
REPO_ROOT=$(git rev-parse --show-toplevel)
14+
OPERATOR_NAME=$(sed -n 's/.*OperatorName .*=.*"\([^"]*\)".*/\1/p' "${REPO_ROOT}/config/config.go")
1515
E2E_SUITE_DIRECTORY=$REPO_ROOT/test/e2e
1616

1717
# Update operator name in templates
@@ -87,4 +87,21 @@ func Test${OPERATOR_NAME_CAMEL_CASE}(t *testing.T) {
8787
}
8888
EOF
8989

90+
tee "${E2E_SUITE_DIRECTORY}/README.md" <<EOF
91+
## Locally running e2e test suite
92+
When updating your operator it's beneficial to add e2e tests for new functionality AND ensure existing functionality is not breaking using e2e tests.
93+
To do this, following steps are recommended
94+
95+
1. Run "make e2e-harness-build" to make sure e2e tests build
96+
2. Deploy your new version of operator in a test cluster
97+
3. Run "go install github.com/onsi/ginkgo/ginkgo@latest"
98+
4. Get kubeadmin credentials from your cluster using
99+
100+
ocm get /api/clusters_mgmt/v1/clusters/(cluster-id)/credentials | jq -r .kubeconfig > /(path-to)/kubeconfig
101+
102+
5. Run test suite using
103+
104+
DISABLE_JUNIT_REPORT=true KUBECONFIG=/(path-to)/kubeconfig ./(path-to)/bin/ginkgo --tags=osde2e -v test/e2e
105+
EOF
106+
90107
sed -e "s/\${OPERATOR_NAME}/${OPERATOR_NAME}/" $(dirname $0)/test-harness-template.yml >"${E2E_SUITE_DIRECTORY}/test-harness-template.yml"

0 commit comments

Comments
 (0)