Skip to content

Added support to join external noobaa system from hosted clusters#1389

Closed
ezio-auditore wants to merge 1 commit intonoobaa:masterfrom
ezio-auditore:nb-remote
Closed

Added support to join external noobaa system from hosted clusters#1389
ezio-auditore wants to merge 1 commit intonoobaa:masterfrom
ezio-auditore:nb-remote

Conversation

@ezio-auditore
Copy link

@ezio-auditore ezio-auditore commented Jul 9, 2024

Explain the changes

Part of : RHSTOR-5187

  1. Edited Join Secret check to differentiate between remote endpoints behaviour and remote noobaa operator via a annonation remote-client-noobaa:true
  2. Create a auth_token secret for noobaa accounts having an annotation remote-operator
  3. Delete the auth_token secret when noobaa account is deleted

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  1. This change works on a the provider-client model of OCS.
  2. When a new client cluster joins with ocs provider cluster, it creates a Noobaa account CR in the provider cluster
  3. An auth token is created for each noobaa remote operator account and is supplied to the client cluster
  4. ocs-client operator creates a join secret containing auth_token and mgmt_addr obtained from the provider noobaa cluster
  5. ocs-client opertor creates a Noobaa CR with a secret referring to the join secret created.
  6. Noobaa operator then reconciles the client Noobaa CR
  7. New OBCs can be created in the client cluster
    Ref: Added support for ocs provider server to fetch noobaa client resources red-hat-storage/ocs-operator#2680
    Add support for noobaa on client clusters red-hat-storage/ocs-client-operator#176
  • Doc added/updated
  • Tests added

return fmt.Errorf("failed to delete account %q. got error: %v", r.NooBaaAccount.Name, err)
}
} else {
if _, exists := r.NooBaaAccount.GetAnnotations()["remote-operator"]; exists {
Copy link
Member

Choose a reason for hiding this comment

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

check if Annotations map exist, since it's optional

Copy link
Member

@dannyzaken dannyzaken Jul 23, 2024

Choose a reason for hiding this comment

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

see GetAnnotationValue that Amit has added here. can be useful

Copy link
Author

Choose a reason for hiding this comment

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

Updated

@ezio-auditore ezio-auditore force-pushed the nb-remote branch 2 times, most recently from c2c2003 to cf25445 Compare July 24, 2024 10:31
@ezio-auditore ezio-auditore requested a review from dannyzaken July 24, 2024 10:33
@ezio-auditore ezio-auditore force-pushed the nb-remote branch 3 times, most recently from ff41302 to d00aea8 Compare July 24, 2024 10:59
Signed-off-by: Kaustav Majumder <kaustav.majumder@ibm.com>

// IsAnnotationPresent checks if an annotation is
// is present in the Annotations map
func IsAnnotationPresent(annotations map[string]string, name string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Please use the GetAnnotationValue function implemented in Amit's PR here once it's merged

return fmt.Errorf("failed to delete account %q. got error: %v", r.NooBaaAccount.Name, err)
}
} else {
if exists := util.IsAnnotationPresent(r.NooBaa.GetAnnotations(), "remote-operator"); exists {
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to check for a specific value, and not just the existance of the annotation

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.

2 participants