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

ceph: fix vault kv secret engine auto-detection #8618

Merged
merged 1 commit into from Aug 31, 2021

Conversation

leseb
Copy link
Member

@leseb leseb commented Aug 30, 2021

Description of your changes:

Passing struct by value essentially gives you a copy, so when modified
within a function, the scope is then reduced to that function. Using
pointers solves that you mutate the struct as many times as you want from
anywhere.
As a result, the auto-detection of the Vault KV backend was working
correctly.
Also, added a ton of unit tests for Vault.

Signed-off-by: Sébastien Han seb@redhat.com

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@mergify mergify bot added the ceph main ceph tag label Aug 30, 2021
@leseb leseb requested a review from travisn August 30, 2021 16:22
Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

The commit message says it "was working correctly". Did you mean it is now working correctly?

pkg/daemon/ceph/osd/kms/vault_api.go Outdated Show resolved Hide resolved
@leseb
Copy link
Member Author

leseb commented Aug 31, 2021

The commit message says it "was working correctly". Did you mean it is now working correctly?

"Was not", sorry for the typo

Passing struct by value essentially gives you a copy, so when modified
within a function, the scope is then reduced to that function. Using
pointers solves that you mutate the struct as many times as you want from
anywhere.
As a result, the auto-detection of the Vault KV backend was not working
correctly.
Also, added a ton of unit tests for Vault.

Signed-off-by: Sébastien Han <seb@redhat.com>
@leseb leseb merged commit 00c111b into rook:master Aug 31, 2021
@leseb leseb deleted the use-pointers branch August 31, 2021 14:13
mergify bot added a commit that referenced this pull request Aug 31, 2021
ceph: fix vault kv secret engine auto-detection (backport #8618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ceph main ceph tag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants