Skip to content

Commit

Permalink
apply moduletemplate before all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanxin committed Nov 25, 2024
1 parent 23fb985 commit 801b34a
Showing 1 changed file with 67 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ env:
ModuleDeploymentNameInOlderVersion: template-operator-v1-controller-manager
NewerVersion: 2.4.2-e2e-test
OlderVersion: 1.1.1-e2e-test
VersionForStatefulSetInWarning: 1.0.0-warning-statefulset
VersionForDeploymentInWarning: 1.0.0-warning-deployment
VersionForMisconfiguredDeploymentImage: 1.0.0-misconfigured-deployment
VersionForMisconfiguredStatefulSetImage: 1.0.0-misconfigured-statefulset
VersionForNoDefaultCR: 1.0.0-no-default-cr
MisconfiguredModuleName: template-operator-misconfigured
ModuleName: template-operator
runs:
Expand Down Expand Up @@ -63,7 +68,58 @@ runs:
kustomize edit add patch --path warning_patch.yaml --kind StatefulSet
popd
make build-statefulset-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} 1.0.1
./generate_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForStatefulSetInWarning }}
- name: Create and apply Template Operator ModuleTemplate with Deployment, with final state and final deletion state as `Warning`
working-directory: template-operator
shell: bash
run: |
pushd config/overlays/deployment
echo \
"- op: replace
path: /spec/template/spec/containers/0/args/1
value: --final-state=Warning
- op: replace
path: /spec/template/spec/containers/0/args/2
value: --final-deletion-state=Warning" >> warning_patch.yaml
cat warning_patch.yaml
kustomize edit add patch --path warning_patch.yaml --kind Deployment
popd
make build-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForDeploymentInWarning }}
- name: Create and apply Template Operator Module with Deployment, with non-working image
working-directory: template-operator
shell: bash
run: |
pushd config/overlays/deployment
echo \
"- op: replace
path: /spec/template/spec/containers/0/image
value: non-working-path" >> image_patch.yaml
cat image_patch.yaml
kustomize edit add patch --path image_patch.yaml --kind Deployment
popd
make build-manifests
./generate_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredDeploymentImage }}
- name: Create and apply Template Operator Module with StatefulSet, with non-working image
working-directory: template-operator
shell: bash
run: |
pushd config/overlays/statefulset
echo \
"- op: replace
path: /spec/template/spec/containers/0/image
value: non-working-path" >> image_patch.yaml
cat image_patch.yaml
kustomize edit add patch --path image_patch.yaml --kind StatefulSet
popd
make build-statefulset-manifests
./generate_moduletemplate.sh ${{ env.MisconfiguredModuleName }} ${{ env.VersionForMisconfiguredStatefulSetImage }}
- name: Create and apply Template Operator ModuleTemplate without default CR
working-directory: template-operator
shell: bash
run: |
make build-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} ${{ env.VersionForNoDefaultCR }} false
- name: Create and apply ModuleReleaseMeta from the latest release
working-directory: template-operator
if: ${{ matrix.e2e-test == 'kyma-metrics' ||
Expand Down Expand Up @@ -110,90 +166,42 @@ runs:
shell: bash
run: |
kubectl apply -f tests/e2e/moduletemplate/mandatory_moduletemplate_template_operator_v1.yaml
- name: Apply Template Operator Module V2 and ModuleReleaseMeta, fast channel
- name: Create and apply ModuleReleaseMeta Template Operator with newer version in fast channel and older version in regular channel
working-directory: template-operator
if: ${{ matrix.e2e-test == 'non-blocking-deletion' }}
shell: bash
run: |
./generate_modulereleasemeta.sh template-operator fast:${{ env.NewerVersion }} regular:${{ inputs.module_version }}
- name: Create Template Operator Module with Deployment, with final state and final deletion state as `Warning` and apply
- name: Create and apply ModuleReleaseMeta with version when deployment is in warning state
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-status-decoupling-with-deployment'}}
shell: bash
run: |
pushd config/overlays/deployment
echo \
"- op: replace
path: /spec/template/spec/containers/0/args/1
value: --final-state=Warning
- op: replace
path: /spec/template/spec/containers/0/args/2
value: --final-deletion-state=Warning" >> warning_patch.yaml
cat warning_patch.yaml
kustomize edit add patch --path warning_patch.yaml --kind Deployment
popd
make build-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} 1.0.1
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:1.0.1
- name: Create Template Operator Module with StatefulSet, with final state and final deletion state as `Warning` and apply
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForDeploymentInWarning }}
- name: Create and apply ModuleReleaseMeta with version when statefulset is in warning state
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-status-decoupling-with-statefulset'}}
shell: bash
run: |
pushd config/overlays/statefulset
echo \
"- op: replace
path: /spec/template/spec/containers/0/args/1
value: --final-state=Warning
- op: replace
path: /spec/template/spec/containers/0/args/2
value: --final-deletion-state=Warning" >> warning_patch.yaml
cat warning_patch.yaml
kustomize edit add patch --path warning_patch.yaml --kind StatefulSet
popd
make build-statefulset-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} 1.0.1
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:1.0.1
- name: Create Template Operator Module with Deployment, with non-working image and apply
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForStatefulSetInWarning }}
- name: Create and apply ModuleReleaseMeta with version when deployment is misconfigured
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-status-decoupling-with-deployment'}}
shell: bash
run: |
pushd config/overlays/deployment
echo \
"- op: replace
path: /spec/template/spec/containers/0/image
value: non-working-path" >> image_patch.yaml
cat image_patch.yaml
kustomize edit add patch --path image_patch.yaml --kind Deployment
popd
make build-manifests
./generate_moduletemplate.sh ${{ env.MisconfiguredModuleName }} 1.1.1
./generate_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:1.1.1
- name: Create Template Operator Module with StatefulSet, with non-working image and apply
./generate_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:${{ env.VersionForMisconfiguredDeploymentImage }}
- name: Create and apply ModuleReleaseMeta with version when statefulset is misconfigured
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-status-decoupling-with-statefulset'}}
shell: bash
run: |
pushd config/overlays/statefulset
echo \
"- op: replace
path: /spec/template/spec/containers/0/image
value: non-working-path" >> image_patch.yaml
cat image_patch.yaml
kustomize edit add patch --path image_patch.yaml --kind StatefulSet
popd
make build-statefulset-manifests
./generate_moduletemplate.sh ${{ env.MisconfiguredModuleName }} 1.1.1
./generate_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:1.1.1
./generate_modulereleasemeta.sh ${{ env.MisconfiguredModuleName }} regular:${{ env.VersionForMisconfiguredStatefulSetImage }}
- name: Create Template Operator Module without default CR and apply ModuleReleaseMeta
working-directory: template-operator
if: ${{ matrix.e2e-test == 'module-without-default-cr' }}
shell: bash
run: |
make build-manifests
./generate_moduletemplate.sh ${{ env.ModuleName }} 1.0.0 false
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:1.0.0
./generate_modulereleasemeta.sh ${{ env.ModuleName }} regular:${{ env.VersionForNoDefaultCR }}
- name: Apply ModuleReleaseMeta with ModuleTemplate with name <modulename>-<channel>
working-directory: template-operator
if: ${{ matrix.e2e-test == 'modulereleasemeta-with-obsolete-moduletemplate' }}
Expand Down

0 comments on commit 801b34a

Please sign in to comment.