Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
Signed-off-by: sadath-12 <[email protected]>
  • Loading branch information
sadath-12 committed Dec 28, 2023
1 parent cdc25d7 commit 1af1df6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/validate-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ 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}')
old_version=$(git show ${{ github.event.pull_request.base.sha }}:pkg/k8s/apis/cilium.io/v1alpha1/register.go 2>/dev/null | grep 'CustomResourceDefinitionSchemaVersion' | awk -F'"' '{print $2}')
new_version=$(grep 'CustomResourceDefinitionSchemaVersion' pkg/k8s/apis/cilium.io/v1alpha1/register.go | awk -F'"' '{print $2}')
new=$(grep 'CustomResourceDefinitionSchemaVersion' pkg/k8s/apis/cilium.io/v1alpha1/register.go )
echo "old_version=$old_version"
echo "new_version=$new_version"
echo "new=$new"
if [ "$old_version" == "$new_version" ]; then
echo "Error: CRD version not updated! Please update the CustomResourceDefinitionSchemaVersion in register.go"
exit 1
Expand Down

0 comments on commit 1af1df6

Please sign in to comment.