mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Use patch when recording commands in kubectl set image
This commit is contained in:
		@@ -212,9 +212,9 @@ func (o *ImageOptions) Run() error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		// record this change (for rollout history)
 | 
							// record this change (for rollout history)
 | 
				
			||||||
		if o.Record || cmdutil.ContainsChangeCause(info) {
 | 
							if o.Record || cmdutil.ContainsChangeCause(info) {
 | 
				
			||||||
			if err := cmdutil.RecordChangeCause(obj, o.ChangeCause); err == nil {
 | 
								if patch, err := cmdutil.ChangeResourcePatch(info, o.ChangeCause); err == nil {
 | 
				
			||||||
				if obj, err = resource.NewHelper(info.Client, info.Mapping).Replace(info.Namespace, info.Name, false, obj); err != nil {
 | 
									if obj, err = resource.NewHelper(info.Client, info.Mapping).Patch(info.Namespace, info.Name, api.StrategicMergePatchType, patch); err != nil {
 | 
				
			||||||
					allErrs = append(allErrs, fmt.Errorf("changes to %s/%s can't be recorded: %v\n", info.Mapping.Resource, info.Name, err))
 | 
										fmt.Fprintf(o.Err, "WARNING: changes to %s/%s can't be recorded: %v\n", info.Mapping.Resource, info.Name, err)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user