Skip to content

Commit ae89949

Browse files
committed
Update conformance test and profiles to only use CNP.
It is not possible anymore to support ANP or BANP only, there is only one conformance profile now - CNP Signed-off-by: Nadia Pinaeva <[email protected]>
1 parent e3ff32d commit ae89949

File tree

51 files changed

+622
-611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+622
-611
lines changed

.github/workflows/conformance.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ jobs:
7676
- name: Install kube-network-policies
7777
run: |
7878
# install CRDs
79-
/usr/local/bin/kubectl apply -f ./config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml
80-
/usr/local/bin/kubectl apply -f ./config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml
79+
/usr/local/bin/kubectl apply -f ./config/crd/experimental/policy.networking.k8s.io_clusternetworkpolicies.yaml
8180
# install kube-network-policies
8281
/usr/local/bin/kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/kube-network-policies/v0.6.1/install-anp.yaml
8382
@@ -93,7 +92,7 @@ jobs:
9392
- name: Run tests
9493
run: |
9594
go mod download
96-
go test -v ./conformance -run TestConformanceProfiles -args --conformance-profiles=AdminNetworkPolicy,BaselineAdminNetworkPolicy --organization=kubernetes --project=kube-network-policies --url=https://github.com/kubernetes-sigs/kube-network-policies --version=0.6.1 [email protected] --additional-info=https://github.com/kubernetes-sigs/kube-network-policies
95+
go test -v ./conformance -run TestConformanceProfiles -args --conformance-profiles=ClusterNetworkPolicy --organization=kubernetes --project=kube-network-policies --url=https://github.com/kubernetes-sigs/kube-network-policies --version=0.6.1 [email protected] --additional-info=https://github.com/kubernetes-sigs/kube-network-policies
9796
9897
- name: Upload Junit Reports
9998
if: always()

config/crd/experimental/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- policy.networking.k8s.io_adminnetworkpolicies.yaml
6-
- policy.networking.k8s.io_baselineadminnetworkpolicies.yaml
5+
- policy.networking.k8s.io_clusternetworkpolicies.yaml
76
#+kubebuilder:scaffold:crdkustomizeresource
87

98
# the following config is for teaching kustomize how to do kustomization for CRDs.

config/crd/standard/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- policy.networking.k8s.io_adminnetworkpolicies.yaml
6-
- policy.networking.k8s.io_baselineadminnetworkpolicies.yaml
5+
- policy.networking.k8s.io_clusternetworkpolicies.yaml
76
#+kubebuilder:scaffold:crdkustomizeresource
87

98
# the following config is for teaching kustomize how to do kustomization for CRDs.

conformance/apis/v1alpha1/profilereport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package v1alpha1
2020
// named conformance profile.
2121
type ProfileReport struct {
2222
// Name indicates the name of the conformance profile
23-
// (e.g. "AdminNetworkPolicy", "BaselineAdminNetworkPolicy")
23+
// (e.g. "ClusterNetworkPolicy", "AdminNetworkPolicy", "BaselineAdminNetworkPolicy")
2424
Name string `json:"name"`
2525

2626
// Standard indicates the standard support level which includes the set of tests

conformance/base/admin_network_policy/experimental-egress-selector-rules.yaml renamed to conformance/base/admin_tier/experimental-egress-selector-rules.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: node-and-cidr-as-peers-example
55
spec:
6+
tier: Admin
67
priority: 75
78
subject:
89
pods:

conformance/base/admin_network_policy/standard-egress-inline-cidr-rules.yaml renamed to conformance/base/admin_tier/standard-egress-inline-cidr-rules.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: inline-cidr-as-peers-example
55
spec:
6+
tier: Admin
67
priority: 85
78
subject:
89
pods:

conformance/base/admin_network_policy/standard-egress-sctp-rules.yaml renamed to conformance/base/admin_tier/standard-egress-sctp-rules.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: egress-sctp
55
spec:
6+
tier: Admin
67
priority: 8
78
subject:
89
namespaces:

conformance/base/admin_network_policy/standard-egress-tcp-rules.yaml renamed to conformance/base/admin_tier/standard-egress-tcp-rules.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: egress-tcp
55
spec:
6+
tier: Admin
67
priority: 6
78
subject:
89
namespaces:

conformance/base/admin_network_policy/standard-egress-udp-rules.yaml renamed to conformance/base/admin_tier/standard-egress-udp-rules.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: egress-udp
55
spec:
6+
tier: Admin
67
priority: 7
78
subject:
89
namespaces:

conformance/base/admin_network_policy/standard-gress-rules-combined.yaml renamed to conformance/base/admin_tier/standard-gress-rules-combined.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
apiVersion: policy.networking.k8s.io/v1alpha1
2-
kind: AdminNetworkPolicy
1+
apiVersion: policy.networking.k8s.io/v1alpha2
2+
kind: ClusterNetworkPolicy
33
metadata:
44
name: gress-rules
55
spec:
6+
tier: Admin
67
priority: 15
78
subject:
89
namespaces:

0 commit comments

Comments
 (0)