Skip to content

Commit a613700

Browse files
authored
Merge pull request #8025 from killianmuldoon/pr-exvars-block-inline-patch-name
🌱 Make 'inline' a reserved name for patches
2 parents d4eee3f + f9d7c9f commit a613700

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/webhooks/patch_validation.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ func validatePatchName(patch clusterv1.ClusterClassPatch, names sets.Set[string]
6969
),
7070
)
7171
}
72+
if patch.Name == clusterv1.VariableDefinitionFromInline {
73+
allErrs = append(allErrs,
74+
field.Required(
75+
path.Child("name"),
76+
fmt.Sprintf("%q can not be used as the name of a patch", clusterv1.VariableDefinitionFromInline),
77+
),
78+
)
79+
}
7280

7381
if names.Has(patch.Name) {
7482
allErrs = append(allErrs,

0 commit comments

Comments
 (0)