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 command unset #1475

Merged
merged 3 commits into from
Jun 26, 2024
Merged

add command unset #1475

merged 3 commits into from
Jun 26, 2024

Conversation

duthils
Copy link
Contributor

@duthils duthils commented Mar 29, 2024

Add an unset command to remove a key or item from the file.

Fixes #1305.

I'm not familiar with Go or Rust, so I mainly adapted what was already present in the set command.

Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I've only had a few minutes so I only looked at the cmd/sops/main.go changes so far, I'll take a closer look at everything later.

cmd/sops/main.go Outdated Show resolved Hide resolved
cmd/sops/main.go Outdated Show resolved Hide resolved
cmd/sops/main.go Outdated Show resolved Hide resolved
@duthils duthils force-pushed the unset-command branch 2 times, most recently from 213e477 to 6743394 Compare March 30, 2024 15:57
@duthils
Copy link
Contributor Author

duthils commented Mar 30, 2024

The test failure was due to using the same file test_unset.json for both JSON and YAML tests. I amended the commit to fix this issue.

sops.go Outdated Show resolved Hide resolved
sops.go Outdated Show resolved Hide resolved
sops.go Outdated Show resolved Hide resolved
sops.go Show resolved Hide resolved
@HarshSheth1128
Copy link

@felixfontein Any update on this? Would love this functionality.

Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good from my side!

@HarshSheth1128
Copy link

@duthils Good to merge? I'm planning on using this functionality shortly. Thanks for the change!

@duthils
Copy link
Contributor Author

duthils commented Jun 25, 2024

@HarshSheth1128 Yes, good to merge, I have rebased the branch to avoid conflicts upon merge.

Signed-off-by: Sebastien Duthil <duthils@duthils.net>
Signed-off-by: Sebastien Duthil <duthils@duthils.net>
Signed-off-by: Sebastien Duthil <duthils@duthils.net>
@felixfontein felixfontein merged commit efa1463 into getsops:main Jun 26, 2024
10 checks passed
@felixfontein
Copy link
Contributor

@duthils thanks for your contribution!

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.

Remove key:value line from encrypted sops file by using sops --set command
3 participants