Skip to content

Commit

Permalink
feat: add ability to delete compositiondefinition from card (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
braghettos authored Nov 25, 2024
1 parent 95d2b66 commit 4c4e20e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions chart/templates/card.template-card.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ spec:
resource: forms
name: template-{{ .Release.Name }}-form
namespace: {{ .Release.Namespace }}
verb: POST
- template:
apiVersion: core.krateo.io/v1alpha1
resource: compositiondefinitions
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
verb: DELETE
app:
template:
{{- with .Values.portal.card }}
Expand Down
20 changes: 20 additions & 0 deletions chart/templates/patch.card-color.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: krateo.io/v1alpha1
kind: Patch
metadata:
name: compositiondefinition-status-card-color
spec:
from:
objectReference:
apiVersion: core.krateo.io/v1alpha1
kind: CompositionDefinition
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
fieldPath: status
to:
objectReference:
apiVersion: templates.krateo.io/v1alpha1
kind: Widget
name: template-{{ .Release.Name }}-card
namespace: {{ .Release.Namespace }}
fieldPath: spec.app.template.color
transform: ${ .conditions[] | select(.type == "Ready") | if .status == "False" then "yellow" elif .status == "True" then "red" else "grey" end }
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ portal:
title: FireworksApp
color: blue
content: This is a card for FireworksApp template
tags: "1.1.8"
tags: "1.1.9"

0 comments on commit 4c4e20e

Please sign in to comment.