Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changecrd #1

Merged
merged 53 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6f89315
changecrd
sadath-12 Dec 27, 2023
3609b54
change crd
sadath-12 Dec 27, 2023
f9adb4b
change
sadath-12 Dec 27, 2023
5f0add6
change
sadath-12 Dec 27, 2023
ac664ce
change
sadath-12 Dec 27, 2023
6bca7ad
c
sadath-12 Dec 27, 2023
a24f055
a
sadath-12 Dec 27, 2023
021d17f
s
sadath-12 Dec 27, 2023
0324936
ax
sadath-12 Dec 28, 2023
447b926
d
sadath-12 Dec 28, 2023
3efb442
s
sadath-12 Dec 28, 2023
b4197f8
a
sadath-12 Dec 28, 2023
7c05c7b
a
sadath-12 Dec 28, 2023
f3eb159
s
sadath-12 Dec 28, 2023
1d600be
s
sadath-12 Dec 28, 2023
1435785
a
sadath-12 Dec 28, 2023
60ce78c
s
sadath-12 Dec 28, 2023
6590ec3
s
sadath-12 Dec 28, 2023
db97b2e
a
sadath-12 Dec 28, 2023
22b71de
a
sadath-12 Dec 28, 2023
ff43f6a
a
sadath-12 Dec 28, 2023
82ca239
a
sadath-12 Dec 28, 2023
4be1838
s
sadath-12 Dec 28, 2023
82b9cd6
Merge branch 'test-dev' into test-dev-2
sadath-12 Dec 28, 2023
da67332
c
sadath-12 Jan 4, 2024
349d6d6
change
sadath-12 Jan 4, 2024
2d6a94c
change
sadath-12 Jan 4, 2024
0f2f00e
ch
sadath-12 Jan 4, 2024
74a5622
ch
sadath-12 Jan 4, 2024
6eef5db
a
sadath-12 Jan 4, 2024
06d808e
hey
sadath-12 Jan 4, 2024
4d56a35
ch
sadath-12 Jan 4, 2024
2e12eb1
ch
sadath-12 Jan 4, 2024
1ac650a
ch
sadath-12 Jan 4, 2024
916a37e
ch
sadath-12 Jan 4, 2024
6a53af2
ch
sadath-12 Jan 4, 2024
77bb764
ch
sadath-12 Jan 4, 2024
cd47137
y
sadath-12 Jan 4, 2024
57c7bb2
y
sadath-12 Jan 4, 2024
96a94b6
new
sadath-12 Jan 8, 2024
3f0d7c6
ch
sadath-12 Jan 8, 2024
3508c03
s
sadath-12 Jan 8, 2024
5acbb81
s
sadath-12 Jan 8, 2024
898eb5b
Merge branch 'test-dev' into test-dev-2
sadath-12 Jan 8, 2024
162244f
d
sadath-12 Jan 8, 2024
00e60c5
s
sadath-12 Jan 8, 2024
e5d02dd
Merge branch 'test-dev' into test-dev-2
sadath-12 Jan 8, 2024
a3fad57
c
sadath-12 Jan 8, 2024
4fb45d6
s
sadath-12 Jan 8, 2024
d685ffe
changed action
sadath-12 Jan 9, 2024
43b8866
d
sadath-12 Jan 9, 2024
dd2302a
undo
sadath-12 Jan 9, 2024
aed1c1e
undo
sadath-12 Jan 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/validate-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Check CRD Version Update
name: Check CRD version update

on:
pull_request:
paths:
- 'pkg/k8s/apis/cilium.io/client/crds/v1alpha1/*.yaml'
- 'pkg/k8s/apis/cilium.io/v1alpha1/register.go'

jobs:
check-version:
runs-on: ubuntu-22.04
steps:
- name: Install git
run: |
apt-get update
apt-get install -y git
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Get all changed files
id: changed-files
uses: jitterbit/get-changed-files@v1

- name: Check for CRD changes and version update
run: |

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=1
fi

if echo "$changed_file" | grep -q 'pkg/k8s/apis/cilium.io/v1alpha1/register.go'; 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}')
new_version=$(grep 'CustomResourceDefinitionSchemaVersion' $changed_file | awk -F'"' '{print $2}')
echo "old_version=$old_version"
echo "new_version=$new_version"
if [ "$old_version" != "$new_version" ]; then
version_changed=1
fi
fi
done

# Check for CRD changes
crd_changes=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} -- pkg/k8s/apis/cilium.io/client/crds/v1alpha1/*.yaml)
if [ -n "$crd_changes" ]; then
crd_changed=1
fi

# Check for version variable changes

old_version=$(git show ${{ github.event.pull_request.base.sha }}:pkg/k8s/apis/cilium.io/v1alpha1/register.go | grep 'CustomResourceDefinitionSchemaVersion' | awk -F'"' '{print $2}')
new_version=$(git show HEAD:pkg/k8s/apis/cilium.io/v1alpha1/register.go | grep 'CustomResourceDefinitionSchemaVersion' | awk -F'"' '{print $2}')

echo "old_version=$old_version"
echo "new_version=$new_version"

if [ "$old_version" != "$new_version" ]; then
version_changed=1
fi

if [ "$crd_changed" -eq 1 ] && [ "$version_changed" -eq 0 ]; then
echo "CRD changed but version not updated"
Expand Down
1 change: 0 additions & 1 deletion pkg/eventcache/eventcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func (ec *Cache) handleEvents() {
// If the process wasn't found before the Add(), likely because
// the execve event was processed after this event, lets look it up
// now because it should be available. Otherwise we have a valid
// process and lets copy it across.
if event.internal == nil {
event.internal, err = event.msg.RetryInternal(event.event, event.startTime)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/k8s/apis/cilium.io/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const (
// TPCRDName is the full name of the TracingPolicy CRD.
TPCRDName = TPKindDefinition + "/" + CRDVersion

CustomResourceDefinitionSchemaVersion = "0.10.1"
CustomResourceDefinitionSchemaVersion = "0.10.7"


// TPNamespacedCRDName is the full name of the TracingPolicy CRD.
TPNamespacedCRDName = TPNamespacedKindDefinition + "/" + CRDVersion
Expand Down