Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make mutating and validating admission controllers consistent #63

Closed
hzxuzhonghu opened this issue Apr 3, 2019 · 3 comments · Fixed by #76
Closed

make mutating and validating admission controllers consistent #63

hzxuzhonghu opened this issue Apr 3, 2019 · 3 comments · Fixed by #76

Comments

@hzxuzhonghu
Copy link
Collaborator

func mutateSpec(tasks []v1alpha1.TaskSpec, basePath string) (patch []patchOperation) {
	for index := range tasks {
		// add default task name
		taskName := tasks[index].Name
		if len(taskName) == 0 {
			tasks[index].Name = v1alpha1.DefaultTaskSpec
		}
	}
	patch = append(patch, patchOperation{
		Op:    "replace",
		Path:  basePath,
		Value: tasks,
	})

	return patch
}

If user not specify the task names of a job, default will be used in mutating stage, but the validating admission controller will reject the Job creation because of duplicate task names.

@TommyLike
Copy link
Contributor

Task name can be indexed when mutating.

@hzxuzhonghu
Copy link
Collaborator Author

Not the same thing, for jobs with multi tasks without name specified, they all set default, so the validation will fail it for the reason Duplicate task names

@TommyLike
Copy link
Contributor

I mean we can index the default task name in mutate webhook

@k82cn k82cn closed this as completed in #76 Apr 9, 2019
wangyuqing4 pushed a commit to wangyuqing4/volcano-1 that referenced this issue Apr 30, 2019
[Issue volcano-sh#63] sync code from github / 190422

## related pr


* Add UT cases for Preempt Action | kubernetes-retired/kube-batch#751
>!! need fix bug on allocate/preempt UT
>errors about enqueue


* support extended resource for kube-batch | kubernetes-retired/kube-batch#795
>modity Convert2K8sResource in resources_info.go


* Fix verify | kubernetes-retired/kube-batch#792
>modify manually


* Remove reclaim and preempt in deployment | kubernetes-retired/kube-batch#772
>add enqueue in kube-conf-ci.conf


* Add CheckNodeDiskPressure,CheckNodePIDPressure,CheckNodeMemoryPressur… | kubernetes-retired/kube-batch#800
>!! need fix bug on reclaim UT
>errors about enqueue


* Add UT Cases for Reclaim Action | kubernetes-retired/kube-batch#801

* Prevent memory leak | kubernetes-retired/kube-batch#809

* Migrate duplicated code in nodeorder and predicate plugin | kubernetes-retired/kube-batch#816


## not applied pr

* restore kube-batch | https://github.com/kubernetes-sigs/kube-batch/pull/791/files

* Add Volcano Installation Tutorial Link | https://github.com/kubernetes-sigs/kube-batch/pull/796/files

* Add document for MPI example | https://github.com/kubernetes-sigs/kube-batch/pull/793/files

* Update tutorial.md | https://github.com/kubernetes-sigs/kube-batch/pull/808/files

* Add kubemark support | https://github.com/kubernetes-sigs/kube-batch/pull/810/files

Issues info:
Issue ID: 63
Title: sync code from github / 190422
Issue url: CBU-PaaS/Community/volcano/volcano#63


See merge request CBU-PaaS/Community/volcano/volcano!106
wangyuqing4 pushed a commit to wangyuqing4/volcano-1 that referenced this issue Apr 30, 2019
[Issue volcano-sh#63]fix action UT

as add new action enqueue, allocate/preempt/reclaim UT go failed, fix~

Issues info:
Issue ID: 63
Title: sync code from github / 190422
Issue url: CBU-PaaS/Community/volcano/volcano#63


See merge request CBU-PaaS/Community/volcano/volcano!108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants