mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-19 17:39:56 +00:00
Merge pull request #101034 from verb/1.22-ec-api
Switch alpha Pod ephemeralcontainers API to use Pod kind Kubernetes-commit: 972ee2d425333d0b30f340328ef6c7dc40fd2715
This commit is contained in:
commit
071918f6b2
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -476,7 +476,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/api",
|
||||
"Rev": "b64c6b5ea77c"
|
||||
"Rev": "95cee4894d89"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery",
|
||||
|
6
go.mod
6
go.mod
@ -28,8 +28,8 @@ require (
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
|
||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
|
||||
google.golang.org/protobuf v1.25.0
|
||||
k8s.io/api v0.0.0-20210518101555-b64c6b5ea77c
|
||||
k8s.io/apimachinery v0.0.0-20210518100450-f3a344a9640c
|
||||
k8s.io/api v0.0.0-20210518101556-95cee4894d89
|
||||
k8s.io/apimachinery v0.0.0-20210518100450-ba18a62c2bc2
|
||||
k8s.io/klog/v2 v2.8.0
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.1.1
|
||||
@ -37,6 +37,6 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20210518101555-b64c6b5ea77c
|
||||
k8s.io/api => k8s.io/api v0.0.0-20210518101556-95cee4894d89
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210518100450-ba18a62c2bc2
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -425,8 +425,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.0.0-20210518101555-b64c6b5ea77c h1:UKWH16VfbGANijR6vN0rRuSX6ua0JsmWw4y1y2bA0TA=
|
||||
k8s.io/api v0.0.0-20210518101555-b64c6b5ea77c/go.mod h1:XAKoutoISH8fQ++BLv5O5gKGpZHoBcQoUKE1SaFlcZc=
|
||||
k8s.io/api v0.0.0-20210518101556-95cee4894d89 h1:uQC3v+9tBtiF1mXGGdM3vN7gDW7StAJCFO4sO0USjhE=
|
||||
k8s.io/api v0.0.0-20210518101556-95cee4894d89/go.mod h1:ZFbvp5WWMe1V9auNefRgVPZzDDSzTMLlulKIDnadhQU=
|
||||
k8s.io/apimachinery v0.0.0-20210518100450-ba18a62c2bc2 h1:KvBnUwNEF2aGJHZbEJW5ck1Tq1R04dSsMPHOSQc2gYo=
|
||||
k8s.io/apimachinery v0.0.0-20210518100450-ba18a62c2bc2/go.mod h1:fBRSkoylGO2QUTae8Wb2wac6pZ83/r+tL6HFSXGbzfs=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
|
@ -189,24 +189,13 @@ func (c *FakePods) ApplyStatus(ctx context.Context, pod *applyconfigurationscore
|
||||
return obj.(*corev1.Pod), err
|
||||
}
|
||||
|
||||
// GetEphemeralContainers takes name of the pod, and returns the corresponding ephemeralContainers object, and an error if there is any.
|
||||
func (c *FakePods) GetEphemeralContainers(ctx context.Context, podName string, options v1.GetOptions) (result *corev1.EphemeralContainers, err error) {
|
||||
// UpdateEphemeralContainers 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) UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts v1.UpdateOptions) (result *corev1.Pod, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetSubresourceAction(podsResource, c.ns, "ephemeralcontainers", podName), &corev1.EphemeralContainers{})
|
||||
Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, pod), &corev1.Pod{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.EphemeralContainers), err
|
||||
}
|
||||
|
||||
// UpdateEphemeralContainers takes the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any.
|
||||
func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *corev1.EphemeralContainers, opts v1.UpdateOptions) (result *corev1.EphemeralContainers, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, ephemeralContainers), &corev1.EphemeralContainers{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.EphemeralContainers), err
|
||||
return obj.(*corev1.Pod), err
|
||||
}
|
||||
|
@ -52,8 +52,7 @@ type PodInterface interface {
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error)
|
||||
Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error)
|
||||
ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error)
|
||||
GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error)
|
||||
UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (*v1.EphemeralContainers, error)
|
||||
UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error)
|
||||
|
||||
PodExpansion
|
||||
}
|
||||
@ -258,30 +257,16 @@ func (c *pods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguratio
|
||||
return
|
||||
}
|
||||
|
||||
// GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any.
|
||||
func (c *pods) GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) {
|
||||
result = &v1.EphemeralContainers{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("pods").
|
||||
Name(podName).
|
||||
SubResource("ephemeralcontainers").
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateEphemeralContainers takes the top resource name and the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any.
|
||||
func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (result *v1.EphemeralContainers, err error) {
|
||||
result = &v1.EphemeralContainers{}
|
||||
// UpdateEphemeralContainers 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) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) {
|
||||
result = &v1.Pod{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("pods").
|
||||
Name(podName).
|
||||
SubResource("ephemeralcontainers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(ephemeralContainers).
|
||||
Body(pod).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user