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

Add RepositorySetParametersCommand #2429

Merged
merged 11 commits into from
Nov 1, 2023
Merged

Conversation

KastenMike
Copy link
Contributor

@KastenMike KastenMike commented Oct 24, 2023

It's a command missing from command/repository.go. Added an initial start with the retention settings.
Also added related params to the create repository https://kopia.io/docs/reference/command-line/common/repository-create-azure/

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=Locked --retention-period=72h0m0s
putblob mode: Locked and retention 72h0m0s...
putblob mode: Locked and retention 72h0m0s...

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=Locked --retention-period=54h0m0s
putblob mode: Locked and retention 54h0m0s...
putblob mode: Locked and retention 54h0m0s...

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=COMPLIANCE --retention-period=54h0m0s
ERROR error updating repository parameters: error setting parameters: unable to write blobcfg blob: PutBlob() failed for "kopia.blobcfg": blob retention mode is not valid for Azure: unsupported put-blob option

@infraq infraq added this to In Progress in Kanister Oct 24, 2023
@@ -34,6 +34,9 @@ type RepositoryCommandArgs struct {
Username string
RepoPathPrefix string
ReadOnly bool
// Only for CreateCommand
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if someone provides this flag with non create command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fields are not used in RepositoryConnectCommand. The same way PITFlag is used in Connect but not in Create

@viveksinghggits
Copy link
Contributor

viveksinghggits commented Oct 27, 2023

@KastenMike can you please share how things look with new subcommand and any test plan. It would be easier to approve the PR.

@KastenMike
Copy link
Contributor Author

KastenMike commented Oct 27, 2023

@KastenMike can you please share how things look with new subcommand and any test plan. It would be easier to approve the PR.

What do you mean? There are unit tests in the PR

The changes are based on
https://kopia.io/docs/reference/command-line/common/repository-set-parameters/
https://kopia.io/docs/reference/command-line/common/repository-create-s3/

@KastenMike
Copy link
Contributor Author

@KastenMike can you please share how things look with new subcommand and any test plan. It would be easier to approve the PR.

e.g.

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=Locked --retention-period=72h0m0s
putblob mode: Locked and retention 72h0m0s...
putblob mode: Locked and retention 72h0m0s...

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=Locked --retention-period=54h0m0s
putblob mode: Locked and retention 54h0m0s...
putblob mode: Locked and retention 54h0m0s...

$HOME/bin/kopia --log-level=error --config-file=/tmp/kopia-repository.config --log-dir=/tmp/kopia-log --password=myPass repository set-parameters --retention-mode=COMPLIANCE --retention-period=54h0m0s
ERROR error updating repository parameters: error setting parameters: unable to write blobcfg blob: PutBlob() failed for "kopia.blobcfg": blob retention mode is not valid for Azure: unsupported put-blob option

KastenMike and others added 2 commits October 30, 2023 22:03
Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com>
Kanister automation moved this from In Progress to Reviewer approved Oct 30, 2023
@mergify mergify bot merged commit 832319e into master Nov 1, 2023
14 checks passed
Kanister automation moved this from Reviewer approved to Done Nov 1, 2023
@mergify mergify bot deleted the add-RepositorySetParametersCommand branch November 1, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants