Skip to content

Commit

Permalink
Allow remote noobaa deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Kaustav Majumder <[email protected]>
  • Loading branch information
Kaustav Majumder committed Jan 8, 2025
1 parent e675057 commit fcd92f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions services/provider/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,20 @@ func (s *OCSProviderServer) getExternalResources(ctx context.Context, consumerRe
Kind: "Secret",
Data: mustMarshal(map[string]string{
"auth_token": string(authToken),
"mgmt_addr": noobaaMgmtAddress,
"mgmt_addr": fmt.Sprintf("https://%s:443", noobaaMgmtAddress),
}),
})

extR = append(extR, &pb.ExternalResource{
Name: "noobaa-remote",
Name: "noobaa",
Kind: "Noobaa",
Data: mustMarshal(&nbv1.NooBaaSpec{
JoinSecret: &v1.SecretReference{
Name: "noobaa-remote-join-secret",
},
CleanupPolicy: nbv1.CleanupPolicySpec{
AllowNoobaaDeletion: true,
},
}),
})
return extR, nil
Expand Down
9 changes: 6 additions & 3 deletions services/provider/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ var noobaaSpec = &nbv1.NooBaaSpec{
JoinSecret: &v1.SecretReference{
Name: "noobaa-remote-join-secret",
},
CleanupPolicy: nbv1.CleanupPolicySpec{
AllowNoobaaDeletion: true,
},
}

var joinSecret = map[string]string{
"auth_token": "authToken",
"mgmt_addr": "noobaaMgmtAddress",
"mgmt_addr": "https://noobaaMgmtAddress:443",
}

var mockExtR = map[string]*externalResource{
Expand Down Expand Up @@ -105,8 +108,8 @@ var mockExtR = map[string]*externalResource{
Kind: "Secret",
Data: joinSecret,
},
"noobaa-remote": {
Name: "noobaa-remote",
"noobaa": {
Name: "noobaa",
Kind: "Noobaa",
Data: noobaaSpec,
},
Expand Down

0 comments on commit fcd92f1

Please sign in to comment.