You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -102,8 +103,11 @@ type OnlineStorePersistence struct {
102
103
}
103
104
104
105
// OnlineStoreFilePersistence configures the file-based persistence for the offline store service
106
+
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? self.path.startsWith('/') : true",message="Ephemeral stores must have absolute paths."
107
+
// +kubebuilder:validation:XValidation:rule="(has(self.pvc) && has(self.path)) ? !self.path.startsWith('/') : true",message="PVC path must be a file name only, with no slashes."
105
108
typeOnlineStoreFilePersistencestruct {
106
-
Pathstring`json:"path,omitempty"`
109
+
Pathstring`json:"path,omitempty"`
110
+
PvcConfig*PvcConfig`json:"pvc,omitempty"`
107
111
}
108
112
109
113
// LocalRegistryConfig configures the deployed registry service
@@ -118,8 +122,40 @@ type RegistryPersistence struct {
118
122
}
119
123
120
124
// RegistryFilePersistence configures the file-based persistence for the registry service
125
+
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? self.path.startsWith('/') : true",message="Ephemeral stores must have absolute paths."
126
+
// +kubebuilder:validation:XValidation:rule="(has(self.pvc) && has(self.path)) ? !self.path.startsWith('/') : true",message="PVC path must be a file name only, with no slashes."
121
127
typeRegistryFilePersistencestruct {
122
-
Pathstring`json:"path,omitempty"`
128
+
Pathstring`json:"path,omitempty"`
129
+
PvcConfig*PvcConfig`json:"pvc,omitempty"`
130
+
}
131
+
132
+
// PvcConfig defines the settings for a persistent file store based on PVCs.
133
+
// We can refer to an existing PVC using the `Ref` field, or create a new one using the `Create` field.
134
+
// +kubebuilder:validation:XValidation:rule="[has(self.ref), has(self.create)].exists_one(c, c)",message="One selection is required between ref and create."
135
+
// +kubebuilder:validation:XValidation:rule="self.mountPath.matches('^/[^:]*$')",message="Mount path must start with '/' and must not contain ':'"
0 commit comments