Skip to content

Commit f282a36

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/liqoctl/authenticate/cluster.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ 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.ObjectMeta.Labels = newTenant.Labels
181+
tenant.ObjectMeta.Annotations = newTenant.Annotations
182+
tenant.Spec = newTenant.Spec
179183
return nil
180184
}); err != nil {
181185
s.Fail(fmt.Sprintf("Unable to apply tenant on provider cluster: %v", output.PrettyErr(err)))
@@ -208,7 +212,11 @@ func (c *Cluster) GenerateIdentity(ctx context.Context, remoteTenantNamespace st
208212
// EnsureIdentity apply the identity resource on the consumer cluster and wait for the status to be updated.
209213
func (c *Cluster) EnsureIdentity(ctx context.Context, identity *authv1beta1.Identity) error {
210214
s := c.local.Printer.StartSpinner("Applying identity on consumer cluster")
215+
newIdentity := identity.DeepCopy()
211216
if _, err := resource.CreateOrUpdate(ctx, c.local.CRClient, identity, func() error {
217+
identity.ObjectMeta.Labels = newIdentity.Labels
218+
identity.ObjectMeta.Annotations = newIdentity.Annotations
219+
identity.Spec = newIdentity.Spec
212220
return nil
213221
}); err != nil {
214222
s.Fail(fmt.Sprintf("Unable to apply identity on consumer cluster: %v", output.PrettyErr(err)))

0 commit comments

Comments
 (0)