From 0c30afd308232fb9d1fffbaf1268ed44b6cbf505 Mon Sep 17 00:00:00 2001 From: William Baker Date: Thu, 13 Jan 2022 11:38:01 -0800 Subject: [PATCH] fix: updating a check does not require an owner id (#23034) --- checks/service.go | 2 +- notification/check/check.go | 6 ------ notification/check/check_test.go | 13 ------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/checks/service.go b/checks/service.go index 72b0bbdd1f..5277f91144 100644 --- a/checks/service.go +++ b/checks/service.go @@ -500,7 +500,7 @@ func (s *Service) updateCheck(ctx context.Context, tx kv.Tx, id platform.ID, chk } } - // ID and OrganizationID can not be updated + // ID, OrganizationID, and OwnerID can not be updated. chk.SetID(current.GetID()) chk.SetOrgID(current.GetOrgID()) chk.SetOwnerID(current.GetOwnerID()) diff --git a/notification/check/check.go b/notification/check/check.go index b00a95eaf2..6275385553 100644 --- a/notification/check/check.go +++ b/notification/check/check.go @@ -52,12 +52,6 @@ func (b Base) Valid(lang fluxlang.FluxLanguageService) error { Msg: "Check Name can't be empty", } } - if !b.OwnerID.Valid() { - return &errors.Error{ - Code: errors.EInvalid, - Msg: "Check OwnerID is invalid", - } - } if !b.OrgID.Valid() { return &errors.Error{ Code: errors.EInvalid, diff --git a/notification/check/check_test.go b/notification/check/check_test.go index c2c62a27c9..22a7dd1306 100644 --- a/notification/check/check_test.go +++ b/notification/check/check_test.go @@ -65,19 +65,6 @@ func TestValidCheck(t *testing.T) { Msg: "Check Name can't be empty", }, }, - { - name: "invalid owner id", - src: &check.Threshold{ - Base: check.Base{ - ID: influxTesting.MustIDBase16(id1), - Name: "name1", - }, - }, - err: &errors.Error{ - Code: errors.EInvalid, - Msg: "Check OwnerID is invalid", - }, - }, { name: "invalid org id", src: &check.Threshold{