feat: Introduce KeptnWorkloadVersion custom resource (#15951)

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
This commit is contained in:
odubajDT
2024-07-25 23:00:02 +02:00
committed by GitHub
parent f1018e88a0
commit ddc0b0fd3f
5 changed files with 178 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
local hs = {}
if obj.status.status == "Succeeded" then
hs.status = "Healthy"
hs.message = "KeptnWorkloadVersion is healthy"
return hs
end
if obj.status.status == "Failed" then
hs.status = "Degraded"
hs.message = "KeptnWorkloadVersion is degraded"
return hs
end
hs.status = "Progressing"
hs.message = "KeptnWorkloadVersion is progressing"
return hs

View File

@@ -0,0 +1,13 @@
tests:
- healthStatus:
status: Progressing
message: "KeptnWorkloadVersion is progressing"
inputPath: testdata/progressing.yaml
- healthStatus:
status: Degraded
message: "KeptnWorkloadVersion is degraded"
inputPath: testdata/degraded.yaml
- healthStatus:
status: Healthy
message: "KeptnWorkloadVersion is healthy"
inputPath: testdata/healthy.yaml

View File

@@ -0,0 +1,50 @@
apiVersion: lifecycle.keptn.sh/v1alpha4
kind: KeptnWorkloadVersion
metadata:
annotations:
traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01
creationTimestamp: "2022-12-14T13:17:36Z"
generation: 2
name: podtato-head-podtato-head-entry-0.2.7
namespace: podtato-kubectl
ownerReferences:
- apiVersion: lifecycle.keptn.sh/v1alpha2
blockOwnerDeletion: true
controller: true
kind: KeptnWorkload
name: podtato-head-podtato-head-entry
uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764
resourceVersion: "226253"
uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b
spec:
app: podtato-head
resourceReference:
kind: ReplicaSet
name: podtato-head-entry-6fc8964846
uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b
traceId:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01
version: 0.2.7
workloadName: podtato-head-podtato-head-entry
status:
currentPhase: PreDeployTasks
deploymentStatus: Succeeded
phaseTraceIDs:
"":
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01
WorkloadDeploy:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01
WorkloadPostDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01
WorkloadPostDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01
WorkloadPreDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01
WorkloadPreDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01
postDeploymentEvaluationStatus: Progressing
postDeploymentStatus: Progressing
preDeploymentEvaluationStatus: Failed
preDeploymentStatus: Failed
startTime: "2022-12-14T13:17:57Z"
status: Failed

View File

@@ -0,0 +1,51 @@
apiVersion: lifecycle.keptn.sh/v1alpha4
kind: KeptnWorkloadVersion
metadata:
annotations:
traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01
creationTimestamp: "2022-12-14T13:17:36Z"
generation: 2
name: podtato-head-podtato-head-entry-0.2.7
namespace: podtato-kubectl
ownerReferences:
- apiVersion: lifecycle.keptn.sh/v1alpha2
blockOwnerDeletion: true
controller: true
kind: KeptnWorkload
name: podtato-head-podtato-head-entry
uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764
resourceVersion: "226253"
uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b
spec:
app: podtato-head
resourceReference:
kind: ReplicaSet
name: podtato-head-entry-6fc8964846
uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b
traceId:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01
version: 0.2.7
workloadName: podtato-head-podtato-head-entry
status:
currentPhase: Completed
deploymentStatus: Succeeded
endTime: "2022-12-14T13:18:41Z"
phaseTraceIDs:
"":
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01
WorkloadDeploy:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01
WorkloadPostDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01
WorkloadPostDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01
WorkloadPreDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01
WorkloadPreDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01
postDeploymentEvaluationStatus: Succeeded
postDeploymentStatus: Succeeded
preDeploymentEvaluationStatus: Succeeded
preDeploymentStatus: Succeeded
startTime: "2022-12-14T13:17:57Z"
status: Succeeded

View File

@@ -0,0 +1,50 @@
apiVersion: lifecycle.keptn.sh/v1alpha4
kind: KeptnWorkloadVersion
metadata:
annotations:
traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01
creationTimestamp: "2022-12-14T13:17:36Z"
generation: 2
name: podtato-head-podtato-head-entry-0.2.7
namespace: podtato-kubectl
ownerReferences:
- apiVersion: lifecycle.keptn.sh/v1alpha2
blockOwnerDeletion: true
controller: true
kind: KeptnWorkload
name: podtato-head-podtato-head-entry
uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764
resourceVersion: "226253"
uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b
spec:
app: podtato-head
resourceReference:
kind: ReplicaSet
name: podtato-head-entry-6fc8964846
uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b
traceId:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01
version: 0.2.7
workloadName: podtato-head-podtato-head-entry
status:
currentPhase: Completed
deploymentStatus: Succeeded
phaseTraceIDs:
"":
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01
WorkloadDeploy:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01
WorkloadPostDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01
WorkloadPostDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01
WorkloadPreDeployEvaluations:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01
WorkloadPreDeployTasks:
traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01
postDeploymentEvaluationStatus: Progressing
postDeploymentStatus: Progressing
preDeploymentEvaluationStatus: Succeeded
preDeploymentStatus: Succeeded
startTime: "2022-12-14T13:17:57Z"
status: Progressing