Skip to content

Commit

Permalink
Merge branch 'main' into tlsauth
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Jorissen authored Dec 22, 2023
2 parents 065b012 + 32ab814 commit 47377a4
Show file tree
Hide file tree
Showing 41 changed files with 466 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @streamnative/cloud
* @streamnative/cloud @streamnative/cloud-data-plane
47 changes: 47 additions & 0 deletions .github/openshift/community-operators-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Signed-off-by: streamnativebot [[email protected]](mailto:[email protected])

Thanks submitting your Operator. Please check below list before you create your Pull Request.

### New Submissions
* [ ] Are you familiar with our [contribution guidelines](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-via-pr.md)?
* [ ] Have you [packaged and deployed](https://github.com/operator-framework/community-operators/blob/master/docs/testing-operators.md) your Operator for Operator Framework?
* [ ] Have you tested your Operator with all Custom Resource Definitions?
* [ ] Have you tested your Operator in all supported [installation modes](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/building-your-csv.md#operator-metadata)?
* [ ] Have you considered whether you want use [semantic versioning order](https://github.com/operator-framework/community-operators/blob/master/docs/operator-ci-yaml.md#semver-mode)?
* [ ] Is your submission [signed](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-prerequisites.md#sign-your-work)?
* [ ] Is operator [icon](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#operator-icon) set?

### Updates to existing Operators
* [x] Did you create a `ci.yaml` file according to the [update instructions](https://github.com/operator-framework/community-operators/blob/master/docs/operator-ci-yaml.md)?
* [x] Is your new CSV pointing to the previous version with the `replaces` property if you chose `replaces-mode` via the `updateGraph` property in `ci.yaml`?
* [x] Is your new CSV referenced in the [appropriate channel](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#channels) defined in the `package.yaml` or `annotations.yaml` ?
* [x] Have you tested an update to your Operator when deployed via OLM?
* [x] Is your submission [signed](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-prerequisites.md#sign-your-work)?

### Your submission should not
* [x] Modify more than one operator
* [x] Modify an Operator you don't own
* [x] Rename an operator - please remove and add with a different name instead
* [x] Modify any files outside the above mentioned folders
* [x] Contain more than one commit. **Please squash your commits.**

### Operator Description must contain (in order)
1. [x] Description about the managed Application and where to find more information
2. [x] Features and capabilities of your Operator and how to use it
3. [x] Any manual steps about potential pre-requisites for using your Operator

### Operator Metadata should contain
* [x] Human readable name and 1-liner description about your Operator
* [x] Valid [category name](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#categories)1
* [x] One of the pre-defined [capability levels](https://github.com/operator-framework/operator-courier/blob/4d1a25d2c8d52f7de6297ec18d8afd6521236aa2/operatorcourier/validate.py#L556)2
* [x] Links to the maintainer, source code and documentation
* [x] Example templates for all Custom Resource Definitions intended to be used
* [x] A quadratic logo

Remember that you can preview your CSV [here](https://operatorhub.io/preview).

--

1 If you feel your Operator does not fit any of the pre-defined categories, file an issue against this repo and explain your need

2 For more information see [here](https://sdk.operatorframework.io/docs/overview/#operator-capability-level)
4 changes: 2 additions & 2 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
docker rmi $(docker images -q) -f
df -h
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
id: go

- name: Set up Git token
Expand Down
142 changes: 142 additions & 0 deletions .github/workflows/release-certificated-olm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Copyright 2022 StreamNative
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release Certificated OLM
on:
workflow_dispatch:
inputs:
channel-tag:
description: 'Operator tag(without prefix v)'
required: true
channels:
description: 'OLM channels'
required: true
default: alpha,beta,stable
default_channel:
description: 'OLM Default channel'
required: true
default: alpha

jobs:
operatorhub-prod:
name: Create PR to the redhat
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
GOPRIVATE: github.com/streamnative
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
steps:
- name: Sync up the prod upstream
run: |
gh repo sync streamnative/community-operators-prod
- name: Sync up the certified upstream
run: |
gh repo sync streamnative/certified-operators
- name: Setup Git token
run: |
git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/"
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Checkout streamnative community-operators-prod
uses: actions/checkout@v3
with:
repository: streamnative/community-operators-prod
path: community-operators-prod
token: ${{ secrets.SNBOT_GITHUB_TOKEN }}

- name: Checkout streamnative certified-operators
uses: actions/checkout@v3
with:
repository: streamnative/certified-operators
path: certified-operators
token: ${{ secrets.SNBOT_GITHUB_TOKEN }}

- name: Setup operator-sdk
run: |
wget https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/operator-sdk_linux_amd64 -O operator-sdk
chmod +x operator-sdk
mv operator-sdk /usr/local/bin/
operator-sdk version
- name: Genarate bundle
env:
VERSION: ${{ inputs.channel-tag }}
CHANNELS: ${{ inputs.channels }}
DEFAULT_CHANNEL: ${{ inputs.default_channel }}
IMAGE_TAG_BASE_RELEASE: olm.streamnative.io/streamnativeio/pulsar-resources-operator
run: |
export IMG=$IMAGE_TAG_BASE_RELEASE:v$VERSION
make bundle-redhat
- name: Copy bundle to community-operators-prod and create pr
env:
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
VERSION: ${{ inputs.channel-tag }}
OPERATOR_NAME: pulsar-resources-operator
run: |
pushd community-operators-prod
git config --global user.email "[email protected]"
git config --global user.name "streamnativebot"
git push -d origin $OPERATOR_NAME-$VERSION || echo 'Skip branch deletion'
git checkout -b $OPERATOR_NAME-$VERSION
# copy bundles
export TARGET_DIR=operators/$OPERATOR_NAME/$VERSION
mkdir -p $TARGET_DIR
cp -rf ../bundle.Dockerfile $TARGET_DIR
cp -rf ../bundle/* $TARGET_DIR
git add .
git commit -s -m "operator $OPERATOR_NAME ($VERSION)"
git push --set-upstream origin $OPERATOR_NAME-$VERSION
gh pr create --title "operator $OPERATOR_NAME ($VERSION)" -F ../.github/openshift/community-operators-prod -R redhat-openshift-ecosystem/community-operators-prod
popd
- name: Copy bundle to certified-operators and create pr
env:
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
VERSION: ${{ inputs.channel-tag }}
OPERATOR_NAME: pulsar-resources-operator
run: |
# install operator-manifest-tools
wget -q https://github.com/operator-framework/operator-manifest-tools/releases/download/v0.2.2/operator-manifest-tools_0.2.2_linux_amd64 -O operator-manifest-tools
chmod +x operator-manifest-tools
mv operator-manifest-tools /usr/local/bin
# install skopeo
sudo apt-get -y install skopeo
pushd certified-operators
git push -d origin $OPERATOR_NAME-$VERSION || echo 'Skip branch deletion'
git checkout -b $OPERATOR_NAME-$VERSION
export TARGET_DIR=operators/$OPERATOR_NAME/$VERSION
mkdir -p $TARGET_DIR
cp -rf ../bundle.Dockerfile $TARGET_DIR
cp -rf ../bundle/* $TARGET_DIR
export MANIFEST_DIR=$TARGET_DIR/manifests
operator-manifest-tools pinning pin $MANIFEST_DIR
operator-manifest-tools pinning replace $MANIFEST_DIR replacements.json
rm references.json replacements.json
git add .
git commit -s -m "operator $OPERATOR_NAME ($VERSION)"
git push --set-upstream origin $OPERATOR_NAME-$VERSION
gh pr create --title "operator $OPERATOR_NAME ($VERSION)" --body "Signed-off-by: streamnativebot [email protected]" -R redhat-openshift-ecosystem/certified-operators
popd
96 changes: 96 additions & 0 deletions .github/workflows/release-community-olm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Copyright 2022 StreamNative
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release Community OLM
on:
workflow_dispatch:
inputs:
channel-tag:
description: 'Operator tag(without prefix v)'
required: true
channels:
description: 'OLM channels'
required: true
default: alpha,beta,stable
default_channel:
description: 'OLM Default channel'
required: true
default: alpha

jobs:
operatorhub:
name: Create PR to the operatorhub
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
GOPRIVATE: github.com/streamnative
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
steps:
- name: Sync up the upstream
run: |
gh repo sync streamnative/community-operators
- name: Setup Git token
run: |
git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/"
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Checkout streamnative community-operators
uses: actions/checkout@v3
with:
repository: streamnative/community-operators
path: community-operators
token: ${{ secrets.SNBOT_GITHUB_TOKEN }}

- name: Setup operator-sdk
run: |
wget https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/operator-sdk_linux_amd64 -O operator-sdk
chmod +x operator-sdk
mv operator-sdk /usr/local/bin/
operator-sdk version
- name: Genarate bundle
env:
VERSION: ${{ inputs.channel-tag }}
CHANNELS: ${{ inputs.channels }}
DEFAULT_CHANNEL: ${{ inputs.default_channel }}
IMAGE_TAG_BASE_RELEASE: olm.streamnative.io/streamnativeio/pulsar-resources-operator
run: |
export IMG=$IMAGE_TAG_BASE_RELEASE:v$VERSION
make bundle-redhat
- name: Copy bundle to community-operators and create pr
env:
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
VERSION: ${{ inputs.channel-tag }}
OPERATOR_NAME: pulsar-resources-operator
run: |
pushd community-operators
git config --global user.email "[email protected]"
git config --global user.name "streamnativebot"
git push -d origin $OPERATOR_NAME-$VERSION || echo 'Skip branch deletion'
git checkout -b $OPERATOR_NAME-$VERSION
export TARGET_DIR=operators/$OPERATOR_NAME/$VERSION
mkdir -p $TARGET_DIR
cp -rf ../bundle.Dockerfile $TARGET_DIR
cp -rf ../bundle/* $TARGET_DIR
git add .
git commit -s -m "operator $OPERATOR_NAME ($VERSION)"
git push --set-upstream origin $OPERATOR_NAME-$VERSION
gh pr create --title "operator $OPERATOR_NAME ($VERSION)" -F ../.github/operatorhub/community-operators -R k8s-operatorhub/community-operators
popd
4 changes: 2 additions & 2 deletions .github/workflows/release-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
default_channel: ${{ steps.redhat.outputs.default_channel }}

steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
id: go

- name: Set up Git token
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GOPRIVATE: github.com/streamnative
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
id: go

- name: Set up git token
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ node_modules/
# chart-releaser
.chart-index/
.chart-packages/

# Generated files while build the operator
config/crd/bases/
config/rbac/role.yaml
config/webhook/manifests.yaml
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ linters:
- asciicheck
- bodyclose
- deadcode
- depguard
# - depguard
- dogsled
- errcheck
- exportloopref
- gci
# - gci
- goconst
- gocritic
- gocyclo
Expand Down
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ header:
- 'NOTICE'
- '.github/CODEOWNERS'
- '.github/operatorhub/'
- '.github/openshift/'
- 'PROJECT'
- '**/go.mod'
- '**/go.sum'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.19-alpine as builder
FROM golang:1.20-alpine as builder

ARG ACCESS_TOKEN="none"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ bundle-redhat: manifests kustomize
sed -i "s|image: docker.cloudsmith.io/.*|image: $(KUBE_RBAC_PROXY_IMG)|g" bundle/manifests/pulsar-resources-operator.clusterserviceversion.yaml

echo " # OpenShift annotations." >> bundle/metadata/annotations.yaml
echo " com.redhat.openshift.versions: v4.6-v4.12" >> bundle/metadata/annotations.yaml
echo " com.redhat.openshift.versions: v4.6-v4.15" >> bundle/metadata/annotations.yaml

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/pulsarconnection_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ type PulsarConnectionStatus struct {
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// SecretKeyHash is the hash of the secret ref
// +optional
SecretKeyHash string `json:"secretKeyHash,omitempty"`

// Represents the observations of a connection's current state.
// +patchMergeKey=type
// +patchStrategy=merge
Expand Down
Loading

0 comments on commit 47377a4

Please sign in to comment.