Skip to content

Commit

Permalink
Merge pull request #234 from vshn/add/bucket-deletionprotection
Browse files Browse the repository at this point in the history
Patch bucketdeletionpolicy
  • Loading branch information
Kidswiss authored Sep 28, 2023
2 parents 4d020a1 + 020c520 commit b57f067
Show file tree
Hide file tree
Showing 23 changed files with 59 additions and 24 deletions.
6 changes: 1 addition & 5 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ parameters:
appcat:
registry: ghcr.io
repository: vshn/appcat
tag: v4.31.0
tag: v4.32.0
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand Down Expand Up @@ -366,20 +366,16 @@ parameters:
enabled: true
secretNamespace: ${appcat:services:generic:objectstorage:secretNamespace}
providerSecretNamespace: ${appcat:providers:exoscale:connectionSecretNamespace}
bucketDeletionPolicy: ${appcat:services:generic:objectstorage:bucketDeletionPolicy}
cloudscale:
enabled: true
secretNamespace: ${appcat:services:generic:objectstorage:secretNamespace}
providerSecretNamespace: ${appcat:providers:cloudscale:connectionSecretNamespace}
bucketDeletionPolicy: ${appcat:services:generic:objectstorage:bucketDeletionPolicy}
minio:
enabled: false
secretNamespace: ${appcat:services:generic:objectstorage:secretNamespace}
providerSecretNamespace: ${appcat:providers:cloudscale:connectionSecretNamespace}
bucketDeletionPolicy: ${appcat:services:generic:objectstorage:bucketDeletionPolicy}
grpcEndpoint: ${appcat:grpcEndpoint}
providerConfig: minio

