Skip to content

Commit ff00746

Browse files
michael-valdronthepetk
authored andcommitted
v0.2.0 (devfile#63)
Signed-off-by: Michael Valdron <[email protected]> Signed-off-by: thepetk <[email protected]>
1 parent c1e24b8 commit ff00746

8 files changed

+132
-131
lines changed

.github/workflows/ci.yaml

+80-90
Original file line numberDiff line numberDiff line change
@@ -16,118 +16,108 @@ name: Validate PRs
1616

1717
on:
1818
pull_request:
19-
branches: [ main ]
19+
branches: [main]
2020

2121
jobs:
2222
go:
2323
name: Check go sources
2424
runs-on: ubuntu-latest
2525
steps:
26-
-
27-
name: Check out code into the Go module directory
28-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
29-
-
30-
name: Set up Go 1.x
31-
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
32-
with:
33-
go-version-file: 'go.mod'
34-
-
35-
name: Cache go modules
36-
id: cache-mod
37-
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
38-
with:
39-
path: ~/go/pkg/mod
40-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
41-
restore-keys: |
42-
${{ runner.os }}-go-
43-
-
44-
name: Download dependencies
45-
run: go mod download
46-
if: steps.cache-mod.outputs.cache-hit != 'true'
47-
-
48-
name: Check go mod status
49-
run: |
50-
go mod tidy
51-
if [[ ! -z $(git status -s) ]]
52-
then
53-
echo "Go mod state is not clean: $(git status -s)"
54-
exit 1
55-
fi
56-
-
57-
name: Check format
58-
run: |
59-
go get -u github.com/google/addlicense
60-
go install github.com/google/addlicense
61-
go get -u golang.org/x/tools/cmd/goimports
62-
go install golang.org/x/tools/cmd/goimports
63-
git reset HEAD --hard
26+
- name: Check out code into the Go module directory
27+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
28+
- name: Set up Go 1.x
29+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
30+
with:
31+
go-version-file: "go.mod"
32+
- name: Cache go modules
33+
id: cache-mod
34+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
35+
with:
36+
path: ~/go/pkg/mod
37+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38+
restore-keys: |
39+
${{ runner.os }}-go-
40+
- name: Download dependencies
41+
run: go mod download
42+
if: steps.cache-mod.outputs.cache-hit != 'true'
43+
- name: Check go mod status
44+
run: |
45+
go mod tidy
46+
if [[ ! -z $(git status -s) ]]
47+
then
48+
echo "Go mod state is not clean: $(git status -s)"
49+
exit 1
50+
fi
51+
- name: Check format
52+
run: |
53+
go get -u github.com/google/addlicense
54+
go install github.com/google/addlicense
55+
go get -u golang.org/x/tools/cmd/goimports
56+
go install golang.org/x/tools/cmd/goimports
57+
git reset HEAD --hard
6458
65-
make fmt
66-
if [[ ! -z $(git status -s) ]]
67-
then
68-
echo "not well formatted sources found during make fmt: $(git --no-pager diff)"
69-
exit 1
70-
fi
59+
make fmt
60+
if [[ ! -z $(git status -s) ]]
61+
then
62+
echo "not well formatted sources found during make fmt: $(git --no-pager diff)"
63+
exit 1
64+
fi
7165
72-
make fmt_license
73-
if [[ ! -z $(git status -s) ]]
74-
then
75-
echo "not well formatted sources found during make fmt_license: $(git status -s)"
76-
exit 1
77-
fi
78-
-
79-
name: Check code generation
80-
run: make generate
81-
-
82-
name: Check CRD manifest generation
83-
run: make manifests
84-
-
85-
name: Run unit tests
86-
run: make test
87-
-
88-
name: Upload coverage to Codecov
89-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
66+
make fmt_license
67+
if [[ ! -z $(git status -s) ]]
68+
then
69+
echo "not well formatted sources found during make fmt_license: $(git status -s)"
70+
exit 1
71+
fi
72+
- name: Check code generation
73+
run: make generate
74+
- name: Check CRD manifest generation
75+
run: make manifests
76+
- name: Run unit tests
77+
run: make test
78+
- name: Upload coverage to Codecov
79+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
9080

91-
- name: Run Gosec Security Scanner
92-
run: |
93-
go install github.com/securego/gosec/v2/cmd/[email protected]
94-
make gosec
95-
if [[ $? != 0 ]]
96-
then
97-
echo "gosec scanner failed to run "
98-
exit 1
99-
fi
81+
- name: Run Gosec Security Scanner
82+
run: |
83+
go install github.com/securego/gosec/v2/cmd/[email protected]
84+
make gosec
85+
if [[ $? != 0 ]]
86+
then
87+
echo "gosec scanner failed to run "
88+
exit 1
89+
fi
10090
101-
- name: Upload SARIF file
102-
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # 2.22.5
103-
with:
104-
# Path to SARIF file relative to the root of the repository
105-
sarif_file: gosec.sarif
91+
- name: Upload SARIF file
92+
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # 2.22.5
93+
with:
94+
# Path to SARIF file relative to the root of the repository
95+
sarif_file: gosec.sarif
10696

10797
operator-build:
10898
name: Check operator container image build
10999
runs-on: ubuntu-latest
110100

111101
steps:
112-
- name: Check out code into the Go module directory
113-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
102+
- name: Check out code into the Go module directory
103+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
114104

115-
- name: Set up QEMU # Enables arm64 image building
116-
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
105+
- name: Set up QEMU # Enables arm64 image building
106+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
117107

118-
- name: Check if operator docker build is working
119-
run: make docker-buildx-build
108+
- name: Check if operator docker build is working
109+
run: make docker-buildx-build
120110

121111
operator-bundle-build:
122112
name: Check operator bundle build
123113
runs-on: ubuntu-latest
124114

125115
steps:
126-
- name: Check out code into the Go module directory
127-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
116+
- name: Check out code into the Go module directory
117+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
128118

129-
- name: Set up QEMU # Enables arm64 image building
130-
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
131-
132-
- name: Build the operator's bundle image
133-
run: make docker-bundle-buildx-build
119+
- name: Set up QEMU # Enables arm64 image building
120+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
121+
122+
- name: Build the operator's bundle image
123+
run: make docker-bundle-buildx-build

.github/workflows/dockerimage-push.yaml

+29-29
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,43 @@ name: Next Dockerimage
1616

1717
on:
1818
push:
19-
branches: [ main ]
19+
branches: [main]
2020

2121
jobs:
2222
push-operator-image:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- name: Checkout registry-operator source code
26-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
27-
28-
- name: Set up QEMU # Enables arm64 image building
29-
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
30-
31-
- name: Login to Quay.io
32-
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
33-
with:
34-
registry: quay.io
35-
username: ${{ secrets.QUAY_USERNAME }}
36-
password: ${{ secrets.QUAY_PASSWORD }}
37-
38-
- name: Build and push Operator with Docker Buildx
39-
run: "make docker-buildx-push"
40-
25+
- name: Checkout registry-operator source code
26+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
27+
28+
- name: Set up QEMU # Enables arm64 image building
29+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
30+
31+
- name: Login to Quay.io
32+
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
33+
with:
34+
registry: quay.io
35+
username: ${{ secrets.QUAY_USERNAME }}
36+
password: ${{ secrets.QUAY_PASSWORD }}
37+
38+
- name: Build and push Operator with Docker Buildx
39+
run: "make docker-buildx-push"
40+
4141
push-operator-bundle:
4242
runs-on: ubuntu-latest
4343
steps:
44-
- name: Checkout registry-operator source code
45-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
44+
- name: Checkout registry-operator source code
45+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
4646

47-
- name: Set up QEMU # Enables arm64 image building
48-
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
47+
- name: Set up QEMU # Enables arm64 image building
48+
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0
4949

50-
- name: Login to Quay.io
51-
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
52-
with:
53-
registry: quay.io
54-
username: ${{ secrets.QUAY_USERNAME }}
55-
password: ${{ secrets.QUAY_PASSWORD }}
50+
- name: Login to Quay.io
51+
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
52+
with:
53+
registry: quay.io
54+
username: ${{ secrets.QUAY_USERNAME }}
55+
password: ${{ secrets.QUAY_PASSWORD }}
5656

57-
- name: Build and push bundle with Docker Buildx
58-
run: "make docker-bundle-buildx-push"
57+
- name: Build and push bundle with Docker Buildx
58+
run: "make docker-bundle-buildx-push"

CONTRIBUTING.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ contribution. See the [DCO](DCO) file for details.
1515

1616
In order to show your agreement with the DCO you should include at the end of the commit message,
1717
the following line:
18+
1819
```console
1920
Signed-off-by: Firstname Lastname <[email protected]>
2021
```
@@ -25,21 +26,24 @@ Once you set your user.name and user.email in your git config, you can sign your
2526

2627
### Issues
2728

28-
If you spot a problem with the **devfile registry operator**, [search if an issue already exists](https://github.com/devfile/api/issues?q=is%3Aissue+is%3Aopen+label%3Aarea%2Fregistry).
29+
If you spot a problem with the **devfile registry operator**, [search if an issue already exists](https://github.com/devfile/api/issues?q=is%3Aissue+is%3Aopen+label%3Aarea%2Fregistry).
2930

3031
If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/devfile/api/issues/new/choose). You can tag Devfile Registry Operator related issues with the `/area registry` text in your issue.
3132

3233
### Development
3334

3435
#### First Time Setup
36+
3537
1. Install prerequisites: see [Requirements section in README](README.md#requirements).
3638

3739
2. Fork and clone this repository.
3840

3941
3. Open the folder in the IDE of your choice (VS Code with Go extension, or GoLand is recommended)
4042

4143
#### Build and Run the Operator
44+
4245
The Makefile currently supports both Docker and Podman. To run the proper command replace `<engine>` with either `podman` or `docker` depending on your container engine.
46+
4347
1. Log in to an OpenShift or Kubernetes cluster
4448

4549
2. Run `export IMG=<operator-image>` where `<operator-image>` is the image repository to where you would like to push the image (e.g. `quay.io/user/registry-operator:latest`).
@@ -60,7 +64,7 @@ The Makefile currently supports both Docker and Podman. To run the proper comman
6064

6165
By default, http/2 on the webhook server is disabled due to [CVE-2023-44487](https://github.com/advisories/GHSA-qppj-fm5r-hxr3).
6266

63-
If you want to enable http/2 for the webhook server, build with `ENABLE_WEBHOOK_HTTP2=true make <engine>-build` or with
67+
If you want to enable http/2 for the webhook server, build with `ENABLE_WEBHOOK_HTTP2=true make <engine>-build` or with
6468
`ENABLE_WEBHOOK_HTTP2=true make run` if running locally.
6569

6670
##### Using other platforms
@@ -124,15 +128,18 @@ You can use `make <engine>-build` to build your own image, `make <engine>-push`
124128
<!--
125129
Will need to be updated after the completion of https://github.com/devfile/api/issues/1523
126130
-->
131+
127132
In order for `make test-integration` to properly run you must first ensure your environment is prepared for the operator. The following steps should be done **before** running `make test-integration` and
128133
these commands should be run from the root of the repository where the [`Makefile`](Makefile) is located.
134+
129135
1. Run `make install-cert` and wait for pods in the `cert-manager` namespace to be running before moving to step 2.
130136
2. Run `make install && make deploy` and wait until pods in the `registry-operator-system` namespace are running before proceeding to step 3.
131137
3. Run `make test-integration` or `IMG=<your-operator-image> make test-integration` to run the integration tests.
132138

133139
### Submitting Pull Request
134140

135141
**Note:** All commits must be signed off with the footer:
142+
136143
```
137144
Signed-off-by: First Lastname <[email protected]>
138145
```

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ endif
6363

6464
# operator-sdk
6565
OPERATOR_SDK_CLI ?= operator-sdk
66+
<<<<<<< HEAD
67+
=======
68+
69+
>>>>>>> 682f891 (v0.2.0 (#63))
6670

6771
# Setting SHELL to bash allows bash commands to be executed by recipes.
6872
# This is a requirement for 'setup-envtest.sh' in the test target.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.4
1+
0.2.0

bundle/manifests/registry-operator.clusterserviceversion.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ metadata:
4949
]
5050
capabilities: Basic Install
5151
categories: OpenShift Optional,Developer Tools
52-
containerImage: quay.io/devfile/registry-operator:v0.1.4
53-
createdAt: "2024-02-27T22:36:03Z"
52+
containerImage: quay.io/devfile/registry-operator:v0.2.0
53+
createdAt: "2023-11-20T18:36:27Z"
5454
description: Deploy and manage Devfile Registries on Kubernetes and OpenShift
5555
with the Devfile Registry operator.
5656
operators.operatorframework.io/builder: operator-sdk-v1.28.0
5757
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
5858
repository: https://github.com/devfile/registry-operator
5959
support: Red Hat
60-
name: registry-operator.v0.1.4
60+
name: registry-operator.v0.2.0
6161
namespace: placeholder
6262
spec:
6363
apiservicedefinitions: {}
@@ -448,7 +448,7 @@ spec:
448448
- --leader-elect
449449
command:
450450
- /manager
451-
image: quay.io/devfile/registry-operator:next
451+
image: quay.io/devfile/registry-operator:v0.2.0
452452
imagePullPolicy: Always
453453
livenessProbe:
454454
httpGet:
@@ -571,7 +571,7 @@ spec:
571571
provider:
572572
name: Red Hat
573573
url: https://redhat.com
574-
version: 0.1.4
574+
version: 0.2.0
575575
webhookdefinitions:
576576
- admissionReviewVersions:
577577
- v1

config/manager/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ kind: Kustomization
1515
images:
1616
- name: controller
1717
newName: quay.io/devfile/registry-operator
18-
newTag: next
18+
newTag: v0.2.0

0 commit comments

Comments
 (0)