Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Some Naming and Comments are Updated According the plugininstaller Refactoring #976

Merged
merged 1 commit into from
Aug 10, 2022
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
8 changes: 4 additions & 4 deletions internal/pkg/plugin/argocd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// Create creates ArgoCD with provided options.
func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.SetDefaultConfig(&defaultHelmConfig),
helm.Validate,
Expand All @@ -19,8 +19,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: helm.GetPluginAllState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/plugin/argocd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
)

func Delete(options map[string]interface{}) (bool, error) {
// 1. config delete operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.SetDefaultConfig(&defaultHelmConfig),
helm.Validate,
},
ExecuteOperations: helm.DefaultDeleteOperations,
}
_, err := runner.Execute(plugininstaller.RawOptions(options))
_, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return false, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/plugin/argocd/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const (
)

func Read(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config read operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.SetDefaultConfig(&defaultHelmConfig),
helm.Validate,
Expand All @@ -21,7 +21,7 @@ func Read(options map[string]interface{}) (map[string]interface{}, error) {
}

// 2. get plugin status
status, err := runner.Execute(plugininstaller.RawOptions(options))
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/plugin/argocd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

func Update(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config update operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.SetDefaultConfig(&defaultHelmConfig),
helm.Validate,
Expand All @@ -18,7 +18,7 @@ func Update(options map[string]interface{}) (map[string]interface{}, error) {
}

// 2. update by helm config and get status
status, err := runner.Execute(plugininstaller.RawOptions(options))
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/argocdapp/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

// Create creates an ArgoCD app YAML and applys it.
func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
},
Expand All @@ -22,8 +22,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: getStaticState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/argocdapp/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

func Delete(options map[string]interface{}) (bool, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
},
Expand All @@ -19,8 +19,8 @@ func Delete(options map[string]interface{}) (bool, error) {
},
}

// 2. execute installer get status and error
_, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
_, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return false, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/argocdapp/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
)

func Read(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
},
GetStateOperation: getDynamicState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/artifactory/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.Validate,
},
Expand All @@ -17,8 +17,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: helm.GetPluginAllState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/plugin/artifactory/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
)

func Delete(options map[string]interface{}) (bool, error) {
// 1. config delete operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.Validate,
},
ExecuteOperations: helm.DefaultDeleteOperations,
}
_, err := runner.Execute(plugininstaller.RawOptions(options))
_, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return false, err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/plugin/artifactory/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
)

func Read(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config read operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.Validate,
},
GetStateOperation: helm.GetPluginAllState,
}

status, err := runner.Execute(plugininstaller.RawOptions(options))
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/artifactory/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
)

func Update(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config update operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
helm.Validate,
},
ExecuteOperations: helm.DefaultUpdateOperations,
GetStateOperation: helm.GetPluginAllState,
}

// 2. execute update get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/devlake/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
ExecuteOperations: plugininstaller.ExecuteOperations{
kubectl.ProcessByContent(
"create", file.NewTemplate().FromRemote(devLakeInstallYAMLDownloadURL),
Expand All @@ -18,8 +18,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: getStaticState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/devlake/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
)

func Delete(options map[string]interface{}) (bool, error) {
// 1. config delete operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
ExecuteOperations: plugininstaller.ExecuteOperations{
kubectl.ProcessByContent(
"delete", file.NewTemplate().FromRemote(devLakeInstallYAMLDownloadURL),
),
},
}

// 2. execute installer get status and error
_, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
_, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return false, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/devlake/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package devlake
import "github.com/devstream-io/devstream/internal/pkg/plugininstaller"

func Read(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
GetStateOperation: getDynamicState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/githubactions/golang/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// Create sets up GitHub Actions workflow(s).
func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
github.BuildWorkFlowsWrapper(workflows),
Expand All @@ -21,8 +21,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: github.GetStaticWorkFlowState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/plugin/githubactions/golang/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// Delete remove GitHub Actions workflows.
func Delete(options map[string]interface{}) (bool, error) {
runner := &plugininstaller.Operator{
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
github.BuildWorkFlowsWrapper(workflows),
Expand All @@ -18,7 +18,7 @@ func Delete(options map[string]interface{}) (bool, error) {
},
}

_, err := runner.Execute(plugininstaller.RawOptions(options))
_, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return false, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/plugin/githubactions/golang/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
)

func Read(options map[string]interface{}) (map[string]interface{}, error) {
runner := &plugininstaller.Operator{
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
github.BuildWorkFlowsWrapper(workflows),
},
GetStateOperation: github.GetActionState,
}

status, err := runner.Execute(plugininstaller.RawOptions(options))
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/plugin/githubactions/golang/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// Update remove and set up GitHub Actions workflows.
func Update(options map[string]interface{}) (map[string]interface{}, error) {
runner := &plugininstaller.Operator{
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
validate,
github.BuildWorkFlowsWrapper(workflows),
Expand All @@ -21,7 +21,7 @@ func Update(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: github.GetActionState,
}

status, err := runner.Execute(plugininstaller.RawOptions(options))
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/plugin/githubactions/nodejs/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// Create sets up GitHub Actions workflow(s).
func Create(options map[string]interface{}) (map[string]interface{}, error) {
// 1. config install operations
runner := &plugininstaller.Operator{
// Initialize Operator with Operations
operator := &plugininstaller.Operator{
PreExecuteOperations: plugininstaller.PreExecuteOperations{
github.Validate,
github.BuildWorkFlowsWrapper(workflows),
Expand All @@ -20,8 +20,8 @@ func Create(options map[string]interface{}) (map[string]interface{}, error) {
GetStateOperation: github.GetStaticWorkFlowState,
}

// 2. execute installer get status and error
status, err := runner.Execute(plugininstaller.RawOptions(options))
// Execute all Operations in Operator
status, err := operator.Execute(plugininstaller.RawOptions(options))
if err != nil {
return nil, err
}
Expand Down
Loading