Fix v1.Handler not exists in k8s-api 0.23
Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
This commit is contained in:
parent
191320b5e0
commit
c7d9592de5
2
Makefile
2
Makefile
|
@ -27,7 +27,7 @@ TMP_DIR=$$(mktemp -d) ;\
|
||||||
cd $$TMP_DIR ;\
|
cd $$TMP_DIR ;\
|
||||||
go mod init tmp ;\
|
go mod init tmp ;\
|
||||||
echo "Downloading $(2)" ;\
|
echo "Downloading $(2)" ;\
|
||||||
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
|
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
|
||||||
rm -rf $$TMP_DIR ;\
|
rm -rf $$TMP_DIR ;\
|
||||||
mv $(PROJECT_DIR)/bin/$(3) $(1);\
|
mv $(PROJECT_DIR)/bin/$(3) $(1);\
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !ignore_autogenerated
|
||||||
// +build !ignore_autogenerated
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -63,7 +63,7 @@ type ContainerRecreateRequestContainer struct {
|
||||||
// PreStop is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
|
// PreStop is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
|
||||||
// Populated by the system.
|
// Populated by the system.
|
||||||
// Read-only.
|
// Read-only.
|
||||||
PreStop *v1.Handler `json:"preStop,omitempty"`
|
PreStop *ProbeHandler `json:"preStop,omitempty"`
|
||||||
// Ports is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
|
// Ports is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
|
||||||
// Populated by the system.
|
// Populated by the system.
|
||||||
// Read-only.
|
// Read-only.
|
||||||
|
@ -74,6 +74,23 @@ type ContainerRecreateRequestContainer struct {
|
||||||
StatusContext *ContainerRecreateRequestContainerContext `json:"statusContext,omitempty"`
|
StatusContext *ContainerRecreateRequestContainerContext `json:"statusContext,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProbeHandler defines a specific action that should be taken
|
||||||
|
// TODO(FillZpp): improve the definition when openkruise/kruise updates to k8s 1.23
|
||||||
|
type ProbeHandler struct {
|
||||||
|
// One and only one of the following should be specified.
|
||||||
|
// Exec specifies the action to take.
|
||||||
|
// +optional
|
||||||
|
Exec *v1.ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"`
|
||||||
|
// HTTPGet specifies the http request to perform.
|
||||||
|
// +optional
|
||||||
|
HTTPGet *v1.HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"`
|
||||||
|
// TCPSocket specifies an action involving a TCP port.
|
||||||
|
// TCP hooks not yet supported
|
||||||
|
// TODO: implement a realistic TCP lifecycle hook
|
||||||
|
// +optional
|
||||||
|
TCPSocket *v1.TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"`
|
||||||
|
}
|
||||||
|
|
||||||
// ContainerRecreateRequestContainerContext contains context status of the container that need to recreate.
|
// ContainerRecreateRequestContainerContext contains context status of the container that need to recreate.
|
||||||
type ContainerRecreateRequestContainerContext struct {
|
type ContainerRecreateRequestContainerContext struct {
|
||||||
// Container's ID in the format 'docker://<container_id>'.
|
// Container's ID in the format 'docker://<container_id>'.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !ignore_autogenerated
|
||||||
// +build !ignore_autogenerated
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -606,7 +607,7 @@ func (in *ContainerRecreateRequestContainer) DeepCopyInto(out *ContainerRecreate
|
||||||
*out = *in
|
*out = *in
|
||||||
if in.PreStop != nil {
|
if in.PreStop != nil {
|
||||||
in, out := &in.PreStop, &out.PreStop
|
in, out := &in.PreStop, &out.PreStop
|
||||||
*out = new(v1.Handler)
|
*out = new(ProbeHandler)
|
||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
if in.Ports != nil {
|
if in.Ports != nil {
|
||||||
|
@ -1622,6 +1623,36 @@ func (in *NodeImageStatus) DeepCopy() *NodeImageStatus {
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ProbeHandler) DeepCopyInto(out *ProbeHandler) {
|
||||||
|
*out = *in
|
||||||
|
if in.Exec != nil {
|
||||||
|
in, out := &in.Exec, &out.Exec
|
||||||
|
*out = new(v1.ExecAction)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.HTTPGet != nil {
|
||||||
|
in, out := &in.HTTPGet, &out.HTTPGet
|
||||||
|
*out = new(v1.HTTPGetAction)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.TCPSocket != nil {
|
||||||
|
in, out := &in.TCPSocket, &out.TCPSocket
|
||||||
|
*out = new(v1.TCPSocketAction)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeHandler.
|
||||||
|
func (in *ProbeHandler) DeepCopy() *ProbeHandler {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ProbeHandler)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *PullPolicy) DeepCopyInto(out *PullPolicy) {
|
func (in *PullPolicy) DeepCopyInto(out *PullPolicy) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !ignore_autogenerated
|
||||||
// +build !ignore_autogenerated
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !ignore_autogenerated
|
||||||
// +build !ignore_autogenerated
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue