Skip to content

Commit

Permalink
update make generate and fix comment issues
Browse files Browse the repository at this point in the history
Signed-off-by: lowang_bh <[email protected]>
  • Loading branch information
lowang-bh committed Jul 4, 2023
1 parent c60a947 commit 123ed4a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 65 deletions.
58 changes: 0 additions & 58 deletions pkg/apis/kubeflow/v2beta1/common_types.go

This file was deleted.

1 change: 1 addition & 0 deletions pkg/apis/kubeflow/v2beta1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
)

// merge from common.v1
// reference https://github.com/kubeflow/common/blob/master/pkg/apis/common/v1/constants.go
const (

// ReplicaIndexLabel represents the label key for the replica-index, e.g. 0, 1, 2.. etc
Expand Down
14 changes: 7 additions & 7 deletions pkg/apis/kubeflow/v2beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions pkg/apis/kubeflow/v2beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,45 @@ const (
// The training has failed its execution.
JobFailed JobConditionType = "Failed"
)

// Following is merge from common.v1
// reference https://github.com/kubeflow/common/blob/master/pkg/apis/common/v1/types.go

// +k8s:openapi-gen=true
// +k8s:deepcopy-gen=true
// ReplicaSpec is a description of the replica
type ReplicaSpec struct {
// Replicas is the desired number of replicas of the given template.
// If unspecified, defaults to 1.
Replicas *int32 `json:"replicas,omitempty"`

// Template is the object that describes the pod that
// will be created for this replica. RestartPolicy in PodTemplateSpec
// will be overide by RestartPolicy in ReplicaSpec
Template v1.PodTemplateSpec `json:"template,omitempty"`

// Restart policy for all replicas within the job.
// One of Always, OnFailure, Never and ExitCode.
// Default to Never.
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"`
}

// +k8s:openapi-gen=true
// RestartPolicy describes how the replicas should be restarted.
// Only one of the following restart policies may be specified.
// If none of the following policies is specified, the default one
// is RestartPolicyAlways.
type RestartPolicy string

const (
RestartPolicyAlways RestartPolicy = "Always"
RestartPolicyOnFailure RestartPolicy = "OnFailure"
RestartPolicyNever RestartPolicy = "Never"

// RestartPolicyExitCode policy means that user should add exit code by themselves,
// The job operator will check these exit codes to
// determine the behavior when an error occurs:
// - 1-127: permanent error, do not restart.
// - 128-255: retryable error, will restart the pod.
RestartPolicyExitCode RestartPolicy = "ExitCode"
)

0 comments on commit 123ed4a

Please sign in to comment.