Skip to content

Commit d1d3813

Browse files
Merge pull request #213 from njhale/sync/10-18
Sync w/ upstream: operator-lifecycle-manager
2 parents 8970fc0 + a4147d8 commit d1d3813

File tree

91 files changed

+1877
-2124
lines changed

Some content is hidden

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

91 files changed

+1877
-2124
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ e2e/operator-registry: ## Run e2e registry tests
122122
$(MAKE) e2e WHAT=operator-registry
123123

124124
e2e/olm: ## Run e2e olm tests
125-
$(MAKE) e2e WHAT=operator-lifecycle-manager
125+
$(MAKE) e2e WHAT=operator-lifecycle-manager E2E_INSTALL_NS=openshift-operator-lifecycle-manager E2E_TEST_NS=openshift-operators E2E_TIMEOUT=120m
126126

127127
.PHONY: vendor
128128
vendor:

manifests/0000_90_olm_01-prometheus-rule.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ spec:
2121
severity: warning
2222
namespace: "{{ $labels.namespace }}"
2323
annotations:
24+
summary: CSV failed for over 2 minutes
25+
description: Fires whenever a CSV has been in the failed phase for more than 2 minutes.
2426
message: Failed to install Operator {{ $labels.name }} version {{ $labels.version }}. Reason-{{ $labels.reason }}
2527
- alert: CsvAbnormalOver30Min
2628
expr: csv_abnormal{phase=~"(^Replacing$|^Pending$|^Deleting$|^Unknown$)"}
@@ -29,6 +31,8 @@ spec:
2931
severity: warning
3032
namespace: "{{ $labels.namespace }}"
3133
annotations:
34+
summary: CSV abnormal for over 30 minutes
35+
description: Fires whenever a CSV is in the Replacing, Pending, Deleting, or Unkown phase for more than 30 minutes.
3236
message: Failed to install Operator {{ $labels.name }} version {{ $labels.version }}. Phase-{{ $labels.phase }} Reason-{{ $labels.reason }}
3337
- name: olm.installplan.rules
3438
rules:
@@ -37,4 +41,6 @@ spec:
3741
labels:
3842
severity: warning
3943
annotations:
44+
summary: API returned a warning when modifying an operator
45+
description: Fires whenever the API server returns a warning when attempting to modify an operator.
4046
message: The API server returned a warning during installation or upgrade of an operator. An Event with reason "AppliedWithWarnings" has been created with complete details, including a reference to the InstallPlan step that generated the warning.

