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

targets: offline-update: Check if dest dir already has data #300

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

detsch
Copy link
Member

@detsch detsch commented Oct 6, 2023

This commit prevents the execution of "targets offlile-update" using a destination directory that already contains update data (i.e., "ostree_repo" or "apps" subdirectories). There is no check for the tuf subdirectory, since the metadata in that subdir is updated by default, and there is no conflict.
The content of the destination directory can be cleaned up automatically if the new --force option is used.

Copy link
Member

@vkhoroz vkhoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mike-sul @doanac do you want to add something?

subcommands/targets/offline-update.go Outdated Show resolved Hide resolved
subcommands/targets/offline-update.go Show resolved Hide resolved
@mike-sul
Copy link
Contributor

mike-sul commented Oct 6, 2023

LGTM, however the --force option name sounds a bit confusing indeed.

@detsch
Copy link
Member Author

detsch commented Oct 9, 2023

Updated changes replacing "--force" logic with "--allow-multiple-targets"

Copy link
Member

@vkhoroz vkhoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Only a couple of nits for error message.

subcommands/targets/offline-update.go Outdated Show resolved Hide resolved
subcommands/targets/offline-update.go Outdated Show resolved Hide resolved
This commit prevents the execution of "targets offlile-update" using a
destination directory that already contains update data (i.e.,
"ostree_repo" or "apps" subdirectories). There is no check for the tuf
subdirectory, since the metadata in that subdir is updated by default,
and there is no conflict.
It is possible to override the default behavior by using a new
--allow-multiple-targets option.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
Copy link
Member

@vkhoroz vkhoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vkhoroz vkhoroz merged commit f7a44be into foundriesio:main Oct 10, 2023
7 checks passed
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.

4 participants