Skip to content

Commit

Permalink
Save apimodel after upgrade (Azure#2306)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon authored and Terje Torkelsen committed Mar 15, 2018
1 parent 04c2b7a commit 43e6704
Showing 1 changed file with 21 additions and 0 deletions.
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 {
return e
}

return nil
}

0 comments on commit 43e6704

Please sign in to comment.