Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(operator): standardize k8s Events on lifecycle path #1692

Merged
merged 12 commits into from
Jul 21, 2023
64 changes: 42 additions & 22 deletions operator/apis/lifecycle/v1alpha3/common/phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ var phases = []KeptnPhaseType{
PhaseAppDeployment,
PhaseReconcileEvaluation,
PhaseReconcileTask,
PhaseReconcileWorkload,
PhaseUpdateWorkload,
PhaseCreateEvaluation,
PhaseCreateTask,
PhaseCreateApp,
PhaseCreateAppCreationRequest,
PhaseCreateWorkload,
PhaseCreateWorklodInstance,
PhaseCreateAppVersion,
PhaseCompleted,
PhaseAppCompleted,
PhaseWorkloadCompleted,
PhaseDeprecateAppVersion,
PhaseDeprecated,
PhaseAppCompleted,
}

func (p KeptnPhaseType) IsEvaluation() bool {
Expand Down Expand Up @@ -77,26 +82,31 @@ func GetShortPhaseName(phase string) string {
}

var (
PhaseWorkloadPreDeployment = KeptnPhaseType{LongName: "Workload Pre-Deployment Tasks", ShortName: "WorkloadPreDeployTasks"}
PhaseWorkloadPostDeployment = KeptnPhaseType{LongName: "Workload Post-Deployment Tasks", ShortName: "WorkloadPostDeployTasks"}
PhaseWorkloadPreEvaluation = KeptnPhaseType{LongName: "Workload Pre-Deployment Evaluations", ShortName: "WorkloadPreDeployEvaluations"}
PhaseWorkloadPostEvaluation = KeptnPhaseType{LongName: "Workload Post-Deployment Evaluations", ShortName: "WorkloadPostDeployEvaluations"}
PhaseWorkloadDeployment = KeptnPhaseType{LongName: "Workload Deployment", ShortName: "WorkloadDeploy"}
PhaseAppPreDeployment = KeptnPhaseType{LongName: "App Pre-Deployment Tasks", ShortName: "AppPreDeployTasks"}
PhaseAppPostDeployment = KeptnPhaseType{LongName: "App Post-Deployment Tasks", ShortName: "AppPostDeployTasks"}
PhaseAppPreEvaluation = KeptnPhaseType{LongName: "App Pre-Deployment Evaluations", ShortName: "AppPreDeployEvaluations"}
PhaseAppPostEvaluation = KeptnPhaseType{LongName: "App Post-Deployment Evaluations", ShortName: "AppPostDeployEvaluations"}
PhaseAppDeployment = KeptnPhaseType{LongName: "App Deployment", ShortName: "AppDeploy"}
PhaseReconcileEvaluation = KeptnPhaseType{LongName: "Reconcile Evaluation", ShortName: "ReconcileEvaluation"}
PhaseReconcileTask = KeptnPhaseType{LongName: "Reconcile Task", ShortName: "ReconcileTask"}
PhaseCreateEvaluation = KeptnPhaseType{LongName: "Create Evaluation", ShortName: "CreateEvaluation"}
PhaseCreateTask = KeptnPhaseType{LongName: "Create Task", ShortName: "CreateTask"}
PhaseCreateApp = KeptnPhaseType{LongName: "Create App", ShortName: "CreateApp"}
PhaseCreateWorkload = KeptnPhaseType{LongName: "Create Workload", ShortName: "CreateWorkload"}
PhaseCreateWorklodInstance = KeptnPhaseType{LongName: "Create WorkloadInstance", ShortName: "CreateWorkloadInstance"}
PhaseCreateAppVersion = KeptnPhaseType{LongName: "Create AppVersion", ShortName: "CreateAppVersion"}
PhaseCompleted = KeptnPhaseType{LongName: "Completed", ShortName: "Completed"}
PhaseDeprecated = KeptnPhaseType{LongName: "Deprecated", ShortName: "Deprecated"}
PhaseWorkloadPreDeployment = KeptnPhaseType{LongName: "Workload Pre-Deployment Tasks", ShortName: "WorkloadPreDeployTasks"}
PhaseWorkloadPostDeployment = KeptnPhaseType{LongName: "Workload Post-Deployment Tasks", ShortName: "WorkloadPostDeployTasks"}
PhaseWorkloadPreEvaluation = KeptnPhaseType{LongName: "Workload Pre-Deployment Evaluations", ShortName: "WorkloadPreDeployEvaluations"}
PhaseWorkloadPostEvaluation = KeptnPhaseType{LongName: "Workload Post-Deployment Evaluations", ShortName: "WorkloadPostDeployEvaluations"}
PhaseWorkloadDeployment = KeptnPhaseType{LongName: "Workload Deployment", ShortName: "WorkloadDeploy"}
PhaseAppPreDeployment = KeptnPhaseType{LongName: "App Pre-Deployment Tasks", ShortName: "AppPreDeployTasks"}
PhaseAppPostDeployment = KeptnPhaseType{LongName: "App Post-Deployment Tasks", ShortName: "AppPostDeployTasks"}
PhaseAppPreEvaluation = KeptnPhaseType{LongName: "App Pre-Deployment Evaluations", ShortName: "AppPreDeployEvaluations"}
PhaseAppPostEvaluation = KeptnPhaseType{LongName: "App Post-Deployment Evaluations", ShortName: "AppPostDeployEvaluations"}
PhaseAppDeployment = KeptnPhaseType{LongName: "App Deployment", ShortName: "AppDeploy"}
PhaseReconcileEvaluation = KeptnPhaseType{LongName: "Reconcile Evaluation", ShortName: "ReconcileEvaluation"}
PhaseReconcileTask = KeptnPhaseType{LongName: "Reconcile Task", ShortName: "ReconcileTask"}
PhaseReconcileWorkload = KeptnPhaseType{LongName: "Reconcile Workloads", ShortName: "ReconcileWorkload"}
PhaseCreateEvaluation = KeptnPhaseType{LongName: "Create Evaluation", ShortName: "CreateEvaluation"}
PhaseCreateTask = KeptnPhaseType{LongName: "Create Task", ShortName: "CreateTask"}
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"}
PhaseCreateAppVersion = KeptnPhaseType{LongName: "Create AppVersion", ShortName: "CreateAppVersion"}
PhaseDeprecateAppVersion = KeptnPhaseType{LongName: "Deprecate AppVersion", ShortName: "DeprecateAppVersion"}
PhaseAppCompleted = KeptnPhaseType{LongName: "App Completed", ShortName: "AppCompleted"}
PhaseWorkloadCompleted = KeptnPhaseType{LongName: "Workload Completed", ShortName: "WorkloadCompleted"}
PhaseCompleted = KeptnPhaseType{LongName: "Completed", ShortName: "Completed"}
PhaseDeprecated = KeptnPhaseType{LongName: "Deprecated", ShortName: "Deprecated"}
)

type PhaseTraceID map[string]propagation.MapCarrier
Expand All @@ -109,3 +119,13 @@ func (pid PhaseTraceID) SetPhaseTraceID(phase string, carrier propagation.MapCar
func (pid PhaseTraceID) GetPhaseTraceID(phase string) propagation.MapCarrier {
return pid[GetShortPhaseName(phase)]
}

var (
PhaseStateFinished = "Finished"
odubajDT marked this conversation as resolved.
Show resolved Hide resolved
PhaseStateStarted = "Started"
PhaseStateFailed = "Failed"
PhaseStateStatusChanged = "StatusChanged"
PhaseStateReconcileError = "ReconcileError"
PhaseStateReconcileTimeout = "ReconcileTimeout"
PhaseStateNotFound = "NotFound"
)
12 changes: 4 additions & 8 deletions operator/controllers/common/evaluationhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r EvaluationHandler) ReconcileEvaluations(ctx context.Context, phaseCtx co
evaluationExists := false

if oldstatus != evaluationStatus.Status {
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Normal", reconcileObject, "EvaluationStatusChanged", fmt.Sprintf("evaluation status changed from %s to %s", oldstatus, evaluationStatus.Status), piWrapper.GetVersion())
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Normal", reconcileObject, apicommon.PhaseStateStatusChanged, fmt.Sprintf("evaluation status changed from %s to %s", oldstatus, evaluationStatus.Status), piWrapper.GetVersion())
}

// Check if evaluation has already succeeded or failed
Expand Down Expand Up @@ -105,9 +105,7 @@ func (r EvaluationHandler) ReconcileEvaluations(ctx context.Context, phaseCtx co
for _, ns := range newStatus {
summary = apicommon.UpdateStatusSummary(ns.Status, summary)
}
if apicommon.GetOverallState(summary) != apicommon.StateSucceeded {
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Warning", reconcileObject, "NotFinished", "has not finished", piWrapper.GetVersion())
}

return newStatus, summary, nil
}

Expand All @@ -128,10 +126,9 @@ func (r EvaluationHandler) CreateKeptnEvaluation(ctx context.Context, namespace
err = r.Client.Create(ctx, &newEvaluation)
if err != nil {
r.Log.Error(err, "could not create KeptnEvaluation")
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "CreateFailed", "could not create KeptnEvaluation", piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, apicommon.PhaseStateFailed, "could not create KeptnEvaluation", piWrapper.GetVersion())
return "", err
}
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, "Created", "created", piWrapper.GetVersion())

return newEvaluation.Name, nil
}
Expand All @@ -145,7 +142,7 @@ func (r EvaluationHandler) emitEvaluationFailureEvents(evaluation *klcv1alpha3.K
k8sEventMessage = fmt.Sprintf("%s\n%s", k8sEventMessage, msg)
}
}
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Warning", evaluation, "Failed", k8sEventMessage, piWrapper.GetVersion())
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Warning", evaluation, apicommon.PhaseStateFailed, k8sEventMessage, piWrapper.GetVersion())
}

