// UpdateCluster implements the UpdateCluster method of simple.Clientset for a VFS-backed state store
19531
func (c *VFSClientset) UpdateCluster(cluster *kops.Cluster, status *kops.ClusterStatus) (*kops.Cluster, error) {
	return c.clusters().Update(cluster, status)
}
682597
func (s *UpdateServicePrimaryTaskSetInput) SetCluster(v string) *UpdateServicePrimaryTaskSetInput {
	s.Cluster = &v
	return s
}
495237
func (s *EnableSnapshotCopyOutput) SetCluster(v *Cluster) *EnableSnapshotCopyOutput {
	s.Cluster = v
	return s
}
747768
func NewCluster() *Cluster {
	return &Cluster{
		stores:  make(map[uint64]*Store),
		regions: make(map[uint64]*Region),
	}
}
726013
func (s *CreateDBClusterOutput) SetDBCluster(v *DBCluster) *CreateDBClusterOutput {
	s.DBCluster = v
	return s
}
324457
func (s *ListTasksInput) SetCluster(v string) *ListTasksInput {
	s.Cluster = &v
	return s
}
600830
func (s *CreateCacheClusterOutput) SetCacheCluster(v *CacheCluster) *CreateCacheClusterOutput {
	s.CacheCluster = v
	return s
}
377228
func (r *Runtime) UpdateContainer(c *Container, res *rspec.LinuxResources) error {
	impl, err := r.RuntimeImpl(c)
	if err != nil {
		return err
	}

	return impl.UpdateContainer(c, res)
}
569980
func (s *FailoverDBClusterOutput) SetDBCluster(v *DBCluster) *FailoverDBClusterOutput {
	s.DBCluster = v
	return s
}
1004448
func (s *DeleteAttributesInput) SetCluster(v string) *DeleteAttributesInput {
	s.Cluster = &v
	return s
}
1367472
func (s *DestinationBackup) SetSourceCluster(v string) *DestinationBackup {
	s.SourceCluster = &v
	return s
}
465826
func RunSetCluster(f *util.Factory, cmd *cobra.Command, out io.Writer, options *SetClusterOptions) error {
	if !featureflag.SpecOverrideFlag.Enabled() {
		return fmt.Errorf("set cluster command is current feature gated; set `export KOPS_FEATURE_FLAGS=SpecOverrideFlag`")
	}

	if options.ClusterName == "" {
		return field.Required(field.NewPath("ClusterName"), "Cluster name is required")
	}

	clientset, err := f.Clientset()
	if err != nil {
		return err
	}

	cluster, err := clientset.GetCluster(options.ClusterName)
	if err != nil {
		return err
	}

	instanceGroups, err := ReadAllInstanceGroups(clientset, cluster)
	if err != nil {
		return err
	}

	if err := SetClusterFields(options.Fields, cluster, instanceGroups); err != nil {
		return err
	}

	if err := UpdateCluster(clientset, cluster, instanceGroups); err != nil {
		return err
	}

	return nil
}
856473
func (s *ModifyClusterIamRolesOutput) SetCluster(v *Cluster) *ModifyClusterIamRolesOutput {
	s.Cluster = v
	return s
}
1098180
func (s *DescribeTasksInput) SetCluster(v string) *DescribeTasksInput {
	s.Cluster = &v
	return s
}
1083010
func (s *ModifyClusterOutput) SetCluster(v *Cluster) *ModifyClusterOutput {
	s.Cluster = v
	return s
}
481843
func UpdateCluster(clientset simple.Clientset, cluster *kops.Cluster, instanceGroups []*kops.InstanceGroup) error {
	err := cloudup.PerformAssignments(cluster)
	if err != nil {
		return fmt.Errorf("error populating configuration: %v", err)
	}

	assetBuilder := assets.NewAssetBuilder(cluster, "")
	fullCluster, err := cloudup.PopulateClusterSpec(clientset, cluster, assetBuilder)
	if err != nil {
		return err
	}

	err = validation.DeepValidate(fullCluster, instanceGroups, true)
	if err != nil {
		return err
	}

	// Retrieve the current status of the cluster.  This will eventually be part of the cluster object.
	statusDiscovery := &CloudDiscoveryStatusStore{}
	status, err := statusDiscovery.FindClusterStatus(cluster)
	if err != nil {
		return err
	}

	// Note we perform as much validation as we can, before writing a bad config
	_, err = clientset.UpdateCluster(cluster, status)
	if err != nil {
		return err
	}

	return nil
}
735105
func (s *ListServicesInput) SetCluster(v string) *ListServicesInput {
	s.Cluster = &v
	return s
}