Skip to content

Commit 3c843b6

Browse files
authored
Merge pull request #541 from vshn/develop
🔀 Merge develop into master (Release)
2 parents 7f6e65c + 0b1abf1 commit 3c843b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+298
-92
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,18 @@ Creating a PostgreSQL or Redis instance will now go through the Webhook instance
171171
## SLI Exporter
172172
### Metrics
173173

174-
The exporter exposes a histogram `appcat_probes_seconds` with five labels
174+
The exporter exposes a histogram `appcat_probes_seconds` with the following labels:
175175

176176
* `service`, the service type that was probed (e.g. `VSHNPostgreSQL`)
177-
* `namespace`, the namespace of the claim that was monitored
177+
* `claim_namespace`, the namespace of the claim that was monitored
178+
* `instance_namespace`, the namespace where the instance is deployed
178179
* `name`, the name of the claim that was monitored
179-
* `sla`, the service level. Can either be `besteffort` or `guaranteed`
180-
* `high_available`, whether this instance is high available (1 or more nodes)
181180
* `reason`, if the probe was successful. Can either be `success`, `fail-timeout`, or `fail-unkown`
181+
* `organization`, the organization label from the namespace
182+
* `ha`, whether this instance is high available (true or false)
183+
* `sla`, the service level. Can either be `besteffort` or `guaranteed`
184+
* `maintenance`, whether maintenance is currently running (true or false)
185+
* `composition`, the name of the composition being used (e.g. `vshnpostgrescnpg.vshn.appcat.vshn.io`)
182186

183187
#### Adding a Prober
184188

apis/vshn/v1/dbaas_vshn_keycloak.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
7+
cpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
78
corev1 "k8s.io/api/core/v1"
89
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
910
)
@@ -250,6 +251,10 @@ func (v *XVSHNKeycloak) GetInstanceNamespace() string {
250251
return fmt.Sprintf("vshn-keycloak-%s", v.GetName())
251252
}
252253

254+
func (v *XVSHNKeycloak) GetCompositionName() string {
255+
return v.Spec.CompositionRef.Name
256+
}
257+
253258
func (v *VSHNKeycloak) SetInstanceNamespaceStatus() {
254259
v.Status.InstanceNamespace = v.GetInstanceNamespace()
255260
}
@@ -301,10 +306,9 @@ type XVSHNKeycloak struct {
301306
// XVSHNKeycloakSpec defines the desired state of a VSHNKeycloak.
302307
type XVSHNKeycloakSpec struct {
303308
// Parameters are the configurable fields of a VSHNKeycloak.
304-
Parameters VSHNKeycloakParameters `json:"parameters,omitempty"`
305-
306-
ResourceRefs []xpv1.TypedReference `json:"resourceRefs,omitempty"`
307-
309+
Parameters VSHNKeycloakParameters `json:"parameters,omitempty"`
310+
CompositionRef cpv1.CompositionReference `json:"compositionRef,omitempty"`
311+
ResourceRefs []xpv1.TypedReference `json:"resourceRefs,omitempty"`
308312
xpv1.ResourceSpec `json:",inline"`
309313
}
310314

apis/vshn/v1/dbaas_vshn_mariadb.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
7+
cpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
78
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
89
)
910

@@ -202,11 +203,15 @@ func (v *XVSHNMariaDB) GetInstanceNamespace() string {
202203
return fmt.Sprintf("vshn-mariadb-%s", v.GetName())
203204
}
204205

206+
func (v *XVSHNMariaDB) GetCompositionName() string {
207+
return v.Spec.CompositionRef.Name
208+
}
209+
205210
// XVSHNMariaDBSpec defines the desired state of a VSHNMariaDB.
206211
type XVSHNMariaDBSpec struct {
207212
// Parameters are the configurable fields of a VSHNMariaDB.
208-
Parameters VSHNMariaDBParameters `json:"parameters,omitempty"`
209-
213+
Parameters VSHNMariaDBParameters `json:"parameters,omitempty"`
214+
CompositionRef cpv1.CompositionReference `json:"compositionRef,omitempty"`
210215
xpv1.ResourceSpec `json:",inline"`
211216
}
212217

apis/vshn/v1/dbaas_vshn_postgresql.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ func (v *XVSHNPostgreSQL) GetInstanceNamespace() string {
431431
return fmt.Sprintf("vshn-postgresql-%s", v.GetName())
432432
}
433433

434+
func (v *XVSHNPostgreSQL) GetCompositionName() string {
435+
return v.Spec.CompositionRef.Name
436+
}
437+
434438
// GetBackupRetention returns the retention definition for this backup.
435439
func (v *VSHNPostgreSQL) GetBackupRetention() K8upRetentionPolicy {
436440
return K8upRetentionPolicy{}

apis/vshn/v1/dbaas_vshn_redis.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
7+
cpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
78
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
89
)
910

@@ -183,11 +184,15 @@ func (v *XVSHNRedis) GetInstanceNamespace() string {
183184
return fmt.Sprintf("vshn-redis-%s", v.GetName())
184185
}
185186

