This commit is contained in:
parent
4003e56271
commit
dcaafeee8b
|
|
@ -62,5 +62,11 @@ func (c *ScheduledWorkflowClient) Get(namespace string, name string) (
|
|||
"Error retrieving scheduled workflow (%v) in namespace (%v): %v", name, namespace, err)
|
||||
}
|
||||
|
||||
// If the APIVersion and Kind are not set then set them to the default values.
|
||||
if schedule.APIVersion == "" && schedule.Kind == "" {
|
||||
schedule.Kind = util.SwfKind
|
||||
schedule.APIVersion = util.ApiVersionV1
|
||||
}
|
||||
|
||||
return util.NewScheduledWorkflow(schedule), nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ const (
|
|||
SWFlegacy ScheduledWorkflowType = "legacy"
|
||||
SWFunknown ScheduledWorkflowType = "Unknown"
|
||||
|
||||
apiVersionV1 = "kubeflow.org/v1beta1"
|
||||
apiVersionV2 = "kubeflow.org/v2beta1"
|
||||
swfKind = "ScheduledWorkflow"
|
||||
ApiVersionV1 = "kubeflow.org/v1beta1"
|
||||
ApiVersionV2 = "kubeflow.org/v2beta1"
|
||||
SwfKind = "ScheduledWorkflow"
|
||||
)
|
||||
|
||||
// ScheduledWorkflow is a type to help manipulate ScheduledWorkflow objects.
|
||||
|
|
@ -160,9 +160,9 @@ func (s *ScheduledWorkflow) ToStringForStore() string {
|
|||
}
|
||||
|
||||
func (s *ScheduledWorkflow) GetVersion() ScheduledWorkflowType {
|
||||
if strings.HasPrefix(s.APIVersion, apiVersionV1) && s.Kind == swfKind {
|
||||
if strings.HasPrefix(s.APIVersion, ApiVersionV1) && s.Kind == SwfKind {
|
||||
return SWFv1
|
||||
} else if strings.HasPrefix(s.APIVersion, apiVersionV2) && s.Kind == swfKind {
|
||||
} else if strings.HasPrefix(s.APIVersion, ApiVersionV2) && s.Kind == SwfKind {
|
||||
return SWFv2
|
||||
} else if s.APIVersion == "" && s.Kind == "" {
|
||||
return SWFlegacy
|
||||
|
|
|
|||
Loading…
Reference in New Issue