mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-17 06:46:40 +00:00
* De-share the Handler struct in core API An upcoming PR adds a handler that only applies on one of these paths. Having fields that don't work seems bad. This never should have been shared. Lifecycle hooks are like a "write" while probes are more like a "read". HTTPGet and TCPSocket don't really make sense as lifecycle hooks (but I can't take that back). When we add gRPC, it is EXPLICITLY a health check (defined by gRPC) not an arbitrary RPC - so a probe makes sense but a hook does not. In the future I can also see adding lifecycle hooks that don't make sense as probes. E.g. 'sleep' is a common lifecycle request. The only option is `exec`, which requires having a sleep binary in your image. * Run update scripts Kubernetes-commit: 11a25bfeb6fd6e8e5c42e316b17cea15a702041c
49 lines
2.0 KiB
Go
49 lines
2.0 KiB
Go
/*
|
|
Copyright The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
|
|
|
package v1
|
|
|
|
// LifecycleApplyConfiguration represents an declarative configuration of the Lifecycle type for use
|
|
// with apply.
|
|
type LifecycleApplyConfiguration struct {
|
|
PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"`
|
|
PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"`
|
|
}
|
|
|
|
// LifecycleApplyConfiguration constructs an declarative configuration of the Lifecycle type for use with
|
|
// apply.
|
|
func Lifecycle() *LifecycleApplyConfiguration {
|
|
return &LifecycleApplyConfiguration{}
|
|
}
|
|
|
|
// WithPostStart sets the PostStart field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the PostStart field is set to the value of the last call.
|
|
func (b *LifecycleApplyConfiguration) WithPostStart(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration {
|
|
b.PostStart = value
|
|
return b
|
|
}
|
|
|
|
// WithPreStop sets the PreStop field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the PreStop field is set to the value of the last call.
|
|
func (b *LifecycleApplyConfiguration) WithPreStop(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration {
|
|
b.PreStop = value
|
|
return b
|
|
}
|