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 Oct 14, 2024
1 parent 07c57b1 commit 5752147
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions services/provider/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
"encoding/json"
"encoding/pem"
"fmt"
"k8s.io/utils/ptr"
"math"
"net"
"slices"
"strconv"
"strings"
"time"

"k8s.io/utils/ptr"

"github.com/blang/semver/v4"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
quotav1 "github.com/openshift/api/quota/v1"
Expand Down Expand Up @@ -438,12 +439,15 @@ func (s *OCSProviderServer) getExternalResources(ctx context.Context, consumerRe
})

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
7 changes: 5 additions & 2 deletions services/provider/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ var noobaaSpec = &nbv1.NooBaaSpec{
JoinSecret: &v1.SecretReference{
Name: "noobaa-remote-join-secret",
},
CleanupPolicy: nbv1.CleanupPolicySpec{
AllowNoobaaDeletion: true,
},
}

var joinSecret = map[string]string{
Expand Down Expand Up @@ -100,8 +103,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 5752147

Please sign in to comment.