Skip to content

Commit

Permalink
Fix admission test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed Mar 29, 2019
1 parent 786e9d3 commit dcfb24b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ volcano.sh/volcano/pkg/controllers/job/cache
volcano.sh/volcano/pkg/controllers/job/helpers
volcano.sh/volcano/pkg/controllers/job/plugins
volcano.sh/volcano/pkg/controllers/job/plugins/env
volcano.sh/volcano/pkg/controllers/job/plugins/interface
volcano.sh/volcano/pkg/controllers/job/plugins/ssh
volcano.sh/volcano/pkg/controllers/job/state
volcano.sh/volcano/pkg/scheduler/actions/allocate
Expand Down
2 changes: 0 additions & 2 deletions installer/chart/volcano/templates/admission-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
"helm.sh/hook": pre-install,pre-upgrade,post-delete
webhooks:
- clientConfig:
caBundle: ""
service:
name: {{ .Release.Name }}-admission-service
namespace: {{ .Release.Namespace }}
Expand All @@ -33,7 +32,6 @@ metadata:
"helm.sh/hook": pre-install,pre-upgrade,post-delete
webhooks:
- clientConfig:
caBundle: ""
service:
name: {{ .Release.Name }}-admission-service
namespace: {{ .Release.Namespace }}
Expand Down
2 changes: 1 addition & 1 deletion installer/chart/volcano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ basic:
scheduler_image_name: "volcano-scheduler"
admission_image_name: "volcano-admission"
admission_secret_name: "volcano-admission-secret"
image_pull_secret: ""
image_pull_secret: ""
8 changes: 4 additions & 4 deletions pkg/admission/admit_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ func validateJobSpec(jobSpec v1alpha1.JobSpec, reviewResponse *v1beta1.Admission
msg = msg + fmt.Sprintf(" duplicated job event policies: %s;", duplicateInfo)
}

if msg != "" {
reviewResponse.Allowed = false
}

//invalid job plugins
if len(jobSpec.Plugins) != 0 {
for name := range jobSpec.Plugins {
Expand All @@ -119,6 +115,10 @@ func validateJobSpec(jobSpec v1alpha1.JobSpec, reviewResponse *v1beta1.Admission
}
}

if msg != "" {
reviewResponse.Allowed = false
}

return msg
}

Expand Down

0 comments on commit dcfb24b

Please sign in to comment.