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

feat(operator): introduce validating webhook for KeptnConfig #1100

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
add test for reconciler loop
Signed-off-by: Giovanni Liva <giovanni.liva@dynatrace.com>
  • Loading branch information
thisthat committed Mar 24, 2023
commit 55301d2382391a309e23c3fdf32a31d44d65f82b
15 changes: 15 additions & 0 deletions operator/controllers/options/keptnconfig_controller_test.go
Original file line number Diff line number Diff line change
@@ -97,6 +97,21 @@ func TestKeptnConfigReconciler_Reconcile(t *testing.T) {
want: ctrl.Result{Requeue: true, RequeueAfter: 10 * time.Second},
wantErr: true,
},
{
name: "continue if request in a different ns",
args: args{
ctx: context.TODO(),
req: ctrl.Request{
NamespacedName: types.NamespacedName{
Namespace: "defenetly-not-keptn-lifecycle-toolkit-system",
Name: "empty-config",
},
},
},
lastAppliedConfig: &optionsv1alpha1.KeptnConfigSpec{},
want: ctrl.Result{},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {