@@ -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.
176176func (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 .Labels = newTenant .Labels
181+ tenant .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.
209213func (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 .Labels = newIdentity .Labels
218+ identity .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