"gerrit.o-ran-sc.org/r/ric-plt/appmgr/pkg/util"
)
+var kubeExec = util.KubectlExec
+var helmExec = util.HelmExec
+
type Helm struct {
initDone bool
cm *cm.CM
}
func (h *Helm) Run(args string) (out []byte, err error) {
- return util.HelmExec(args)
+ return helmExec(args)
}
// API functions
return out, err
}
- return util.HelmExec(strings.Join([]string{"init -c --skip-refresh"}, ""))
+ return helmExec(strings.Join([]string{"init -c --skip-refresh"}, ""))
}
func (h *Helm) AddRepo() (out []byte, err error) {
repoArgs := fmt.Sprintf(" %s %s ", viper.GetString("helm.repo-name"), viper.GetString("helm.repo"))
credentials := fmt.Sprintf(" --username %s --password %s", string(username), string(password))
- return util.HelmExec(strings.Join([]string{"repo add ", repoArgs, credentials}, ""))
+ return helmExec(strings.Join([]string{"repo add ", repoArgs, credentials}, ""))
}
func (h *Helm) Install(m models.XappDescriptor) (xapp models.Xapp, err error) {
appmgr.Logger.Info("Getting xapps status: %v", err.Error())
return
}
-
return h.ParseStatus(name, string(out))
}
port = 4560 // Default
ns := h.cm.GetNamespace("")
args := fmt.Sprintf(" get service -n %s service-%s-%s-rmr -o json", ns, ns, name)
- out, err := util.KubectlExec(args)
+ out, err := kubeExec(args)
if err != nil {
return fmt.Sprintf("service-%s-%s-rmr.%s", ns, name, ns), 4560
}
}
if cmOverride == true {
- args = fmt.Sprintf("%s ---set ricapp.appconfig.override=%s-appconfig", args, *x.XappName)
+ args = fmt.Sprintf("%s --set ricapp.appconfig.override=%s-appconfig", args, *x.XappName)
}
if x.OverrideFile != nil {