Documentation
¶
Index ¶
- Variables
- func GetContextFromv1alpha1Rollout(rollout *appsv1alpha1.Rollout) *validateContext
- func GetContextFromv1beta1Rollout(rollout *appsv1beta1.Rollout) *validateContext
- func IsPercentageCanaryReplicasType(replicas *intstr.IntOrString) bool
- func IsSameV1alpha1WorkloadRefGVKName(a, b *appsv1alpha1.WorkloadRef) bool
- func IsSameWorkloadRefGVKName(a, b *appsv1beta1.ObjectRef) bool
- type RolloutCreateUpdateHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HandlerMap contains admission webhook handlers HandlerMap = map[string]admission.Handler{ "validate-rollouts-kruise-io-rollout": &RolloutCreateUpdateHandler{}, } )
View Source
var ( // PartitionReplicasLimitWithTraffic represents the maximum percentage of replicas // allowed for a step of partition-style release, if traffic/matches specified. // If a step is configured with a number of replicas exceeding this percentage, the traffic strategy for that step // must not be specified. If this rule is violated, the Rollout webhook will block the creation or modification of the Rollout. // The default limit is set to 50%. // Here is why we set this limit for partition style release: // In rollback and continuous scenarios, usually we expect the Rollout to route all traffic to the stable version first. // However, if the stable version's pods are relatively few (less than 1-PartitionReplicasLimitWithTraffic), this might overload the stable version's pods. PartitionReplicasLimitWithTraffic = 50 )
Functions ¶
func GetContextFromv1alpha1Rollout ¶ added in v0.6.0
func GetContextFromv1alpha1Rollout(rollout *appsv1alpha1.Rollout) *validateContext
func GetContextFromv1beta1Rollout ¶ added in v0.6.0
func GetContextFromv1beta1Rollout(rollout *appsv1beta1.Rollout) *validateContext
func IsPercentageCanaryReplicasType ¶
func IsPercentageCanaryReplicasType(replicas *intstr.IntOrString) bool
func IsSameV1alpha1WorkloadRefGVKName ¶ added in v0.5.0
func IsSameV1alpha1WorkloadRefGVKName(a, b *appsv1alpha1.WorkloadRef) bool
func IsSameWorkloadRefGVKName ¶
func IsSameWorkloadRefGVKName(a, b *appsv1beta1.ObjectRef) bool
Types ¶
type RolloutCreateUpdateHandler ¶
type RolloutCreateUpdateHandler struct {
// To use the client, you need to do the following:
// - uncomment it
// - import sigs.k8s.io/controller-runtime/pkg/client
// - uncomment the InjectClient method at the bottom of this file.
Client client.Client
// Decoder decodes objects
Decoder *admission.Decoder
}
RolloutCreateUpdateHandler handles Rollout
func (*RolloutCreateUpdateHandler) Handle ¶
func (h *RolloutCreateUpdateHandler) Handle(ctx context.Context, req admission.Request) admission.Response
Handle handles admission requests.
func (*RolloutCreateUpdateHandler) InjectClient ¶
func (h *RolloutCreateUpdateHandler) InjectClient(c client.Client) error
InjectClient injects the client into the RolloutCreateUpdateHandler
func (*RolloutCreateUpdateHandler) InjectDecoder ¶
func (h *RolloutCreateUpdateHandler) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects the decoder into the RolloutCreateUpdateHandler
Click to show internal directories.
Click to hide internal directories.