staging/operator-lifecycle-manager/.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
- name: Check out the repo
1111
uses: actions/checkout@v2
1212
- name: Build the container image
13-
uses: docker/build-push-action@v1
13+
uses: docker/build-push-action@v2
1414
with:
15-
repository: operator-framework/olm
16-
dockerfile: ./Dockerfile
15+
context: .
16+
file: Dockerfile
1717
push: false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ jobs:
2222
run: |
2323
kind create cluster
2424
kind export kubeconfig
25-
- name: Run e2e tests
25+
- name: Run OLM
2626
run: make run-local

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
sudo mv minikube /bin/
2222
- name: Setup minikube
2323
run: minikube config set vm-driver docker
24-
- name: Run e2e tests
24+
- name: Run OLM
2525
run: make run-local

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/setup-go@v2
1515
with:
1616
go-version: '~1.16'
17-
- run: make e2e-local NODES=2 JUNIT_DIRECTORY=./artifacts/
17+
- run: make e2e-local E2E_NODES=2 ARTIFACTS_DIR=./artifacts/
1818
- name: Archive Test Artifacts # test results, failed or not, are always uploaded.
1919
if: ${{ always() }}
2020
uses: actions/upload-artifact@v2
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: release
2+
on:
3+
pull_request:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: 1.16
20+
21+
- name: Get the image tag
22+
if: startsWith(github.ref, 'refs/tags')
23+
run: |
24+
# Source: https://i.8713187.xyzmunity/t/how-to-get-just-the-tag-name/16241/32
25+
if [[ $GITHUB_REF == refs/tags/* ]]; then
26+
echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
27+
fi
28+
29+
- name: Create a draft release
30+
uses: actions/create-release@v1
31+
id: release
32+
if: startsWith(github.ref, 'refs/tags')
33+
env:
34+
GITHUB_TOKEN: ${{ github.token }}
35+
with:
36+
draft: true
37+
tag_name: ${{ github.ref }}
38+
release_name: ${{ github.ref }}
39+
40+
- name: Docker Login
41+
uses: docker/login-action@v1
42+
if: startsWith(github.ref, 'refs/tags')
43+
with:
44+
registry: quay.io
45+
username: ${{ secrets.QUAY_USERNAME }}
46+
password: ${{ secrets.QUAY_PASSWORD }}
47+
48+
- name: Run GoReleaser
49+
uses: goreleaser/goreleaser-action@v2
50+
if: startsWith(github.ref, 'refs/tags')
51+
with:
52+
version: 0.177.0
53+
args: release --rm-dist
54+
env:
55+
GITHUB_TOKEN: ${{ github.token }}
56+
IMAGE_REPO: ${{ secrets.QUAY_USERNAME }}/olm
57+
PKG: github.com/operator-framework/operator-lifecycle-manager
58+
59+
- name: Generate quickstart release manifests
60+
if: startsWith(github.ref, 'refs/tags')
61+
run: make release ver=${{ env.IMAGE_TAG }} IMAGE_REPO=quay.io/${{ secrets.QUAY_USERNAME }}/olm
62+
63+
- name: Update release artifacts with rendered Kubernetes manifests
64+
uses: softprops/action-gh-release@v1
65+
if: startsWith(github.ref, 'refs/tags')
66+
with:
67+
name: ${{ env.IMAGE_TAG }}
68+
files: |
69+
deploy/upstream/quickstart/crds.yaml
70+
deploy/upstream/quickstart/olm.yaml
71+
deploy/upstream/quickstart/install.sh
72+
draft: true
73+
token: ${{ github.token }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
paths-ignore:
9+
- '**/*.md'
10+
11+
jobs:
12+
sanity:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-go@v2
17+
with:
18+
go-version: '~1.16'
19+
- name: Install goimports
20+
run: go install golang.org/x/tools/cmd/goimports@latest
21+
- name: Run sanity checks
22+
run: make vendor && make lint && make diff

staging/operator-lifecycle-manager/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,5 @@ apiserver.key
455455

456456
!vendor/**
457457
test/e2e-local.image.tar
458+
459+
dist/
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
env:
2+
- GO111MODULE=on
3+
- CGO_ENABLED=0
4+
before:
5+
hooks:
6+
- go mod tidy
7+
- go mod vendor
8+
builds:
9+
- id: olm
10+
main: ./cmd/olm
11+
binary: olm
12+
goos:
13+
- linux
14+
goarch:
15+
- amd64
16+
- arm64
17+
- ppc64le
18+
- s390x
19+
tags:
20+
- json1
21+
flags:
22+
- -mod=vendor
23+
ldflags:
24+
- -X {{ .Env.PKG }}/pkg/version.GitCommit={{ .FullCommit }}
25+
- -X {{ .Env.PKG }}/pkg/version.OLMVersion={{ .Tag }}
26+
- id: catalog
27+
main: ./cmd/catalog
28+
binary: catalog
29+
goos:
30+
- linux
31+
goarch:
32+
- amd64
33+
- arm64
34+
- ppc64le
35+
- s390x
36+
tags:
37+
- json1
38+
flags:
39+
- -mod=vendor
40+
ldflags:
41+
- -X {{ .Env.PKG }}/pkg/version.GitCommit={{ .FullCommit }}
42+
- -X {{ .Env.PKG }}/pkg/version.OLMVersion={{ .Tag }}
43+
- id: cpb
44+
main: ./util/cpb
45+
binary: cpb
46+
goos:
47+
- linux
48+
goarch:
49+
- amd64
50+
- arm64
51+
- ppc64le
52+
- s390x
53+
tags:
54+
- json1
55+
flags:
56+
- -mod=vendor
57+
ldflags:
58+
- -X {{ .Env.PKG }}/pkg/version.GitCommit={{ .FullCommit }}
59+
- -X {{ .Env.PKG }}/pkg/version.OLMVersion={{ .Tag }}
60+
- id: package-server
61+
main: ./cmd/package-server
62+
binary: package-server
63+
goos:
64+
- linux
65+
goarch:
66+
- amd64
67+
- arm64
68+
- ppc64le
69+
- s390x
70+
tags:
71+
- json1
72+
flags:
73+
- -mod=vendor
74+
ldflags:
75+
- -X {{ .Env.PKG }}/pkg/version.GitCommit={{ .FullCommit }}
76+
- -X {{ .Env.PKG }}/pkg/version.OLMVersion={{ .Tag }}
77+
dockers:
78+
- image_templates:
79+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64
80+
dockerfile: Dockerfile.goreleaser
81+
use: buildx
82+
goos: linux
83+
goarch: amd64
84+
build_flag_templates:
85+
- --platform=linux/amd64
86+
- image_templates:
87+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64
88+
dockerfile: Dockerfile.goreleaser
89+
use: buildx
90+
goos: linux
91+
goarch: arm64
92+
build_flag_templates:
93+
- --platform=linux/arm64
94+
- image_templates:
95+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le
96+
dockerfile: Dockerfile.goreleaser
97+
use: buildx
98+
goos: linux
99+
goarch: ppc64le
100+
build_flag_templates:
101+
- --platform=linux/ppc64le
102+
- image_templates:
103+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x
104+
dockerfile: Dockerfile.goreleaser
105+
use: buildx
106+
goos: linux
107+
goarch: s390x
108+
build_flag_templates:
109+
- --platform=linux/s390x
110+
docker_manifests:
111+
- name_template: quay.io/{{ .Env.IMAGE_REPO }}:v{{ .Major }}.{{ .Minor }}
112+
image_templates:
113+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64
114+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64
115+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le
116+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x
117+
- name_template: quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}
118+
image_templates:
119+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-amd64
120+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-arm64
121+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-ppc64le
122+
- quay.io/{{ .Env.IMAGE_REPO }}:{{ .Tag }}-s390x
123+
checksum:
124+
name_template: 'checksums.txt'
125+
snapshot:
126+
name_template: "{{ .Tag }}"
127+
changelog:
128+
sort: asc
129+
filters:
130+
exclude:
131+
- '^doc:'
132+
- '^test:'
133+
release:
134+
draft: true

0 commit comments

Comments
 (0)