diff --git a/changes/22198-defaults b/changes/22198-defaults index a8db9479f518..ec243e9a48e4 100644 --- a/changes/22198-defaults +++ b/changes/22198-defaults @@ -1,2 +1,2 @@ -- Fixes a bug where removing a VPP or ABM token from a GitOps YAML file would leave the tema +- Fixes a bug where removing a VPP or ABM token from a GitOps YAML file would leave the team assignments unchanged. \ No newline at end of file diff --git a/server/service/appconfig.go b/server/service/appconfig.go index a2deca2b3235..22998d24d601 100644 --- a/server/service/appconfig.go +++ b/server/service/appconfig.go @@ -575,9 +575,7 @@ func (svc *Service) ModifyAppConfig(ctx context.Context, p []byte, applyOpts fle } // Reset teams for VPP tokens that exist in Fleet but aren't present in the config being passed - for k := range tokensInCfg { - delete(tokensInCfg, k) - } + clear(tokensInCfg) for _, t := range newAppConfig.MDM.VolumePurchasingProgram.Value { tokensInCfg[t.Location] = struct{}{}