Skip to content

Commit

Permalink
Rename reserved namespace to gatekeeper_internal_
Browse files Browse the repository at this point in the history
Signed-off-by: Max Smythe <[email protected]>
  • Loading branch information
maxsmythe committed Jan 5, 2024
1 parent 70504d1 commit b8a5935
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion constraint/pkg/client/drivers/k8scel/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
Name = "K8sNativeValidation"
// ReservedPrefix signifies a prefix that no user-defined value (variable, matcher, etc.) is allowed to have.
// This gives us the ability to add new variables in the future without worrying about breaking pre-existing templates.
ReservedPrefix = "g8r_internal_"
ReservedPrefix = "gatekeeper_internal_"
// ParamsName is the VAP variable constraint parameters will be bound to.
ParamsName = "params"
)
Expand Down
4 changes: 2 additions & 2 deletions constraint/pkg/client/drivers/k8scel/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestValidationErrors(t *testing.T) {
FailurePolicy: ptr.To[string]("Fail"),
MatchConditions: []MatchCondition{
{
Name: "g8r_internal_must_match_something",
Name: "gatekeeper_internal_must_match_something",
Expression: "true == true",
},
},
Expand All @@ -83,7 +83,7 @@ func TestValidationErrors(t *testing.T) {
},
Variables: []Variable{
{
Name: "g8r_internal_my_variable",
Name: "gatekeeper_internal_my_variable",
Expression: "true",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const (

func MatchExcludedNamespacesGlobV1Alpha1() admissionregistrationv1alpha1.MatchCondition {
return admissionregistrationv1alpha1.MatchCondition{
Name: "g8r_internal_match_excluded_namespaces",
Name: "gatekeeper_internal_match_excluded_namespaces",
Expression: matchExcludedNamespacesGlob,
}
}
Expand All @@ -89,7 +89,7 @@ func MatchExcludedNamespacesGlobCEL() []cel.ExpressionAccessor {

func MatchNamespacesGlobV1Alpha1() admissionregistrationv1alpha1.MatchCondition {
return admissionregistrationv1alpha1.MatchCondition{
Name: "g8r_internal_match_namespaces",
Name: "gatekeeper_internal_match_namespaces",
Expression: matchNamespacesGlob,
}
}
Expand All @@ -106,7 +106,7 @@ func MatchNamespacesGlobCEL() []cel.ExpressionAccessor {

func MatchNameGlobV1Alpha1() admissionregistrationv1alpha1.MatchCondition {
return admissionregistrationv1alpha1.MatchCondition{
Name: "g8r_internal_match_name",
Name: "gatekeeper_internal_match_name",
Expression: matchNameGlob,
}
}
Expand All @@ -123,7 +123,7 @@ func MatchNameGlobCEL() []cel.ExpressionAccessor {

func MatchKindsV1Alpha1() admissionregistrationv1alpha1.MatchCondition {
return admissionregistrationv1alpha1.MatchCondition{
Name: "g8r_internal_match_kinds",
Name: "gatekeeper_internal_match_kinds",
Expression: matchKinds,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ func TestTemplateToPolicyDefinition(t *testing.T) {
Expression: "true == true",
},
{
Name: "g8r_internal_match_excluded_namespaces",
Name: "gatekeeper_internal_match_excluded_namespaces",
Expression: matchExcludedNamespacesGlob,
},
{
Name: "g8r_internal_match_namespaces",
Name: "gatekeeper_internal_match_namespaces",
Expression: matchNamespacesGlob,
},
{
Name: "g8r_internal_match_name",
Name: "gatekeeper_internal_match_name",
Expression: matchNameGlob,
},
{
Name: "g8r_internal_match_kinds",
Name: "gatekeeper_internal_match_kinds",
Expression: matchKinds,
},
},
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestTemplateToPolicyDefinition(t *testing.T) {
FailurePolicy: ptr.To[string]("Fail"),
MatchConditions: []schema.MatchCondition{
{
Name: "g8r_internal_match_something",
Name: "gatekeeper_internal_match_something",
Expression: "true == true",
},
},
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestTemplateToPolicyDefinition(t *testing.T) {
},
Variables: []schema.Variable{
{
Name: "g8r_internal_my_variable",
Name: "gatekeeper_internal_my_variable",
Expression: "true",
},
},
Expand Down

0 comments on commit b8a5935

Please sign in to comment.