Skip to content

Commit 82af458

Browse files
authored
feat(GcpRedisInstance,RedisInstance) update types (#374)
1 parent d853f33 commit 82af458

10 files changed

+568
-664
lines changed

api/cloud-control/v1beta1/redisinstance_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func (redisConfigs *RedisInstanceGcpConfigs) ToMap() map[string]string {
154154
type RedisInstanceGcp struct {
155155
// +kubebuilder:default=BASIC
156156
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="Tier is immutable."
157+
// +kubebuilder:validation:Enum=BASIC;STANDARD_HA
157158
Tier string `json:"tier"`
158159

159160
// +kubebuilder:validation:Required

api/cloud-resources/v1beta1/awsredisinstance_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type AwsRedisInstanceSpec struct {
2626
// +optional
2727
IpRange IpRangeRef `json:"ipRange"`
2828

29-
AuthSecret *AuthSecretSpec `json:"volume,omitempty"`
29+
AuthSecret *AuthSecretSpec `json:"authSecret,omitempty"`
3030

3131
// +kubebuilder:validation:Required
3232
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="CacheNodeType is immutable."

api/cloud-resources/v1beta1/gcpredisinstance_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type GcpRedisInstanceSpec struct {
5656

5757
// +kubebuilder:default=BASIC
5858
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="Tier is immutable."
59+
// +kubebuilder:validation:Enum=BASIC;STANDARD_HA
5960
Tier string `json:"tier"`
6061

6162
// +kubebuilder:validation:Required
@@ -82,7 +83,7 @@ type GcpRedisInstanceSpec struct {
8283
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="RedisConfigs is immutable."
8384
RedisConfigs RedisInstanceGcpConfigs `json:"redisConfigs"`
8485

85-
AuthSecret *AuthSecretSpec `json:"volume,omitempty"`
86+
AuthSecret *AuthSecretSpec `json:"authSecret,omitempty"`
8687
}
8788

8889
// GcpRedisInstanceStatus defines the observed state of GcpRedisInstance

config/crd/bases/cloud-control.kyma-project.io_redisinstances.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ spec:
183183
rule: (self == oldSelf)
184184
tier:
185185
default: BASIC
186+
enum:
187+
- BASIC
188+
- STANDARD_HA
186189
type: string
187190
x-kubernetes-validations:
188191
- message: Tier is immutable.

config/crd/bases/cloud-resources.kyma-project.io_awsredisinstances.yaml

Lines changed: 116 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.13.0
7+
cloud-resources.kyma-project.io/version: v0.0.2
78
name: awsredisinstances.cloud-resources.kyma-project.io
89
spec:
910
group: cloud-resources.kyma-project.io
@@ -14,152 +15,123 @@ spec:
1415
singular: awsredisinstance
1516
scope: Namespaced
1617
versions:
17-
- additionalPrinterColumns:
18-
- jsonPath: .status.state
19-
name: State
20-
type: string
21-
name: v1beta1
22-
schema:
23-
openAPIV3Schema:
24-
description: AwsRedisInstance is the Schema for the awsredisinstances API
25-
properties:
26-
apiVersion:
27-
description: 'APIVersion defines the versioned schema of this representation
28-
of an object. Servers should convert recognized schemas to the latest
29-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
30-
type: string
31-
kind:
32-
description: 'Kind is a string value representing the REST resource this
33-
object represents. Servers may infer this from the endpoint the client
34-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
35-
type: string
36-
metadata:
37-
type: object
38-
spec:
39-
description: AwsRedisInstanceSpec defines the desired state of AwsRedisInstance
40-
properties:
41-
autoMinorVersionUpgrade:
42-
default: false
43-
type: boolean
44-
x-kubernetes-validations:
45-
- message: AutoMinorVersionUpgrade is immutable.
46-
rule: (self == oldSelf)
47-
cacheNodeType:
48-
type: string
49-
x-kubernetes-validations:
50-
- message: CacheNodeType is immutable.
51-
rule: (self == oldSelf)
52-
engineVersion:
53-
default: "7.0"
54-
type: string
55-
x-kubernetes-validations:
56-
- message: EngineVersion is immutable.
57-
rule: (self == oldSelf)
58-
ipRange:
59-
properties:
60-
name:
61-
type: string
62-
required:
63-
- name
64-
type: object
65-
volume:
66-
properties:
67-
annotations:
68-
additionalProperties:
69-
type: string
70-
type: object
71-
labels:
72-
additionalProperties:
73-
type: string
74-
type: object
75-
name:
76-
type: string
77-
type: object
78-
required:
79-
- cacheNodeType
80-
type: object
81-
status:
82-
description: AwsRedisInstanceStatus defines the observed state of AwsRedisInstance
83-
properties:
84-
conditions:
85-
description: List of status conditions
86-
items:
87-
description: "Condition contains details for one aspect of the current
88-
state of this API Resource. --- This struct is intended for direct
89-
use as an array at the field path .status.conditions. For example,
90-
\n type FooStatus struct{ // Represents the observations of a
91-
foo's current state. // Known .status.conditions.type are: \"Available\",
92-
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
93-
// +listType=map // +listMapKey=type Conditions []metav1.Condition
94-
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
95-
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
18+
- additionalPrinterColumns:
19+
- jsonPath: .status.state
20+
name: State
21+
type: string
22+
name: v1beta1
23+
schema:
24+
openAPIV3Schema:
25+
description: AwsRedisInstance is the Schema for the awsredisinstances API
26+
properties:
27+
apiVersion:
28+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
29+
type: string
30+
kind:
31+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
32+
type: string
33+
metadata:
34+
type: object
35+
spec:
36+
description: AwsRedisInstanceSpec defines the desired state of AwsRedisInstance
37+
properties:
38+
authSecret:
9639
properties:
97-
lastTransitionTime:
98-
description: lastTransitionTime is the last time the condition
99-
transitioned from one status to another. This should be when
100-
the underlying condition changed. If that is not known, then
101-
using the time when the API field changed is acceptable.
102-
format: date-time
103-
type: string
104-
message:
105-
description: message is a human readable message indicating
106-
details about the transition. This may be an empty string.
107-
maxLength: 32768
40+
annotations:
41+
additionalProperties:
42+
type: string
43+
type: object
44+
labels:
45+
additionalProperties:
46+
type: string
47+
type: object
48+
name:
10849
type: string
109-
observedGeneration:
110-
description: observedGeneration represents the .metadata.generation
111-
that the condition was set based upon. For instance, if .metadata.generation
112-
is currently 12, but the .status.conditions[x].observedGeneration
113-
is 9, the condition is out of date with respect to the current
114-
state of the instance.
115-
format: int64
116-
minimum: 0
117-
type: integer
118-
reason:
119-
description: reason contains a programmatic identifier indicating
120-
the reason for the condition's last transition. Producers
121-
of specific condition types may define expected values and
122-
meanings for this field, and whether the values are considered
123-
a guaranteed API. The value should be a CamelCase string.
124-
This field may not be empty.
125-
maxLength: 1024
126-
minLength: 1
127-
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
128-
type: string
129-
status:
130-
description: status of the condition, one of True, False, Unknown.
131-
enum:
132-
- "True"
133-
- "False"
134-
- Unknown
135-
type: string
136-
type:
137-
description: type of condition in CamelCase or in foo.example.com/CamelCase.
138-
--- Many .condition.type values are consistent across resources
139-
like Available, but because arbitrary conditions can be useful
140-
(see .node.status.conditions), the ability to deconflict is
141-
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
142-
maxLength: 316
143-
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
50+
type: object
51+
autoMinorVersionUpgrade:
52+
default: false
53+
type: boolean
54+
x-kubernetes-validations:
55+
- message: AutoMinorVersionUpgrade is immutable.
56+
rule: (self == oldSelf)
57+
cacheNodeType:
58+
type: string
59+
x-kubernetes-validations:
60+
- message: CacheNodeType is immutable.
61+
rule: (self == oldSelf)
62+
engineVersion:
63+
default: "7.0"
64+
type: string
65+
x-kubernetes-validations:
66+
- message: EngineVersion is immutable.
67+
rule: (self == oldSelf)
68+
ipRange:
69+
properties:
70+
name:
14471
type: string
14572
required:
146-
- lastTransitionTime
147-
- message
148-
- reason
149-
- status
150-
- type
73+
- name
15174
type: object
152-
type: array
153-
x-kubernetes-list-map-keys:
154-
- type
155-
x-kubernetes-list-type: map
156-
id:
157-
type: string
158-
state:
159-
type: string
160-
type: object
161-
type: object
162-
served: true
163-
storage: true
164-
subresources:
165-
status: {}
75+
required:
76+
- cacheNodeType
77+
type: object
78+
status:
79+
description: AwsRedisInstanceStatus defines the observed state of AwsRedisInstance
80+
properties:
81+
conditions:
82+
description: List of status conditions
83+
items:
84+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
85+
properties:
86+
lastTransitionTime:
87+
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
88+
format: date-time
89+
type: string
90+
message:
91+
description: message is a human readable message indicating details about the transition. This may be an empty string.
92+
maxLength: 32768
93+
type: string
94+
observedGeneration:
95+
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
96+
format: int64
97+
minimum: 0
98+
type: integer
99+
reason:
100+
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
101+
maxLength: 1024
102+
minLength: 1
103+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
104+
type: string
105+
status:
106+
description: status of the condition, one of True, False, Unknown.
107+
enum:
108+
- "True"
109+
- "False"
110+
- Unknown
111+
type: string
112+
type:
113+
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
114+
maxLength: 316
115+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
116+
type: string
117+
required:
118+
- lastTransitionTime
119+
- message
120+
- reason
121+
- status
122+
- type
123+
type: object
124+
type: array
125+
x-kubernetes-list-map-keys:
126+
- type
127+
x-kubernetes-list-type: map
128+
id:
129+
type: string
130+
state:
131+
type: string
132+
type: object
133+
type: object
134+
served: true
135+
storage: true
136+
subresources:
137+
status: {}

0 commit comments

Comments
 (0)