Skip to content

Commit

Permalink
Add TrialSource in TrialTemplate
Browse files Browse the repository at this point in the history
Remove GoTemplate from Experiment API
  • Loading branch information
andreyvelich committed Jun 4, 2020
1 parent b1eb0e9 commit 59ea302
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions pkg/apis/controller/experiments/v1beta1/experiment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,31 @@ type FeasibleSpace struct {
Step string `json:"step,omitempty"`
}

// TrialTemplate describes structure of Trial template
type TrialTemplate struct {
// Retain indicates that Trial resources must be not cleanup
Retain bool `json:"retain,omitempty"`

GoTemplate *GoTemplate `json:"goTemplate,omitempty"`
// Source for Trial template (unstructured structure or config map)
TrialSource `json:",inline"`

// List of parameres that are used in Trial template
TrialParameters []TrialParameterSpec `json:"trialParameters,omitempty"`
}

// TrialSource represent the source for Trial template
// Only one source can be specified
type TrialSource struct {

// Trial spec contains Trial template in unstructured format
// TrialSpec represents Trial template in unstructured format
TrialSpec *unstructured.Unstructured `json:"trialSpec,omitempty"`

// ConfigMap spec represents a reference to ConfigMap
ConfigMap *ConfigMapSource `json:"configMap,omitempty"`
}

// ConfigMapSource references the config map where Trial template is located
type ConfigMapSource struct {
// Name of config map where Trial template is located
ConfigMapName string `json:"configMapName,omitempty"`

Expand All @@ -209,6 +222,7 @@ type TrialTemplate struct {
TemplatePath string `json:"templatePath,omitempty"`
}

// TrialParameterSpec describes parameters that must be replaced in Trial template
type TrialParameterSpec struct {
// Name of the parameter that must be replaced in Trial template
Name string `json:"name,omitempty"`
Expand All @@ -220,17 +234,6 @@ type TrialParameterSpec struct {
Reference string `json:"reference,omitempty"`
}

type TemplateSpec struct {
ConfigMapName string `json:"configMapName,omitempty"`
ConfigMapNamespace string `json:"configMapNamespace,omitempty"`
TemplatePath string `json:"templatePath,omitempty"`
}

type GoTemplate struct {
TemplateSpec *TemplateSpec `json:"templateSpec,omitempty"`
RawTemplate string `json:"rawTemplate,omitempty"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

Expand Down

0 comments on commit 59ea302

Please sign in to comment.