From 59a14c0b0913f3d3aee08b73b1b09148aa8c07c7 Mon Sep 17 00:00:00 2001 From: Rui Fu Date: Fri, 28 Nov 2025 10:30:36 +0800 Subject: [PATCH 1/2] migrate to helm-unittest/helm-unittest --- .github/workflows/chart-test.yml | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/chart-test.yml b/.github/workflows/chart-test.yml index 7af0dec7..1aa3e083 100644 --- a/.github/workflows/chart-test.yml +++ b/.github/workflows/chart-test.yml @@ -18,10 +18,10 @@ name: Chart Test on: pull_request: branches: - - '*' + - "*" paths: - - 'charts/**' - - '.github/workflows/chart-test.yml' + - "charts/**" + - ".github/workflows/chart-test.yml" env: GOPRIVATE: github.com/streamnative @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - + - name: Check if the CRDs are update to date run: | diff config/crd/bases/resource.streamnative.io_pulsarconnections.yaml charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarconnections.yaml && \ @@ -63,14 +63,14 @@ jobs: - name: Install plugin unittest run: | - helm plugin install https://github.com/quintush/helm-unittest + helm plugin install https://github.com/helm-unittest/helm-unittest # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and # yamllint (https://github.com/adrienverge/yamllint) which require Python - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: "3.10" - name: Set up chart-testing uses: helm/chart-testing-action@v2.6.0 @@ -158,7 +158,7 @@ jobs: run: | echo "Waiting for pods to be ready..." kubectl wait --for=condition=Ready pods --all -n chart-testing --timeout=300s - + echo "Checking pod status..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.phase}' | tr ' ' '\n' | grep -v "Running" | wc -l) -ne 0 ]]; then echo "Some pods are not running:" @@ -166,7 +166,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "Checking for pod restarts..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.containerStatuses[*].restartCount}' | tr ' ' '\n' | grep -v "^0$" | wc -l) -ne 0 ]]; then echo "Some pods have restarted:" @@ -174,7 +174,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "All pods are running properly!" kubectl get pods -n chart-testing @@ -237,7 +237,7 @@ jobs: run: | echo "Waiting for pods to be ready..." kubectl wait --for=condition=Ready pods --all -n chart-testing --timeout=300s - + echo "Checking pod status..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.phase}' | tr ' ' '\n' | grep -v "Running" | wc -l) -ne 0 ]]; then echo "Some pods are not running:" @@ -245,7 +245,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "Checking for pod restarts..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.containerStatuses[*].restartCount}' | tr ' ' '\n' | grep -v "^0$" | wc -l) -ne 0 ]]; then echo "Some pods have restarted:" @@ -253,7 +253,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "All pods are running properly!" kubectl get pods -n chart-testing @@ -261,7 +261,7 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - + install-on-v1-28: runs-on: ubuntu-22.04 needs: lint-test @@ -316,7 +316,7 @@ jobs: run: | echo "Waiting for pods to be ready..." kubectl wait --for=condition=Ready pods --all -n chart-testing --timeout=300s - + echo "Checking pod status..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.phase}' | tr ' ' '\n' | grep -v "Running" | wc -l) -ne 0 ]]; then echo "Some pods are not running:" @@ -324,7 +324,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "Checking for pod restarts..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.containerStatuses[*].restartCount}' | tr ' ' '\n' | grep -v "^0$" | wc -l) -ne 0 ]]; then echo "Some pods have restarted:" @@ -332,7 +332,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "All pods are running properly!" kubectl get pods -n chart-testing @@ -395,7 +395,7 @@ jobs: run: | echo "Waiting for pods to be ready..." kubectl wait --for=condition=Ready pods --all -n chart-testing --timeout=300s - + echo "Checking pod status..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.phase}' | tr ' ' '\n' | grep -v "Running" | wc -l) -ne 0 ]]; then echo "Some pods are not running:" @@ -403,7 +403,7 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "Checking for pod restarts..." if [[ $(kubectl get pods -n chart-testing -o jsonpath='{.items[*].status.containerStatuses[*].restartCount}' | tr ' ' '\n' | grep -v "^0$" | wc -l) -ne 0 ]]; then echo "Some pods have restarted:" @@ -411,11 +411,11 @@ jobs: kubectl describe pods -n chart-testing exit 1 fi - + echo "All pods are running properly!" kubectl get pods -n chart-testing - name: Setup tmate session uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 - if: failure() \ No newline at end of file + if: failure() From 3da8f558b971b4797e6201c880ed35b7456279fd Mon Sep 17 00:00:00 2001 From: Rui Fu Date: Fri, 28 Nov 2025 10:35:51 +0800 Subject: [PATCH 2/2] fix crd --- .../resource.streamnative.io_pulsarconnections.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarconnections.yaml b/charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarconnections.yaml index e9864203..10916619 100644 --- a/charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarconnections.yaml +++ b/charts/pulsar-resources-operator/crds/resource.streamnative.io_pulsarconnections.yaml @@ -143,6 +143,11 @@ spec: For confidential clients, this would be the client secret. For public clients using JWT authentication, this would be the path to the JSON credentials file. properties: + file: + description: |- + File points to a local file path whose contents will be used as the value. + This is useful when running the operator locally without creating Kubernetes secrets. + type: string secretRef: description: SecretKeyRef indicates a secret name and key @@ -187,6 +192,11 @@ spec: This can be either a direct token value or a reference to a secret containing the token. If using a secret, the token should be stored under the specified key in the secret. properties: + file: + description: |- + File points to a local file path whose contents will be used as the value. + This is useful when running the operator locally without creating Kubernetes secrets. + type: string secretRef: description: SecretKeyRef indicates a secret name and key properties: