From 8c35595ec015b660b40840700a90fcc71294c724 Mon Sep 17 00:00:00 2001 From: CecileRobertMichon Date: Fri, 16 Feb 2018 17:33:38 -0800 Subject: [PATCH] Save apimodel after upgrade --- cmd/upgrade.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 39d1dee4c4..b693e1b5f2 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -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 }