func (r EvaluationHandler) setupEvaluations(evaluationCreateAttributes CreateEvaluationAttributes, piWrapper *interfaces.PhaseItemWrapper) ([]string, []klcv1alpha3.ItemStatus) {
Expand Down Expand Up @@ -190,7 +187,6 @@ func (r EvaluationHandler) handleEvaluationExists(phaseCtx context.Context, piWr
if evaluationStatus.Status.IsSucceeded() {
spanEvaluationTrace.AddEvent(evaluation.Name + " has finished")
spanEvaluationTrace.SetStatus(codes.Ok, "Finished")
r.EventSender.SendK8sEvent(apicommon.PhaseReconcileEvaluation, "Normal", evaluation, "Succeeded", "evaluation succeeded", piWrapper.GetVersion())
} else {
spanEvaluationTrace.AddEvent(evaluation.Name + " has failed")
r.emitEvaluationFailureEvents(evaluation, spanEvaluationTrace, piWrapper)
Expand Down
4 changes: 1 addition & 3 deletions operator/controllers/common/evaluationhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

//nolint:dupl
func TestEvaluationHandler(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -248,9 +249,6 @@ func TestEvaluationHandler(t *testing.T) {
wantErr: nil,
getSpanCalls: 1,
unbindSpanCalls: 1,
events: []string{
"ReconcileEvaluationSucceeded",
},
},
}

Expand Down
17 changes: 7 additions & 10 deletions operator/controllers/common/phasehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ func (r PhaseHandler) HandlePhase(ctx context.Context, ctxTrace context.Context,
if shouldAbortPhase(oldStatus) {
return &PhaseResult{Continue: false, Result: ctrl.Result{}}, nil
}
piWrapper.SetCurrentPhase(phase.ShortName)
if oldPhase != phase.ShortName {
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, apicommon.PhaseStateStarted, "has started", piWrapper.GetVersion())
piWrapper.SetCurrentPhase(phase.ShortName)
}

r.Log.Info(phase.LongName + " not finished")
spanPhaseCtx, spanPhaseTrace, err := r.SpanHandler.GetSpan(ctxTrace, tracer, reconcileObject, phase.ShortName)
if err != nil {
r.Log.Error(err, "could not get span")
Expand All @@ -49,15 +51,11 @@ func (r PhaseHandler) HandlePhase(ctx context.Context, ctxTrace context.Context,
state, err := reconcilePhase(spanPhaseCtx)
if err != nil {
spanPhaseTrace.AddEvent(phase.LongName + " could not get reconciled")
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "ReconcileErrored", "could not get reconciled", piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, apicommon.PhaseStateReconcileError, "could not get reconciled", piWrapper.GetVersion())
span.SetStatus(codes.Error, err.Error())
return &PhaseResult{Continue: false, Result: requeueResult}, err
}

if state.IsPending() {
state = apicommon.StateProgressing
}

defer func(ctx context.Context, oldStatus apicommon.KeptnState, oldPhase string, reconcileObject client.Object) {
piWrapper, _ := interfaces.NewPhaseItemWrapperFromClientObject(reconcileObject)
if oldStatus != piWrapper.GetState() || oldPhase != piWrapper.GetCurrentPhase() {
Expand All @@ -72,7 +70,6 @@ func (r PhaseHandler) HandlePhase(ctx context.Context, ctxTrace context.Context,
}

piWrapper.SetState(apicommon.StateProgressing)
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "NotFinished", "has not finished", piWrapper.GetVersion())

return &PhaseResult{Continue: false, Result: requeueResult}, nil
}
Expand All @@ -91,7 +88,7 @@ func (r PhaseHandler) handleCompletedPhase(state apicommon.KeptnState, piWrapper
if err := r.SpanHandler.UnbindSpan(reconcileObject, phase.ShortName); err != nil {
r.Log.Error(err, controllererrors.ErrCouldNotUnbindSpan, reconcileObject.GetName())
}
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "Failed", "has failed", piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, apicommon.PhaseStateFailed, "has failed", piWrapper.GetVersion())
piWrapper.DeprecateRemainingPhases(phase)
return &PhaseResult{Continue: false, Result: ctrl.Result{}}, nil
}
Expand All @@ -103,7 +100,7 @@ func (r PhaseHandler) handleCompletedPhase(state apicommon.KeptnState, piWrapper
if err := r.SpanHandler.UnbindSpan(reconcileObject, phase.ShortName); err != nil {
r.Log.Error(err, controllererrors.ErrCouldNotUnbindSpan, reconcileObject.GetName())
}
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, "Succeeded", "has succeeded", piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, apicommon.PhaseStateFinished, "has finished", piWrapper.GetVersion())
odubajDT marked this conversation as resolved.
Show resolved Hide resolved

return &PhaseResult{Continue: true, Result: ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Second}}, nil
}
9 changes: 3 additions & 6 deletions operator/controllers/common/taskhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r TaskHandler) ReconcileTasks(ctx context.Context, phaseCtx context.Contex
taskExists := false

if oldstatus != taskStatus.Status {
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, "TaskStatusChanged", fmt.Sprintf("task status changed from %s to %s", oldstatus, taskStatus.Status), piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, apicommon.PhaseStateStatusChanged, fmt.Sprintf("task status changed from %s to %s", oldstatus, taskStatus.Status), piWrapper.GetVersion())
}

