mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Add a subbindings resource as /pods/{name}/binding
Allows POST to create a binding as a child. Also refactors internal and v1beta3 Binding to be more generic (so that other resources can support Bindings).
This commit is contained in:
@@ -1324,6 +1324,24 @@ func init() {
|
||||
|
||||
return nil
|
||||
},
|
||||
func(in *Binding, out *newer.Binding, s conversion.Scope) error {
|
||||
if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Target = newer.ObjectReference{
|
||||
Name: in.Host,
|
||||
}
|
||||
out.Name = in.PodID
|
||||
return nil
|
||||
},
|
||||
func(in *newer.Binding, out *Binding, s conversion.Scope) error {
|
||||
if err := s.DefaultConvert(in, out, conversion.IgnoreMissingFields); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Host = in.Target.Name
|
||||
out.PodID = in.Name
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
|
||||
Reference in New Issue
Block a user