// Update updates a BuildConfig using the OpenShift client.
5720
func (c ClientBuildConfigClient) Update(buildConfig *buildv1.BuildConfig) error {
	_, err := c.Client.BuildV1().BuildConfigs(buildConfig.Namespace).Update(buildConfig)
	return err
}
250605
func (c *appProjects) Update(appProject *v1alpha1.AppProject) (result *v1alpha1.AppProject, err error) {
	result = &v1alpha1.AppProject{}
	err = c.client.Put().
		Namespace(c.ns).
		Resource("appprojects").
		Name(appProject.Name).
		Body(appProject).
		Do().
		Into(result)
	return
}
523268
func (c *Cluster) Update(version uint64, spec types.Spec, flags types.UpdateFlags) error {
	return c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
		swarm, err := getSwarm(ctx, state.controlClient)
		if err != nil {
			return err
		}

		// Validate spec name.
		if spec.Annotations.Name == "" {
			spec.Annotations.Name = "default"
		} else if spec.Annotations.Name != "default" {
			return errdefs.InvalidParameter(errors.New(`swarm spec must be named "default"`))
		}

		// In update, client should provide the complete spec of the swarm, including
		// Name and Labels. If a field is specified with 0 or nil, then the default value
		// will be used to swarmkit.
		clusterSpec, err := convert.SwarmSpecToGRPC(spec)
		if err != nil {
			return errdefs.InvalidParameter(err)
		}

		_, err = state.controlClient.UpdateCluster(
			ctx,
			&swarmapi.UpdateClusterRequest{
				ClusterID: swarm.ID,
				Spec:      &clusterSpec,
				ClusterVersion: &swarmapi.Version{
					Index: version,
				},
				Rotation: swarmapi.KeyRotation{
					WorkerJoinToken:  flags.RotateWorkerToken,
					ManagerJoinToken: flags.RotateManagerToken,
					ManagerUnlockKey: flags.RotateManagerUnlockKey,
				},
			},
		)
		return err
	})
}
45256
func updateBuildConfig(c *model.CommandConfig, args []string) bool {
	c.Index = model.BUILD
	// If arguments were passed in then there must be two
	if len(args) < 2 {
		fmt.Fprintf(os.Stderr, "%s\n%s", cmdBuild.UsageLine, cmdBuild.Long)
		return false
	}

	c.Build.ImportPath = args[0]
	c.Build.TargetPath = args[1]
	if len(args) > 2 {
		c.Build.Mode = args[2]
	}
	return true
}
858084
func (c *Client) Update(namespace string, originalReader, targetReader io.Reader, force bool, recreate bool, timeout int64, shouldWait bool) error {
	return c.UpdateWithOptions(namespace, originalReader, targetReader, UpdateOptions{
		Force:      force,
		Recreate:   recreate,
		Timeout:    timeout,
		ShouldWait: shouldWait,
	})
}
737745
func (c *FakeSecurityContextConstraints) Update(securityContextConstraints *security.SecurityContextConstraints) (result *security.SecurityContextConstraints, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(securitycontextconstraintsResource, securityContextConstraints), &security.SecurityContextConstraints{})
	if obj == nil {
		return nil, err
	}
	return obj.(*security.SecurityContextConstraints), err
}
745874
func (c *SessionTrackingConfiguration) Update(config *SessionTrackingConfiguration) {
	c.mutex.Lock()
	defer c.mutex.Unlock()
	if config.PublishInterval != 0 {
		c.PublishInterval = config.PublishInterval
	}
	if config.APIKey != "" {
		c.APIKey = config.APIKey
	}
	if config.Endpoint != "" {
		c.Endpoint = config.Endpoint
	}
	if config.Version != "" {
		c.Version = config.Version
	}
	if config.ReleaseStage != "" {
		c.ReleaseStage = config.ReleaseStage
	}
	if config.Hostname != "" {
		c.Hostname = config.Hostname
	}
	if config.AppType != "" {
		c.AppType = config.AppType
	}
	if config.AppVersion != "" {
		c.AppVersion = config.AppVersion
	}
	if config.Transport != nil {
		c.Transport = config.Transport
	}
	if config.Logger != nil {
		c.Logger = config.Logger
	}
	if config.NotifyReleaseStages != nil {
		c.NotifyReleaseStages = config.NotifyReleaseStages
	}
	if config.AutoCaptureSessions != nil {
		c.AutoCaptureSessions = config.AutoCaptureSessions
	}
}
33621
func Update(i Installer) error {
	if _, pathErr := os.Stat(i.Path()); os.IsNotExist(pathErr) {
		return errors.New("plugin does not exist")
	}

	return i.Update()
}
466182
func (s *SourcesStore) Update(ctx context.Context, src chronograf.Source) error {
	if err := s.client.db.Update(func(tx *bolt.Tx) error {
		return s.update(ctx, src, tx)
	}); err != nil {
		return err
	}

	return nil
}
654143
func (s *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, _ rest.ValidateObjectFunc, _ rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
	obj, err := objInfo.UpdatedObject(ctx, nil)
	if err != nil {
		return nil, false, err
	}
	mapping, ok := obj.(*userinternal.UserIdentityMapping)
	if !ok {
		return nil, false, kerrs.NewBadRequest("invalid type")
	}
	Strategy.PrepareForUpdate(ctx, mapping, nil)
	return s.createOrUpdate(ctx, mapping, false)
}
499027
func (u *Updater) Update(ctx Context) (*Update, error) {
	options := ctx.UpdateOptions()
	update, err := u.update(ctx, options)
	report(ctx, err, update, options)
	return update, err
}
1169594
func (c ClientBuildClient) Update(namespace string, build *buildv1.Build) error {
	_, e := c.Client.BuildV1().Builds(namespace).Update(build)
	return e
}
1357720
func Update(ctx context.Context, key string, value []byte, lease bool) error {
	err := Client().Update(ctx, key, value, lease)
	Trace("Update", err, logrus.Fields{fieldKey: key, fieldValue: string(value), fieldAttachLease: lease})
	return err
}
337872
func (s *Store) Update(key interface{}, data interface{}) error {
	return s.Bolt().Update(func(tx *bolt.Tx) error {
		return s.TxUpdate(tx, key, data)
	})
}
1016057
func (s *BuildStore) Update(ctx context.Context, build chronograf.BuildInfo) error {
	if err := s.client.db.Update(func(tx *bolt.Tx) error {
		return s.update(ctx, build, tx)
	}); err != nil {
		return err
	}

	return nil
}
7139
func (c *environConfig) update(cfg *config.Config) error {
	// Validate the updates. newValidConfig does not modify the "known"
	// config attributes so it is safe to call Validate here first.
	if err := config.Validate(cfg, c.Config); err != nil {
		return errors.Trace(err)
	}

	updates, err := newValidConfig(cfg)
	if err != nil {
		return errors.Trace(err)
	}

	// Check that no immutable fields have changed.
	attrs := updates.UnknownAttrs()
	for _, field := range configImmutableFields {
		if attrs[field] != c.attrs[field] {
			return errors.Errorf("%s: cannot change from %v to %v", field, c.attrs[field], attrs[field])
		}
	}

	// Apply the updates.
	c.Config = cfg
	c.attrs = cfg.UnknownAttrs()
	return nil
}
605035
func (c *Cluster) Update() error {
	c.mu.Lock()
	defer c.mu.Unlock()
	if err := c.cacheHosts(); err != nil {
		return microerror.Mask(err)
	}

	err := c.reindex()
	if err != nil {
		return microerror.Mask(err)
	}
	return nil
}