Skip to content

Commit

Permalink
Patch name of the inner ns object as well
Browse files Browse the repository at this point in the history
Up to this point we only patched the name of the kube object, but forgot
to actually patch the name of the inner namespace object. This worked
because `provider-kubernetes` will automatically apply the name of the
outer object to the inner object during its reconcile. This got to be a
problem with 1.14 as the AppCat function would mess up the quotas if the
name was empty in the desired objects.

However this object does not adhere to our naming scheme of
`metadata.labels[crossplane.io/composite]+"-description"`. Unfortunately
we can't change that name now without re-creating the namespaces.
  • Loading branch information
Kidswiss committed Nov 29, 2023
1 parent f393de1 commit 22a5a5f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions component/component/vshn_postgres.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ local instanceNamespace = {
comp.ToCompositeFieldPath('status.conditions', 'status.namespaceConditions'),
comp.ToCompositeFieldPath('metadata.name', 'status.instanceNamespace'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'metadata.name', 'vshn-postgresql'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.metadata.name', 'vshn-postgresql'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/claim-namespace]', 'spec.forProvider.manifest.metadata.labels[%s]' % serviceNamespaceLabelKey),
comp.FromCompositeFieldPath('spec.parameters.service.serviceLevel', 'spec.forProvider.manifest.metadata.labels[appcat.vshn.io/sla]'),
comp.FromCompositeFieldPath('metadata.labels[appuio.io/organization]', 'spec.forProvider.manifest.metadata.labels[appuio.io/organization]'),
Expand Down
1 change: 1 addition & 0 deletions component/component/vshn_redis.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ local composition =
patches: [
comp.ToCompositeFieldPath('status.conditions', 'status.namespaceConditions'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'metadata.name', 'vshn-redis'),
comp.FromCompositeFieldPathWithTransformPrefix('metadata.labels[crossplane.io/composite]', 'spec.forProvider.manifest.metadata.name', 'vshn-redis'),
comp.FromCompositeFieldPath('metadata.labels[crossplane.io/claim-namespace]', 'spec.forProvider.manifest.metadata.labels[%s]' % serviceNamespaceLabelKey),
comp.FromCompositeFieldPath('metadata.labels[appuio.io/organization]', 'spec.forProvider.manifest.metadata.labels[appuio.io/organization]'),
comp.ToCompositeFieldPath('metadata.name', 'status.instanceNamespace'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ spec:
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.forProvider.manifest.metadata.name
transforms:
- string:
fmt: vshn-postgresql-%s
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
toFieldPath: spec.forProvider.manifest.metadata.labels[appcat.vshn.io/claim-namespace]
type: FromCompositeFieldPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ spec:
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.forProvider.manifest.metadata.name
transforms:
- string:
fmt: vshn-postgresql-%s
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
toFieldPath: spec.forProvider.manifest.metadata.labels[appcat.vshn.io/claim-namespace]
type: FromCompositeFieldPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ spec:
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/composite]
toFieldPath: spec.forProvider.manifest.metadata.name
transforms:
- string:
fmt: vshn-redis-%s
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.labels[crossplane.io/claim-namespace]
toFieldPath: spec.forProvider.manifest.metadata.labels[appcat.vshn.io/claim-namespace]
type: FromCompositeFieldPath
Expand Down
4 changes: 2 additions & 2 deletions package/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ applications:
- crossplane
parameters:
pkg.appcat:
componentVersion: v2.10.1
componentVersion: v2.10.2
image:
registry: ghcr.io
repository: vshn/appcat
tag: v4.43.1
tag: v4.43.2
components:
appcat:
url: https://github.com/vshn/component-appcat.git
Expand Down

0 comments on commit 22a5a5f

Please sign in to comment.