fix unit test for new subPathExpr feature (#2638)

* fix unit test for new subPathExpr feature
* add subPathExpr flag to CRD and re-sort
This commit is contained in:
Felix Kunde
2024-05-24 15:07:17 +02:00
committed by GitHub
parent 7bcb73a402
commit b550f8ae39
9 changed files with 78 additions and 52 deletions
+9 -6
View File
@@ -146,12 +146,18 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "object",
Required: []string{"name", "mountPath", "volumeSource"},
Properties: map[string]apiextv1.JSONSchemaProps{
"isSubPathExpr": {
Type: "boolean",
},
"name": {
Type: "string",
},
"mountPath": {
Type: "string",
},
"subPath": {
Type: "string",
},
"targetContainers": {
Type: "array",
Nullable: true,
@@ -165,12 +171,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "object",
XPreserveUnknownFields: util.True(),
},
"subPath": {
Type: "string",
},
"isSubPathExpr": {
Type: "boolean",
},
},
},
},
@@ -1033,6 +1033,9 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
Type: "object",
Required: []string{"size"},
Properties: map[string]apiextv1.JSONSchemaProps{
"isSubPathExpr": {
Type: "boolean",
},
"iops": {
Type: "integer",
},
+9 -8
View File
@@ -129,13 +129,14 @@ type MaintenanceWindow struct {
// Volume describes a single volume in the manifest.
type Volume struct {
Selector *metav1.LabelSelector `json:"selector,omitempty"`
Size string `json:"size"`
StorageClass string `json:"storageClass,omitempty"`
SubPath string `json:"subPath,omitempty"`
Iops *int64 `json:"iops,omitempty"`
Throughput *int64 `json:"throughput,omitempty"`
VolumeType string `json:"type,omitempty"`
Selector *metav1.LabelSelector `json:"selector,omitempty"`
Size string `json:"size"`
StorageClass string `json:"storageClass,omitempty"`
SubPath string `json:"subPath,omitempty"`
IsSubPathExpr *bool `json:"isSubPathExpr,omitemtpy"`
Iops *int64 `json:"iops,omitempty"`
Throughput *int64 `json:"throughput,omitempty"`
VolumeType string `json:"type,omitempty"`
}
// AdditionalVolume specs additional optional volumes for statefulset
@@ -143,7 +144,7 @@ type AdditionalVolume struct {
Name string `json:"name"`
MountPath string `json:"mountPath"`
SubPath string `json:"subPath,omitempty"`
IsSubPathExpr bool `json:"isSubPathExpr,omitemtpy"`
IsSubPathExpr *bool `json:"isSubPathExpr,omitemtpy"`
TargetContainers []string `json:"targetContainers"`
VolumeSource v1.VolumeSource `json:"volumeSource"`
}
@@ -53,6 +53,11 @@ func (in *AWSGCPConfiguration) DeepCopy() *AWSGCPConfiguration {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdditionalVolume) DeepCopyInto(out *AdditionalVolume) {
*out = *in
if in.IsSubPathExpr != nil {
in, out := &in.IsSubPathExpr, &out.IsSubPathExpr
*out = new(bool)
**out = **in
}
if in.TargetContainers != nil {
in, out := &in.TargetContainers, &out.TargetContainers
*out = make([]string, len(*in))
@@ -1447,6 +1452,11 @@ func (in *Volume) DeepCopyInto(out *Volume) {
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.IsSubPathExpr != nil {
in, out := &in.IsSubPathExpr, &out.IsSubPathExpr
*out = new(bool)
**out = **in
}
if in.Iops != nil {
in, out := &in.Iops, &out.Iops
*out = new(int64)