Skip to content

Commit b79eb70

Browse files
guangbochenCraig Jellick
authored andcommitted
Add valuesYaml to the catalog upgrade action
Problem: Cannot update valuesYaml field for catalog app in upgrade Solution: Add valuesYaml filed to the catalog upgrade action. Issues: rancher#18111 Related PRs: rancher/types#723
1 parent 032da9c commit b79eb70

File tree

1 file changed

+6
-0
lines changed
  • pkg/api/customization/app

1 file changed

+6
-0
lines changed

pkg/api/customization/app/app.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (w Wrapper) ActionHandler(actionName string, action *types.Action, apiConte
115115
answers := actionInput["answers"]
116116
forceUpgrade := actionInput["forceUpgrade"]
117117
files := actionInput["files"]
118+
valuesYaml := actionInput["valuesYaml"]
118119
_, namespace := ref.Parse(app.ProjectID)
119120
obj, err := w.AppGetter.Apps(namespace).Get(app.Name, metav1.GetOptions{})
120121
if err != nil {
@@ -148,10 +149,14 @@ func (w Wrapper) ActionHandler(actionName string, action *types.Action, apiConte
148149
obj.Spec.ExternalID = "" // ignore externalID
149150
}
150151
}
152+
if valuesYaml != nil {
153+
obj.Spec.ValuesYaml = convert.ToString(valuesYaml)
154+
}
151155

152156
if _, err := w.AppGetter.Apps(namespace).Update(obj); err != nil {
153157
return err
154158
}
159+
apiContext.WriteResponse(http.StatusNoContent, map[string]interface{}{})
155160
return nil
156161
case "rollback":
157162
forceUpgrade := actionInput["forceUpgrade"]
@@ -183,6 +188,7 @@ func (w Wrapper) ActionHandler(actionName string, action *types.Action, apiConte
183188
if _, err := w.AppGetter.Apps(namespace).Update(obj); err != nil {
184189
return err
185190
}
191+
apiContext.WriteResponse(http.StatusNoContent, map[string]interface{}{})
186192
return nil
187193
}
188194
return nil

0 commit comments

Comments
 (0)