Skip to content

Commit 9b41a28

Browse files
akuitybothiddeco
andauthored
chore(backport release-1.3): fix(api): further improve branch regex (#3704)
Co-authored-by: Hidde Beydals <[email protected]>
1 parent 32549bb commit 9b41a28

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

api/v1alpha1/generated.proto

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/warehouse_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ type GitSubscription struct {
125125
//
126126
// +kubebuilder:validation:MinLength=1
127127
// +kubebuilder:validation:MaxLength=255
128-
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9][a-zA-Z0-9._\/-]*[a-zA-Z0-9_-]$`
128+
// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([a-zA-Z0-9._\/-]*[a-zA-Z0-9_-])?$`
129129
Branch string `json:"branch,omitempty" protobuf:"bytes,3,opt,name=branch"`
130130
// StrictSemvers specifies whether only "strict" semver tags should be
131131
// considered. A "strict" semver tag is one containing ALL of major, minor,

charts/kargo/resources/crds/kargo.akuity.io_warehouses.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ spec:
154154
subscription is implicitly to the repository's default branch.
155155
maxLength: 255
156156
minLength: 1
157-
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._\/-]*[a-zA-Z0-9_-]$
157+
pattern: ^[a-zA-Z0-9]([a-zA-Z0-9._\/-]*[a-zA-Z0-9_-])?$
158158
type: string
159159
commitSelectionStrategy:
160160
default: NewestFromBranch

ui/src/gen/schema/warehouses.kargo.akuity.io_v1alpha1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"description": "Branch references a particular branch of the repository. The value in this\nfield only has any effect when the CommitSelectionStrategy is\nNewestFromBranch or left unspecified (which is implicitly the same as\nNewestFromBranch). This field is optional. When left unspecified, (and the\nCommitSelectionStrategy is NewestFromBranch or unspecified), the\nsubscription is implicitly to the repository's default branch.",
8383
"maxLength": 255,
8484
"minLength": 1,
85-
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9._\\/-]*[a-zA-Z0-9_-]$",
85+
"pattern": "^[a-zA-Z0-9]([a-zA-Z0-9._\\/-]*[a-zA-Z0-9_-])?$",
8686
"type": "string"
8787
},
8888
"commitSelectionStrategy": {

ui/src/gen/v1alpha1/generated_pb.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ export type GitSubscription = Message<"github.jpy.wang.akuity.kargo.api.v1alpha1.GitS
11801180
*
11811181
* +kubebuilder:validation:MinLength=1
11821182
* +kubebuilder:validation:MaxLength=255
1183-
* +kubebuilder:validation:Pattern=`^[a-zA-Z0-9][a-zA-Z0-9._\/-]*[a-zA-Z0-9_-]$`
1183+
* +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([a-zA-Z0-9._\/-]*[a-zA-Z0-9_-])?$`
11841184
*
11851185
* @generated from field: optional string branch = 3;
11861186
*/

0 commit comments

Comments
 (0)