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

check: export label prefixes constants #1978

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions connectivity/check/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ import (
)

const (
// kubernetesSourcedLabelPrefix is the optional prefix used in labels to
// KubernetesSourcedLabelPrefix is the optional prefix used in labels to
// indicate they are sourced from Kubernetes.
// NOTE: For some reason, ':' gets replaced by '.' in keys so we use that instead.
kubernetesSourcedLabelPrefix = "k8s."
KubernetesSourcedLabelPrefix = "k8s."

// anySourceLabelPrefix is the optional prefix used in labels to
// AnySourceLabelPrefix is the optional prefix used in labels to
// indicate they could be from anywhere.
// NOTE: For some reason, ':' gets replaced by '.' in keys so we use that instead.
anySourceLabelPrefix = "any."
AnySourceLabelPrefix = "any."
)

var (
Expand Down Expand Up @@ -351,8 +351,8 @@ func (t *Test) WithCiliumPolicy(policy string) *Test {
if pl[i].Spec != nil {
for _, k := range []string{
k8sConst.PodNamespaceLabel,
kubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
anySourceLabelPrefix + k8sConst.PodNamespaceLabel,
KubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
AnySourceLabelPrefix + k8sConst.PodNamespaceLabel,
} {
for _, e := range pl[i].Spec.Egress {
for _, es := range e.ToEndpoints {
Expand Down Expand Up @@ -414,8 +414,8 @@ func (t *Test) WithK8SPolicy(policy string) *Test {
if pl[i].Spec.Size() != 0 {
for _, k := range []string{
k8sConst.PodNamespaceLabel,
kubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
anySourceLabelPrefix + k8sConst.PodNamespaceLabel,
KubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
AnySourceLabelPrefix + k8sConst.PodNamespaceLabel,
} {
for _, e := range pl[i].Spec.Egress {
for _, es := range e.To {
Expand Down Expand Up @@ -486,8 +486,8 @@ func (t *Test) WithCiliumEgressGatewayPolicy(policy string, params CiliumEgressG
// Change the default test namespace as required.
for _, k := range []string{
k8sConst.PodNamespaceLabel,
kubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
anySourceLabelPrefix + k8sConst.PodNamespaceLabel,
KubernetesSourcedLabelPrefix + k8sConst.PodNamespaceLabel,
AnySourceLabelPrefix + k8sConst.PodNamespaceLabel,
} {
for _, e := range pl[i].Spec.Selectors {
ps := e.PodSelector
Expand Down