Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
Signed-off-by: sadath-12 <[email protected]>
  • Loading branch information
sadath-12 committed Jan 8, 2024
1 parent 62141e1 commit 58acf63
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/validate-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:

- name: Check for CRD changes and version update
run: |
crd_changed=false
version_changed=false
crd_changed=0
version_changed=0
for changed_file in ${{ steps.changed-files.outputs.all }}; do
if echo "$changed_file" | grep -q 'pkg/k8s/apis/cilium.io/client/crds/v1alpha1/'; then
crd_changed=true
crd_changed=1
fi
if echo "$changed_file" | grep -q 'pkg/k8s/apis/cilium.io/v1alpha1/register.go'; then
Expand All @@ -32,17 +33,17 @@ jobs:
echo "old_version=$old_version"
echo "new_version=$new_version"
if [ "$old_version" != "$new_version" ]; then
version_changed=true
version_changed=1
fi
fi
done
if [ "$crd_changed" = true ] && [ "$version_changed" = false ]; then
if [ "$crd_changed" -eq 1 ] && [ "$version_changed" -eq 0 ]; then
echo "CRD changed but version not updated"
exit 1
fi
if [ "$crd_changed" = false ] && [ "$version_changed" = true ]; then
if [ "$crd_changed" -eq 0 ] && [ "$version_changed" -eq 1 ]; then
echo "Version updated but CRD not changed"
exit 1
fi
Expand Down

0 comments on commit 58acf63

Please sign in to comment.