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: always rehydrate the access and secret keys #8286

Merged
merged 2 commits into from Jul 12, 2021

Conversation

leseb
Copy link
Member

@leseb leseb commented Jul 9, 2021

Description of your changes:

Prior to that the access and secret keys were left empty if the user
already existed, which led to updating the secret with empty values when
the operator restarts.

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.

Prior to that the access and secret keys were left empty if the user
already existed, which led to updating the secret with empty values when
the operator restarts.

Signed-off-by: Sébastien Han <seb@redhat.com>
@leseb leseb requested a review from thotz July 9, 2021 08:41
@mergify mergify bot added the ceph main ceph tag label Jul 9, 2021
@leseb leseb requested a review from BlaineEXE July 9, 2021 14:10
Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

Approving with some nits.

Comment on lines +38 to +39
// Somehow meta.TypeAccessor returns an empty string for the type name so using reflection instead
objType := reflect.TypeOf(obj)
Copy link
Member

Choose a reason for hiding this comment

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

If this is only in unit tests, that is to be expected, and I've had to manually fill this info in in the tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed, it was at runtime :(

pkg/operator/ceph/object/bucket/rgw-handlers.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/bucket/rgw-handlers.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/user/controller.go Outdated Show resolved Hide resolved
The Rados Gateway Admin OPS API has changed its behavior from Nautilus
to Pacific. Calling user create on an existing user wil generate
additional keys to the user on Nautilus. Where in Pacific it will report
an error with UserAlreadyExists.
So to handle both scenarios, let's first get the user, and if the user
does not exist (NoSuchUser) we then create it.

Signed-off-by: Sébastien Han <seb@redhat.com>
@leseb leseb merged commit fa14361 into rook:master Jul 12, 2021
@leseb leseb deleted the fix-object-store-user branch July 12, 2021 07:13
leseb added a commit that referenced this pull request Jul 12, 2021
ceph: always rehydrate the access and secret keys (backport #8286)
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