// SetPodTerminationReason attempts to set a reason and message in the
// pod status, updates it in the apiserver, and returns an error if it
// encounters one.
494631
func SetPodTerminationReason(kubeClient clientset.Interface, pod *v1.Pod, nodeName string) (*v1.Pod, error) {
	if pod.Status.Reason == nodepkg.NodeUnreachablePodReason {
		return pod, nil
	}

	pod.Status.Reason = nodepkg.NodeUnreachablePodReason
	pod.Status.Message = fmt.Sprintf(nodepkg.NodeUnreachablePodMessage, nodeName, pod.Name)

	var updatedPod *v1.Pod
	var err error
	if updatedPod, err = kubeClient.CoreV1().Pods(pod.Namespace).UpdateStatus(pod); err != nil {
		return nil, err
	}
	return updatedPod, nil
}
516180
func (s *CancelStepsInfo) SetReason(v string) *CancelStepsInfo {
	s.Reason = &v
	return s
}
158053
func (s *RespondActivityTaskFailedInput) SetReason(v string) *RespondActivityTaskFailedInput {
	s.Reason = &v
	return s
}
1164399
func (s *DeleteWorkerBlockInput) SetReason(v string) *DeleteWorkerBlockInput {
	s.Reason = &v
	return s
}
761255
func getPodReadyCondition(status corev1.PodStatus) *corev1.PodCondition {
	_, condition := getPodCondition(&status, corev1.PodReady)
	return condition
}
1080346
func (c *HyperClient) SetPodLabels(podID string, override bool, labels map[string]string) error {
	_, err := c.client.SetPodLabels(
		c.ctx,
		&types.PodLabelsRequest{PodID: podID, Override: override, Labels: labels},
	)

	if err != nil {
		return err
	}

	return nil
}
424741
func (s *StopTaskInput) SetReason(v string) *StopTaskInput {
	s.Reason = &v
	return s
}
1017550
func (s *RejectCertificateTransferInput) SetRejectReason(v string) *RejectCertificateTransferInput {
	s.RejectReason = &v
	return s
}
684383
func (s *PutVoiceConnectorTerminationInput) SetTermination(v *Termination) *PutVoiceConnectorTerminationInput {
	s.Termination = v
	return s
}
531598
func (s *DeletionTaskFailureReasonType) SetReason(v string) *DeletionTaskFailureReasonType {
	s.Reason = &v
	return s
}
93155
func GeneratePodReadyCondition(spec *v1.PodSpec, conditions []v1.PodCondition, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition {
	containersReady := GenerateContainersReadyCondition(spec, containerStatuses, podPhase)
	// If the status of ContainersReady is not True, return the same status, reason and message as ContainersReady.
	if containersReady.Status != v1.ConditionTrue {
		return v1.PodCondition{
			Type:    v1.PodReady,
			Status:  containersReady.Status,
			Reason:  containersReady.Reason,
			Message: containersReady.Message,
		}
	}

	// Evaluate corresponding conditions specified in readiness gate
	// Generate message if any readiness gate is not satisfied.
	unreadyMessages := []string{}
	for _, rg := range spec.ReadinessGates {
		_, c := podutil.GetPodConditionFromList(conditions, rg.ConditionType)
		if c == nil {
			unreadyMessages = append(unreadyMessages, fmt.Sprintf("corresponding condition of pod readiness gate %q does not exist.", string(rg.ConditionType)))
		} else if c.Status != v1.ConditionTrue {
			unreadyMessages = append(unreadyMessages, fmt.Sprintf("the status of pod readiness gate %q is not \"True\", but %v", string(rg.ConditionType), c.Status))
		}
	}

	// Set "Ready" condition to "False" if any readiness gate is not ready.
	if len(unreadyMessages) != 0 {
		unreadyMessage := strings.Join(unreadyMessages, ", ")
		return v1.PodCondition{
			Type:    v1.PodReady,
			Status:  v1.ConditionFalse,
			Reason:  ReadinessGatesNotReady,
			Message: unreadyMessage,
		}
	}

	return v1.PodCondition{
		Type:   v1.PodReady,
		Status: v1.ConditionTrue,
	}
}
162754
func (s *FailureDetails) SetReason(v string) *FailureDetails {
	s.Reason = &v
	return s
}
912843
func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatusReason(v string) *DescribeStackDriftDetectionStatusOutput {
	s.DetectionStatusReason = &v
	return s
}
98542
func (s *ContainerDetail) SetReason(v string) *ContainerDetail {
	s.Reason = &v
	return s
}
177570
func (s *Stack) SetStackStatusReason(v string) *Stack {
	s.StackStatusReason = &v
	return s
}
817742
func IsPodReadyConditionTrue(status v1.PodStatus) bool {
	condition := GetPodReadyCondition(status)
	return condition != nil && condition.Status == v1.ConditionTrue
}
297484
func (s *LambdaFunctionFailedEventAttributes) SetReason(v string) *LambdaFunctionFailedEventAttributes {
	s.Reason = &v
	return s
}