Skip to content

Commit

Permalink
Fix other references to same/notSame
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Seetharaman <[email protected]>
  • Loading branch information
tssurya committed Mar 8, 2024
1 parent c673f7c commit 6493a47
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
4 changes: 0 additions & 4 deletions conformance/utils/suite/conformance_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ var (
),
ExtendedFeatures: sets.New(
SupportAdminNetworkPolicyNamedPorts,
SupportAdminNetworkPolicySameLabels,
SupportAdminNetworkPolicyNotSameLabels,
),
}

Expand All @@ -74,8 +72,6 @@ var (
),
ExtendedFeatures: sets.New(
SupportBaselineAdminNetworkPolicyNamedPorts,
SupportBaselineAdminNetworkPolicySameLabels,
SupportBaselineAdminNetworkPolicyNotSameLabels,
),
}
)
Expand Down
12 changes: 2 additions & 10 deletions conformance/utils/suite/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
)

// CoreFeatures are the features that are required to be conformant with
// the Core API features (e.g. all fields in the API except for NamedPorts, SameLabels, NotSameLabels).
// the Core API features (e.g. all fields in the API except for NamedPorts).
var CoreFeatures = sets.New(
SupportAdminNetworkPolicy,
SupportBaselineAdminNetworkPolicy,
Expand All @@ -49,25 +49,17 @@ var CoreFeatures = sets.New(
// -----------------------------------------------------------------------------

const (
// This option indicates AdminNetworkPolicy's NamedPorts, SameLabels and NotSameLabels
// This option indicates AdminNetworkPolicy's NamedPorts
// fall under the extended test conformance.
SupportAdminNetworkPolicyNamedPorts SupportedFeature = "AdminNetworkPolicyNamedPorts"
SupportAdminNetworkPolicySameLabels SupportedFeature = "AdminNetworkPolicySameLabels"
SupportAdminNetworkPolicyNotSameLabels SupportedFeature = "AdminNetworkPolicyNotSameLabels"
SupportBaselineAdminNetworkPolicyNamedPorts SupportedFeature = "BaselineAdminNetworkPolicyNamedPorts"
SupportBaselineAdminNetworkPolicySameLabels SupportedFeature = "BaselineAdminNetworkPolicySameLabels"
SupportBaselineAdminNetworkPolicyNotSameLabels SupportedFeature = "BaselineAdminNetworkPolicyNotSameLabels"
)

// ExtendedFeatures are extra generic features that implementations may
// choose to support as an opt-in.
var ExtendedFeatures = sets.New(
SupportAdminNetworkPolicyNamedPorts,
SupportAdminNetworkPolicySameLabels,
SupportAdminNetworkPolicyNotSameLabels,
SupportBaselineAdminNetworkPolicyNamedPorts,
SupportBaselineAdminNetworkPolicySameLabels,
SupportBaselineAdminNetworkPolicyNotSameLabels,
).Insert(CoreFeatures.UnsortedList()...)

// -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pkg/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func main() {
channelCrd := crdRaw.DeepCopy()
for _, version := range channelCrd.Spec.Versions {
version.Schema.OpenAPIV3Schema.Properties = channelTweaks(channel, version.Schema.OpenAPIV3Schema.Properties)
if _, ok := version.Schema.OpenAPIV3Schema.Properties["notSameLabels"]; ok {
if _, ok := version.Schema.OpenAPIV3Schema.Properties["namedPort"]; ok {
fmt.Println("Changes not persisted")
}
}
Expand Down
4 changes: 2 additions & 2 deletions site-src/user-story-examples/user-story-4-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spec:
- action: Deny
from:
- namespaces:
notSameLabels:
- tenant
# This user story is currently not implementable.
# See https://network-policy-api.sigs.k8s.io/npeps/npep-122/ for more details.
4 changes: 2 additions & 2 deletions site-src/user-story-examples/user-story-4-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
- action: Pass # Pass inter-tenant traffic to any defined NetworkPolicies
from:
- namespaces:
sameLabels:
- tenant
# This user story is currently not implementable.
# See https://network-policy-api.sigs.k8s.io/npeps/npep-122/ for more details.
- action: Deny # Deny everything else other than same tenant traffic
from:
- namespaces:
Expand Down

0 comments on commit 6493a47

Please sign in to comment.