mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-23 05:37:13 +00:00
api: generate client code for resize subresource
Kubernetes-commit: d9a1d861f7cec8c00a034e67a8d7d34aaebd76e8
This commit is contained in:
parent
9d76eb1606
commit
fc589c225c
@ -207,3 +207,15 @@ func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string
|
|||||||
}
|
}
|
||||||
return obj.(*v1.Pod), err
|
return obj.(*v1.Pod), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resize takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any.
|
||||||
|
func (c *FakePods) Resize(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) {
|
||||||
|
emptyResult := &v1.Pod{}
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "resize", c.ns, pod, opts), &v1.Pod{})
|
||||||
|
|
||||||
|
if obj == nil {
|
||||||
|
return emptyResult, err
|
||||||
|
}
|
||||||
|
return obj.(*v1.Pod), err
|
||||||
|
}
|
||||||
|
@ -52,6 +52,7 @@ type PodInterface interface {
|
|||||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||||
ApplyStatus(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Pod, err error)
|
ApplyStatus(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *corev1.Pod, err error)
|
||||||
UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error)
|
UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error)
|
||||||
|
Resize(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error)
|
||||||
|
|
||||||
PodExpansion
|
PodExpansion
|
||||||
}
|
}
|
||||||
@ -91,3 +92,18 @@ func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, po
|
|||||||
Into(result)
|
Into(result)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resize takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any.
|
||||||
|
func (c *pods) Resize(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (result *corev1.Pod, err error) {
|
||||||
|
result = &corev1.Pod{}
|
||||||
|
err = c.GetClient().Put().
|
||||||
|
Namespace(c.GetNamespace()).
|
||||||
|
Resource("pods").
|
||||||
|
Name(podName).
|
||||||
|
SubResource("resize").
|
||||||
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
Body(pod).
|
||||||
|
Do(ctx).
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user