Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion installer/pkg/workflow/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func ConvertWorkflow(configFilePath string) Workflow {
return Workflow{
metadata: metadata{configFilePath: configFilePath},
steps: []Step{
steps: []step{
readTFVarsConfigStep,
printYAMLConfigStep,
},
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package workflow
func DestroyWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
destroyJoinMastersStep,
destroyJoinWorkersStep,
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
func InitWorkflow(configFilePath string) Workflow {
return Workflow{
metadata: metadata{configFilePath: configFilePath},
steps: []Step{
steps: []step{
prepareWorspaceStep,
refreshConfigStep,
},
Expand Down
10 changes: 5 additions & 5 deletions installer/pkg/workflow/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func InstallFullWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
generateClusterConfigMaps,
readClusterConfigStep,
Expand All @@ -36,7 +36,7 @@ func InstallFullWorkflow(clusterDir string) Workflow {
func InstallTLSNewWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
generateClusterConfigMaps,
generateTLSConfigStep,
Expand All @@ -49,7 +49,7 @@ func InstallTLSNewWorkflow(clusterDir string) Workflow {
func InstallAssetsWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
generateClusterConfigMaps,
installAssetsStep,
Expand All @@ -63,7 +63,7 @@ func InstallAssetsWorkflow(clusterDir string) Workflow {
func InstallBootstrapWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
installTopologyStep,
installTNCCNAMEStep,
Expand All @@ -79,7 +79,7 @@ func InstallBootstrapWorkflow(clusterDir string) Workflow {
func InstallJoinWorkflow(clusterDir string) Workflow {
return Workflow{
metadata: metadata{clusterDir: clusterDir},
steps: []Step{
steps: []step{
refreshConfigStep,
installJoinMastersStep,
installJoinWorkersStep,
Expand Down
6 changes: 3 additions & 3 deletions installer/pkg/workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ type metadata struct {
clusterDir string
}

// Step is the entrypoint of a workflow step implementation.
// step is the entrypoint of a workflow step implementation.
// To add a new step, put your logic in a function that matches this signature.
// Next, add a reference to this new function in a Workflow's steps list.
type Step func(*metadata) error
type step func(*metadata) error

// Workflow is a high-level representation
// of a set of actions performed in a predictable order.
type Workflow struct {
metadata metadata
steps []Step
steps []step
}

// Execute runs all steps in order.
Expand Down
6 changes: 3 additions & 3 deletions installer/pkg/workflow/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ func TestWorkflowTypeExecute(t *testing.T) {

testCases := []struct {
test string
steps []Step
steps []step
m metadata
expectedError bool
}{
{
test: "All steps succeed",
steps: []Step{test1Step, test2Step},
steps: []step{test1Step, test2Step},
m: m,
expectedError: false,
},
{
test: "At least one step fails",
steps: []Step{test1Step, test2Step, test3Step},
steps: []step{test1Step, test2Step, test3Step},
m: m,
expectedError: true,
},
Expand Down