You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: manager_common_updater.go
    path of file: ./repos/pipeline/src/cluster
    
    the code of the file until where you have to start completion: // Copyright Â© 2018 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distrib
    
func (c *commonUpdater) Update(ctx context.Context) error {
	if !c.clusterPropertiesChanged {
		return nil
	}

	// obtain desired set of labels for each node pool
	nodePoolLabelsList, err := buildNodePoolsLabelList(c.cluster, c.request)
	if err != nil {
		return err
	}
	labelsMap, err := GetDesiredLabelsForCluster(ctx, c.cluster, nodePoolLabelsList)
	if err != nil {
		return err
	}

	secretID := brn.New(c.cluster.GetOrganizationId(), brn.SecretResourceType, c.cluster.GetConfigSecretId()).String()
	dclient, err := c.clientFactory.FromSecret(ctx, secretID)
	if err != nil {
		return err
	}

	manager := npls.NewManager(dclient, global.Config.Cluster.Labels.Namespace)

	if err = manager.Sync(ctx, labelsMap); err != nil {
		return err
	}

	if updater, ok := c.cluster.(interface {
		UpdatePKECluster(context.Context, *cluster.UpdateClusterRequest, uint, client.Client, string, bool) error
	}); ok {
		err = updater.UpdatePKECluster(ctx, c.request, c.userID, c.workflowClient, c.externalBaseURL, c.externalBaseURLInsecure)
	} else {
		err = c.cluster.UpdateCluster(c.request, c.userID)
	}
	if err != nil {
		return err
	}

	// on certain clouds we still need to add node pool name labels
	if err := labelNodesWithNodePoolName(ctx, c.cluster); err != nil {
		return errors.WrapIf(err, "adding labels to nodes failed")
	}
	return nil
}