From 5bdd703d91d0098de708781765286c33dfaaefdf Mon Sep 17 00:00:00 2001 From: petar-cvit Date: Sat, 5 Apr 2025 20:33:49 +0200 Subject: [PATCH 1/3] validate CRDs step --- .github/workflows/controller-test.yml | 27 ++++++++++++++++++++++++++- cyclops-ctrl/config/crd/bases/_.yaml | 14 -------------- 2 files changed, 26 insertions(+), 15 deletions(-) delete mode 100644 cyclops-ctrl/config/crd/bases/_.yaml diff --git a/.github/workflows/controller-test.yml b/.github/workflows/controller-test.yml index 57cb13f13..4b1d65e61 100644 --- a/.github/workflows/controller-test.yml +++ b/.github/workflows/controller-test.yml @@ -17,6 +17,31 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Unit tests + working-directory: cyclops-ctrl run: | - cd ${{ github.workspace }}/cyclops-ctrl make unit-test + + validate-crd-updates: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Validate Module + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "modules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_modules.yaml) + - name: Validate TemplateAuthRule + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templateauthrules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templateauthrules.yaml) + - name: Validate TemplateStore + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templatestores.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templatestores.yaml) \ No newline at end of file diff --git a/cyclops-ctrl/config/crd/bases/_.yaml b/cyclops-ctrl/config/crd/bases/_.yaml deleted file mode 100644 index 80a04045b..000000000 --- a/cyclops-ctrl/config/crd/bases/_.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null -spec: - group: "" - names: - kind: "" - plural: "" - scope: "" - versions: null From 5abc21946520ba9c613cdc1163c585fb5f1523a1 Mon Sep 17 00:00:00 2001 From: petar-cvit Date: Sat, 5 Apr 2025 20:36:51 +0200 Subject: [PATCH 2/3] update ts crd --- .../config/crd/bases/cyclops-ui.com_templatestores.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml index dc0a5cac5..e2971343a 100644 --- a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml +++ b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml @@ -27,6 +27,9 @@ spec: - jsonPath: .spec.path name: Path type: string + - jsonPath: .spec.path + name: Testing + type: string - jsonPath: .spec.version name: Version type: string From 6d4d08bf26ac17e9360cbaac6d432db97391ec9a Mon Sep 17 00:00:00 2001 From: petar-cvit Date: Sat, 5 Apr 2025 20:39:28 +0200 Subject: [PATCH 3/3] validate on controller build --- .github/workflows/ci.yml | 26 +++++++++++++++++++ .../bases/cyclops-ui.com_templatestores.yaml | 3 --- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99c0b26c4..028699675 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,31 @@ jobs: cd ${{ github.workspace }}/cyclops-ctrl make unit-test + validate-crd-updates: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Validate Module + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "modules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_modules.yaml) + - name: Validate TemplateAuthRule + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templateauthrules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templateauthrules.yaml) + - name: Validate TemplateStore + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templatestores.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templatestores.yaml) + build-UI: needs: - test-UI @@ -67,6 +92,7 @@ jobs: build-controller: needs: - test-controller + - validate-crd-updates runs-on: ubuntu-latest steps: - name: Set up QEMU diff --git a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml index e2971343a..dc0a5cac5 100644 --- a/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml +++ b/cyclops-ctrl/config/crd/bases/cyclops-ui.com_templatestores.yaml @@ -27,9 +27,6 @@ spec: - jsonPath: .spec.path name: Path type: string - - jsonPath: .spec.path - name: Testing - type: string - jsonPath: .spec.version name: Version type: string