diff --git a/controllers/rest_controller.go b/controllers/rest_controller.go index adc4774..2f7054b 100644 --- a/controllers/rest_controller.go +++ b/controllers/rest_controller.go @@ -132,16 +132,7 @@ func (r *RESTReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. return ctrl.Result{}, err } - // refresh object to avoid getting error: the object has been modified; please apply your changes to the latest version and try again - if err := r.ControllerClient.Get(ctx, req.NamespacedName, rest); err != nil { - if kerrors.IsNotFound(err) { - log.Error(err, "rest not found") - return reconcile.Result{}, nil - } - log.Error(err, "failed to get rest") - incRESTFailed(name) - return reconcile.Result{}, err - } + return ctrl.Result{}, nil } err = tm.Update(ctx, rest) diff --git a/examples/rest.yml b/examples/rest.yml index 02216f4..47d5d85 100644 --- a/examples/rest.yml +++ b/examples/rest.yml @@ -16,7 +16,7 @@ spec: "matchers": [ { "name": "alertname", - "value": "ExcessivePodCPURatioS", + "value": "ExcessivePodCPURatio", "isRegex": false, "isEqual": true } diff --git a/k8s/rest_manager.go b/k8s/rest_manager.go index c534dde..83d3e9a 100644 --- a/k8s/rest_manager.go +++ b/k8s/rest_manager.go @@ -46,10 +46,6 @@ func (r *RESTManager) Update(ctx context.Context, rest *templatev1.REST) error { return nil } - if rest.Status == nil { - rest.Status = map[string]string{} - } - url := rest.Spec.Update.URL method := rest.Spec.Update.Method body := rest.Spec.Update.Body @@ -82,10 +78,6 @@ func (r *RESTManager) Update(ctx context.Context, rest *templatev1.REST) error { } func (r *RESTManager) Delete(ctx context.Context, rest *templatev1.REST) error { - if rest.Status == nil { - rest.Status = map[string]string{} - } - url := rest.Spec.Remove.URL method := rest.Spec.Remove.Method body := rest.Spec.Remove.Body diff --git a/test/e2e.go b/test/e2e.go index 61b00f5..afbb754 100644 --- a/test/e2e.go +++ b/test/e2e.go @@ -794,6 +794,7 @@ metadata: spec: backup: bucket: e2e-postgres-backups + restic: false cpu: "0.5" memory: 6Gi parameters: