fix: cmd is null (#1941)

Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com>
This commit is contained in:
张启航 2024-06-13 18:18:00 +08:00 committed by GitHub
parent 27c1ff858c
commit 66528aef26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -283,10 +283,10 @@ func TenantServiceVersion(as *v1.AppService, dbmanager db.Manager) error {
func getMainContainer(as *v1.AppService, version *dbmodel.VersionInfo, dv *volume.Define, envs []corev1.EnvVar, envVarSecrets []*corev1.Secret, dbmanager db.Manager) (*corev1.Container, error) {
cmd, err := createCMD(as, dbmanager)
var containerCMD []string
containerCMD = []string{cmd}
if cmd == "" {
containerCMD = nil
}
containerCMD = []string{cmd}
if err != nil {
return nil, fmt.Errorf("craete service account name failure: %v", err)
}