mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Create should be able to accept multiple resources
This commit is contained in:
@@ -112,6 +112,19 @@ func makeImageList(spec *api.PodSpec) string {
|
||||
return strings.Join(listOfImages(spec), ",")
|
||||
}
|
||||
|
||||
// OutputVersionMapper is a RESTMapper that will prefer mappings that
|
||||
// correspond to a preferred output version (if feasible)
|
||||
type OutputVersionMapper struct {
|
||||
meta.RESTMapper
|
||||
OutputVersion string
|
||||
}
|
||||
|
||||
// RESTMapping implements meta.RESTMapper by prepending the output version to the preferred version list.
|
||||
func (m OutputVersionMapper) RESTMapping(kind string, versions ...string) (*meta.RESTMapping, error) {
|
||||
preferred := append([]string{m.OutputVersion}, versions...)
|
||||
return m.RESTMapper.RESTMapping(kind, preferred...)
|
||||
}
|
||||
|
||||
// ShortcutExpander is a RESTMapper that can be used for Kubernetes
|
||||
// resources.
|
||||
type ShortcutExpander struct {
|
||||
|
Reference in New Issue
Block a user