|
| 1 | +package v1alpha1 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | +) |
| 6 | + |
| 7 | +// Mode indicates the operational state of the optional features. |
| 8 | +type Mode string |
| 9 | + |
| 10 | +const ( |
| 11 | + // Enabled indicates the optional configuration is enabled. |
| 12 | + Enabled Mode = "Enabled" |
| 13 | + |
| 14 | + // Disabled indicates the optional configuration is disabled. |
| 15 | + Disabled Mode = "Disabled" |
| 16 | +) |
| 17 | + |
| 18 | +// ConfigMapReference holds the details of a configmap. |
| 19 | +type ConfigMapReference struct { |
| 20 | + // name of the ConfigMap. |
| 21 | + // +kubebuilder:validation:MinLength:=1 |
| 22 | + // +kubebuilder:validation:MaxLength:=253 |
| 23 | + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must consist of lowercase alphanumeric characters, hyphens ('-'), and periods ('.'). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted." |
| 24 | + // +kubebuilder:validation:Required |
| 25 | + // +required |
| 26 | + Name string `json:"name"` |
| 27 | + |
| 28 | + // namespace in which the ConfigMap exists. If empty, ConfigMap will be looked up in IstioCSR created namespace. |
| 29 | + // +kubebuilder:validation:MinLength:=0 |
| 30 | + // +kubebuilder:validation:MaxLength:=63 |
| 31 | + // +kubebuilder:validation:XValidation:rule=`size(self) == 0 || !format.dns1123Label().validate(self).hasValue()`,message="namespace must consist of only lowercase alphanumeric characters and hyphens, and must start with an alphabetic character and end with an alphanumeric character." |
| 32 | + // +kubebuilder:validation:Optional |
| 33 | + // +optional |
| 34 | + Namespace string `json:"namespace,omitempty"` |
| 35 | + |
| 36 | + // key name holding the required data. |
| 37 | + // +kubebuilder:validation:MinLength:=1 |
| 38 | + // +kubebuilder:validation:MaxLength:=253 |
| 39 | + // +kubebuilder:validation:Pattern:=^[-._a-zA-Z0-9]+$ |
| 40 | + // +kubebuilder:validation:Required |
| 41 | + // +required |
| 42 | + Key string `json:"key"` |
| 43 | +} |
| 44 | + |
| 45 | +type ConditionalStatus struct { |
| 46 | + // conditions holds information about the current state of the istio-csr agent deployment. |
| 47 | + // +patchMergeKey=type |
| 48 | + // +patchStrategy=merge |
| 49 | + // +listType=map |
| 50 | + // +listMapKey=type |
| 51 | + Conditions []metav1.Condition `json:"conditions,omitempty"` |
| 52 | +} |
0 commit comments