Skip to content

Commit

Permalink
feat: adapt code to use KeptnWorkloadVersion instead of KeptnWorkload…
Browse files Browse the repository at this point in the history
…Instance (#2255)

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Oct 13, 2023
1 parent 0df464d commit c06fae1
Show file tree
Hide file tree
Showing 81 changed files with 1,242 additions and 734 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7000,7 +7000,7 @@ rules:
- apiGroups:
- lifecycle.keptn.sh
resources:
- keptnworkloadinstances
- keptnworkloadversions
verbs:
- get
- list
Expand Down Expand Up @@ -8272,6 +8272,8 @@ spec:
value: "0"
- name: KEPTN_WORKLOAD_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_VERSION_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_INSTANCE_CONTROLLER_LOG_LEVEL
value: "0"
- name: OPTIONS_CONTROLLER_LOG_LEVEL
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/.helm-tests/lifecycle-only/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5772,7 +5772,7 @@ rules:
- apiGroups:
- lifecycle.keptn.sh
resources:
- keptnworkloadinstances
- keptnworkloadversions
verbs:
- get
- list
Expand Down Expand Up @@ -6520,6 +6520,8 @@ spec:
value: "0"
- name: KEPTN_WORKLOAD_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_VERSION_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_INSTANCE_CONTROLLER_LOG_LEVEL
value: "0"
- name: OPTIONS_CONTROLLER_LOG_LEVEL
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/.helm-tests/lifecycle-with-certs/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5839,7 +5839,7 @@ rules:
- apiGroups:
- lifecycle.keptn.sh
resources:
- keptnworkloadinstances
- keptnworkloadversions
verbs:
- get
- list
Expand Down Expand Up @@ -6776,6 +6776,8 @@ spec:
value: "0"
- name: KEPTN_WORKLOAD_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_VERSION_CONTROLLER_LOG_LEVEL
value: "0"
- name: KEPTN_WORKLOAD_INSTANCE_CONTROLLER_LOG_LEVEL
value: "0"
- name: OPTIONS_CONTROLLER_LOG_LEVEL
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/create-reports-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for namespace in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnTaskDefinition" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnTask" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnWorkload" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnWorkloadInstance" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnWorkloadVersion" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnMetric" false
createResourceReport "$logsDir/$namespace" "$namespace" "KeptnMetricsProvider" false

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
processor:
useRawDocstring: true
ignoreFields:
- "TypeMeta$"
render:
kubernetesVersion: 1.24
knownTypes:
- name: ResourceReference
package: github.com/keptn/lifecycle-toolkit/lifecycle-operator/apis/lifecycle/v1alpha3
link: ../v1alpha3/#resourcereference
- name: ItemStatus
package: github.com/keptn/lifecycle-toolkit/lifecycle-operator/apis/lifecycle/v1alpha3
link: ../v1alpha3/#itemstatus
19 changes: 9 additions & 10 deletions .github/scripts/generate-crd-docs/generate-crd-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ OPERATOR_API_ROOT='lifecycle-operator/apis/'
METRICS_API_ROOT='metrics-operator/api/'
TEMPLATE_DIR='.github/scripts/generate-crd-docs/templates'
RENDERER='markdown'
RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-config.yaml'
RENDERER_CONFIG_FILE_TEMPLATE_PATH='.github/scripts/generate-crd-docs/crd-docs-generator-config'
RENDERER_CONFIG_FILE=$RENDERER_CONFIG_FILE_TEMPLATE_PATH'.yaml'
PATH=$PATH:$(go env GOPATH)/bin

echo "Checking if code generator tool is installed..."
Expand Down Expand Up @@ -45,13 +46,18 @@ for api_group in "$OPERATOR_API_ROOT"*; do

OUTPUT_PATH="./docs/content/en/docs/crd-ref/$sanitized_api_group/$sanitized_api_version"

renderer_config_file="$RENDERER_CONFIG_FILE_TEMPLATE_PATH-$sanitized_api_group-$sanitized_api_version.yaml"
if [ ! -f "$renderer_config_file" ]; then
renderer_config_file=$RENDERER_CONFIG_FILE
fi

echo "Arguments:"
echo "TEMPLATE_DIR: $TEMPLATE_DIR"
echo "OPERATOR_API_ROOT: $OPERATOR_API_ROOT"
echo "API_GROUP: $sanitized_api_group"
echo "API_VERSION: $sanitized_api_version"
echo "RENDERER: $RENDERER"
echo "RENDERER_CONFIG_FILE: $RENDERER_CONFIG_FILE"
echo "RENDERER_CONFIG_FILE: $renderer_config_file"
echo "OUTPUT_PATH: $OUTPUT_PATH/_index.md"

echo "Creating docs folder $OUTPUT_PATH..."
Expand All @@ -63,20 +69,13 @@ for api_group in "$OPERATOR_API_ROOT"*; do
--templates-dir "$TEMPLATE_DIR" \
--source-path="./$api_version" \
--renderer="$RENDERER" \
--config "$RENDERER_CONFIG_FILE" \
--config "$renderer_config_file" \
--max-depth 10 \
--output-path "$OUTPUT_PATH/_index.md"
echo "---------------------"
done
done

## Hack: sorry :(
## Due to not adding KeptnWorkload resource into v1alpha4, there is a problem to generate CRD docs
## in KeptnWorkloadVersion we are using KeptnWorkloadSpec from v1alpha3, which leads to using
## ResourceReference struct from v1alpha3 -> CRD docs generator generates the docs, but it
## refers to ResourceReference from v1alpha3, as if it is present in v1alpha4
sed -i 's|#resourcereference|../v1alpha3/#resourcereference|' docs/content/en/docs/crd-ref/lifecycle/v1alpha4/_index.md

# Metrics API


Expand Down
14 changes: 7 additions & 7 deletions docs/content/en/docs/architecture/components/scheduler/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ For instance a pod gated by keptn looks like the following:

{{< embed path="/docs/assets/scheduler-gates/gated.yaml" >}}

The **WorkloadInstance CRD** contains information about the `pre-deployment` checks that
The **WorkloadVersion CRD** contains information about the `pre-deployment` checks that
need to be performed before the Pod can be scheduled.
If the `pre-deployment` checks have finished successfully, the WorkloadInstance Controller removes the gate from the
If the `pre-deployment` checks have finished successfully, the WorkloadVersion Controller removes the gate from the
Pod.
The scheduler can then allow the Pod to be scheduled to a node.
If the `pre-deployment` checks have not yet finished, the gate stays and the Pod remains in the pending state.
When removing the gate, the WorkloadInstance controller also adds the following annotation so that,
When removing the gate, the WorkloadVersion controller also adds the following annotation so that,
if the spec is updated,
the Pod is not gated again:

Expand Down Expand Up @@ -72,11 +72,11 @@ A Pod `test-pod` modified by the Mutating Webhook looks as follows:
{{< embed path="/docs/assets/scheduler-gates/scheduler.yaml" >}}

If the Pod is annotated with Keptn specific annotations, the Keptn Scheduler retrieves
the WorkloadInstance CRD that is associated with the Pod.
The **WorkloadInstance CRD** contains information about the `pre-deployment` checks that
the WorkloadVersion CRD that is associated with the Pod.
The **WorkloadVersion CRD** contains information about the `pre-deployment` checks that
need to be performed before the Pod can be scheduled.

The Keptn Scheduler then checks the status of the WorkloadInstance CRD to see
The Keptn Scheduler then checks the status of the WorkloadVersion CRD to see
if the `pre-deployment` checks have finished successfully.
If the pre-deployment checks have finished successfully, the **Keptn Scheduler** allows
the Pod to be scheduled to a node.
Expand All @@ -89,7 +89,7 @@ For example, if there is not enough capacity on any node to schedule the Pod,
the Keptn Scheduler will not be able to schedule it, even if the `pre-deployment`
checks have finished successfully.

The Keptn Scheduler processes the following information from the WorkloadInstance CRD:
The Keptn Scheduler processes the following information from the WorkloadVersion CRD:

- The name of the pre-deployment checks that need to be performed.
- The status of the pre-deployment checks.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/architecture/deployment-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ CreateTask
CreateApp
CreateAppVersion
CreateWorkload
CreateWorkloadInstance
CreateWorkloadVersion
Completed
Deprecated
WorkloadDeployReconcile
Expand Down
26 changes: 4 additions & 22 deletions docs/content/en/docs/crd-ref/lifecycle/v1alpha4/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ Package v1alpha4 contains API Schema definitions for the lifecycle v1alpha4 API



#### ItemStatus





_Appears in:_
- [KeptnWorkloadVersionStatus](#keptnworkloadversionstatus)

| Field | Description |
| --- | --- |
| `definitionName` _string_ | DefinitionName is the name of the EvaluationDefinition/TaskDefinition |
| `status` _KeptnState_ | |
| `name` _string_ | Name is the name of the Evaluation/Task |
| `startTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#time-v1-meta)_ | StartTime represents the time at which the Item (Evaluation/Task) started. |
| `endTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#time-v1-meta)_ | EndTime represents the time at which the Item (Evaluation/Task) started. |


#### KeptnWorkloadVersion


Expand Down Expand Up @@ -109,10 +91,10 @@ _Appears in:_
| `preDeploymentEvaluationStatus` _KeptnState_ | PreDeploymentEvaluationStatus indicates the current status of the KeptnWorkloadVersion's PreDeploymentEvaluation phase. |
| `postDeploymentEvaluationStatus` _KeptnState_ | PostDeploymentEvaluationStatus indicates the current status of the KeptnWorkloadVersion's PostDeploymentEvaluation phase. |
| `postDeploymentStatus` _KeptnState_ | PostDeploymentStatus indicates the current status of the KeptnWorkloadVersion's PostDeployment phase. |
| `preDeploymentTaskStatus` _[ItemStatus](#itemstatus) array_ | PreDeploymentTaskStatus indicates the current state of each preDeploymentTask of the KeptnWorkloadVersion. |
| `postDeploymentTaskStatus` _[ItemStatus](#itemstatus) array_ | PostDeploymentTaskStatus indicates the current state of each postDeploymentTask of the KeptnWorkloadVersion. |
| `preDeploymentEvaluationTaskStatus` _[ItemStatus](#itemstatus) array_ | PreDeploymentEvaluationTaskStatus indicates the current state of each preDeploymentEvaluation of the KeptnWorkloadVersion. |
| `postDeploymentEvaluationTaskStatus` _[ItemStatus](#itemstatus) array_ | PostDeploymentEvaluationTaskStatus indicates the current state of each postDeploymentEvaluation of the KeptnWorkloadVersion. |
| `preDeploymentTaskStatus` _[ItemStatus](../v1alpha3/#itemstatus) array_ | PreDeploymentTaskStatus indicates the current state of each preDeploymentTask of the KeptnWorkloadVersion. |
| `postDeploymentTaskStatus` _[ItemStatus](../v1alpha3/#itemstatus) array_ | PostDeploymentTaskStatus indicates the current state of each postDeploymentTask of the KeptnWorkloadVersion. |
| `preDeploymentEvaluationTaskStatus` _[ItemStatus](../v1alpha3/#itemstatus) array_ | PreDeploymentEvaluationTaskStatus indicates the current state of each preDeploymentEvaluation of the KeptnWorkloadVersion. |
| `postDeploymentEvaluationTaskStatus` _[ItemStatus](../v1alpha3/#itemstatus) array_ | PostDeploymentEvaluationTaskStatus indicates the current state of each postDeploymentEvaluation of the KeptnWorkloadVersion. |
| `startTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#time-v1-meta)_ | StartTime represents the time at which the deployment of the KeptnWorkloadVersion started. |
| `endTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#time-v1-meta)_ | EndTime represents the time at which the deployment of the KeptnWorkloadVersion finished. |
| `currentPhase` _string_ | CurrentPhase indicates the current phase of the KeptnWorkloadVersion. This can be: - PreDeploymentTasks - PreDeploymentEvaluations - Deployment - PostDeploymentTasks - PostDeploymentEvaluations |
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/implementing/integrate/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Afterward, you can monitor the status of the deployment using
a command like the following:

```shell
kubectl get keptnworkloadinstance -n podtato-kubectl -w
kubectl get keptnworkloadversion -n podtato-kubectl -w
```

The generated `KeptnApp` file includes `metadata`
Expand Down Expand Up @@ -370,7 +370,7 @@ kubectl apply -f .
Afterward, you can monitor the status of the deployment using

```shell
kubectl get keptnworkloadinstance -n podtato-kubectl -w
kubectl get keptnworkloadversion -n podtato-kubectl -w
```

The deployment for a Workload stays in a `Pending`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and apply the updated `KeptnApp` manifest
to create a new revision of the `KeptnApp`
without modifying the `version`.

Afterwards, all related `KeptnWorkloadInstances`
Afterwards, all related `KeptnWorkloadVersions`
automatically refer to the newly created revision of the `KeptnAppVersion`
to determine whether they are allowed
to enter their respective deployment phases.
Expand Down
2 changes: 1 addition & 1 deletion examples/sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ If you want to port-forward to a different port, please execute:
```make deploy-version-1```

Now watch the progress on the cluster
```kubectl get keptnworkloadinstances```
```kubectl get keptnworkloadversions```
```kubectl get keptnappversions```

You could also open up a browser and watch the progress in Jaeger.
Expand Down
2 changes: 1 addition & 1 deletion examples/support/argo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ In the meanwhile you can watch the progress of the deployment using:
* Pre-Deployment Tasks are started
* Pods get scheduled

```kubectl get keptnworkloadinstances -n podtato-kubectl```
```kubectl get keptnworkloadversions -n podtato-kubectl```

* Get the current status of the workloads
* See in which phase your workload deployments are at the moment
Expand Down
8 changes: 4 additions & 4 deletions examples/support/argo/assets/argo_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ data:
end
return hs
resource.customizations.health.lifecycle.keptn.sh_KeptnWorkloadInstance: |
resource.customizations.health.lifecycle.keptn.sh_KeptnWorkloadVersion: |
hs = {}
hs.status = "Progressing"
hs.message = "KeptnWorkloadInstance is progressing"
hs.message = "KeptnWorkloadVersion is progressing"
if obj.status.status == "Succeeded" then
hs.status = "Healthy"
hs.message = "KeptnWorkloadInstance is healthy"
hs.message = "KeptnWorkloadVersion is healthy"
end
if obj.status.status == "Failed" then
hs.status = "Degraded"
hs.message = "KeptnWorkloadInstance is degraded"
hs.message = "KeptnWorkloadVersion is degraded"
end
return hs
Expand Down
6 changes: 3 additions & 3 deletions examples/support/observability/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ deploy-podtatohead:
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition1.yaml
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition2.yaml
kubectl wait --for=condition=available deployment/podtato-head-entry -n podtato-kubectl --timeout=120s
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadinstances -n podtato-kubectl -w"
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadversions -n podtato-kubectl -w"

.PHONY: deploy-podtatohead-failed-post
deploy-podtatohead-failed-post:
Expand All @@ -135,7 +135,7 @@ deploy-podtatohead-failed-post:
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition1.yaml
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition3.yaml
kubectl wait --for=condition=available deployment/podtato-head-entry -n podtato-kubectl --timeout=120s
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadinstances -n podtato-kubectl -w"
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadversions -n podtato-kubectl -w"

.PHONY: deploy-podtatohead-failed-pre
deploy-podtatohead-failed-pre:
Expand All @@ -145,7 +145,7 @@ deploy-podtatohead-failed-pre:
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition3.yaml
kubectl apply -f ./assets/podtatohead-evaluationdefinitions/keptnevaluationdefinition4.yaml
kubectl wait --for=condition=available deployment/podtato-head-entry -n podtato-kubectl --timeout=120s
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadinstances -n podtato-kubectl -w"
@echo "Watch Workload Deployment Progress: kubectl get keptnworkloadversions -n podtato-kubectl -w"

.PHONY: undeploy-podtatohead
undeploy-podtatohead:
Expand Down
8 changes: 4 additions & 4 deletions lifecycle-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ component-test: manifests generate envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/task/... -v -timeout 30m -coverprofile cover-task.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptntask/..."
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/taskdefinition/... -v -timeout 30m -coverprofile cover-taskdefinition.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptntaskdefinition/..."
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/workload/... -v -timeout 30m -coverprofile cover-workload.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptnworkload/..."
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/workloadinstance/... -v -timeout 30m -coverprofile cover-workloadinstance.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptnworkloadinstance/..."
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/workloadversion/... -v -timeout 30m -coverprofile cover-workloadversion.out -coverpkg "github.com/keptn/lifecycle-toolkit/lifecycle-operator/controllers/lifecycle/keptnworkloadversion/..."
sed -i '/mode: set/d' "cover-app.out"
sed -i '/mode: set/d' "cover-appversion.out"
sed -i '/mode: set/d' "cover-evaluation.out"
sed -i '/mode: set/d' "cover-task.out"
sed -i '/mode: set/d' "cover-taskdefinition.out"
sed -i '/mode: set/d' "cover-workload.out"
sed -i '/mode: set/d' "cover-workloadinstance.out"
sed -i '/mode: set/d' "cover-workloadversion.out"
echo "mode: set" > cover.out
cat cover-app.out cover-appversion.out cover-evaluation.out cover-task.out cover-taskdefinition.out cover-workload.out cover-workloadinstance.out >> cover.out
rm cover-app.out cover-appversion.out cover-evaluation.out cover-task.out cover-taskdefinition.out cover-workload.out cover-workloadinstance.out
cat cover-app.out cover-appversion.out cover-evaluation.out cover-task.out cover-taskdefinition.out cover-workload.out cover-workloadversion.out >> cover.out
rm cover-app.out cover-appversion.out cover-evaluation.out cover-task.out cover-taskdefinition.out cover-workload.out cover-workloadversion.out

.PHONY: performance-test
performance-test: manifests generate envtest ## Run tests.
Expand Down
4 changes: 2 additions & 2 deletions lifecycle-operator/apis/lifecycle/v1alpha3/common/phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var phases = []KeptnPhaseType{
PhaseCreateTask,
PhaseCreateAppCreationRequest,
PhaseCreateWorkload,
PhaseCreateWorklodInstance,
PhaseCreateWorkloadVersion,
PhaseCreateAppVersion,
PhaseAppCompleted,
PhaseWorkloadCompleted,
Expand Down Expand Up @@ -100,7 +100,7 @@ var (
PhaseCreateAppCreationRequest = KeptnPhaseType{LongName: "Create AppCreationRequest", ShortName: "CreateAppCreationRequest"}
PhaseCreateWorkload = KeptnPhaseType{LongName: "Create Workload", ShortName: "CreateWorkload"}
PhaseUpdateWorkload = KeptnPhaseType{LongName: "Update Workload", ShortName: "UpdateWorkload"}
PhaseCreateWorklodInstance = KeptnPhaseType{LongName: "Create WorkloadInstance", ShortName: "CreateWorkloadInstance"}
PhaseCreateWorkloadVersion = KeptnPhaseType{LongName: "Create WorkloadVersion", ShortName: "CreateWorkloadVersion"}
PhaseCreateAppVersion = KeptnPhaseType{LongName: "Create AppVersion", ShortName: "CreateAppVersion"}
PhaseDeprecateAppVersion = KeptnPhaseType{LongName: "Deprecate AppVersion", ShortName: "DeprecateAppVersion"}
PhaseAppCompleted = KeptnPhaseType{LongName: "App Completed", ShortName: "AppCompleted"}
Expand Down
20 changes: 0 additions & 20 deletions lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@ func TestKeptnWorkload(t *testing.T) {
},
}

workloadInstanceName := workload.GetWorkloadInstanceName()
require.Equal(t, "workload-version", workloadInstanceName)

workloadInstance := workload.GenerateWorkloadInstance("prev", map[string]string{})
require.Equal(t, KeptnWorkloadInstance{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{},
Name: "workload-version",
Namespace: "namespace",
},
Spec: KeptnWorkloadInstanceSpec{
KeptnWorkloadSpec: KeptnWorkloadSpec{
Version: "version",
AppName: "app",
},
WorkloadName: "workload",
PreviousVersion: "prev",
},
}, workloadInstance)

require.Equal(t, []attribute.KeyValue{
common.AppName.String("app"),
common.WorkloadName.String("workload"),
Expand Down
Loading

0 comments on commit c06fae1

Please sign in to comment.