Skip to content

Commit 96ab256

Browse files
committed
fix: tenant in-band override
1 parent 906c7ec commit 96ab256

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/liqoctl/authenticate/cluster.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ func (c *Cluster) GenerateTenant(
175175
// EnsureTenant apply the tenant resource on the provider cluster and wait for the status to be updated.
176176
func (c *Cluster) EnsureTenant(ctx context.Context, tenant *authv1beta1.Tenant) error {
177177
s := c.local.Printer.StartSpinner("Applying tenant on provider cluster")
178+
newTenant := tenant.DeepCopy()
178179
if _, err := resource.CreateOrUpdate(ctx, c.local.CRClient, tenant, func() error {
180+
tenant.Spec = newTenant.Spec
179181
return nil
180182
}); err != nil {
181183
s.Fail(fmt.Sprintf("Unable to apply tenant on provider cluster: %v", output.PrettyErr(err)))
@@ -208,7 +210,9 @@ func (c *Cluster) GenerateIdentity(ctx context.Context, remoteTenantNamespace st
208210
// EnsureIdentity apply the identity resource on the consumer cluster and wait for the status to be updated.
209211
func (c *Cluster) EnsureIdentity(ctx context.Context, identity *authv1beta1.Identity) error {
210212
s := c.local.Printer.StartSpinner("Applying identity on consumer cluster")
213+
newIdentity := identity.DeepCopy()
211214
if _, err := resource.CreateOrUpdate(ctx, c.local.CRClient, identity, func() error {
215+
identity.Spec = newIdentity.Spec
212216
return nil
213217
}); err != nil {
214218
s.Fail(fmt.Sprintf("Unable to apply identity on consumer cluster: %v", output.PrettyErr(err)))

0 commit comments

Comments
 (0)