Documentation ¶
Index ¶
- Constants
- func CopyDeploymentFields(from, to *appsv1.Deployment) bool
- func CopyJobFields(from, to *batchv1.Job) bool
- func CopyServiceFields(from, to *corev1.Service) bool
- func GeneratePlxDeployment(name string, namespace string, labels map[string]string, port int, ...) (*appsv1.Deployment, error)
- func GeneratePlxJob(name string, namespace string, labels map[string]string, backoffLimit *int32, ...) *batchv1.Job
- func GeneratePlxService(name string, namespace string, labels map[string]string, port int) *corev1.Service
- func GetLastPod(pods corev1.PodList) (*corev1.Pod, error)
- func GetPodPort(podSpec corev1.PodSpec, defaultPort int) int
- func GetReplicas(dreplicas int, plxDeployment corev1alpha1.PolyaxonDeploymentSpec) int32
- func IgnoreNotFound(err error) error
- func IsPlxDeploymentRunning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
- func IsPlxDeploymentWarning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
- func IsPlxJobFailed(jc batchv1.JobCondition) bool
- func IsPlxJobSucceded(jc batchv1.JobCondition) bool
Constants ¶
const ( // DefaultBackoffLimit for PlxJobs DefaultBackoffLimit = 1 // DefaultRestartPolicy for PlxJobs DefaultRestartPolicy = "Never" )
Variables ¶
This section is empty.
Functions ¶
func CopyDeploymentFields ¶
func CopyDeploymentFields(from, to *appsv1.Deployment) bool
CopyDeploymentFields copies the owned fields from one Deployment to another Returns true if the fields copied from don't match to.
func CopyJobFields ¶
CopyJobFields copies the owned fields from one Job to another Returns true if the fields copied from don't match to.
func CopyServiceFields ¶
CopyServiceFields copies the owned fields from one Service to another
func GeneratePlxDeployment ¶
func GeneratePlxDeployment( name string, namespace string, labels map[string]string, port int, replicas int32, podSpec corev1.PodSpec, ) (*appsv1.Deployment, error)
GeneratePlxDeployment returns a deployment given a PolyaxonDeploymentSpec
func GeneratePlxJob ¶
func GeneratePlxJob( name string, namespace string, labels map[string]string, backoffLimit *int32, activeDeadlineSeconds *int64, ttlSecondsAfterFinished *int32, podSpec corev1.PodSpec, ) *batchv1.Job
GeneratePlxJob returns a a batch job given a PolyaxonBaseJobSpec
func GeneratePlxService ¶
func GeneratePlxService(name string, namespace string, labels map[string]string, port int) *corev1.Service
GeneratePlxService returns a service given info from a PolyaxonDeploymentSpec
func GetLastPod ¶
GetLastPod returns the last pod bassed on the creation time of the items
func GetPodPort ¶
GetPodPort returns the pod's port from the container definition
func GetReplicas ¶
func GetReplicas(dreplicas int, plxDeployment corev1alpha1.PolyaxonDeploymentSpec) int32
GetReplicas Get replicas for PolyaxonDeploymentSpec
func IgnoreNotFound ¶
IgnoreNotFound allows to ignore (not requeue) NotFound errors, since we'll get a reconciliation request once the object exists, and requeuing in the meantime won't help, and we can get them on deleted requests.
func IsPlxDeploymentRunning ¶
func IsPlxDeploymentRunning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
IsPlxDeploymentRunning return true if deploymeny is running
func IsPlxDeploymentWarning ¶
func IsPlxDeploymentWarning(ds appsv1.DeploymentStatus, dc appsv1.DeploymentCondition) bool
IsPlxDeploymentWarning return true if deploymeny is in warning state
func IsPlxJobFailed ¶
func IsPlxJobFailed(jc batchv1.JobCondition) bool
IsPlxJobFailed return true if job is running
func IsPlxJobSucceded ¶
func IsPlxJobSucceded(jc batchv1.JobCondition) bool
IsPlxJobSucceded return true if job is running
Types ¶
This section is empty.