Skip to content

Commit

Permalink
fix create namespace flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh committed Oct 24, 2023
1 parent a2e803f commit fcf0ffa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/namespace/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ func (s *Service) Create(ctx context.Context, ns *Namespace) error {
return err
}

labels, err := pluginService.SyncRuntimeConfig(ctx, encryptedNamespace.ID, ns.URN, ns.Labels, ns.Provider)
encryptedNamespace.Provider = *prov

labels, err := pluginService.SyncRuntimeConfig(ctx, encryptedNamespace.ID, encryptedNamespace.URN, encryptedNamespace.Labels, encryptedNamespace.Provider)
if err != nil {
if err := s.repository.Rollback(ctx, err); err != nil {
return err
Expand Down Expand Up @@ -153,7 +155,6 @@ func (s *Service) Update(ctx context.Context, ns *Namespace) error {

// urn is immutable
ns.URN = existingNS.URN
ns.Provider = existingNS.Provider

encryptedNamespace, err := s.encrypt(ns)
if err != nil {
Expand Down Expand Up @@ -182,7 +183,9 @@ func (s *Service) Update(ctx context.Context, ns *Namespace) error {
return err
}

labels, err := pluginService.SyncRuntimeConfig(ctx, encryptedNamespace.ID, ns.URN, ns.Labels, ns.Provider)
encryptedNamespace.Provider = ns.Provider

labels, err := pluginService.SyncRuntimeConfig(ctx, encryptedNamespace.ID, encryptedNamespace.URN, encryptedNamespace.Labels, encryptedNamespace.Provider)
if err != nil {
if err := s.repository.Rollback(ctx, err); err != nil {
return err
Expand Down

0 comments on commit fcf0ffa

Please sign in to comment.