Skip to content
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

CASMCMS-8793: Update CFS import tool to add support for CFS sources #5548

Open
wants to merge 2 commits into
base: CASMCMS-9209-1.6
Choose a base branch
from

Conversation

mharding-hpe
Copy link
Contributor

@mharding-hpe mharding-hpe commented Nov 18, 2024

NOTE: This PR is against another PR branch, rather than the main release branch. That's because it modifies code that was changed in that other PR, so this was the simplest way to reduce merge conflict problems. Once the target PR branch merges, I'll rebase this one against the release branch. But it's ready for review as-is, because it'll be the same code changes.

CFS v3 introduced a new CFS object -- a source. The CFS export tool has already been updated to include them in the export data. This PR updates the import tool to include them in the imports, and also updated the associated documentation around CFS imports and exports.

Mostly the restore process for these is the same as for configurations, with a couple of caveats:

  1. CFS sources refer to secrets that are stored in Vault. The CFS tools make no attempts to import/export or validate this Vault data. Part of this PR is to update the documentation to make this clear. There is existing documentation on how to backup and restore Vault, and that is now referenced by the CFS import/export docs.

  2. CFS v3 originally provided no mechanism to restore a previously-created source. When creating a source in CFS v3, there was no way to specify the corresponding Vault secret. The idea is that you would pass in credentials when creating the source, and CFS would store those for you in Vault. But this doesn't help us in the import case, because our exports will never contain the credentials used to create the sources originally. The exports only contain the names of the Vault secrets that contain them. CASMCMS-9202 updated CFS v3 to allow for this kind of restore operation, where the Vault secret name was instead specified. This PR uses that new ability to do the restores. However, because this ability was only added in a particular CFS version, the import tooling has to check the CFS version before attempting those restores. So this PR contains logic to do that checking, and to inform the user in the case that the CFS version does not support source restores, but the exported data contains sources that need to be restored. In the case that the CFS version does not support restores, but the export data does not contain any sources that need to be restored (either because it has no sources at all, or because the sources it does have already exist in CFS), then the tool doesn't bug the user about it.

I have tested this on mug and verified that it works.

CSM 1.5 backport:
#5550

@mharding-hpe
Copy link
Contributor Author

/backport backport/5546-to-release/1.5

Copy link
Contributor

Backporting into branch backport/5546-to-release/1.5 was successful. New PR: #5550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant