Skip to content

Commit 3076632

Browse files
authored
feat: block the creation of github.com endpoint (#193)
it's not possible to create a githubendpoint configuration with the name github.com This is because garm ships a default githubendpoint configuration which is immutable. fixes #187 Signed-off-by: Mario Constanti <[email protected]>
1 parent 495a9ec commit 3076632

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

api/v1beta1/githubendpoint_types.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type GitHubEndpointStatus struct {
3131
//+kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message",priority=1
3232
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of GitHubEndpoint"
3333

34+
// +kubebuilder:validation:XValidation:rule="self.metadata.name != 'github.com'",message="github.com is not allowed as name as GARM ships with a default github.com configuration."
3435
// GitHubEndpoint is the Schema for the githubendpoints API
3536
type GitHubEndpoint struct {
3637
metav1.TypeMeta `json:",inline"`

config/crd/bases/garm-operator.mercedes-benz.com_githubendpoints.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ spec:
146146
type: array
147147
type: object
148148
type: object
149+
x-kubernetes-validations:
150+
- message: github.com is not allowed as name as GARM ships with a default
151+
github.com configuration.
152+
rule: self.metadata.name != 'github.com'
149153
served: true
150154
storage: true
151155
subresources:

0 commit comments

Comments
 (0)