fix: updating a check does not require an owner id (#23034)

pull/23064/head
William Baker 2022-01-13 11:38:01 -08:00 committed by GitHub
parent b02c89edf6
commit 0c30afd308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 20 deletions

View File

@ -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())

View File

@ -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,

View File

@ -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{