// Check if task has already succeeded or failed
Expand Down Expand Up @@ -109,9 +109,7 @@ func (r TaskHandler) ReconcileTasks(ctx context.Context, phaseCtx context.Contex
for _, ns := range newStatus {
summary = apicommon.UpdateStatusSummary(ns.Status, summary)
}
if apicommon.GetOverallState(summary) != apicommon.StateSucceeded {
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "NotFinished", "has not finished", piWrapper.GetVersion())
}

return newStatus, summary, nil
}

Expand All @@ -132,10 +130,9 @@ func (r TaskHandler) CreateKeptnTask(ctx context.Context, namespace string, reco
err = r.Client.Create(ctx, &newTask)
if err != nil {
r.Log.Error(err, "could not create KeptnTask")
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, "CreateFailed", "could not create KeptnTask", piWrapper.GetVersion())
r.EventSender.SendK8sEvent(phase, "Warning", reconcileObject, apicommon.PhaseStateFailed, "could not create KeptnTask", piWrapper.GetVersion())
return "", err
}
r.EventSender.SendK8sEvent(phase, "Normal", reconcileObject, "Created", "created", piWrapper.GetVersion())

return newTask.Name, nil
}
Expand Down
6 changes: 2 additions & 4 deletions operator/controllers/lifecycle/keptnapp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ func (r *KeptnAppReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
if err != nil {
r.Log.Error(err, "could not create AppVersion")
span.SetStatus(codes.Error, err.Error())
r.EventSender.SendK8sEvent(common.PhaseCreateAppVersion, "Warning", appVersion, "AppVersionNotCreated", "Could not create KeptnAppVersion", appVersion.Spec.Version)
r.EventSender.SendK8sEvent(common.PhaseCreateAppVersion, "Warning", appVersion, common.PhaseStateFailed, "Could not create KeptnAppVersion", appVersion.Spec.Version)
return ctrl.Result{}, err
}
r.EventSender.SendK8sEvent(common.PhaseCreateAppVersion, "Normal", appVersion, "AppVersionCreated", "created KeptnAppVersion", appVersion.Spec.Version)

app.Status.CurrentVersion = app.Spec.Version
if err := r.Client.Status().Update(ctx, app); err != nil {
Expand Down Expand Up @@ -172,10 +171,9 @@ func (r *KeptnAppReconciler) handleGenerationBump(ctx context.Context, app *klcv
if app.Generation != 1 {
if err := r.deprecateAppVersions(ctx, app); err != nil {
r.Log.Error(err, "could not deprecate appVersions for appVersion %s", app.GetAppVersionName())
r.EventSender.SendK8sEvent(common.PhaseCreateAppVersion, "Warning", app, "AppVersionNotDeprecated", fmt.Sprintf("could not deprecate KeptnAppVersions for KeptnAppVersion: %s", app.GetAppVersionName()), app.Spec.Version)
r.EventSender.SendK8sEvent(common.PhaseDeprecateAppVersion, "Warning", app, common.PhaseStateFailed, fmt.Sprintf("could not deprecate outdated revisions of KeptnAppVersion: %s", app.GetAppVersionName()), app.Spec.Version)
return err
}
r.EventSender.SendK8sEvent(common.PhaseCreateAppVersion, "Normal", app, "AppVersionDeprecated", fmt.Sprintf("deprecated KeptnAppVersions for KeptnAppVersion: %s", app.GetAppVersionName()), app.Spec.Version)
}
return nil
}
Expand Down
35 changes: 18 additions & 17 deletions operator/controllers/lifecycle/keptnapp/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ func TestKeptnAppReconciler_createAppVersionWithLongName(t *testing.T) {

func TestKeptnAppReconciler_reconcile(t *testing.T) {

r, eventChannel, tracer := setupReconciler()
r, _, tracer := setupReconciler()

tests := []struct {
name string
req ctrl.Request
wantErr error
event string //check correct events are generated
name string
req ctrl.Request
wantErr error
appVersionName string
}{
{
name: "test simple create appVersion",
Expand All @@ -90,7 +90,6 @@ func TestKeptnAppReconciler_reconcile(t *testing.T) {
},
},
wantErr: nil,
event: `Normal CreateAppVersionAppVersionCreated Create AppVersion: created KeptnAppVersion / Namespace: default, Name: myapp-1.0.0-6b86b273, Version: 1.0.0`,
},
{
name: "test simple notfound should not return error nor event",
Expand Down Expand Up @@ -131,13 +130,13 @@ func TestKeptnAppReconciler_reconcile(t *testing.T) {
t.Errorf("Reconcile() error = %v, wantErr %v", err, tt.wantErr)
return
}
if tt.event != "" {
event := <-eventChannel
assert.Matches(t, event, tt.event)
if tt.appVersionName != "" {
keptnappversion := &lfcv1alpha3.KeptnAppVersion{}
err = r.Client.Get(context.TODO(), types.NamespacedName{Namespace: "default", Name: "myapp-1.0.0-6b86b273"}, keptnappversion)
require.Nil(t, err)
}

})

}

// check correct traces
Expand All @@ -152,7 +151,7 @@ func TestKeptnAppReconciler_reconcile(t *testing.T) {
}

func TestKeptnAppReconciler_deprecateAppVersions(t *testing.T) {
r, eventChannel, _ := setupReconciler()
r, _, _ := setupReconciler()

err := controllercommon.AddApp(r.Client, "myapp")
require.Nil(t, err)
Expand All @@ -166,8 +165,9 @@ func TestKeptnAppReconciler_deprecateAppVersions(t *testing.T) {

require.Nil(t, err)

event := <-eventChannel
assert.Matches(t, event, `Normal CreateAppVersionAppVersionCreated Create AppVersion: created KeptnAppVersion / Namespace: default, Name: myapp-1.0.0-6b86b273, Version: 1.0.0`)
keptnappversion := &lfcv1alpha3.KeptnAppVersion{}
err = r.Client.Get(context.TODO(), types.NamespacedName{Namespace: "default", Name: "myapp-1.0.0-6b86b273"}, keptnappversion)
require.Nil(t, err)

err = controllercommon.UpdateAppRevision(r.Client, "myapp", 2)
require.Nil(t, err)
Expand All @@ -181,11 +181,12 @@ func TestKeptnAppReconciler_deprecateAppVersions(t *testing.T) {

require.Nil(t, err)

event = <-eventChannel
assert.Matches(t, event, `Normal CreateAppVersionAppVersionCreated Create AppVersion: created KeptnAppVersion / Namespace: default, Name: myapp-1.0.0-d4735e3a, Version: 1.0.0`)
err = r.Client.Get(context.TODO(), types.NamespacedName{Namespace: "default", Name: "myapp-1.0.0-d4735e3a"}, keptnappversion)
require.Nil(t, err)

event = <-eventChannel
assert.Matches(t, event, `Normal CreateAppVersionAppVersionDeprecated Create AppVersion: deprecated KeptnAppVersions for KeptnAppVersion: myapp-1.0.0-d4735e3a / Namespace: default, Name: myapp, Version: 1.0.0`)
err = r.Client.Get(context.TODO(), types.NamespacedName{Namespace: "default", Name: "myapp-1.0.0-6b86b273"}, keptnappversion)
require.Nil(t, err)
require.Equal(t, apicommon.StateDeprecated, keptnappversion.Status.Status)
}

func setupReconciler() (*KeptnAppReconciler, chan string, *fake.ITracerMock) {
Expand Down
Loading