Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Update apimodel after upgrade #2306

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,26 @@ func (uc *upgradeCmd) run(cmd *cobra.Command, args []string) error {
log.Fatalf("Error upgrading cluster: %s \n", err.Error())
}

apiloader := &api.Apiloader{
Translator: &i18n.Translator{
Locale: uc.locale,
},
}
b, e := apiloader.SerializeContainerService(uc.containerService, uc.apiVersion)

if e != nil {
return e
}

f := acsengine.FileSaver{
Translator: &i18n.Translator{
Locale: uc.locale,
},
}

if e = f.SaveFile(uc.deploymentDirectory, "apimodel.json", b); e != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on the method used to save the apimodel after running scale

if e = f.SaveFile(sc.deploymentDirectory, "apimodel.json", b); e != nil {

return e
}

return nil
}