-
Notifications
You must be signed in to change notification settings - Fork 477
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
GitOps: Remove teams #16677
Comments
Heads up @getvictor, this feature request was brought to feature fest on 2024-02-15 and wasn't prioritized for the current design sprint. I think we'll get to it after we start dogfooding. |
Hey @getvictor, heads up, we brought this into the upcoming design sprint (4.49). |
Hey @getvictor, I pulled this change out of the user story. If I'm understanding correctly, currently we error if the When we add "GitOps: Dry run before merge" (#17687) the user will see an error in this case and add the missing team or correct a typo if the team already exists. I'm not sure we want to take this on because we don't know if the user is missing the team or made a typo. |
Estimation assumes Fleetctl does not have team handling. |
@noahtalerman If core, we can accomplish this by allowing all relevant files to be passed in at once, like:
The above is easier to implement and seems like a cleaner approach. If part of the action, then the action needs to track what has been done. This can be done by writing to a file during the previous gitops commands, then reading all teams via |
@getvictor, I think we should make it core. That way, the teams behavior is consistent w/ queries, policies, and config profiles: full replace. One benefit to doing it as part of the action is that users could tweak the behavior if they wanted to. However, they can't do this for queries, policies, and config profiles. So I think let's be consistent and make it core to |
#16677 Improvements to `fleetctl gitops` command: - Added the ability to pass multiple files, like `fleetctl gitops -f file1 -f file2`, where the first file must be the global configuration - Added the ability to remove teams that were not specified in team configs using the switch `--delete-other-teams` - When passing a global config and team config during initial configuration, the `org_settings.mdm.apple_bm_default_team` value can be set to match the team that will be created by the provided team config. After these changes are released to prod, we can update https://github.com/fleetdm/fleet-gitops to use the new switches: #18692 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
@noahtalerman There is a situation that I wanted you to be aware. We delete the teams last, after applying configs to the existing/new teams. If the user wants to reuse an enroll secret for the existing/new team, GitOps will fail. That is because the secret is still held by the team to be deleted. |
@getvictor why not delete teams first? If I'm understanding correctly, here's an example workflow in which the user will trigger a failure:
Is that right? I think that's ok if we can't avoid it. Any other items that would trigger a failure like this? Other items that must be unique across teams. |
Two reasons for deleting teams last
|
Makes sense.
GitOps best practice always does a dry run though right? @getvictor I'm onboard and trust your decision. Just trying to get a good understanding of how it works. |
@noahtalerman We should just fix dry run to catch this issue. I filed a bug: #19152 |
Syncing teams with Git, |
Goal
Context
Currently, best practice GitOps doesn't remove teams that are created in the UI.
After these changes are released to prod, we can update https://github.com/fleetdm/fleet-gitops to use the new switches: #18692
Product
Engineering
Context
QA
Risk assessment
Manual testing steps
Reference YAML configs can be seen at https://github.com/fleetdm/fleet-gitops
Test the new GitOps switches:
fleetctl gitops -f file1 -f file2
, where the first file must be the global configuration--delete-other-teams
For this part of the feature:
org_settings.mdm.apple_bm_default_team
value can be set to match the team that will be created by the provided team config.Test cases (using fleetctl gitops)
org_settings.mdm.apple_bm_default_team
and create a new team with a singlefleetctl gitops
commandapple_bm_default_team
to a non-existent team or team about to be deleted.Testing notes
Confirmation
The text was updated successfully, but these errors were encountered: