├── .ci ├── clusters │ └── values.yaml ├── publish_chart.sh └── release.sh ├── .dockerignore ├── .github ├── CODEOWNERS ├── PULL_REQUEST_TEMPLATE.md ├── openshift │ └── community-operators-prod ├── operatorhub │ └── community-operators └── workflows │ ├── chart-test.yml │ ├── check-license-header.yml │ ├── documentbot.yml │ ├── e2e_test.yml │ ├── golangci-lint.yml │ ├── release-certificated-olm.yaml │ ├── release-community-olm.yaml │ ├── release-operator.yml │ └── style.yml ├── .gitignore ├── .golangci.yml ├── .husky └── pre-commit ├── .licenserc.yaml ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── PROJECT ├── README.md ├── api └── v1alpha1 │ ├── apikey_types.go │ ├── common.go │ ├── computeflinkdeployment_types.go │ ├── computeworkspace_types.go │ ├── constants.go │ ├── groupversion_info.go │ ├── pulsarconnection_types.go │ ├── pulsarfunction_types.go │ ├── pulsargeoreplication_types.go │ ├── pulsarnamespace_types.go │ ├── pulsarnsisolationpolicy_types.go │ ├── pulsarpackage_types.go │ ├── pulsarpermission_types.go │ ├── pulsarsink_types.go │ ├── pulsarsource_types.go │ ├── pulsartenant_types.go │ ├── pulsartopic_types.go │ ├── secret_types.go │ ├── serviceaccount_types.go │ ├── serviceaccountbinding_types.go │ ├── streamnativecloudconnection_types.go │ └── zz_generated.deepcopy.go ├── charts └── pulsar-resources-operator │ ├── .helmignore │ ├── Chart.yaml │ ├── README.md │ ├── README.md.gotmpl │ ├── crds │ ├── resource.streamnative.io_computeflinkdeployments.yaml │ ├── resource.streamnative.io_computeworkspaces.yaml │ ├── resource.streamnative.io_pulsarconnections.yaml │ ├── resource.streamnative.io_pulsarfunctions.yaml │ ├── resource.streamnative.io_pulsargeoreplications.yaml │ ├── resource.streamnative.io_pulsarnamespaces.yaml │ ├── resource.streamnative.io_pulsarnsisolationpolicies.yaml │ ├── resource.streamnative.io_pulsarpackages.yaml │ ├── resource.streamnative.io_pulsarpermissions.yaml │ ├── resource.streamnative.io_pulsarsinks.yaml │ ├── resource.streamnative.io_pulsarsources.yaml │ ├── resource.streamnative.io_pulsartenants.yaml │ ├── resource.streamnative.io_pulsartopics.yaml │ ├── resource.streamnative.io_secrets.yaml │ └── resource.streamnative.io_streamnativecloudconnections.yaml │ ├── templates │ ├── _helpers.tpl │ ├── cloud-storage-secrets.yaml │ ├── deployment.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── role.yaml │ ├── role_binding.yaml │ └── serviceaccount.yaml │ ├── tests │ ├── deployment_test.yaml │ └── serviceaccount_test.yaml │ ├── values.schema.json │ └── values.yaml ├── config ├── crd │ ├── bases │ │ ├── resource.streamnative.io_apikeys.yaml │ │ ├── resource.streamnative.io_computeflinkdeployments.yaml │ │ ├── resource.streamnative.io_computeworkspaces.yaml │ │ ├── resource.streamnative.io_pulsarconnections.yaml │ │ ├── resource.streamnative.io_pulsarfunctions.yaml │ │ ├── resource.streamnative.io_pulsargeoreplications.yaml │ │ ├── resource.streamnative.io_pulsarnamespaces.yaml │ │ ├── resource.streamnative.io_pulsarnsisolationpolicies.yaml │ │ ├── resource.streamnative.io_pulsarpackages.yaml │ │ ├── resource.streamnative.io_pulsarpermissions.yaml │ │ ├── resource.streamnative.io_pulsarsinks.yaml │ │ ├── resource.streamnative.io_pulsarsources.yaml │ │ ├── resource.streamnative.io_pulsartenants.yaml │ │ ├── resource.streamnative.io_pulsartopics.yaml │ │ ├── resource.streamnative.io_secrets.yaml │ │ ├── resource.streamnative.io_serviceaccountbindings.yaml │ │ ├── resource.streamnative.io_serviceaccounts.yaml │ │ └── resource.streamnative.io_streamnativecloudconnections.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_computeflinkdeployments.yaml │ │ ├── cainjection_in_computeworkspaces.yaml │ │ ├── cainjection_in_pulsarconnections.yaml │ │ ├── cainjection_in_pulsarfunctions.yaml │ │ ├── cainjection_in_pulsargeoreplications.yaml │ │ ├── cainjection_in_pulsarnamespaces.yaml │ │ ├── cainjection_in_pulsarnsisolationpolicies.yaml │ │ ├── cainjection_in_pulsarpackages.yaml │ │ ├── cainjection_in_pulsarpermissions.yaml │ │ ├── cainjection_in_pulsarsinks.yaml │ │ ├── cainjection_in_pulsarsources.yaml │ │ ├── cainjection_in_pulsartenants.yaml │ │ ├── cainjection_in_pulsartopics.yaml │ │ ├── cainjection_in_secrets.yaml │ │ ├── cainjection_in_streamnativecloudconnections.yaml │ │ ├── webhook_in_computeflinkdeployments.yaml │ │ ├── webhook_in_computeworkspaces.yaml │ │ ├── webhook_in_pulsarconnections.yaml │ │ ├── webhook_in_pulsarfunctions.yaml │ │ ├── webhook_in_pulsargeoreplications.yaml │ │ ├── webhook_in_pulsarnamespaces.yaml │ │ ├── webhook_in_pulsarnsisolationpolicies.yaml │ │ ├── webhook_in_pulsarpackages.yaml │ │ ├── webhook_in_pulsarpermissions.yaml │ │ ├── webhook_in_pulsarsinks.yaml │ │ ├── webhook_in_pulsarsources.yaml │ │ ├── webhook_in_pulsartenants.yaml │ │ ├── webhook_in_pulsartopics.yaml │ │ ├── webhook_in_secrets.yaml │ │ └── webhook_in_streamnativecloudconnections.yaml ├── default │ ├── kustomization.yaml │ ├── manager_auth_proxy_patch.yaml │ └── manager_config_patch.yaml ├── manager │ ├── controller_manager_config.yaml │ ├── kustomization.yaml │ └── manager.yaml ├── manifests-redhat │ ├── bases │ │ └── pulsar-resources-operator.clusterserviceversion.yaml │ └── kustomization.yaml ├── manifests │ ├── bases │ │ └── pulsar-resources-operator.clusterserviceversion.yaml │ └── kustomization.yaml ├── prometheus │ ├── kustomization.yaml │ └── monitor.yaml ├── rbac │ ├── apikey_editor_role.yaml │ ├── apikey_viewer_role.yaml │ ├── auth_proxy_client_clusterrole.yaml │ ├── auth_proxy_role.yaml │ ├── auth_proxy_role_binding.yaml │ ├── auth_proxy_service.yaml │ ├── computeflinkdeployment_editor_role.yaml │ ├── computeflinkdeployment_viewer_role.yaml │ ├── computeworkspace_editor_role.yaml │ ├── computeworkspace_viewer_role.yaml │ ├── kustomization.yaml │ ├── leader_election_role.yaml │ ├── leader_election_role_binding.yaml │ ├── pulsarconnection_editor_role.yaml │ ├── pulsarconnection_viewer_role.yaml │ ├── pulsarfunction_editor_role.yaml │ ├── pulsarfunction_viewer_role.yaml │ ├── pulsargeoreplication_editor_role.yaml │ ├── pulsargeoreplication_viewer_role.yaml │ ├── pulsarnamespace_editor_role.yaml │ ├── pulsarnamespace_viewer_role.yaml │ ├── pulsarnsisolationpolicy_editor_role.yaml │ ├── pulsarnsisolationpolicy_viewer_role.yaml │ ├── pulsarpackage_editor_role.yaml │ ├── pulsarpackage_viewer_role.yaml │ ├── pulsarpermission_editor_role.yaml │ ├── pulsarpermission_viewer_role.yaml │ ├── pulsarsink_editor_role.yaml │ ├── pulsarsink_viewer_role.yaml │ ├── pulsarsource_editor_role.yaml │ ├── pulsarsource_viewer_role.yaml │ ├── pulsartenant_editor_role.yaml │ ├── pulsartenant_viewer_role.yaml │ ├── pulsartopic_editor_role.yaml │ ├── pulsartopic_viewer_role.yaml │ ├── role.yaml │ ├── role_binding.yaml │ ├── secret_editor_role.yaml │ ├── secret_viewer_role.yaml │ ├── service_account.yaml │ ├── serviceaccount_editor_role.yaml │ ├── serviceaccount_viewer_role.yaml │ ├── serviceaccountbinding_editor_role.yaml │ ├── serviceaccountbinding_viewer_role.yaml │ ├── streamnativecloudconnection_editor_role.yaml │ └── streamnativecloudconnection_viewer_role.yaml ├── samples │ ├── kustomization.yaml │ ├── resource_v1alpha1_computeflinkdeployment.yaml │ ├── resource_v1alpha1_computeworkspace.yaml │ ├── resource_v1alpha1_pulsarconnection.yaml │ ├── resource_v1alpha1_pulsarfunction.yaml │ ├── resource_v1alpha1_pulsargeoreplication.yaml │ ├── resource_v1alpha1_pulsarnamespace.yaml │ ├── resource_v1alpha1_pulsarnsisolationpolicy.yaml │ ├── resource_v1alpha1_pulsarpackage.yaml │ ├── resource_v1alpha1_pulsarpermission.yaml │ ├── resource_v1alpha1_pulsarsink.yaml │ ├── resource_v1alpha1_pulsarsource.yaml │ ├── resource_v1alpha1_pulsartenant.yaml │ ├── resource_v1alpha1_pulsartopic.yaml │ ├── resource_v1alpha1_secret.yaml │ └── resource_v1alpha1_streamnativecloudconnection.yaml └── scorecard │ ├── bases │ └── config.yaml │ ├── kustomization.yaml │ └── patches │ ├── basic.config.yaml │ └── olm.config.yaml ├── controllers ├── apikey_controller.go ├── apiserverconnection_controller.go ├── connection_manager.go ├── connection_ref_mapper.go ├── doc.go ├── flinkdeployment_controller.go ├── pulsarconnection_controller.go ├── secret_controller.go ├── serviceaccount_controller.go ├── serviceaccountbinding_controller.go ├── suite_test.go └── workspace_controller.go ├── cr.yaml ├── ct.yaml ├── docs ├── apikey.md ├── compute_flink_deployment.md ├── compute_workspace.md ├── pulsar_connection.md ├── pulsar_function.md ├── pulsar_geo_replication.md ├── pulsar_namespace.md ├── pulsar_ns_isolation_policy.md ├── pulsar_package.md ├── pulsar_permission.md ├── pulsar_resource_lifecycle.md ├── pulsar_sink.md ├── pulsar_source.md ├── pulsar_tenant.md ├── pulsar_topic.md ├── secret.md ├── serviceaccount.md ├── serviceaccountbinding.md └── streamnative_cloud_connection.md ├── go.mod ├── go.sum ├── go.work ├── go.work.sum ├── hack ├── boilerplate.go.txt ├── common.sh ├── kind-cluster-build.sh ├── kube_codegen.sh └── update-codegen.sh ├── lintconf.yaml ├── main.go ├── package-lock.json ├── package.json ├── pkg ├── admin │ ├── doc.go │ ├── dummy.go │ ├── errors.go │ ├── impl.go │ └── interface.go ├── connection │ ├── doc.go │ ├── package_properties.go │ ├── reconcile_function.go │ ├── reconcile_geo_replication.go │ ├── reconcile_namespace.go │ ├── reconcile_nsisolationpolicy.go │ ├── reconcile_package.go │ ├── reconcile_permission.go │ ├── reconcile_sink.go │ ├── reconcile_source.go │ ├── reconcile_tenant.go │ ├── reconcile_topic.go │ └── reconciler.go ├── crypto │ ├── jwe.go │ └── rsa.go ├── feature │ ├── doc.go │ ├── feature.go │ └── feature_gate.go ├── reconciler │ ├── doc.go │ └── interface.go ├── streamnativecloud │ ├── api_connection.go │ ├── apikey_client.go │ ├── apis │ │ ├── cloud │ │ │ └── v1alpha1 │ │ │ │ ├── apikey_types.go │ │ │ │ ├── common_types.go │ │ │ │ ├── conditions.go │ │ │ │ ├── doc.go │ │ │ │ ├── secret_types.go │ │ │ │ ├── serviceaccount_types.go │ │ │ │ ├── serviceaccountbinding_types.go │ │ │ │ ├── taints.go │ │ │ │ ├── v1alpha1.go │ │ │ │ ├── zz_generated.api.register.go │ │ │ │ └── zz_generated.deepcopy.go │ │ └── compute │ │ │ └── v1alpha1 │ │ │ ├── commons.go │ │ │ ├── conditions.go │ │ │ ├── doc.go │ │ │ ├── flinkdeployment_types.go │ │ │ ├── podtemplate.go │ │ │ ├── v1alpha1.go │ │ │ ├── workspace_types.go │ │ │ ├── zz_generated.api.register.go │ │ │ └── zz_generated.deepcopy.go │ ├── client │ │ ├── clientset_generated │ │ │ └── clientset │ │ │ │ ├── clientset.go │ │ │ │ ├── fake │ │ │ │ ├── clientset_generated.go │ │ │ │ ├── doc.go │ │ │ │ └── register.go │ │ │ │ ├── scheme │ │ │ │ ├── doc.go │ │ │ │ └── register.go │ │ │ │ └── typed │ │ │ │ ├── cloud │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── apikey.go │ │ │ │ │ ├── cloud_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── fake_apikey.go │ │ │ │ │ ├── fake_cloud_client.go │ │ │ │ │ ├── fake_secret.go │ │ │ │ │ ├── fake_serviceaccount.go │ │ │ │ │ └── fake_serviceaccountbinding.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── secret.go │ │ │ │ │ ├── serviceaccount.go │ │ │ │ │ └── serviceaccountbinding.go │ │ │ │ └── compute │ │ │ │ └── v1alpha1 │ │ │ │ ├── compute_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_compute_client.go │ │ │ │ ├── fake_flinkdeployment.go │ │ │ │ └── fake_workspace.go │ │ │ │ ├── flinkdeployment.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── workspace.go │ │ ├── informers_generated │ │ │ └── externalversions │ │ │ │ ├── cloud │ │ │ │ ├── interface.go │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── apikey.go │ │ │ │ │ ├── interface.go │ │ │ │ │ ├── secret.go │ │ │ │ │ ├── serviceaccount.go │ │ │ │ │ └── serviceaccountbinding.go │ │ │ │ ├── compute │ │ │ │ ├── interface.go │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── flinkdeployment.go │ │ │ │ │ ├── interface.go │ │ │ │ │ └── workspace.go │ │ │ │ ├── factory.go │ │ │ │ ├── generic.go │ │ │ │ └── internalinterfaces │ │ │ │ └── factory_interfaces.go │ │ └── listers_generated │ │ │ ├── cloud │ │ │ └── v1alpha1 │ │ │ │ ├── apikey.go │ │ │ │ ├── expansion_generated.go │ │ │ │ ├── secret.go │ │ │ │ ├── serviceaccount.go │ │ │ │ └── serviceaccountbinding.go │ │ │ └── compute │ │ │ └── v1alpha1 │ │ │ ├── expansion_generated.go │ │ │ ├── flinkdeployment.go │ │ │ └── workspace.go │ ├── doc.go │ ├── flinkdeployment_client.go │ ├── flinkdeployment_converter.go │ ├── secret_client.go │ ├── serviceaccount_client.go │ ├── serviceaccountbinding_client.go │ ├── status_helper.go │ └── workspace_client.go └── utils │ ├── common.go │ ├── doc.go │ ├── duration.go │ ├── event_source.go │ ├── event_source_test.go │ ├── hash.go │ ├── managed.go │ ├── oauth2.go │ ├── retry.go │ ├── retry_test.go │ ├── secrets.go │ └── suit_test.go ├── redhat.Dockerfile ├── scripts ├── lint.sh ├── op_man.sh ├── setup_git_hook.sh ├── sync_rules.py ├── verify_gofmt.sh └── verify_govet.sh └── tests ├── README.md ├── go.mod ├── go.sum ├── operator ├── operator_suite_test.go └── resources_test.go └── utils ├── k8s.go └── spec.go /.ci/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | set -ex 18 | 19 | BINDIR=`dirname "$0"` 20 | CHARTS_HOME=`cd ${BINDIR}/..;pwd` 21 | CHARTS_PKGS=${CHARTS_HOME}/.chart-packages 22 | CHARTS_REPO_PATH=`cd ${CHARTS_HOME}/../charts;pwd` 23 | CHARTS_INDEX=${CHARTS_REPO_PATH}/.chart-index 24 | # Deprecated. you can find these args in cr.yaml 25 | # CHARTS_REPO=${CHARTS_REPO:-"https://charts.streamnative.io"} 26 | OWNER=${OWNER:-streamnative} 27 | REPO=${REPO:-pulsar-resources-operator} 28 | GITHUB_TOKEN=${GITHUB_TOKEN:-"UNSET"} 29 | GITUSER=${GITUSER:-"UNSET"} 30 | GITEMAIL=${GITEMAIL:-"UNSET"} 31 | CHART="$1" 32 | RELEASE_BRANCH="$2" 33 | 34 | # hack/common.sh need this variable to be set 35 | PULSAR_CHART_HOME=${CHARTS_HOME} 36 | source ${CHARTS_HOME}/hack/common.sh 37 | 38 | # allow overwriting cr binary 39 | CR="${CR_BIN} --config ${CHARTS_HOME}/cr.yaml" 40 | 41 | function release::ensure_dir() { 42 | local dir=$1 43 | if [[ -d ${dir} ]]; then 44 | rm -rf ${dir} 45 | fi 46 | mkdir -p ${dir} 47 | } 48 | 49 | 50 | function release::package_chart() { 51 | echo "Packaging chart '${CHART}'..." 52 | ${CR} package ${CHARTS_HOME}/charts/${CHART} 53 | } 54 | 55 | function release::upload_packages() { 56 | echo "Uploading charts..." 57 | ${CR} upload -t ${GITHUB_TOKEN} --commit ${RELEASE_BRANCH} 58 | } 59 | 60 | 61 | 62 | 63 | 64 | # install cr 65 | hack::ensure_cr 66 | 67 | release::ensure_dir ${CHARTS_PKGS} 68 | release::ensure_dir ${CHARTS_INDEX} 69 | 70 | release::package_chart 71 | 72 | release::upload_packages 73 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file 16 | # Ignore build and test binaries. 17 | bin/ 18 | testbin/ 19 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @streamnative/cloud @streamnative/cloud-data-plane -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | *(If this PR fixes a github issue, please add `Fixes #`.)* 17 | 18 | Fixes # 19 | 20 | *(or if this PR is one task of a github issue, please add `Master Issue: #` to link to the master issue.)* 21 | 22 | Master Issue: # 23 | 24 | ### Motivation 25 | 26 | *Explain here the context, and why you're making that change. What is the problem you're trying to solve.* 27 | 28 | ### Modifications 29 | 30 | *Describe the modifications you've done.* 31 | 32 | ### Verifying this change 33 | 34 | - [ ] Make sure that the change passes the CI checks. 35 | 36 | *(Please pick either of the following options)* 37 | 38 | This change is a trivial rework / code cleanup without any test coverage. 39 | 40 | *(or)* 41 | 42 | This change is already covered by existing tests, such as *(please describe tests)*. 43 | 44 | *(or)* 45 | 46 | This change added tests and can be verified as follows: 47 | 48 | *(example:)* 49 | - *Added integration tests for end-to-end deployment with large payloads (10MB)* 50 | - *Extended integration test for recovery after broker failure* 51 | 52 | ### Documentation 53 | 54 | Check the box below. 55 | 56 | Need to update docs? 57 | 58 | - [ ] `doc-required` 59 | 60 | (If you need help on updating docs, create a doc issue) 61 | 62 | - [ ] `no-need-doc` 63 | 64 | (Please explain why) 65 | 66 | - [ ] `doc` 67 | 68 | (If this PR contains doc changes) 69 | 70 | -------------------------------------------------------------------------------- /.github/workflows/check-license-header.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | name: Check License Header 17 | on: 18 | pull_request: 19 | push: 20 | branches: 21 | - main 22 | 23 | jobs: 24 | license-check: 25 | name: check license header 26 | runs-on: ubuntu-22.04 27 | steps: 28 | - uses: actions/checkout@v3 29 | 30 | - name: Check License Header 31 | uses: apache/skywalking-eyes@v0.4.0 32 | with: 33 | mode: check 34 | -------------------------------------------------------------------------------- /.github/workflows/documentbot.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: Auto Labeling 16 | 17 | on: 18 | pull_request_target : 19 | types: 20 | - opened 21 | - edited 22 | - labeled 23 | 24 | 25 | 26 | # A GitHub token created for a PR coming from a fork doesn't have 27 | # 'admin' or 'write' permission (which is required to add labels) 28 | # To avoid this issue, you can use the `scheduled` event and run 29 | # this action on a certain interval.And check the label about the 30 | # document. 31 | 32 | jobs: 33 | labeling: 34 | if: ${{ github.repository == 'streamnative/pulsar-resources-operator' }} 35 | permissions: 36 | pull-requests: write 37 | runs-on: ubuntu-22.04 38 | steps: 39 | - uses: streamnative/github-workflow-libraries/doc-label-check@master 40 | with: 41 | github-token: ${{ secrets.GITHUB_TOKEN }} 42 | label-pattern: '- \[(.*?)\] ?`(.+?)`' # matches '- [x] `label`' 43 | 44 | -------------------------------------------------------------------------------- /.github/workflows/style.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: Precommit Style Check 16 | on: 17 | push: 18 | branches: 19 | - master 20 | - main 21 | - develop 22 | pull_request: 23 | branches: 24 | - '*' 25 | env: 26 | GOPRIVATE: github.com/streamnative 27 | jobs: 28 | build: 29 | name: Build 30 | runs-on: ubuntu-22.04 31 | env: 32 | ACCESS_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }} 33 | GOPRIVATE: github.com/streamnative 34 | steps: 35 | - name: Set up Go 1.23 36 | uses: actions/setup-go@v3 37 | with: 38 | go-version: '1.23' 39 | id: go 40 | 41 | - name: Set up git token 42 | run: | 43 | git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/" 44 | 45 | - name: Check out code into the Go module directory 46 | uses: actions/checkout@v3 47 | 48 | - name: Check style 49 | run: | 50 | ./scripts/verify_gofmt.sh ./... 51 | ./scripts/verify_govet.sh ./... -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Binaries for programs and plugins 16 | *.exe 17 | *.exe~ 18 | *.dll 19 | *.so 20 | *.dylib 21 | bin 22 | testbin/* 23 | 24 | # Test binary, build with `go test -c` 25 | *.test 26 | 27 | # Output of the go coverage tool, specifically when used with LiteIDE 28 | *.out 29 | 30 | # Kubernetes Generated files - skip generated files, except for vendored files 31 | 32 | !vendor/**/zz_generated.* 33 | 34 | # editor and IDE paraphernalia 35 | .DS_Store 36 | .idea 37 | *.swp 38 | *.swo 39 | *~ 40 | 41 | # bundles 42 | bundle 43 | bundle.Dockerfile 44 | build 45 | 46 | # husky 47 | node_modules/ 48 | 49 | # chart-releaser 50 | .chart-index/ 51 | .chart-packages/ 52 | 53 | .cursor 54 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | echo "Check License" 5 | make license-check 6 | echo "Check Lint" 7 | ./scripts/lint.sh ./... 8 | echo "Go fmt" 9 | ./scripts/verify_gofmt.sh ./... 10 | echo "Go vet" 11 | ./scripts/verify_govet.sh ./... 12 | -------------------------------------------------------------------------------- /.licenserc.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | header: 17 | license: 18 | spdx-id: Apache-2.0 19 | copyright-owner: StreamNative 20 | 21 | paths-ignore: 22 | - 'dist' 23 | - 'licenses' 24 | - '**/*.md' 25 | - 'LICENSE' 26 | - 'NOTICE' 27 | - '.github/CODEOWNERS' 28 | - '.github/operatorhub/' 29 | - '.github/openshift/' 30 | - 'PROJECT' 31 | - '**/go.mod' 32 | - '**/go.work' 33 | - '**/go.work.sum' 34 | - '**/go.sum' 35 | - '.husky/**' 36 | - 'hack/**' 37 | - 'charts/ct/' 38 | - '**/README.md.gotmpl' 39 | - '**/*.json' 40 | - '**/.helmignore' 41 | - 'testbin/**' 42 | 43 | comment: on-failure 44 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Build the manager binary 16 | FROM golang:1.23-alpine3.21 as builder 17 | 18 | ARG ACCESS_TOKEN="none" 19 | 20 | RUN go env -w GOPRIVATE=github.com/streamnative \ 21 | && apk add --no-cache ca-certificates git \ 22 | && git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/" 23 | 24 | WORKDIR /workspace 25 | # Copy the Go Modules manifests 26 | COPY go.mod go.mod 27 | COPY go.sum go.sum 28 | # cache deps before building and copying source so that we don't need to re-download as much 29 | # and so that source changes don't invalidate our downloaded layer 30 | RUN go mod download 31 | 32 | # Copy the go source 33 | COPY main.go main.go 34 | COPY api/ api/ 35 | COPY controllers/ controllers/ 36 | COPY pkg/ pkg/ 37 | 38 | # Build 39 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go 40 | 41 | # Use distroless as minimal base image to package the manager binary 42 | # Refer to https://github.com/GoogleContainerTools/distroless for more details 43 | FROM alpine:3.21 44 | 45 | # Upgrade all packages to get latest versions with security fixes 46 | RUN apk upgrade --no-cache 47 | 48 | WORKDIR / 49 | COPY --from=builder /workspace/manager . 50 | USER 65532:65532 51 | 52 | ENTRYPOINT ["/manager"] 53 | -------------------------------------------------------------------------------- /PROJECT: -------------------------------------------------------------------------------- 1 | domain: streamnative.io 2 | layout: 3 | - go.kubebuilder.io/v3 4 | plugins: 5 | manifests.sdk.operatorframework.io/v2: {} 6 | scorecard.sdk.operatorframework.io/v2: {} 7 | projectName: pulsar-resources-operator 8 | repo: github.com/streamnative/pulsar-resources-operator 9 | resources: 10 | - api: 11 | crdVersion: v1 12 | namespaced: true 13 | controller: true 14 | domain: streamnative.io 15 | group: resource 16 | kind: PulsarConnection 17 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 18 | version: v1alpha1 19 | - api: 20 | crdVersion: v1 21 | namespaced: true 22 | domain: streamnative.io 23 | group: resource 24 | kind: PulsarNamespace 25 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 26 | version: v1alpha1 27 | - api: 28 | crdVersion: v1 29 | namespaced: true 30 | domain: streamnative.io 31 | group: resource 32 | kind: PulsarTenant 33 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 34 | version: v1alpha1 35 | - api: 36 | crdVersion: v1 37 | namespaced: true 38 | domain: streamnative.io 39 | group: resource 40 | kind: PulsarTopic 41 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 42 | version: v1alpha1 43 | - api: 44 | crdVersion: v1 45 | namespaced: true 46 | domain: streamnative.io 47 | group: resource 48 | kind: PulsarPermission 49 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 50 | version: v1alpha1 51 | - api: 52 | crdVersion: v1 53 | namespaced: true 54 | domain: streamnative.io 55 | group: resource 56 | kind: PulsarGeoReplication 57 | path: github.com/streamnative/pulsar-resources-operator/api/v1alpha1 58 | version: v1alpha1 59 | version: "3" 60 | -------------------------------------------------------------------------------- /api/v1alpha1/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1alpha1 16 | 17 | const ( 18 | // ConditionReady indicates status condition ready 19 | ConditionReady string = "Ready" 20 | // ConditionTopicPolicyReady indicates the topic policy ready 21 | ConditionTopicPolicyReady string = "PolicyReady" 22 | // FinalizerName is the finalizer string that add to object 23 | FinalizerName string = "cloud.streamnative.io/finalizer" 24 | 25 | // AuthPluginToken indicates the authentication pulgin type token 26 | AuthPluginToken string = "org.apache.pulsar.client.impl.auth.AuthenticationToken" // #nosec G101 27 | // AuthPluginOAuth2 indicates the authentication pulgin type oauth2 28 | AuthPluginOAuth2 string = "org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2" 29 | ) 30 | -------------------------------------------------------------------------------- /api/v1alpha1/groupversion_info.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v1alpha1 contains API Schema definitions for the resource v1alpha1 API group 16 | // +kubebuilder:object:generate=true 17 | // +groupName=resource.streamnative.io 18 | package v1alpha1 19 | 20 | import ( 21 | "k8s.io/apimachinery/pkg/runtime/schema" 22 | "sigs.k8s.io/controller-runtime/pkg/scheme" 23 | ) 24 | 25 | var ( 26 | // GroupVersion is group version used to register these objects 27 | GroupVersion = schema.GroupVersion{Group: "resource.streamnative.io", Version: "v1alpha1"} 28 | 29 | // SchemeBuilder is used to add go types to the GroupVersionKind scheme 30 | SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 31 | 32 | // AddToScheme adds the types in this group-version to the given scheme. 33 | AddToScheme = SchemeBuilder.AddToScheme 34 | ) 35 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | 25 | # unittest files 26 | tests 27 | 28 | # ci value files 29 | ci/ 30 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/README.md.gotmpl: -------------------------------------------------------------------------------- 1 | {{ template "chart.header" . }} 2 | {{ template "chart.description" . }} 3 | 4 | {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} 5 | 6 | 7 | ## Installing the Chart 8 | 9 | To install the chart with the release name `my-release`: 10 | 11 | ```console 12 | $ helm repo add streamnative https://charts.streamnative.io 13 | $ helm -n install my-release streamnative/{{ template "chart.name" . }} 14 | ``` 15 | 16 | {{ template "chart.requirementsSection" . }} 17 | 18 | Pulsar: `>= 2.9.0.x` 19 | 20 | {{ template "chart.valuesSection" . }} -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/templates/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # permissions to do leader election. 17 | apiVersion: rbac.authorization.k8s.io/v1 18 | kind: Role 19 | metadata: 20 | name: {{ include "pulsar-resources-operator.roleLeaderElectionName" . }} 21 | namespace: {{ include "pulsar-resources-operator.namespace" .}} 22 | rules: 23 | - apiGroups: 24 | - "" 25 | resources: 26 | - configmaps 27 | verbs: 28 | - get 29 | - list 30 | - watch 31 | - create 32 | - update 33 | - patch 34 | - delete 35 | - apiGroups: 36 | - coordination.k8s.io 37 | resources: 38 | - leases 39 | verbs: 40 | - get 41 | - list 42 | - watch 43 | - create 44 | - update 45 | - patch 46 | - delete 47 | - apiGroups: 48 | - "" 49 | resources: 50 | - events 51 | verbs: 52 | - create 53 | - patch 54 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/templates/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: RoleBinding 18 | metadata: 19 | name: '{{ include "pulsar-resources-operator.fullname" . }}-leader-election-rolebinding' 20 | namespace: {{ include "pulsar-resources-operator.namespace" .}} 21 | roleRef: 22 | apiGroup: rbac.authorization.k8s.io 23 | kind: Role 24 | name: {{ include "pulsar-resources-operator.roleLeaderElectionName" . }} 25 | subjects: 26 | - kind: ServiceAccount 27 | name: {{ include "pulsar-resources-operator.serviceAccountName" . }} 28 | namespace: {{ include "pulsar-resources-operator.namespace" .}} 29 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/templates/role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRoleBinding 18 | metadata: 19 | name: '{{ include "pulsar-resources-operator.fullname" . }}-manager-rolebinding' 20 | roleRef: 21 | apiGroup: rbac.authorization.k8s.io 22 | kind: ClusterRole 23 | name: '{{ include "pulsar-resources-operator.clusterRoleManagerName" . }}' 24 | subjects: 25 | - kind: ServiceAccount 26 | name: {{ include "pulsar-resources-operator.serviceAccountName" . }} 27 | namespace: {{ include "pulsar-resources-operator.namespace" .}} 28 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | {{ if .Values.serviceAccount.create -}} 17 | apiVersion: v1 18 | kind: ServiceAccount 19 | metadata: 20 | name: {{ include "pulsar-resources-operator.serviceAccountName" . }} 21 | namespace: {{ include "pulsar-resources-operator.namespace" .}} 22 | labels: 23 | {{- include "pulsar-resources-operator.labels" . | nindent 4 }} 24 | annotations: 25 | {{- if and .Values.cloudStorage.gcs.enabled .Values.cloudStorage.gcs.serviceAccount.useWorkloadIdentity }} 26 | iam.gke.io/gcp-service-account: {{ .Values.cloudStorage.gcs.serviceAccount.name }} 27 | {{- end }} 28 | {{- with .Values.serviceAccount.annotations }} 29 | {{- toYaml . | nindent 4 }} 30 | {{- end }} 31 | {{- end }} 32 | -------------------------------------------------------------------------------- /charts/pulsar-resources-operator/tests/serviceaccount_test.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | suite: test service account 17 | templates: 18 | - serviceaccount.yaml 19 | tests: 20 | - it: should pass all default settings 21 | asserts: 22 | - isAPIVersion: 23 | of: v1 24 | - isKind: 25 | of: ServiceAccount 26 | - matchRegex: 27 | path: metadata.name 28 | pattern: -pulsar-resources-operator$ 29 | 30 | - it: should be the specified name 31 | set: 32 | serviceAccount.name: test 33 | asserts: 34 | - equal: 35 | path: metadata.name 36 | value: test 37 | -------------------------------------------------------------------------------- /config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 16 | nameReference: 17 | - kind: Service 18 | version: v1 19 | fieldSpecs: 20 | - kind: CustomResourceDefinition 21 | version: v1 22 | group: apiextensions.k8s.io 23 | path: spec/conversion/webhook/clientConfig/service/name 24 | 25 | namespace: 26 | - kind: CustomResourceDefinition 27 | version: v1 28 | group: apiextensions.k8s.io 29 | path: spec/conversion/webhook/clientConfig/service/namespace 30 | create: false 31 | 32 | varReference: 33 | - path: metadata/annotations 34 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_computeflinkdeployments.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: computeflinkdeployments.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_computeworkspaces.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: computeworkspaces.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarconnections.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarconnections.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarfunctions.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarfunctions.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsargeoreplications.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsargeoreplications.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarnamespaces.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarnamespaces.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarnsisolationpolicies.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarnsisolationpolicies.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarpackages.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarpackages.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarpermissions.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarpermissions.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarsinks.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarsinks.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsarsources.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsarsources.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsartenants.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsartenants.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_pulsartopics.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: pulsartopics.resource.streamnative.io 22 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_secrets.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: secrets.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_streamnativecloudconnections.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch adds a directive for certmanager to inject CA into the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | annotations: 20 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 21 | name: streamnativecloudconnections.resource.streamnative.io -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_computeflinkdeployments.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: computeflinkdeployments.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_computeworkspaces.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: computeworkspaces.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarconnections.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarconnections.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarfunctions.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarfunctions.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsargeoreplications.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsargeoreplications.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarnamespaces.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarnamespaces.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarnsisolationpolicies.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarnsisolationpolicies.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarpackages.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarpackages.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarpermissions.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarpermissions.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarsinks.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarsinks.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsarsources.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsarsources.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsartenants.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsartenants.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_pulsartopics.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: pulsartopics.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 31 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_secrets.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: secrets.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_streamnativecloudconnections.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # The following patch enables a conversion webhook for the CRD 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: streamnativecloudconnections.resource.streamnative.io 20 | spec: 21 | conversion: 22 | strategy: Webhook 23 | webhook: 24 | clientConfig: 25 | service: 26 | namespace: system 27 | name: webhook-service 28 | path: /convert 29 | conversionReviewVersions: 30 | - v1 -------------------------------------------------------------------------------- /config/default/manager_auth_proxy_patch.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # This patch inject a sidecar container which is a HTTP proxy for the 16 | # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. 17 | apiVersion: apps/v1 18 | kind: Deployment 19 | metadata: 20 | name: controller-manager 21 | namespace: system 22 | spec: 23 | template: 24 | spec: 25 | containers: 26 | - name: kube-rbac-proxy 27 | image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.4 28 | args: 29 | - "--secure-listen-address=0.0.0.0:8443" 30 | - "--upstream=http://127.0.0.1:8080/" 31 | - "--logtostderr=true" 32 | - "--v=0" 33 | ports: 34 | - containerPort: 8443 35 | protocol: TCP 36 | name: https 37 | resources: 38 | limits: 39 | cpu: 500m 40 | memory: 128Mi 41 | requests: 42 | cpu: 5m 43 | memory: 64Mi 44 | - name: manager 45 | args: 46 | - "--health-probe-bind-address=:8081" 47 | - "--metrics-bind-address=127.0.0.1:8080" 48 | - "--leader-elect" 49 | -------------------------------------------------------------------------------- /config/default/manager_config_patch.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: apps/v1 16 | kind: Deployment 17 | metadata: 18 | name: controller-manager 19 | namespace: system 20 | spec: 21 | template: 22 | spec: 23 | containers: 24 | - name: manager 25 | args: 26 | - "--config=controller_manager_config.yaml" 27 | volumeMounts: 28 | - name: manager-config 29 | mountPath: /controller_manager_config.yaml 30 | subPath: controller_manager_config.yaml 31 | volumes: 32 | - name: manager-config 33 | configMap: 34 | name: manager-config 35 | -------------------------------------------------------------------------------- /config/manager/controller_manager_config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 16 | kind: ControllerManagerConfig 17 | health: 18 | healthProbeBindAddress: :8081 19 | metrics: 20 | bindAddress: 127.0.0.1:8080 21 | webhook: 22 | port: 9443 23 | leaderElection: 24 | leaderElect: true 25 | resourceName: ed4866ca.streamnative.io 26 | -------------------------------------------------------------------------------- /config/manager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | resources: 16 | - manager.yaml 17 | 18 | generatorOptions: 19 | disableNameSuffixHash: true 20 | 21 | configMapGenerator: 22 | - files: 23 | - controller_manager_config.yaml 24 | name: manager-config 25 | apiVersion: kustomize.config.k8s.io/v1beta1 26 | kind: Kustomization 27 | images: 28 | - name: controller 29 | newName: controller 30 | newTag: latest 31 | -------------------------------------------------------------------------------- /config/manifests-redhat/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # These resources constitute the fully configured set of manifests 16 | # used to generate the 'manifests/' directory in a bundle. 17 | resources: 18 | - bases/pulsar-resources-operator.clusterserviceversion.yaml 19 | - ../default 20 | - ../samples 21 | - ../scorecard 22 | 23 | # [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. 24 | # Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. 25 | # These patches remove the unnecessary "cert" volume and its manager container volumeMount. 26 | #patchesJson6902: 27 | #- target: 28 | # group: apps 29 | # version: v1 30 | # kind: Deployment 31 | # name: controller-manager 32 | # namespace: system 33 | # patch: |- 34 | # # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. 35 | # # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment. 36 | # - op: remove 37 | # path: /spec/template/spec/containers/1/volumeMounts/0 38 | # # Remove the "cert" volume, since OLM will create and mount a set of certs. 39 | # # Update the indices in this path if adding or removing volumes in the manager's Deployment. 40 | # - op: remove 41 | # path: /spec/template/spec/volumes/0 42 | -------------------------------------------------------------------------------- /config/manifests/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # These resources constitute the fully configured set of manifests 16 | # used to generate the 'manifests/' directory in a bundle. 17 | resources: 18 | - bases/pulsar-resources-operator.clusterserviceversion.yaml 19 | - ../default 20 | - ../samples 21 | - ../scorecard 22 | 23 | # [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. 24 | # Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. 25 | # These patches remove the unnecessary "cert" volume and its manager container volumeMount. 26 | #patchesJson6902: 27 | #- target: 28 | # group: apps 29 | # version: v1 30 | # kind: Deployment 31 | # name: controller-manager 32 | # namespace: system 33 | # patch: |- 34 | # # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. 35 | # # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment. 36 | # - op: remove 37 | # path: /spec/template/spec/containers/1/volumeMounts/0 38 | # # Remove the "cert" volume, since OLM will create and mount a set of certs. 39 | # # Update the indices in this path if adding or removing volumes in the manager's Deployment. 40 | # - op: remove 41 | # path: /spec/template/spec/volumes/0 42 | -------------------------------------------------------------------------------- /config/prometheus/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | resources: 16 | - monitor.yaml 17 | -------------------------------------------------------------------------------- /config/prometheus/monitor.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Prometheus Monitor Service (Metrics) 16 | apiVersion: monitoring.coreos.com/v1 17 | kind: ServiceMonitor 18 | metadata: 19 | labels: 20 | control-plane: controller-manager 21 | name: controller-manager-metrics-monitor 22 | namespace: system 23 | spec: 24 | endpoints: 25 | - path: /metrics 26 | port: https 27 | scheme: https 28 | bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token 29 | tlsConfig: 30 | insecureSkipVerify: true 31 | selector: 32 | matchLabels: 33 | control-plane: controller-manager 34 | -------------------------------------------------------------------------------- /config/rbac/apikey_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit apikeys. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: apikey-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - apikeys 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - apikeys/status 37 | verbs: 38 | - get -------------------------------------------------------------------------------- /config/rbac/apikey_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view apikeys. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: apikey-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - apikeys 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - apikeys/status 33 | verbs: 34 | - get -------------------------------------------------------------------------------- /config/rbac/auth_proxy_client_clusterrole.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRole 17 | metadata: 18 | name: metrics-reader 19 | rules: 20 | - nonResourceURLs: 21 | - "/metrics" 22 | verbs: 23 | - get 24 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRole 17 | metadata: 18 | name: proxy-role 19 | rules: 20 | - apiGroups: 21 | - authentication.k8s.io 22 | resources: 23 | - tokenreviews 24 | verbs: 25 | - create 26 | - apiGroups: 27 | - authorization.k8s.io 28 | resources: 29 | - subjectaccessreviews 30 | verbs: 31 | - create 32 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRoleBinding 17 | metadata: 18 | name: proxy-rolebinding 19 | roleRef: 20 | apiGroup: rbac.authorization.k8s.io 21 | kind: ClusterRole 22 | name: proxy-role 23 | subjects: 24 | - kind: ServiceAccount 25 | name: controller-manager 26 | namespace: system 27 | -------------------------------------------------------------------------------- /config/rbac/auth_proxy_service.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | kind: Service 17 | metadata: 18 | labels: 19 | control-plane: controller-manager 20 | name: controller-manager-metrics-service 21 | namespace: system 22 | spec: 23 | ports: 24 | - name: https 25 | port: 8443 26 | protocol: TCP 27 | targetPort: https 28 | selector: 29 | control-plane: controller-manager 30 | -------------------------------------------------------------------------------- /config/rbac/computeflinkdeployment_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: computeflinkdeployment-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - computeflinkdeployments 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - computeflinkdeployments/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/computeflinkdeployment_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: computeflinkdeployment-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - computeflinkdeployments 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - computeflinkdeployments/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/computeworkspace_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: computeworkspace-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - computeworkspaces 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - computeworkspaces/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/computeworkspace_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: computeworkspace-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - computeworkspaces 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - computeworkspaces/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | resources: 16 | # All RBAC will be applied under this service account in 17 | # the deployment namespace. You may comment out this resource 18 | # if your manager will use a service account that exists at 19 | # runtime. Be sure to update RoleBinding and ClusterRoleBinding 20 | # subjects if changing service account names. 21 | - service_account.yaml 22 | - role.yaml 23 | - role_binding.yaml 24 | - leader_election_role.yaml 25 | - leader_election_role_binding.yaml 26 | # Comment the following 4 lines if you want to disable 27 | # the auth proxy (https://github.com/brancz/kube-rbac-proxy) 28 | # which protects your /metrics endpoint. 29 | - auth_proxy_service.yaml 30 | - auth_proxy_role.yaml 31 | - auth_proxy_role_binding.yaml 32 | - auth_proxy_client_clusterrole.yaml 33 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions to do leader election. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: Role 18 | metadata: 19 | name: leader-election-role 20 | rules: 21 | - apiGroups: 22 | - "" 23 | resources: 24 | - configmaps 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - create 30 | - update 31 | - patch 32 | - delete 33 | - apiGroups: 34 | - coordination.k8s.io 35 | resources: 36 | - leases 37 | verbs: 38 | - get 39 | - list 40 | - watch 41 | - create 42 | - update 43 | - patch 44 | - delete 45 | - apiGroups: 46 | - "" 47 | resources: 48 | - events 49 | verbs: 50 | - create 51 | - patch 52 | -------------------------------------------------------------------------------- /config/rbac/leader_election_role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: RoleBinding 17 | metadata: 18 | name: leader-election-rolebinding 19 | roleRef: 20 | apiGroup: rbac.authorization.k8s.io 21 | kind: Role 22 | name: leader-election-role 23 | subjects: 24 | - kind: ServiceAccount 25 | name: controller-manager 26 | namespace: system 27 | -------------------------------------------------------------------------------- /config/rbac/pulsarconnection_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsarconnections. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarconnection-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarconnections 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarconnections/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarconnection_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsarconnections. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarconnection-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarconnections 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarconnections/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarfunction_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarfunction-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarfunctions 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarfunctions/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarfunction_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarfunction-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarfunctions 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarfunctions/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsargeoreplication_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsargeoreplications. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | labels: 20 | app.kubernetes.io/name: clusterrole 21 | app.kubernetes.io/instance: pulsargeoreplication-editor-role 22 | app.kubernetes.io/component: rbac 23 | app.kubernetes.io/created-by: pulsar-resources-operator 24 | app.kubernetes.io/part-of: pulsar-resources-operator 25 | app.kubernetes.io/managed-by: kustomize 26 | name: pulsargeoreplication-editor-role 27 | rules: 28 | - apiGroups: 29 | - resource.streamnative.io 30 | resources: 31 | - pulsargeoreplications 32 | verbs: 33 | - create 34 | - delete 35 | - get 36 | - list 37 | - patch 38 | - update 39 | - watch 40 | - apiGroups: 41 | - resource.streamnative.io 42 | resources: 43 | - pulsargeoreplications/status 44 | verbs: 45 | - get 46 | -------------------------------------------------------------------------------- /config/rbac/pulsargeoreplication_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsargeoreplications. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | labels: 20 | app.kubernetes.io/name: clusterrole 21 | app.kubernetes.io/instance: pulsargeoreplication-viewer-role 22 | app.kubernetes.io/component: rbac 23 | app.kubernetes.io/created-by: pulsar-resources-operator 24 | app.kubernetes.io/part-of: pulsar-resources-operator 25 | app.kubernetes.io/managed-by: kustomize 26 | name: pulsargeoreplication-viewer-role 27 | rules: 28 | - apiGroups: 29 | - resource.streamnative.io 30 | resources: 31 | - pulsargeoreplications 32 | verbs: 33 | - get 34 | - list 35 | - watch 36 | - apiGroups: 37 | - resource.streamnative.io 38 | resources: 39 | - pulsargeoreplications/status 40 | verbs: 41 | - get 42 | -------------------------------------------------------------------------------- /config/rbac/pulsarnamespace_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsarnamespaces. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarnamespace-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarnamespaces 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarnamespaces/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarnamespace_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsarnamespaces. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarnamespace-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarnamespaces 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarnamespaces/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarnsisolationpolicy_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsarconnections. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarnsisolation-policy-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarnsisolationpolicies 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarnsisolationpolicies/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarnsisolationpolicy_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsarconnections. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarnsisolation-policy-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarnsisolationpolicies 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarnsisolationpolicies/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarpackage_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarpackage-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarpackages 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarpackages/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarpackage_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarpackage-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarpackages 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarpackages/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarpermission_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsarpermissions. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarpermission-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarpermissions 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarpermissions/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarpermission_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsarpermissions. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarpermission-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarpermissions 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarpermissions/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarsink_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarsink-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarsinks 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarsinks/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarsink_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarsink-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarsinks 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarsinks/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsarsource_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarsource-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarsources 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsarsources/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsarsource_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsarsource-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsarsources 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsarsources/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsartenant_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartenants. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsartenant-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsartenants 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsartenants/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsartenant_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartenants. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsartenant-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsartenants 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsartenants/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/pulsartopic_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsartopic-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsartopics 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - pulsartopics/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/pulsartopic_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: pulsartopic-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - pulsartopics 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - pulsartopics/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/role_binding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: rbac.authorization.k8s.io/v1 16 | kind: ClusterRoleBinding 17 | metadata: 18 | name: manager-rolebinding 19 | roleRef: 20 | apiGroup: rbac.authorization.k8s.io 21 | kind: ClusterRole 22 | name: manager-role 23 | subjects: 24 | - kind: ServiceAccount 25 | name: controller-manager 26 | namespace: system 27 | -------------------------------------------------------------------------------- /config/rbac/secret_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit secrets. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: secret-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - secrets 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - secrets/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/secret_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view secrets. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: secret-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - secrets 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - secrets/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/rbac/service_account.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: v1 16 | kind: ServiceAccount 17 | metadata: 18 | name: controller-manager 19 | namespace: system 20 | -------------------------------------------------------------------------------- /config/rbac/serviceaccount_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit serviceaccounts. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: serviceaccount-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - serviceaccounts 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - serviceaccounts/status 37 | verbs: 38 | - get -------------------------------------------------------------------------------- /config/rbac/serviceaccount_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view serviceaccounts. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: serviceaccount-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - serviceaccounts 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - serviceaccounts/status 33 | verbs: 34 | - get -------------------------------------------------------------------------------- /config/rbac/serviceaccountbinding_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit serviceaccountbindings. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: serviceaccountbinding-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - serviceaccountbindings 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - serviceaccountbindings/status 37 | verbs: 38 | - get -------------------------------------------------------------------------------- /config/rbac/serviceaccountbinding_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to view serviceaccountbindings. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: serviceaccountbinding-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - serviceaccountbindings 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - serviceaccountbindings/status 33 | verbs: 34 | - get -------------------------------------------------------------------------------- /config/rbac/streamnativecloudconnection_editor_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: streamnativecloudconnection-editor-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - streamnativecloudconnections 25 | verbs: 26 | - create 27 | - delete 28 | - get 29 | - list 30 | - patch 31 | - update 32 | - watch 33 | - apiGroups: 34 | - resource.streamnative.io 35 | resources: 36 | - streamnativecloudconnections/status 37 | verbs: 38 | - get 39 | -------------------------------------------------------------------------------- /config/rbac/streamnativecloudconnection_viewer_role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # permissions for end users to edit pulsartopics. 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: streamnativecloudconnection-viewer-role 20 | rules: 21 | - apiGroups: 22 | - resource.streamnative.io 23 | resources: 24 | - streamnativecloudconnections 25 | verbs: 26 | - get 27 | - list 28 | - watch 29 | - apiGroups: 30 | - resource.streamnative.io 31 | resources: 32 | - streamnativecloudconnections/status 33 | verbs: 34 | - get 35 | -------------------------------------------------------------------------------- /config/samples/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ## Append samples you want in your CSV to this file as resources ## 16 | resources: 17 | - resource_v1alpha1_pulsarconnection.yaml 18 | - resource_v1alpha1_pulsarnamespace.yaml 19 | - resource_v1alpha1_pulsartenant.yaml 20 | - resource_v1alpha1_pulsartopic.yaml 21 | - resource_v1alpha1_pulsarpermission.yaml 22 | - resource_v1alpha1_pulsargeoreplication.yaml 23 | - resource_v1alpha1_pulsarpackage.yaml 24 | - resource_v1alpha1_pulsarfunction.yaml 25 | - resource_v1alpha1_pulsarsink.yaml 26 | - resource_v1alpha1_pulsarsource.yaml 27 | - resource_v1alpha1_pulsarnsisolationpolicy.yaml 28 | - resource_v1alpha1_streamnativecloudconnection.yaml 29 | - resource_v1alpha1_computeworkspace.yaml 30 | - resource_v1alpha1_computeflinkdeployment.yaml 31 | - resource_v1alpha1_secret.yaml 32 | #+kubebuilder:scaffold:manifestskustomizesamples 33 | -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_computeworkspace.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: ComputeWorkspace 17 | metadata: 18 | name: test-operator-workspace 19 | namespace: default 20 | spec: 21 | apiServerRef: 22 | name: test-connection 23 | pulsarClusterNames: 24 | - "test-pulsar" 25 | poolRef: 26 | name: shared 27 | namespace: streamnative -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarconnection.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarConnection 17 | metadata: 18 | name: pulsarconnection-sample 19 | namespace: pulsar 20 | spec: 21 | adminServiceURL: http://c-sn-platform-broker.pulsar.svc.cluster.local:8080 22 | authentication: 23 | token: 24 | secretRef: 25 | name: c-sn-platform-vault-secret-env-injection 26 | key: brokerClientAuthenticationParameters -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarfunction.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarFunction 17 | metadata: 18 | name: test-func 19 | namespace: default 20 | spec: 21 | autoAck: true 22 | className: org.apache.pulsar.functions.api.examples.ExclamationFunction 23 | cleanupSubscription: true 24 | connectionRef: 25 | name: test-connection 26 | customRuntimeOptions: {} 27 | deadLetterTopic: dl-topic 28 | exposePulsarAdminClientEnabled: false 29 | forwardSourceMessageProperty: true 30 | inputs: 31 | - input 32 | jar: 33 | url: file:///pulsar/examples/api-examples.jar 34 | lifecyclePolicy: CleanUpAfterDeletion 35 | logTopic: func-log 36 | maxMessageRetries: 101 37 | name: test-func 38 | namespace: default 39 | output: output 40 | parallelism: 1 41 | processingGuarantees: ATLEAST_ONCE 42 | retainKeyOrdering: true 43 | retainOrdering: false 44 | secrets: 45 | SECRET1: 46 | key: hello 47 | path: sectest 48 | skipToLatest: true 49 | subName: test-sub 50 | subscriptionPosition: Latest 51 | tenant: public 52 | timeoutMs: 6666 -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsargeoreplication.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarGeoReplication 17 | metadata: 18 | labels: 19 | app.kubernetes.io/name: pulsargeoreplication 20 | app.kubernetes.io/instance: pulsargeoreplication-sample 21 | app.kubernetes.io/part-of: pulsar-resources-operator 22 | app.kubernetes.io/managed-by: kustomize 23 | app.kubernetes.io/created-by: pulsar-resources-operator 24 | name: pulsargeoreplication-sample 25 | spec: 26 | connectionRef: 27 | name: local-pulsarconnection 28 | destinationConnectionRef: 29 | name: remote-pulsarconnection -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarnamespace.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarNamespace 17 | metadata: 18 | name: pulsarnamespace-sample 19 | namespace: pulsar 20 | spec: 21 | name: tenant-one/testns 22 | connectionRef: 23 | name: pulsarconnection-sample 24 | backlogQuotaLimitSize: 1Gi 25 | backlogQuotaLimitTime: 2h 26 | backlogQuotaRetentionPolicy: producer_request_hold 27 | # default is destination_storage 28 | # backlogQuotaType: message_age 29 | bundles: 16 30 | messageTTL: 1h 31 | maxProducersPerTopic: 2 32 | maxConsumersPerTopic: 12 33 | maxConsumersPerSubscription: 4 34 | retentionTime: 20h 35 | retentionSize: 2Gi 36 | lifecyclePolicy: CleanUpAfterDeletion 37 | -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarnsisolationpolicy.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarNSIsolationPolicy 17 | metadata: 18 | name: test-pulsar-ns-isolation-policy 19 | namespace: test 20 | spec: 21 | name: test-policy 22 | cluster: standalone 23 | connectionRef: 24 | name: test-pulsar-connection 25 | namespaces: 26 | - test-tenant/test-ns 27 | primary: 28 | - test-pulsar-broker-0.* 29 | secondary: 30 | - test-pulsar-broker-1.* 31 | autoFailoverPolicyType: min_available 32 | autoFailoverPolicyParams: 33 | min_limit: "1" 34 | usage_threshold: "80" 35 | -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarpackage.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarPackage 17 | metadata: 18 | name: pulsarpackage-sample 19 | namespace: pulsar 20 | spec: 21 | packageURL: function://public/default/test@latest 22 | fileURL: https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-2.10.4/connectors/pulsar-io-file-2.10.4.nar 23 | connectionRef: 24 | name: pulsarconnection-sample 25 | description: "test" 26 | lifecyclePolicy: CleanUpAfterDeletion 27 | -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarpermission.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarPermission 17 | metadata: 18 | name: pulsarpermission-namespace 19 | namespace: pulsar 20 | spec: 21 | connectionRef: 22 | name: pulsarconnection-sample 23 | resourceType: namespace 24 | resourceName: tenant-one/testns 25 | lifecyclePolicy: CleanUpAfterDeletion 26 | roles: 27 | - ironman 28 | actions: 29 | - produce 30 | - consume 31 | --- 32 | apiVersion: resource.streamnative.io/v1alpha1 33 | kind: PulsarPermission 34 | metadata: 35 | name: pulsarpermission-topic 36 | namespace: pulsar 37 | spec: 38 | connectionRef: 39 | name: pulsarconnection-sample 40 | resourceType: topic 41 | resourceName: persistent://tenant-one/testns/topic123 42 | lifecyclePolicy: CleanUpAfterDeletion 43 | roles: 44 | - superman 45 | actions: 46 | - produce 47 | - consume 48 | - functions -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarsink.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarSink 17 | metadata: 18 | name: test-pulsar-sink 19 | namespace: default 20 | spec: 21 | autoAck: true 22 | className: org.apache.pulsar.io.datagenerator.DataGeneratorPrintSink 23 | cleanupSubscription: false 24 | connectionRef: 25 | name: "test-pulsar-connection" 26 | customRuntimeOptions: {} 27 | inputs: 28 | - sink-input 29 | archive: 30 | url: builtin://data-generator 31 | lifecyclePolicy: CleanUpAfterDeletion 32 | name: test-pulsar-sink 33 | namespace: default 34 | parallelism: 1 35 | processingGuarantees: EFFECTIVELY_ONCE 36 | secrets: 37 | SECRET1: 38 | key: hello 39 | path: sectest 40 | sourceSubscriptionPosition: Latest 41 | tenant: public -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsarsource.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarSource 17 | metadata: 18 | name: test-pulsar-source 19 | namespace: default 20 | spec: 21 | className: org.apache.pulsar.io.datagenerator.DataGeneratorSource 22 | connectionRef: 23 | name: "test-pulsar-connection" 24 | customRuntimeOptions: 25 | sleepBetweenMessages: "1000" 26 | topicName: sink-input 27 | archive: 28 | url: builtin://data-generator 29 | configs: 30 | sleepBetweenMessages: "1000" 31 | lifecyclePolicy: CleanUpAfterDeletion 32 | name: test-pulsar-source 33 | namespace: default 34 | parallelism: 1 35 | processingGuarantees: ATLEAST_ONCE 36 | secrets: 37 | SECRET1: 38 | key: hello 39 | path: sectest 40 | tenant: public -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsartenant.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarTenant 17 | metadata: 18 | name: pulsartenant-sample 19 | namespace: pulsar 20 | spec: 21 | name: tenant-one 22 | connectionRef: 23 | name: pulsarconnection-sample 24 | adminRoles: 25 | - admin 26 | - ops 27 | - devops 28 | # allowedClusters: 29 | # - c-sn-platform 30 | lifecyclePolicy: CleanUpAfterDeletion -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_pulsartopic.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: PulsarTopic 17 | metadata: 18 | name: pulsartopic-sample 19 | namespace: pulsar 20 | spec: 21 | name: persistent://tenant-one/testns/topic123 22 | connectionRef: 23 | name: pulsarconnection-sample 24 | # persistent: true 25 | # partitions: 8 26 | maxProducers: 4 27 | maxConsumers: 9 28 | messageTTL: 1h 29 | # maxUnAckedMessagesPerConsumer: 11 30 | # maxUnAckedMessagesPerSubscription: 4 31 | # retentionTime: 1h 32 | # retentionSize: 10Gi 33 | # backlogQuotaLimitTime: 24h 34 | # backlogQuotaLimitSize: 1Gi 35 | # backlogQuotaRetentionPolicy: producer_request_hold 36 | lifecyclePolicy: CleanUpAfterDeletion -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_secret.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: Secret 17 | metadata: 18 | name: test-secret 19 | namespace: default 20 | spec: 21 | apiServerRef: 22 | name: test-connection 23 | type: Opaque 24 | data: 25 | key: value 26 | location: "useast1" 27 | instanceName: "test-instance" 28 | -------------------------------------------------------------------------------- /config/samples/resource_v1alpha1_streamnativecloudconnection.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: resource.streamnative.io/v1alpha1 16 | kind: StreamNativeCloudConnection 17 | metadata: 18 | name: test-connection 19 | namespace: default 20 | spec: 21 | server: https://api.streamnative.dev 22 | auth: 23 | credentialsRef: 24 | name: test-credentials 25 | organization: org 26 | --- 27 | apiVersion: v1 28 | kind: Secret 29 | metadata: 30 | name: test-credentials 31 | namespace: default 32 | type: Opaque 33 | data: 34 | credentials.json: | 35 | { 36 | "type": "sn_service_account", 37 | "client_secret": "client_secret", 38 | "client_email": "client-email", 39 | "issuer_url": "issuer_url", 40 | "client_id": "client-id" 41 | } 42 | -------------------------------------------------------------------------------- /config/scorecard/bases/config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiVersion: scorecard.operatorframework.io/v1alpha3 16 | kind: Configuration 17 | metadata: 18 | name: config 19 | stages: 20 | - parallel: true 21 | tests: [] 22 | -------------------------------------------------------------------------------- /config/scorecard/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | resources: 16 | - bases/config.yaml 17 | patchesJson6902: 18 | - path: patches/basic.config.yaml 19 | target: 20 | group: scorecard.operatorframework.io 21 | version: v1alpha3 22 | kind: Configuration 23 | name: config 24 | - path: patches/olm.config.yaml 25 | target: 26 | group: scorecard.operatorframework.io 27 | version: v1alpha3 28 | kind: Configuration 29 | name: config 30 | #+kubebuilder:scaffold:patchesJson6902 31 | -------------------------------------------------------------------------------- /config/scorecard/patches/basic.config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - op: add 16 | path: /stages/0/tests/- 17 | value: 18 | entrypoint: 19 | - scorecard-test 20 | - basic-check-spec 21 | image: quay.io/operator-framework/scorecard-test:master 22 | labels: 23 | suite: basic 24 | test: basic-check-spec-test 25 | -------------------------------------------------------------------------------- /config/scorecard/patches/olm.config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - op: add 16 | path: /stages/0/tests/- 17 | value: 18 | entrypoint: 19 | - scorecard-test 20 | - olm-bundle-validation 21 | image: quay.io/operator-framework/scorecard-test:master 22 | labels: 23 | suite: olm 24 | test: olm-bundle-validation-test 25 | - op: add 26 | path: /stages/0/tests/- 27 | value: 28 | entrypoint: 29 | - scorecard-test 30 | - olm-crds-have-validation 31 | image: quay.io/operator-framework/scorecard-test:master 32 | labels: 33 | suite: olm 34 | test: olm-crds-have-validation-test 35 | - op: add 36 | path: /stages/0/tests/- 37 | value: 38 | entrypoint: 39 | - scorecard-test 40 | - olm-crds-have-resources 41 | image: quay.io/operator-framework/scorecard-test:master 42 | labels: 43 | suite: olm 44 | test: olm-crds-have-resources-test 45 | - op: add 46 | path: /stages/0/tests/- 47 | value: 48 | entrypoint: 49 | - scorecard-test 50 | - olm-spec-descriptors 51 | image: quay.io/operator-framework/scorecard-test:master 52 | labels: 53 | suite: olm 54 | test: olm-spec-descriptors-test 55 | - op: add 56 | path: /stages/0/tests/- 57 | value: 58 | entrypoint: 59 | - scorecard-test 60 | - olm-status-descriptors 61 | image: quay.io/operator-framework/scorecard-test:master 62 | labels: 63 | suite: olm 64 | test: olm-status-descriptors-test 65 | -------------------------------------------------------------------------------- /controllers/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package controllers implements controllers. 16 | package controllers 17 | -------------------------------------------------------------------------------- /cr.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | owner: streamnative 16 | git-repo: pulsar-resources-operator 17 | package-path: .chart-packages 18 | index-path: .chart-index 19 | git-base-url: https://api.github.com/ 20 | git-upload-url: https://uploads.github.com/ 21 | -------------------------------------------------------------------------------- /ct.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # See https://github.com/helm/chart-testing#configuration 17 | 18 | # common parameters 19 | debug: true 20 | validate-maintainers: false 21 | chart-dirs: 22 | - charts 23 | 24 | # parameters for ct list-changed 25 | remote: origin 26 | target-branch: main 27 | 28 | 29 | # parameters for ct lint 30 | charts: 31 | - charts/pulsar-resources-operator 32 | 33 | # 添加固定的命名配置 34 | namespace: chart-testing 35 | release-label: app.kubernetes.io/instance 36 | release-name: pulsar-resources-operator 37 | 38 | # Additional commands to run per chart. 39 | # Commands will be executed in the same order as provided in the list and will 40 | # be rendered with go template before being executed. 41 | additional-commands: 42 | # tigger `helm unittest` after the lint check 43 | - helm unittest charts/pulsar-resources-operator 44 | -------------------------------------------------------------------------------- /go.work: -------------------------------------------------------------------------------- 1 | go 1.23.0 2 | 3 | toolchain go1.24.1 4 | 5 | use ( 6 | . 7 | tests 8 | ) 9 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. -------------------------------------------------------------------------------- /lintconf.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 StreamNative 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | --- 16 | rules: 17 | braces: 18 | min-spaces-inside: 0 19 | max-spaces-inside: 0 20 | min-spaces-inside-empty: -1 21 | max-spaces-inside-empty: -1 22 | brackets: 23 | min-spaces-inside: 0 24 | max-spaces-inside: 0 25 | min-spaces-inside-empty: -1 26 | max-spaces-inside-empty: -1 27 | colons: 28 | max-spaces-before: 0 29 | max-spaces-after: 1 30 | commas: 31 | max-spaces-before: 0 32 | min-spaces-after: 1 33 | max-spaces-after: 1 34 | comments: 35 | require-starting-space: true 36 | min-spaces-from-content: 2 37 | document-end: disable 38 | document-start: disable # No --- to start a file 39 | empty-lines: 40 | max: 2 41 | max-start: 0 42 | max-end: 0 43 | hyphens: 44 | max-spaces-after: 1 45 | indentation: 46 | spaces: consistent 47 | indent-sequences: whatever # - list indentation will handle both indentation and without 48 | check-multi-line-strings: false 49 | key-duplicates: enable 50 | line-length: disable # Lines can be any length 51 | new-line-at-end-of-file: enable 52 | new-lines: 53 | type: unix 54 | trailing-spaces: disable 55 | truthy: 56 | level: warning 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@commitlint/cli": "^17.6.1", 4 | "@commitlint/config-conventional": "^16.0.0", 5 | "husky": "^7.0.4" 6 | }, 7 | "scripts": { 8 | "prepare": "husky install" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /pkg/admin/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package admin implements the functions to call pulsar admin 16 | package admin 17 | -------------------------------------------------------------------------------- /pkg/connection/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package connection implements the reconcilations for pulsar resource 16 | package connection 17 | -------------------------------------------------------------------------------- /pkg/crypto/jwe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package crypto implements the crypto functions 16 | package crypto 17 | 18 | import ( 19 | "crypto/rsa" 20 | "fmt" 21 | 22 | "github.com/lestrrat-go/jwx/v2/jwa" 23 | "github.com/lestrrat-go/jwx/v2/jwe" 24 | ) 25 | 26 | // EncryptTokenToJWE encrypts a token using JWE with the provided public key 27 | func EncryptTokenToJWE(token string, publicKey *rsa.PublicKey) (string, error) { 28 | // Encrypt the token using RSA-OAEP for key encryption and A256GCM for content encryption 29 | encrypted, err := jwe.Encrypt([]byte(token), jwe.WithKey(jwa.RSA_OAEP, publicKey)) 30 | if err != nil { 31 | return "", fmt.Errorf("failed to encrypt token: %w", err) 32 | } 33 | 34 | return string(encrypted), nil 35 | } 36 | 37 | // DecryptJWEToken decrypts a JWE token using the provided private key 38 | func DecryptJWEToken(jweToken string, privateKey *rsa.PrivateKey) (string, error) { 39 | // Decrypt the JWE token 40 | decrypted, err := jwe.Decrypt([]byte(jweToken), jwe.WithKey(jwa.RSA_OAEP, privateKey)) 41 | if err != nil { 42 | return "", fmt.Errorf("failed to decrypt token: %w", err) 43 | } 44 | 45 | return string(decrypted), nil 46 | } 47 | -------------------------------------------------------------------------------- /pkg/feature/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package feature implements the feature gate 16 | package feature 17 | -------------------------------------------------------------------------------- /pkg/feature/feature.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package feature 16 | 17 | import "k8s.io/component-base/featuregate" 18 | 19 | const ( 20 | // AlwaysUpdatePulsarResource is the feature gate for always update pulsar resource 21 | AlwaysUpdatePulsarResource featuregate.Feature = "AlwaysUpdatePulsarResource" 22 | ) 23 | 24 | var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ 25 | AlwaysUpdatePulsarResource: {Default: false, PreRelease: featuregate.Alpha}, 26 | } 27 | -------------------------------------------------------------------------------- /pkg/feature/feature_gate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package feature 16 | 17 | import ( 18 | "os" 19 | "strconv" 20 | 21 | "k8s.io/apimachinery/pkg/util/runtime" 22 | "k8s.io/component-base/featuregate" 23 | ) 24 | 25 | var ( 26 | 27 | // DefaultMutableFeatureGate is a mutable version of DefaultFeatureGate. 28 | DefaultMutableFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate() 29 | 30 | // DefaultFeatureGate is a shared global FeatureGate. 31 | DefaultFeatureGate featuregate.FeatureGate = DefaultMutableFeatureGate 32 | ) 33 | 34 | func init() { 35 | runtime.Must(DefaultMutableFeatureGate.Add(defaultFeatureGates)) 36 | } 37 | 38 | // SetFeatureGates sets the provided feature gates. 39 | func SetFeatureGates() error { 40 | envFlags := map[string]featuregate.Feature{ 41 | "ALWAYS_UPDATE_PULSAR_RESOURCE": AlwaysUpdatePulsarResource, 42 | } 43 | 44 | m := map[string]bool{} 45 | for envVar, feature := range envFlags { 46 | if v, ok := os.LookupEnv(envVar); ok { 47 | val, err := strconv.ParseBool(v) 48 | if err != nil { 49 | return err 50 | } 51 | m[string(feature)] = val 52 | } 53 | } 54 | 55 | return DefaultMutableFeatureGate.SetFromMap(m) 56 | } 57 | -------------------------------------------------------------------------------- /pkg/reconciler/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package reconciler implements the function of resource reconcile 16 | package reconciler 17 | -------------------------------------------------------------------------------- /pkg/reconciler/interface.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package reconciler 16 | 17 | import ( 18 | "context" 19 | 20 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 | "k8s.io/apimachinery/pkg/runtime" 22 | ) 23 | 24 | // Object is a abstract interface 25 | type Object interface { 26 | metav1.Object 27 | runtime.Object 28 | } 29 | 30 | // Interface implements the functions to observe and reconcile resource object 31 | type Interface interface { 32 | Observe(ctx context.Context) error 33 | Reconcile(ctx context.Context) error 34 | } 35 | 36 | // Dummy is a dummy reconciler that does nothing. 37 | type Dummy struct { 38 | } 39 | 40 | // Observe is a fake implements of Observe 41 | func (d *Dummy) Observe(context.Context) error { 42 | return nil 43 | } 44 | 45 | // Reconcile is a fake implements of Reconcile 46 | func (d *Dummy) Reconcile(context.Context) error { 47 | return nil 48 | } 49 | 50 | var _ Interface = &Dummy{} 51 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/apis/cloud/v1alpha1/conditions.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1alpha1 16 | 17 | import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 18 | 19 | type ConditionType string 20 | 21 | type ConditionReason string 22 | 23 | const ( 24 | ConditionTypeReady ConditionType = "Ready" 25 | 26 | ConditionReasonReady ConditionReason = "Ready" 27 | ConditionReasonNotReady ConditionReason = "NotReady" 28 | ) 29 | 30 | type Condition struct { 31 | Type ConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ConditionType"` 32 | Status metav1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/apimachinery/pkg/apis/meta/v1.ConditionStatus"` 33 | Reason ConditionReason `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason,casttype=ConditionReason"` 34 | Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 35 | LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,5,opt,name=lastTransitionTime"` 36 | // +optional 37 | // +kubebuilder:validation:Minimum=0 38 | ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,6,opt,name=observedGeneration"` 39 | } 40 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/apis/cloud/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Api versions allow the api contract for a resource to be changed while keeping 16 | // backward compatibility by support multiple concurrent versions 17 | // of the same resource 18 | 19 | //go:generate go run k8s.io/code-generator/cmd/deepcopy-gen -O zz_generated.deepcopy -i . -h ../../../../../hack/boilerplate.go.txt 20 | //go:generate go run k8s.io/code-generator/cmd/defaulter-gen -O zz_generated.defaults -i . -h ../../../../../hack/boilerplate.go.txt 21 | //go:generate go run k8s.io/code-generator/cmd/conversion-gen -O zz_generated.conversion -i . -h ../../../../../hack/boilerplate.go.txt 22 | 23 | // +k8s:openapi-gen=true 24 | // +k8s:deepcopy-gen=package,register 25 | // +k8s:conversion-gen=github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/cloud 26 | // +k8s:defaulter-gen=TypeMeta 27 | // +k8s:protobuf-gen=package 28 | // +groupName=cloud.streamnative.io 29 | // 30 | //nolint:stylecheck 31 | package v1alpha1 // import "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/cloud/v1alpha1" 32 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/apis/cloud/v1alpha1/v1alpha1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1alpha1 16 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/apis/compute/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Api versions allow the api contract for a resource to be changed while keeping 16 | // backward compatibility by support multiple concurrent versions 17 | // of the same resource 18 | 19 | //go:generate go run k8s.io/code-generator/cmd/deepcopy-gen -O zz_generated.deepcopy -i . -h ../../../../../hack/boilerplate.go.txt 20 | //go:generate go run k8s.io/code-generator/cmd/defaulter-gen -O zz_generated.defaults -i . -h ../../../../../hack/boilerplate.go.txt 21 | //go:generate go run k8s.io/code-generator/cmd/conversion-gen -O zz_generated.conversion -i . -h ../../../../../hack/boilerplate.go.txt 22 | 23 | // +k8s:openapi-gen=true 24 | // +k8s:deepcopy-gen=package,register 25 | // +k8s:conversion-gen=github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/compute 26 | // +k8s:defaulter-gen=TypeMeta 27 | // +k8s:protobuf-gen=package 28 | // +groupName=compute.streamnative.io 29 | // 30 | //nolint:stylecheck 31 | package v1alpha1 // import "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/compute/v1alpha1" 32 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/apis/compute/v1alpha1/v1alpha1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1alpha1 16 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/fake/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // This package has the automatically generated fake clientset. 17 | package fake 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/fake/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | package fake 17 | 18 | import ( 19 | cloudv1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/cloud/v1alpha1" 20 | computev1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/apis/compute/v1alpha1" 21 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 | runtime "k8s.io/apimachinery/pkg/runtime" 23 | schema "k8s.io/apimachinery/pkg/runtime/schema" 24 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 25 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 26 | ) 27 | 28 | var scheme = runtime.NewScheme() 29 | var codecs = serializer.NewCodecFactory(scheme) 30 | 31 | var localSchemeBuilder = runtime.SchemeBuilder{ 32 | cloudv1alpha1.AddToScheme, 33 | computev1alpha1.AddToScheme, 34 | } 35 | 36 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 37 | // of clientsets, like in: 38 | // 39 | // import ( 40 | // "k8s.io/client-go/kubernetes" 41 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 42 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 43 | // ) 44 | // 45 | // kclientset, _ := kubernetes.NewForConfig(c) 46 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 47 | // 48 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 49 | // correctly. 50 | var AddToScheme = localSchemeBuilder.AddToScheme 51 | 52 | func init() { 53 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 54 | utilruntime.Must(AddToScheme(scheme)) 55 | } 56 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/scheme/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // This package contains the scheme of the automatically generated clientset. 17 | package scheme 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/cloud/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // This package has the automatically generated typed clients. 17 | package v1alpha1 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/cloud/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // Package fake has the automatically generated clients. 17 | package fake 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/cloud/v1alpha1/fake/fake_cloud_client.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | package fake 17 | 18 | import ( 19 | v1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/clientset_generated/clientset/typed/cloud/v1alpha1" 20 | rest "k8s.io/client-go/rest" 21 | testing "k8s.io/client-go/testing" 22 | ) 23 | 24 | type FakeCloudV1alpha1 struct { 25 | *testing.Fake 26 | } 27 | 28 | func (c *FakeCloudV1alpha1) APIKeys(namespace string) v1alpha1.APIKeyInterface { 29 | return &FakeAPIKeys{c, namespace} 30 | } 31 | 32 | func (c *FakeCloudV1alpha1) Secrets(namespace string) v1alpha1.SecretInterface { 33 | return &FakeSecrets{c, namespace} 34 | } 35 | 36 | func (c *FakeCloudV1alpha1) ServiceAccounts(namespace string) v1alpha1.ServiceAccountInterface { 37 | return &FakeServiceAccounts{c, namespace} 38 | } 39 | 40 | func (c *FakeCloudV1alpha1) ServiceAccountBindings(namespace string) v1alpha1.ServiceAccountBindingInterface { 41 | return &FakeServiceAccountBindings{c, namespace} 42 | } 43 | 44 | // RESTClient returns a RESTClient that is used to communicate 45 | // with API server by this client implementation. 46 | func (c *FakeCloudV1alpha1) RESTClient() rest.Interface { 47 | var ret *rest.RESTClient 48 | return ret 49 | } 50 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/cloud/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | package v1alpha1 17 | 18 | type APIKeyExpansion interface{} 19 | 20 | type SecretExpansion interface{} 21 | 22 | type ServiceAccountExpansion interface{} 23 | 24 | type ServiceAccountBindingExpansion interface{} 25 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/compute/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // This package has the automatically generated typed clients. 17 | package v1alpha1 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/compute/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | // Package fake has the automatically generated clients. 17 | package fake 18 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/compute/v1alpha1/fake/fake_compute_client.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | package fake 17 | 18 | import ( 19 | v1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/clientset_generated/clientset/typed/compute/v1alpha1" 20 | rest "k8s.io/client-go/rest" 21 | testing "k8s.io/client-go/testing" 22 | ) 23 | 24 | type FakeComputeV1alpha1 struct { 25 | *testing.Fake 26 | } 27 | 28 | func (c *FakeComputeV1alpha1) FlinkDeployments(namespace string) v1alpha1.FlinkDeploymentInterface { 29 | return &FakeFlinkDeployments{c, namespace} 30 | } 31 | 32 | func (c *FakeComputeV1alpha1) Workspaces(namespace string) v1alpha1.WorkspaceInterface { 33 | return &FakeWorkspaces{c, namespace} 34 | } 35 | 36 | // RESTClient returns a RESTClient that is used to communicate 37 | // with API server by this client implementation. 38 | func (c *FakeComputeV1alpha1) RESTClient() rest.Interface { 39 | var ret *rest.RESTClient 40 | return ret 41 | } 42 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/clientset_generated/clientset/typed/compute/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by client-gen. DO NOT EDIT. 15 | 16 | package v1alpha1 17 | 18 | type FlinkDeploymentExpansion interface{} 19 | 20 | type WorkspaceExpansion interface{} 21 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/informers_generated/externalversions/cloud/interface.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by informer-gen. DO NOT EDIT. 15 | 16 | package cloud 17 | 18 | import ( 19 | v1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/informers_generated/externalversions/cloud/v1alpha1" 20 | internalinterfaces "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/informers_generated/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to each of this group's versions. 24 | type Interface interface { 25 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 26 | V1alpha1() v1alpha1.Interface 27 | } 28 | 29 | type group struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // V1alpha1 returns a new v1alpha1.Interface. 41 | func (g *group) V1alpha1() v1alpha1.Interface { 42 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 43 | } 44 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/informers_generated/externalversions/compute/interface.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by informer-gen. DO NOT EDIT. 15 | 16 | package compute 17 | 18 | import ( 19 | v1alpha1 "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/informers_generated/externalversions/compute/v1alpha1" 20 | internalinterfaces "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/informers_generated/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to each of this group's versions. 24 | type Interface interface { 25 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 26 | V1alpha1() v1alpha1.Interface 27 | } 28 | 29 | type group struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // V1alpha1 returns a new v1alpha1.Interface. 41 | func (g *group) V1alpha1() v1alpha1.Interface { 42 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 43 | } 44 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/informers_generated/externalversions/compute/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by informer-gen. DO NOT EDIT. 15 | 16 | package v1alpha1 17 | 18 | import ( 19 | internalinterfaces "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/informers_generated/externalversions/internalinterfaces" 20 | ) 21 | 22 | // Interface provides access to all the informers in this group version. 23 | type Interface interface { 24 | // FlinkDeployments returns a FlinkDeploymentInformer. 25 | FlinkDeployments() FlinkDeploymentInformer 26 | // Workspaces returns a WorkspaceInformer. 27 | Workspaces() WorkspaceInformer 28 | } 29 | 30 | type version struct { 31 | factory internalinterfaces.SharedInformerFactory 32 | namespace string 33 | tweakListOptions internalinterfaces.TweakListOptionsFunc 34 | } 35 | 36 | // New returns a new Interface. 37 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 38 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 39 | } 40 | 41 | // FlinkDeployments returns a FlinkDeploymentInformer. 42 | func (v *version) FlinkDeployments() FlinkDeploymentInformer { 43 | return &flinkDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 44 | } 45 | 46 | // Workspaces returns a WorkspaceInformer. 47 | func (v *version) Workspaces() WorkspaceInformer { 48 | return &workspaceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 49 | } 50 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by informer-gen. DO NOT EDIT. 15 | 16 | package internalinterfaces 17 | 18 | import ( 19 | time "time" 20 | 21 | clientset "github.com/streamnative/pulsar-resources-operator/pkg/streamnativecloud/client/clientset_generated/clientset" 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | runtime "k8s.io/apimachinery/pkg/runtime" 24 | cache "k8s.io/client-go/tools/cache" 25 | ) 26 | 27 | // NewInformerFunc takes clientset.Interface and time.Duration to return a SharedIndexInformer. 28 | type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer 29 | 30 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 31 | type SharedInformerFactory interface { 32 | Start(stopCh <-chan struct{}) 33 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 34 | } 35 | 36 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 37 | type TweakListOptionsFunc func(*v1.ListOptions) 38 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/listers_generated/cloud/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by lister-gen. DO NOT EDIT. 15 | 16 | package v1alpha1 17 | 18 | // APIKeyListerExpansion allows custom methods to be added to 19 | // APIKeyLister. 20 | type APIKeyListerExpansion interface{} 21 | 22 | // APIKeyNamespaceListerExpansion allows custom methods to be added to 23 | // APIKeyNamespaceLister. 24 | type APIKeyNamespaceListerExpansion interface{} 25 | 26 | // SecretListerExpansion allows custom methods to be added to 27 | // SecretLister. 28 | type SecretListerExpansion interface{} 29 | 30 | // SecretNamespaceListerExpansion allows custom methods to be added to 31 | // SecretNamespaceLister. 32 | type SecretNamespaceListerExpansion interface{} 33 | 34 | // ServiceAccountListerExpansion allows custom methods to be added to 35 | // ServiceAccountLister. 36 | type ServiceAccountListerExpansion interface{} 37 | 38 | // ServiceAccountNamespaceListerExpansion allows custom methods to be added to 39 | // ServiceAccountNamespaceLister. 40 | type ServiceAccountNamespaceListerExpansion interface{} 41 | 42 | // ServiceAccountBindingListerExpansion allows custom methods to be added to 43 | // ServiceAccountBindingLister. 44 | type ServiceAccountBindingListerExpansion interface{} 45 | 46 | // ServiceAccountBindingNamespaceListerExpansion allows custom methods to be added to 47 | // ServiceAccountBindingNamespaceLister. 48 | type ServiceAccountBindingNamespaceListerExpansion interface{} 49 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/client/listers_generated/compute/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Code generated by lister-gen. DO NOT EDIT. 15 | 16 | package v1alpha1 17 | 18 | // FlinkDeploymentListerExpansion allows custom methods to be added to 19 | // FlinkDeploymentLister. 20 | type FlinkDeploymentListerExpansion interface{} 21 | 22 | // FlinkDeploymentNamespaceListerExpansion allows custom methods to be added to 23 | // FlinkDeploymentNamespaceLister. 24 | type FlinkDeploymentNamespaceListerExpansion interface{} 25 | 26 | // WorkspaceListerExpansion allows custom methods to be added to 27 | // WorkspaceLister. 28 | type WorkspaceListerExpansion interface{} 29 | 30 | // WorkspaceNamespaceListerExpansion allows custom methods to be added to 31 | // WorkspaceNamespaceLister. 32 | type WorkspaceNamespaceListerExpansion interface{} 33 | -------------------------------------------------------------------------------- /pkg/streamnativecloud/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package streamnativecloud implements the function of SN Cloud resource reconcile 16 | package streamnativecloud 17 | -------------------------------------------------------------------------------- /pkg/utils/common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | import ( 18 | "encoding/json" 19 | 20 | apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" 21 | ) 22 | 23 | // ConvertMap converts a map[string]string to a map[string]interface{} 24 | func ConvertMap(input map[string]string) map[string]interface{} { 25 | // Create an empty map[string]interface{} 26 | result := make(map[string]interface{}) 27 | 28 | // Loop through each key-value pair in the input map 29 | for key, value := range input { 30 | // Assign the value to the result map with the same key 31 | result[key] = value 32 | } 33 | 34 | return result 35 | } 36 | 37 | // ConvertJSONToMapStringInterface converts a JSON object to a map[string]interface{} 38 | func ConvertJSONToMapStringInterface(raw *apiextensionsv1.JSON) (map[string]interface{}, error) { 39 | // Create an empty map[string]interface{} 40 | result := make(map[string]interface{}) 41 | 42 | // Unmarshal the raw JSON object into the result map 43 | if err := json.Unmarshal(raw.Raw, &result); err != nil { 44 | return nil, err 45 | } 46 | 47 | return result, nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/utils/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package utils implements the util functions 16 | package utils 17 | -------------------------------------------------------------------------------- /pkg/utils/duration.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | import ( 18 | "time" 19 | 20 | str2duration "github.com/xhit/go-str2duration/v2" 21 | ) 22 | 23 | // Duration represents a elapsed time in string. 24 | type Duration string 25 | 26 | // Parse parses a duration from string. 27 | // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w". 28 | func (d *Duration) Parse() (time.Duration, error) { 29 | var res time.Duration 30 | res, err := str2duration.ParseDuration(string(*d)) 31 | if err != nil { 32 | return res, err 33 | } 34 | return res, nil 35 | } 36 | -------------------------------------------------------------------------------- /pkg/utils/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | import ( 18 | "crypto/md5" //nolint:gosec 19 | "encoding/hex" 20 | "fmt" 21 | 22 | corev1 "k8s.io/api/core/v1" 23 | ) 24 | 25 | // CalculateSecretKeyMd5 calculates the hash of the secret key. 26 | func CalculateSecretKeyMd5(secret *corev1.Secret, key string) (string, error) { 27 | data, ok := secret.Data[key] 28 | if !ok { 29 | return "", fmt.Errorf("key %s not found in secret", key) 30 | } 31 | 32 | // we use md5 to calculate fingerprint of the secret key 33 | hasher := md5.New() //nolint:gosec 34 | if _, err := hasher.Write(data); err != nil { 35 | return "", err 36 | } 37 | 38 | return hex.EncodeToString(hasher.Sum(nil)), nil 39 | } 40 | -------------------------------------------------------------------------------- /pkg/utils/managed.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 18 | 19 | const ( 20 | // ManagedAnnotation indicates the object is managed by the controller 21 | ManagedAnnotation = "cloud.streamnative.io/managed" 22 | ) 23 | 24 | // IsManaged returns true if the object is under control of the controller by checking 25 | // the specific annotation 26 | func IsManaged(object metav1.Object) bool { 27 | managed, exists := object.GetAnnotations()[ManagedAnnotation] 28 | return !exists || managed != "false" 29 | } 30 | -------------------------------------------------------------------------------- /pkg/utils/oauth2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | // ClientCredentials represents the client credentials for OAuth2 18 | type ClientCredentials struct { 19 | IssuerURL string `json:"issuerUrl,omitempty"` 20 | Audience string `json:"audience,omitempty"` 21 | Scope string `json:"scope,omitempty"` 22 | PrivateKey string `json:"privateKey,omitempty"` 23 | ClientID string `json:"clientId,omitempty"` 24 | } 25 | -------------------------------------------------------------------------------- /pkg/utils/suit_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 StreamNative 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package utils 16 | 17 | import ( 18 | "testing" 19 | 20 | . "github.com/onsi/ginkgo/v2" 21 | . "github.com/onsi/gomega" 22 | ) 23 | 24 | func TestAPIs(t *testing.T) { 25 | RegisterFailHandler(Fail) 26 | 27 | RunSpecs(t, "Utils test") 28 | } 29 | -------------------------------------------------------------------------------- /scripts/lint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | #!/usr/bin/env bash 18 | # exit immediately when a command fails 19 | 20 | set -e 21 | # only exit with zero if all commands of the pipeline exit successfully 22 | set -o pipefail 23 | # error on unset variables 24 | set -u 25 | 26 | BINDIR=$(dirname "$0") 27 | export POP_HOME=`cd $BINDIR/..;pwd` 28 | 29 | if [ ! -f ${POP_HOME}/bin/golangci-lint ]; then 30 | cd ${POP_HOME} 31 | wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.55.2 32 | cd - 33 | fi 34 | ${POP_HOME}/bin/golangci-lint --version 35 | ${POP_HOME}/bin/golangci-lint run -c ${POP_HOME}/.golangci.yml $@ 36 | -------------------------------------------------------------------------------- /scripts/setup_git_hook.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright 2024 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | # Install husky locally 18 | npm install husky -D 19 | # Enable git hooks 20 | npm set-script prepare "husky install" 21 | npm run prepare 22 | 23 | # # Install commitlint locally 24 | # npm install --save-dev @commitlint/{config-conventional,cli} 25 | # echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js 26 | # # Add commitlint for commit-msg hook. 27 | # # This hook will check commit message,if you want to bypass the check, use --no-verify options 28 | # # eg: git commit -m "hell" --no-verify 29 | # npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"' 30 | 31 | 32 | # Add pre-commit hook to check license 33 | npx husky add .husky/pre-commit 'echo "Check License"' 34 | npx husky add .husky/pre-commit 'go test license_test.go' 35 | 36 | # Add pre-commit hook to lint code 37 | npx husky add .husky/pre-commit 'echo "Check Lint"' 38 | npx husky add .husky/pre-commit './scripts/lint.sh ./...' 39 | 40 | # Add pre-commit hook to fmt code 41 | npx husky add .husky/pre-commit 'echo "Go fmt"' 42 | npx husky add .husky/pre-commit './scripts/verify_gofmt.sh ./...' 43 | 44 | # Add pre-commit hook to go vet code 45 | npx husky add .husky/pre-commit 'echo "Go vet"' 46 | npx husky add .husky/pre-commit './scripts/verify_govet.sh ./...' -------------------------------------------------------------------------------- /scripts/sync_rules.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2025 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import re 17 | import sys 18 | 19 | def sync_rules(source_file, target_file): 20 | """ 21 | Sync the rules section from source_file to target_file 22 | 23 | Args: 24 | source_file: The path to the source file 25 | target_file: The path to the target file 26 | """ 27 | # Read the source file and extract the rules section 28 | with open(source_file, "r") as f: 29 | source_content = f.read() 30 | 31 | rules_match = re.search(r"^rules:\n(.*?)(?=^[a-zA-Z]|\Z)", source_content, re.MULTILINE | re.DOTALL) 32 | if not rules_match: 33 | print("Error: Could not find rules section in source file") 34 | sys.exit(1) 35 | 36 | rules_content = rules_match.group(1) 37 | 38 | # Read the target file 39 | with open(target_file, "r") as f: 40 | target_content = f.read() 41 | 42 | # Replace the rules section in the target file 43 | new_content = re.sub(r"^rules:.*?(?=^[a-zA-Z]|\Z)", f"rules:\n{rules_content}", target_content, flags=re.MULTILINE | re.DOTALL) 44 | 45 | # Write back to the target file 46 | with open(target_file, "w") as f: 47 | f.write(new_content) 48 | 49 | print("Rules section successfully synced") 50 | 51 | if __name__ == "__main__": 52 | if len(sys.argv) != 3: 53 | print("Usage: python sync_rules.py ") 54 | sys.exit(1) 55 | 56 | source_file = sys.argv[1] 57 | target_file = sys.argv[2] 58 | sync_rules(source_file, target_file) -------------------------------------------------------------------------------- /scripts/verify_gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | # exit immediately when a command fails 18 | set -e 19 | # only exit with zero if all commands of the pipeline exit successfully 20 | set -o pipefail 21 | # error on unset variables 22 | set -u 23 | 24 | goFiles=$(find . -name \*.go -not -path "*/vendor/*" -print) 25 | invalidFiles=$(gofmt -l $goFiles) 26 | 27 | if [ "$invalidFiles" ]; then 28 | echo -e "These files did not pass the 'go fmt' check, please run 'go fmt' on them:" 29 | echo -e $invalidFiles 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /scripts/verify_govet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2024 StreamNative 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | # exit immediately when a command fails 18 | set -e 19 | # only exit with zero if all commands of the pipeline exit successfully 20 | set -o pipefail 21 | # error on unset variables 22 | set -u 23 | 24 | go vet ./... -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # tests 2 | 3 | tests is an individul module beside pulsar resources operator 4 | 5 | `go mod tidy` to download modules for tests 6 | 7 | 8 | ## Requirements 9 | - Pulsar Operator installed 10 | - A pulsar cluster installed without authentication and authorization 11 | 12 | 13 | ## Run tests 14 | 15 | `ginkgo --trace --progress ./operator` 16 | 17 | Optionally, if you have an external pulsar cluster (e.g. deployed on minikube) and you want to test the operator without deploying it in kubernetes: 18 | 19 | 1. Run the code in a terminal 20 | 21 | ```bash 22 | make install 23 | go run . 24 | ``` 25 | 26 | 2. In another terminal run 27 | 28 | ```bash 29 | # your admin service url 30 | export ADMIN_SERVICE_URL=http://localhost:80 31 | # your pulsar namespace 32 | export NAMESPACE=pulsar 33 | # your pulsar broker name 34 | export BROKER_NAME=pulsar-mini 35 | # your pulsar proxy url 36 | export PROXY_URL=http://localhost:80 37 | 38 | ginkgo --trace --progress ./operator 39 | ``` 40 | --------------------------------------------------------------------------------