# Generic config for objecstorage composite
secretNamespace: ${crossplane:namespace}
bucketDeletionPolicy: DeleteAll
6 changes: 4 additions & 2 deletions component/objectstorage.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local compositionCloudscale =
},
endpointURL: '',
region: '',
bucketDeletionPolicy: compParams.bucketDeletionPolicy,
bucketDeletionPolicy: '',
},
},
};
Expand Down Expand Up @@ -120,6 +120,7 @@ local compositionCloudscale =
comp.ToCompositeFieldPath('status.conditions', 'status.bucketConditions'),
comp.FromCompositeFieldPath('spec.parameters.bucketName', 'spec.forProvider.bucketName'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'spec.forProvider.credentialsSecretRef.name'),
comp.FromCompositeFieldPath('spec.parameters.bucketDeletionPolicy', 'spec.forProvider.bucketDeletionPolicy'),
comp.FromCompositeFieldPath('spec.parameters.region', 'spec.forProvider.region') {
transforms: [
{
Expand Down Expand Up @@ -174,7 +175,7 @@ local compositionExoscale =
forProvider: {
bucketName: '',
zone: '',
bucketDeletionPolicy: compParams.bucketDeletionPolicy,
bucketDeletionPolicy: '',
},
providerConfigRef: {
name: 'exoscale',
Expand Down Expand Up @@ -235,6 +236,7 @@ local compositionExoscale =
comp.ToCompositeFieldPath('status.conditions', 'status.bucketConditions'),
comp.FromCompositeFieldPath('spec.parameters.bucketName', 'spec.forProvider.bucketName'),
comp.FromCompositeFieldPath('spec.parameters.region', 'spec.forProvider.zone'),
comp.FromCompositeFieldPath('spec.parameters.bucketDeletionPolicy', 'spec.forProvider.bucketDeletionPolicy'),
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ spec:
description: ObjectBucketParameters are the configurable fields
of a ObjectBucket.
properties:
bucketDeletionPolicy:
default: DeleteAll
description: BucketDeletionPolicy determines how buckets should
be deleted when Bucket is deleted. `DeleteIfEmpty` only deletes
the bucket if the bucket is empty. `DeleteAll` recursively
deletes all objects in the bucket and then removes it.
type: string
bucketName:
description: BucketName is the name of the bucket to create.
Cannot be changed after bucket is created. Name must be acceptable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
metadata: {}
spec:
forProvider:
bucketDeletionPolicy: DeleteAll
bucketDeletionPolicy: ''
bucketName: ''
credentialsSecretRef:
name: ''
Expand Down Expand Up @@ -99,6 +99,9 @@ spec:
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.forProvider.credentialsSecretRef.name
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.bucketDeletionPolicy
toFieldPath: spec.forProvider.bucketDeletionPolicy
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.region
transforms:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
7 changes: 7 additions & 0 deletions tests/golden/exoscale/appcat/appcat/20_xrd_objectstorage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ spec:
description: ObjectBucketParameters are the configurable fields
of a ObjectBucket.
properties:
bucketDeletionPolicy:
default: DeleteAll
description: BucketDeletionPolicy determines how buckets should
be deleted when Bucket is deleted. `DeleteIfEmpty` only deletes
the bucket if the bucket is empty. `DeleteAll` recursively
deletes all objects in the bucket and then removes it.
type: string
bucketName:
description: BucketName is the name of the bucket to create.
Cannot be changed after bucket is created. Name must be acceptable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
metadata: {}
spec:
forProvider:
bucketDeletionPolicy: DeleteAll
bucketDeletionPolicy: ''
bucketName: ''
zone: ''
providerConfigRef:
Expand Down Expand Up @@ -106,4 +106,7 @@ spec:
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.zone
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.bucketDeletionPolicy
toFieldPath: spec.forProvider.bucketDeletionPolicy
type: FromCompositeFieldPath
writeConnectionSecretsToNamespace: syn-crossplane
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.31.0
imageTag: v4.32.0
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
minioChartVersion: 5.0.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ spec:
description: ObjectBucketParameters are the configurable fields
of a ObjectBucket.
properties:
bucketDeletionPolicy:
default: DeleteAll
description: BucketDeletionPolicy determines how buckets should
be deleted when Bucket is deleted. `DeleteIfEmpty` only deletes
the bucket if the bucket is empty. `DeleteAll` recursively
deletes all objects in the bucket and then removes it.
type: string
bucketName:
description: BucketName is the name of the bucket to create.
Cannot be changed after bucket is created. Name must be acceptable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
metadata: {}
spec:
forProvider:
bucketDeletionPolicy: DeleteAll
bucketDeletionPolicy: ''
bucketName: ''
zone: ''
providerConfigRef:
Expand Down Expand Up @@ -106,4 +106,7 @@ spec:
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.zone
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.bucketDeletionPolicy
toFieldPath: spec.forProvider.bucketDeletionPolicy
type: FromCompositeFieldPath
writeConnectionSecretsToNamespace: syn-crossplane
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
7 changes: 7 additions & 0 deletions tests/golden/vshn/appcat/appcat/20_xrd_objectstorage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ spec:
description: ObjectBucketParameters are the configurable fields
of a ObjectBucket.
properties:
bucketDeletionPolicy:
default: DeleteAll
description: BucketDeletionPolicy determines how buckets should
be deleted when Bucket is deleted. `DeleteIfEmpty` only deletes
the bucket if the bucket is empty. `DeleteAll` recursively
deletes all objects in the bucket and then removes it.
type: string
bucketName:
description: BucketName is the name of the bucket to create.
Cannot be changed after bucket is created. Name must be acceptable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.31.0
imageTag: v4.32.0
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
minioChartVersion: 5.0.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: myuser@example.com
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.31.0
imageTag: v4.32.0
quotasEnabled: 'false'
sgNamespace: stackgres
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: myuser@example.com
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.31.0
imageTag: v4.32.0
quotasEnabled: 'false'
sgNamespace: stackgres
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
data:
bucketRegion: lpg
controlNamespace: syn-appcat-control
imageTag: v4.31.0
imageTag: v4.32.0
maintenanceSA: helm-based-service-maintenance
quotasEnabled: 'false'
restoreSA: redisrestoreserviceaccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "true"
- name: APPCAT_SLI_VSHNREDIS
value: "true"
image: ghcr.io/vshn/appcat:v4.31.0
image: ghcr.io/vshn/appcat:v4.32.0
livenessProbe:
httpGet:
path: /healthz
Expand Down

0 comments on commit b57f067

Please sign in to comment.