Merge pull request #672 from fanyangyang/updatejob

remove job debug env
This commit is contained in:
barnettZQG 2020-02-14 08:57:01 +08:00 committed by GitHub
commit e3470bda10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,7 +272,6 @@ func (s *slugBuild) runBuildJob(re *Request) error {
corev1.EnvVar{Name: "SERVICE_ID", Value: re.ServiceID}, corev1.EnvVar{Name: "SERVICE_ID", Value: re.ServiceID},
corev1.EnvVar{Name: "TENANT_ID", Value: re.TenantID}, corev1.EnvVar{Name: "TENANT_ID", Value: re.TenantID},
corev1.EnvVar{Name: "LANGUAGE", Value: re.Lang.String()}, corev1.EnvVar{Name: "LANGUAGE", Value: re.Lang.String()},
corev1.EnvVar{Name: "DEBUG", Value: "true"},
} }
for k, v := range re.BuildEnvs { for k, v := range re.BuildEnvs {
envs = append(envs, corev1.EnvVar{Name: k, Value: v}) envs = append(envs, corev1.EnvVar{Name: k, Value: v})
@ -318,7 +317,7 @@ func (s *slugBuild) runBuildJob(re *Request) error {
logrus.Debugf("slug subpath is : %s", slugSubPath) logrus.Debugf("slug subpath is : %s", slugSubPath)
appSubPath := strings.TrimPrefix(re.SourceDir, "/cache/") appSubPath := strings.TrimPrefix(re.SourceDir, "/cache/")
logrus.Debugf("app subpath is : %s", appSubPath) logrus.Debugf("app subpath is : %s", appSubPath)
cacheSubPath := strings.TrimPrefix((re.CacheDir), "/cache/") cacheSubPath := strings.TrimPrefix(re.CacheDir, "/cache/")
container.VolumeMounts = []corev1.VolumeMount{ container.VolumeMounts = []corev1.VolumeMount{
corev1.VolumeMount{ corev1.VolumeMount{
Name: "app", Name: "app",
@ -470,7 +469,7 @@ func getJobPodLogs(ctx context.Context, podChan chan struct{}, clientset kuberne
func delete(clientset kubernetes.Interface, namespace, job string) { func delete(clientset kubernetes.Interface, namespace, job string) {
logrus.Debugf("start delete job: %s", job) logrus.Debugf("start delete job: %s", job)
listOptions := metav1.ListOptions{LabelSelector:fmt.Sprintf("job-name=%s", job)} listOptions := metav1.ListOptions{LabelSelector: fmt.Sprintf("job-name=%s", job)}
if err := clientset.CoreV1().Pods(namespace).DeleteCollection(&metav1.DeleteOptions{}, listOptions); err != nil { if err := clientset.CoreV1().Pods(namespace).DeleteCollection(&metav1.DeleteOptions{}, listOptions); err != nil {
logrus.Errorf("delete job pod failed: %s", err.Error()) logrus.Errorf("delete job pod failed: %s", err.Error())