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

Support user-provided NSFSAccountConfig when creating OBCs #1342

Merged
merged 26 commits into from
May 15, 2024

Conversation

Neon-White
Copy link
Contributor

@Neon-White Neon-White commented Apr 12, 2024

Explain the changes

  • Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
  • Add CLI support for passing an NSFS configuration
  • Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
  • Add NSFS account config validation
  • Add distinguished_name support
  • Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
  • Fix bug that wouldn't allow setting UID/GID to 0

All the changes are needed to support a flow where the user creates a new OBC on top of an NSFS namespacestore, and would like to use the OBC's credentials to interact with the bucket

Note: path is already supported

Issues: Fixed #xxx / Gap #xxx

Fixes #958

Testing Instructions:

  1. Create an NSFS namespacestore
  2. Create a bucketclass that utilizes the NS from the previous step
  3. Create an OBC with NSFS account config that utilizes the bucketclass from the previous step
  4. Use the credentials provided after the OBC's creation to write to it
  5. Access the filesystem, verify the object was written successfully
  • Doc added/updated
  • Tests added

@Neon-White Neon-White marked this pull request as ready for review April 12, 2024 14:40
pkg/validations/common_bucket_validations.go Show resolved Hide resolved
pkg/validations/common_bucket_validations.go Show resolved Hide resolved
pkg/validations/common_bucket_validations.go Show resolved Hide resolved
pkg/obc/obc.go Outdated Show resolved Hide resolved
doc/obc-provisioner.md Outdated Show resolved Hide resolved
@Neon-White Neon-White requested a review from romayalon May 6, 2024 22:57
@Neon-White Neon-White force-pushed the pass-nsfs-cfg-in-obc-creation branch from 62f8200 to 2f36728 Compare May 8, 2024 09:43
@Neon-White Neon-White force-pushed the pass-nsfs-cfg-in-obc-creation branch from de1dea6 to f18c606 Compare May 8, 2024 15:19
…nJSON` function

- Add CLI support for passing an NSFS configuration
- Pass NsfsAccountConfig to `CreateAccountAPI` when creating a new OBC
- Add NSFS account config validation

Signed-off-by: Ben <[email protected]>
- Cater to linter

Signed-off-by: Ben <[email protected]>
- Add operator support for distinguished_name

Signed-off-by: Ben <[email protected]>
- Always default to NSFS-only account creation when creating NSFS OBCs
- Recapitalize `nsfsAccountConfig` to adhere to style

Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
- Force all NSFS OBCs to be NSFS-only, and to not accept any value for `new_buckets_path`

Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
- Change UID and GID in `AccountNsfsConfig` to be pointers to allow us to pass 0-values to the core
- Revamp validations
- Add CLI tests

Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
@Neon-White Neon-White force-pushed the pass-nsfs-cfg-in-obc-creation branch from c13eeb0 to a6bfdbe Compare May 13, 2024 06:46
@Neon-White Neon-White requested a review from romayalon May 13, 2024 06:46
- Use correct controller-gen output
- Improve OBC docs
- Change CLI `distinguished-name` check to be consistent with other `distinguished-name` checks
- Add `CreateAccountAPI` clarifications for posterity
- Uncomment tests
- Validate case where YAMLs are supplied with an NSFS config but without UID/GID/DN

Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
- Add bucketclass check

Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
Copy link
Contributor

@romayalon romayalon left a comment

Choose a reason for hiding this comment

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

approved :)
please don't forget to squash the commits before merge :)

@Neon-White Neon-White merged commit fa6f6e4 into noobaa:master May 15, 2024
14 checks passed
@Neon-White Neon-White deleted the pass-nsfs-cfg-in-obc-creation branch May 15, 2024 16:57
liranmauda pushed a commit to liranmauda/noobaa-operator that referenced this pull request Sep 9, 2024
Support user-provided NSFSAccountConfig when creating OBCs
Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
Add CLI support for passing an NSFS configuration
Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
Add NSFS account config validation
Add distinguished_name support
Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
Fix bug that wouldn't allow setting UID/GID to 0
Signed-off-by: Ben <[email protected]>

(cherry picked from commit fa6f6e4)
liranmauda pushed a commit to liranmauda/noobaa-operator that referenced this pull request Sep 9, 2024
Support user-provided NSFSAccountConfig when creating OBCs
Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
Add CLI support for passing an NSFS configuration
Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
Add NSFS account config validation
Add distinguished_name support
Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
Fix bug that wouldn't allow setting UID/GID to 0
Signed-off-by: Ben <[email protected]>

(cherry picked from commit fa6f6e4)
Signed-off-by: liranmauda <[email protected]>
liranmauda pushed a commit to liranmauda/noobaa-operator that referenced this pull request Sep 11, 2024
Support user-provided NSFSAccountConfig when creating OBCs
Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
Add CLI support for passing an NSFS configuration
Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
Add NSFS account config validation
Add distinguished_name support
Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
Fix bug that wouldn't allow setting UID/GID to 0
Signed-off-by: Ben <[email protected]>

(cherry picked from commit fa6f6e4)
liranmauda pushed a commit to liranmauda/noobaa-operator that referenced this pull request Sep 11, 2024
Support user-provided NSFSAccountConfig when creating OBCs
Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
Add CLI support for passing an NSFS configuration
Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
Add NSFS account config validation
Add distinguished_name support
Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
Fix bug that wouldn't allow setting UID/GID to 0
Signed-off-by: Ben <[email protected]>

(cherry picked from commit fa6f6e4)
Signed-off-by: liranmauda <[email protected]>
liranmauda pushed a commit to liranmauda/noobaa-operator that referenced this pull request Sep 11, 2024
Support user-provided NSFSAccountConfig when creating OBCs
Refactor LoadBucketReplicationJSON to a generic LoadConfigurationJSON function
Add CLI support for passing an NSFS configuration
Pass NsfsAccountConfig to CreateAccountAPI when creating a new OBC
Add NSFS account config validation
Add distinguished_name support
Convert NsfsAccountConfig's GID and UID properties to be pointers to support a 0-value without omitempty getting rid of them
Fix bug that wouldn't allow setting UID/GID to 0
Signed-off-by: Ben <[email protected]>

(cherry picked from commit fa6f6e4)
Signed-off-by: liranmauda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing nsfs_account_config when using noobaa obc to provision nsfs bucket+account
2 participants