187+
func (v *XVSHNRedis) GetCompositionName() string {
188+
return v.Spec.CompositionRef.Name
189+
}
190+
186191
// XVSHNRedisSpec defines the desired state of a VSHNRedis.
187192
type XVSHNRedisSpec struct {
188193
// Parameters are the configurable fields of a VSHNRedis.
189-
Parameters VSHNRedisParameters `json:"parameters,omitempty"`
190-
194+
Parameters VSHNRedisParameters `json:"parameters,omitempty"`
195+
CompositionRef cpv1.CompositionReference `json:"compositionRef,omitempty"`
191196
xpv1.ResourceSpec `json:",inline"`
192197
}
193198

apis/vshn/v1/vshn_minio.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
7+
cpv1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
78
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
89
)
910

@@ -156,11 +157,15 @@ func (v *XVSHNMinio) GetInstanceNamespace() string {
156157
return fmt.Sprintf("vshn-minio-%s", v.GetName())
157158
}
158159

160+
func (v *XVSHNMinio) GetCompositionName() string {
161+
return v.Spec.CompositionRef.Name
162+
}
163+
159164
// XVSHNMinioSpec defines the desired state of a VSHNMinio.
160165
type XVSHNMinioSpec struct {
161166
// Parameters are the configurable fields of a VSHNMinio.
162-
Parameters VSHNMinioParameters `json:"parameters,omitempty"`
163-
167+
Parameters VSHNMinioParameters `json:"parameters,omitempty"`
168+
CompositionRef cpv1.CompositionReference `json:"compositionRef,omitempty"`
164169
xpv1.ResourceSpec `json:",inline"`
165170
}
166171

apis/vshn/v1/vshn_nextcloud.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,13 @@ type VSHNNextcloudServiceSpec struct {
117117
// +kubebuilder:default="/"
118118
RelativePath string `json:"relativePath,omitempty"`
119119

120+
// +kubebuilder:validation:Pattern=`^[0-9]+(\.[0-9]+)?$`
120121
// +kubebuilder:default="31"
121122

122123
// Version contains supported version of nextcloud.
123124
// Multiple versions are supported. The latest version 31 is the default version.
125+
// Only major (e.g., "31") or major.minor (e.g., "31.0") versions are allowed.
126+
// Patch versions (e.g., "31.0.4") are not allowed as they break maintenance.
124127
Version string `json:"version,omitempty"`
125128

126129
// +kubebuilder:validation:Enum="besteffort";"guaranteed"
@@ -228,7 +231,10 @@ type CollaboraSpec struct {
228231
Enabled bool `json:"enabled"`
229232
// FQDN contains the FQDN of the Collabora server. This is used to configure the Collabora server URL in Your Nextcloud instance.
230233
FQDN string `json:"fqdn,omitempty"`
234+
// +kubebuilder:validation:Pattern=`^[0-9]+(\.[0-9]+)?$`
231235
// Version defines the Collabora version to use.
236+
// Only major (e.g., "24") or major.minor (e.g., "24.04") versions are allowed.
237+
// Patch versions (e.g., "24.04.3") are not allowed as they break maintenance.
232238
Version string `json:"version,omitempty"`
233239
}
234240

apis/vshn/v1/zz_generated.deepcopy.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crds/vshn.appcat.vshn.io_vshnnextclouds.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4627,7 +4627,11 @@ spec:
46274627
description: FQDN contains the FQDN of the Collabora server. This is used to configure the Collabora server URL in Your Nextcloud instance.
46284628
type: string
46294629
version:
4630-
description: Version defines the Collabora version to use.
4630+
description: |-
4631+
Version defines the Collabora version to use.
4632+
Only major (e.g., "24") or major.minor (e.g., "24.04") versions are allowed.
4633+
Patch versions (e.g., "24.04.3") are not allowed as they break maintenance.
4634+
pattern: ^[0-9]+(\.[0-9]+)?$
46314635
type: string
46324636
required:
46334637
- enabled
@@ -9492,6 +9496,9 @@ spec:
94929496
description: |-
94939497
Version contains supported version of nextcloud.
94949498
Multiple versions are supported. The latest version 31 is the default version.
9499+
Only major (e.g., "31") or major.minor (e.g., "31.0") versions are allowed.
9500+
Patch versions (e.g., "31.0.4") are not allowed as they break maintenance.
9501+
pattern: ^[0-9]+(\.[0-9]+)?$
94959502
type: string
94969503
required:
94979504
- fqdn

crds/vshn.appcat.vshn.io_xvshnkeycloaks.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ spec:
3939
spec:
4040
description: XVSHNKeycloakSpec defines the desired state of a VSHNKeycloak.
4141
properties:
42+
compositionRef:
43+
description: A CompositionReference references a Composition.
44+
properties:
45+
name:
46+
description: Name of the Composition.
47+
type: string
48+
required:
49+
- name
50+
type: object
4251
deletionPolicy:
4352
default: Delete
4453
description: |-

0 commit comments

Comments
 (0)