Skip to content

Commit

Permalink
Merge pull request #373 from vshn/event-forward
Browse files Browse the repository at this point in the history
Event forwarding for external object storage
  • Loading branch information
zugao authored Jun 5, 2024
2 parents d22f327 + 1b60521 commit 433ba09
Show file tree
Hide file tree
Showing 36 changed files with 118 additions and 42 deletions.
2 changes: 1 addition & 1 deletion component/class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ parameters:
appcat:
registry: ghcr.io
repository: vshn/appcat
tag: v4.74.0
tag: v4.75.0
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand Down
18 changes: 14 additions & 4 deletions component/component/objectstorage.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ local xrd = xrds.XRDFromCRD(
]
);

local eventForwarder = {
annotations+: {
'appcat.vshn.io/forward-events-to': '',
},
};

local compositionCloudscale =
local compParams = objStoParams.compositions.cloudscale;

local baseUser = {
apiVersion: 'cloudscale.crossplane.io/v1',
kind: 'ObjectsUser',
metadata: {},
metadata: {} + eventForwarder,
spec: {
forProvider: {
displayName: '',
Expand All @@ -54,7 +60,7 @@ local compositionCloudscale =
local baseBucket = {
apiVersion: 'cloudscale.crossplane.io/v1',
kind: 'Bucket',
metadata: {},
metadata: {} + eventForwarder,
spec: {
forProvider: {
bucketName: '',
Expand Down Expand Up @@ -87,6 +93,7 @@ local compositionCloudscale =
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'metadata.name'),
comp.ToCompositeFieldPath('status.conditions', 'status.accessUserConditions'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'spec.writeConnectionSecretToRef.name'),
comp.CombineCompositeFromTwoFieldPaths('metadata.labels[crossplane.io/claim-namespace]', 'metadata.labels[crossplane.io/claim-name]', 'spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]', 'cloudscale.crossplane.io/v1/ObjectsUser/%s/%s'),
{
type: 'CombineFromComposite',
toFieldPath: 'spec.forProvider.displayName',
Expand Down Expand Up @@ -121,6 +128,7 @@ local compositionCloudscale =
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.CombineCompositeFromTwoFieldPaths('metadata.labels[crossplane.io/claim-namespace]', 'metadata.labels[crossplane.io/claim-name]', 'spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]', 'cloudscale.crossplane.io/v1/Bucket/%s/%s'),
comp.FromCompositeFieldPath('spec.parameters.region', 'spec.forProvider.region') {
transforms: [
{
Expand All @@ -145,7 +153,7 @@ local compositionExoscale =
local IAMKeyBase = {
apiVersion: 'exoscale.crossplane.io/v1',
kind: 'IAMKey',
metadata: {},
metadata: {} + eventForwarder,
spec: {
forProvider: {
keyName: '',
Expand All @@ -170,7 +178,7 @@ local compositionExoscale =
local bucketBase = {
apiVersion: 'exoscale.crossplane.io/v1',
kind: 'Bucket',
metadata: {},
metadata: {} + eventForwarder,
spec: {
forProvider: {
bucketName: '',
Expand Down Expand Up @@ -200,6 +208,7 @@ local compositionExoscale =
patches: [
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'metadata.name'),
comp.ToCompositeFieldPath('status.conditions', 'status.accessUserConditions'),
comp.CombineCompositeFromTwoFieldPaths('metadata.labels[crossplane.io/claim-namespace]', 'metadata.labels[crossplane.io/claim-name]', 'spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]', 'exoscale.crossplane.io/v1/IAMKey/%s/%s'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/composite]', 'spec.writeConnectionSecretToRef.name'),
{
type: 'CombineFromComposite',
Expand Down Expand Up @@ -237,6 +246,7 @@ local compositionExoscale =
comp.FromCompositeFieldPath('spec.parameters.bucketName', 'spec.forProvider.bucketName'),
comp.FromCompositeFieldPath('spec.parameters.region', 'spec.forProvider.zone'),
comp.FromCompositeFieldPath('spec.parameters.bucketDeletionPolicy', 'spec.forProvider.bucketDeletionPolicy'),
comp.CombineCompositeFromTwoFieldPaths('metadata.labels[crossplane.io/claim-namespace]', 'metadata.labels[crossplane.io/claim-name]', 'spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]', 'exoscale.crossplane.io/v1/Bucket/%s/%s'),
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ spec:
- base:
apiVersion: cloudscale.crossplane.io/v1
kind: ObjectsUser
metadata: {}
metadata:
annotations:
appcat.vshn.io/forward-events-to: ''
spec:
forProvider:
displayName: ''
Expand Down Expand Up @@ -51,6 +53,15 @@ spec:
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.writeConnectionSecretToRef.name
type: FromCompositeFieldPath
- combine:
strategy: string
string:
fmt: cloudscale.crossplane.io/v1/ObjectsUser/%s/%s
variables:
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
- fromFieldPath: metadata.labels[crossplane.io/claim-name]
toFieldPath: spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]
type: CombineFromComposite
- combine:
strategy: string
string:
Expand All @@ -68,7 +79,9 @@ spec:
- base:
apiVersion: cloudscale.crossplane.io/v1
kind: Bucket
metadata: {}
metadata:
annotations:
appcat.vshn.io/forward-events-to: ''
spec:
forProvider:
bucketDeletionPolicy: ''
Expand Down Expand Up @@ -107,6 +120,15 @@ spec:
- fromFieldPath: spec.parameters.bucketDeletionPolicy
toFieldPath: spec.forProvider.bucketDeletionPolicy
type: FromCompositeFieldPath
- combine:
strategy: string
string:
fmt: cloudscale.crossplane.io/v1/Bucket/%s/%s
variables:
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
- fromFieldPath: metadata.labels[crossplane.io/claim-name]
toFieldPath: spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]
type: CombineFromComposite
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.region
transforms:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
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.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ spec:
- base:
apiVersion: exoscale.crossplane.io/v1
kind: IAMKey
metadata: {}
metadata:
annotations:
appcat.vshn.io/forward-events-to: ''
spec:
forProvider:
keyName: ''
Expand Down Expand Up @@ -51,6 +53,15 @@ spec:
- fromFieldPath: status.conditions
toFieldPath: status.accessUserConditions
type: ToCompositeFieldPath
- combine:
strategy: string
string:
fmt: exoscale.crossplane.io/v1/IAMKey/%s/%s
variables:
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
- fromFieldPath: metadata.labels[crossplane.io/claim-name]
toFieldPath: spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]
type: CombineFromComposite
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.writeConnectionSecretToRef.name
type: FromCompositeFieldPath
Expand All @@ -72,7 +83,9 @@ spec:
- base:
apiVersion: exoscale.crossplane.io/v1
kind: Bucket
metadata: {}
metadata:
annotations:
appcat.vshn.io/forward-events-to: ''
spec:
forProvider:
bucketDeletionPolicy: ''
Expand Down Expand Up @@ -109,4 +122,13 @@ spec:
- fromFieldPath: spec.parameters.bucketDeletionPolicy
toFieldPath: spec.forProvider.bucketDeletionPolicy
type: FromCompositeFieldPath
- combine:
strategy: string
string:
fmt: exoscale.crossplane.io/v1/Bucket/%s/%s
variables:
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
- fromFieldPath: metadata.labels[crossplane.io/claim-name]
toFieldPath: spec.forProvider.values.commonAnnotations[appcat.vshn.io/forward-events-to]
type: CombineFromComposite
writeConnectionSecretsToNamespace: crossplane-system
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.74.0
imageTag: v4.75.0
isOpenshift: 'false'
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
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.74.0
image: ghcr.io/vshn/appcat:v4.75.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.74.0
image: ghcr.io/vshn/appcat:v4.75.0
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNMARIADB
value: "false"
image: ghcr.io/vshn/appcat:v4.74.0
image: ghcr.io/vshn/appcat:v4.75.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.74.0-func
package: ghcr.io/vshn/appcat:v4.75.0-func
runtimeConfigRef:
name: function-appcat
Loading

0 comments on commit 433ba09

Please sign in to comment.