Skip to content

Commit

Permalink
Merge branch 'test-dev' into test-dev-2
Browse files Browse the repository at this point in the history
Signed-off-by: syedsadath-17 <[email protected]>
  • Loading branch information
sadath-12 authored Jan 8, 2024
2 parents 00e60c5 + 58acf63 commit e5d02dd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/validate-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Check for CRD changes and version update
run: |
if echo "${{ env.changed_files }}" | grep -q 'pkg/k8s/apis/cilium.io/client/crds/v1alpha1/'; then
old_version=$(git show ${{ github.event.pull_request.base.sha }}:pkg/k8s/apis/cilium.io/v1alpha1/register.go | grep 'CustomResourceDefinitionSchemaVersion' | awk -F'"' '{print $2}')
echo "old_version=$old_version"
Expand All @@ -29,6 +30,7 @@ jobs:
echo "Error: Unable to retrieve old version from the base branch"
exit 1
fi
if echo "$changed_file" | grep -q 'pkg/k8s/apis/cilium.io/v1alpha1/register.go'; then
Expand All @@ -37,20 +39,20 @@ 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
echo crd_changed=$crd_changed
echo version_changed=$version_changed
echo "crd_changed=$crd_changed"
echo "version_changed=$version_changed"

0 comments on commit e5d02dd

Please sign in to comment.