Skip to content

Commit

Permalink
云端原生yaml资源管理 (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meteriox committed Nov 8, 2023
1 parent 3e6c502 commit 24c29e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ami/kube/kube_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type YamlAppInfo struct {

func (k *kubeImpl) ApplyYaml(app specv1.Application, cfgs map[string]specv1.Configuration) error {
if customNs, ok := app.Labels[specv1.CustomAppNsLabel]; customNs != "" && ok {
k.log.Info("user custom ns", log.Any("ns", customNs))
k.log.Info("user yaml app custom ns", log.Any("ns", customNs))
err := k.deleteYamlApp(customNs, app.Name, cfgs)
if err != nil {
return errors.Trace(err)
Expand All @@ -46,8 +46,8 @@ func (k *kubeImpl) StatsYaml() ([]specv1.AppStats, error) {
customInfo := &YamlAppInfo{}
err := k.store.Get(CustomYamlAppInfo, customInfo)
if err != nil {
k.log.Debug("no custom app info found", log.Any("err", err))
return nil, err
k.log.Debug("no yaml app info found", log.Any("err", err))
return nil, nil
}
for name, info := range customInfo.AppInfo {
custom, err := k.collectCustomStats(name, info)
Expand Down
2 changes: 1 addition & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (e *engineImpl) applyApp(ns string, info specv1.AppInfo) error {
return errors.Errorf("failed to get app name: (%s) version: (%s) with error: %s", app.Name, app.Version, err.Error())
}

if customNs, ok := app.Labels[specv1.CustomAppNsLabel]; ok && customNs != "" {
if customNs, ok := app.Labels[specv1.CustomAppNsLabel]; ok && customNs != "" && app.Type == specv1.AppTypeYaml {
appInfo, err := e.getCustomAppInfo()
if err != nil {
appInfo = &kube.YamlAppInfo{
Expand Down

0 comments on commit 24c29e1

Please sign in to comment.