Skip to content

Commit

Permalink
Switch to standard ProviderConfigs.name = id
Browse files Browse the repository at this point in the history
* Upgrade to latest v0.6.0 function-kcl that enables composition
  resource name override, crossplane-contrib/function-kcl#81
* It enables to keep same metadata.name for different resource kinds,
  providerConfigs of helm and kubernetes in this case
* The metada.name = id is important convention that is used by other
  Configurations that integrate with configuration-aws-eks in the higher
  level platform-ref-aws

Signed-off-by: Yury Tsarev <[email protected]>
  • Loading branch information
ytsarev committed Apr 19, 2024
1 parent eae4b0a commit b4f9a8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions apis/composition-kcl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
}
}
clusterSecurityGroupId = option("params")?.ocds?[xrName + "-kubernetes-cluster"]?.Resource?.status?.atProvider?.vpcConfig?[0]?.clusterSecurityGroupId
clusterSecurityGroupId = option("params")?.ocds?[xrName + "-kubernetes-cluster"]?.Resource?.status?.atProvider?.vpcConfig?[0]?.clusterSecurityGroupId or False
if clusterSecurityGroupId:
clusterSecurityGroupImport = {
apiVersion = "ec2.aws.upbound.io/v1beta1"
Expand Down Expand Up @@ -247,9 +247,10 @@ spec:
providerConfigs = [{
apiVersion = "{}.crossplane.io/v1alpha1".format(t)
kind = "ProviderConfig"
metadata.name = id + "-" + t # need to deviate metadata.name until https://github.com/crossplane-contrib/function-kcl/issues/77 is fixed
metadata.name = id
metadata.annotations = {
"krm.kcl.dev/ready": "True"
"krm.kcl.dev/composition-resource-name" = "providerConfig-" + t
}
spec.credentials = {
secretRef = {
Expand All @@ -267,7 +268,7 @@ spec:
apiVersion = "kubernetes.crossplane.io/v1alpha2"
kind = "Object"
metadata.name = id + "-irsa-settings"
spec.providerConfigRef.name = id + "-kubernetes"
spec.providerConfigRef.name = id
spec.deletionPolicy = "Orphan"
spec.forProvider = {
manifest: {
Expand All @@ -291,7 +292,7 @@ spec:
apiVersion = "kubernetes.crossplane.io/v1alpha2"
kind = "Object"
metadata.name = id + "-aws-auth"
spec.providerConfigRef.name = id + "-kubernetes"
spec.providerConfigRef.name = id
spec.deletionPolicy = "Orphan"
spec.forProvider = {
manifest: {
Expand Down
2 changes: 1 addition & 1 deletion crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
version: "v0.4.0"
- function: xpkg.upbound.io/crossplane-contrib/function-kcl
# renovate: datasource=github-releases depName=crossplane-contrib/function-kcl
version: "v0.5.1"
version: "v0.6.0"
- function: xpkg.upbound.io/crossplane-contrib/function-auto-ready
# renovate: datasource=github-releases depName=crossplane-contrib/function-auto-ready
version: "v0.2.1"

0 comments on commit b4f9a8b

Please sign in to comment.