Skip to content

Commit

Permalink
dev test
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 27, 2023
1 parent a250225 commit 43cf381
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/validate-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check CRD Version Update
on:
pull_request:
paths:
- 'pkg/k8s/apis/cilium.io/client/crds/v1alpha1/*.yaml'
jobs:
check-version:
runs-on: ubuntu-22.04
steps:
- name: Check for CRD changes and version update
run: |
if git diff --name-only HEAD^ | grep -q 'pkg/k8s/apis/cilium.io/client/crds/v1alpha1/'; then
old_version=$(grep 'CustomResourceDefinitionSchemaVersion' pkg/k8s/apis/cilium.io/v1alpha1/register.go | awk -F'"' '{print $2}')
new_version=$(grep 'CustomResourceDefinitionSchemaVersion' pkg/k8s/apis/cilium.io/v1alpha1/register.go | awk -F'"' '{print $2}')
if [ "$old_version" == "$new_version" ]; then
echo "Error: CRD version not updated! Please update the CustomResourceDefinitionSchemaVersion in register.go"
exit 1
fi
else
echo "No changes in the CRD files"
fi
3 changes: 2 additions & 1 deletion pkg/policyfilter/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ type policy struct {

// polMap is the (inner) policy map for this policy
polMap polMap
}
}

func (pol *policy) podMatches(podNs string, podLabels labels.Labels) bool {
if pol.namespace != "" && podNs != pol.namespace {
Expand Down Expand Up @@ -386,6 +386,7 @@ func (m *state) AddPolicy(polID PolicyID, namespace string, podLabelSelector *sl
}

podSelector, err := labels.SelectorFromLabelSelector(podLabelSelector)
// https://github.com/cilium/tetragon/issues/1854 you extract the namespace from here and add into policy
if err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pick which is the main folders
where is the kubernetes operator

0 comments on commit 43cf381

Please sign in to comment.