You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the SupplyChain deploying a Quarkus application to create the ResourceClaim and ServiceBinding if a ServiceRef has been defined on the workload. See the following ytt code
#@ def get_claims_extension():
#@ claims_extension_key = "serviceclaims.supplychain.apps.x-tanzu.vmware.com/extensions"
#@ if not hasattr(data.values.workload.metadata, "annotations") or not hasattr(data.values.workload.metadata.annotations, claims_extension_key):
#@ return None
#@ end
#@
#@ extension = json.decode(data.values.workload.metadata.annotations[claims_extension_key])
#@
#@ spec_extension = extension.get('spec')
#@ if spec_extension == None:
#@ return None
#@ end
#@
#@ return spec_extension.get('serviceClaims')
#@ end
#@ def merge_claims_extension(claim, claims_extension):
#@ if claims_extension == None:
#@ return claim.ref
#@ end
#@ extension = claims_extension.get(claim.name)
#@ if extension == None:
#@ return claim.ref
#@ end
#@ extension.update(claim.ref)
#@ return extension
#@ end
#@ def claims():
#@ claims_extension = get_claims_extension()
#@ for s in data.values.workload.spec.serviceClaims:
---
apiVersion: services.apps.tanzu.vmware.com/v1alpha1
kind: ResourceClaim
metadata:
name: #@ data.values.workload.metadata.name + '-' + s.name
annotations: #@ merge_annotations({})
labels: #@ merge_labels({ "app.kubernetes.io/component": "run", "carto.run/workload-name": data.values.workload.metadata.name })
spec:
ref: #@ merge_claims_extension(s, claims_extension)
---
apiVersion: servicebinding.io/v1alpha3
kind: ServiceBinding
metadata:
name: #@ data.values.workload.metadata.name + '-' + s.name
annotations: #@ merge_annotations({})
labels: #@ merge_labels({ "app.kubernetes.io/component": "run", "carto.run/workload-name": data.values.workload.metadata.name })
spec:
name: #@ s.name
service:
apiVersion: services.apps.tanzu.vmware.com/v1alpha1
kind: ResourceClaim
name: #@ data.values.workload.metadata.name + '-' + s.name
workload:
apiVersion: serving.knative.dev/v1
kind: Service
name: #@ data.values.workload.metadata.name
#@ end
#@ end
The text was updated successfully, but these errors were encountered:
To do
Improve the SupplyChain deploying a Quarkus application to create the ResourceClaim and ServiceBinding if a ServiceRef has been defined on the workload. See the following ytt code
The text was updated successfully, but these errors were encountered: