Skip to content

Commit 627590c

Browse files
committed
fix: change according jf's review comment
Signed-off-by: Daniel Hu <[email protected]>
1 parent 3030aea commit 627590c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+40
-559
lines changed

internal/pkg/develop/plugin/template/NAME.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ var NameGoDirTpl = "internal/pkg/plugin/[[ .Name | dirFormat ]]/"
55
var NameGoMustExistFlag = true
66
var NameGoContentTpl = `package [[ .Name | format ]]
77
8-
const Name = "[[ .Name ]]"
9-
108
// TODO(dtm): Add your logic here.
119
`
1210

internal/pkg/develop/plugin/template/create.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ var createGoContentTpl = `package [[ .Name | format ]]
66
77
import (
88
"github.com/devstream-io/devstream/internal/pkg/configmanager"
9-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
109
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
1110
"github.com/devstream-io/devstream/internal/pkg/statemanager"
1211
"github.com/devstream-io/devstream/pkg/util/log"
1312
)
1413
1514
func Create(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
16-
var err error
17-
defer func() {
18-
HandleErrLogsWithPlugin(err, Name)
19-
}()
20-
2115
// Initialize Operator with Operations
2216
operator := &installer.Operator{
2317
PreExecuteOperations: installer.PreExecuteOperations{

internal/pkg/develop/plugin/template/delete.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,10 @@ var deleteGoContentTpl = `package [[ .Name | format ]]
66
77
import (
88
"github.com/devstream-io/devstream/internal/pkg/configmanager"
9-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
109
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
1110
)
1211
1312
func Delete(options configmanager.RawOptions) (bool, error) {
14-
var err error
15-
defer func() {
16-
HandleErrLogsWithPlugin(err, Name)
17-
}()
18-
1913
// Initialize Operator with Operations
2014
operator := &installer.Operator{
2115
PreExecuteOperations: installer.PreExecuteOperations{
@@ -27,7 +21,7 @@ func Delete(options configmanager.RawOptions) (bool, error) {
2721
}
2822
2923
// Execute all Operations in Operator
30-
_, err = operator.Execute(options)
24+
_, err := operator.Execute(options)
3125
if err != nil {
3226
return false, err
3327
}

internal/pkg/develop/plugin/template/read.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ var readGoContentTpl = `package [[ .Name | format ]]
66
77
import (
88
"github.com/devstream-io/devstream/internal/pkg/configmanager"
9-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
109
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
1110
"github.com/devstream-io/devstream/internal/pkg/statemanager"
1211
"github.com/devstream-io/devstream/pkg/util/log"
1312
)
1413
1514
func Read(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
16-
var err error
17-
defer func() {
18-
HandleErrLogsWithPlugin(err, Name)
19-
}()
20-
2115
// Initialize Operator with Operations
2216
operator := &installer.Operator{
2317
PreExecuteOperations: installer.PreExecuteOperations{

internal/pkg/develop/plugin/template/update.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@ var updateGoContentTpl = `package [[ .Name | format ]]
66
77
import (
88
"github.com/devstream-io/devstream/internal/pkg/configmanager"
9-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
109
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
1110
"github.com/devstream-io/devstream/internal/pkg/statemanager"
1211
"github.com/devstream-io/devstream/pkg/util/log"
1312
)
1413
1514
func Update(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
16-
var err error
17-
defer func() {
18-
HandleErrLogsWithPlugin(err, Name)
19-
}()
20-
2115
// Initialize Operator with Operations
2216
operator := &installer.Operator{
2317
PreExecuteOperations: installer.PreExecuteOperations{

internal/pkg/plugin/argocdapp/argocdapp.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ import (
44
_ "embed"
55
)
66

7-
const Name = "argocdapp"
8-
97
//go:embed tpl/argocd.tpl.yaml
108
var templateFileLoc string

internal/pkg/plugin/argocdapp/create.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package argocdapp
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
65
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
76
"github.com/devstream-io/devstream/internal/pkg/plugin/installer/kubectl"
87
"github.com/devstream-io/devstream/internal/pkg/statemanager"
@@ -12,11 +11,6 @@ import (
1211

1312
// Create creates an ArgoCD app YAML and applies it.
1413
func Create(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
15-
var err error
16-
defer func() {
17-
HandleErrLogsWithPlugin(err, Name)
18-
}()
19-
2014
// Initialize Operator with Operations
2115
operator := &installer.Operator{
2216
PreExecuteOperations: installer.PreExecuteOperations{

internal/pkg/plugin/argocdapp/delete.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ package argocdapp
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
65
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
76
"github.com/devstream-io/devstream/internal/pkg/plugin/installer/kubectl"
87
kubectlUtil "github.com/devstream-io/devstream/pkg/util/kubectl"
98
)
109

1110
func Delete(options configmanager.RawOptions) (bool, error) {
12-
var err error
13-
defer func() {
14-
HandleErrLogsWithPlugin(err, Name)
15-
}()
16-
1711
// Initialize Operator with Operations
1812
operator := &installer.Operator{
1913
PreExecuteOperations: installer.PreExecuteOperations{
@@ -25,7 +19,7 @@ func Delete(options configmanager.RawOptions) (bool, error) {
2519
}
2620

2721
// Execute all Operations in Operator
28-
_, err = operator.Execute(options)
22+
_, err := operator.Execute(options)
2923
if err != nil {
3024
return false, err
3125
}

internal/pkg/plugin/argocdapp/read.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ package argocdapp
22

33
import (
44
"github.com/devstream-io/devstream/internal/pkg/configmanager"
5-
. "github.com/devstream-io/devstream/internal/pkg/plugin/common"
65
"github.com/devstream-io/devstream/internal/pkg/plugin/installer"
76
"github.com/devstream-io/devstream/internal/pkg/statemanager"
87
)
98

109
func Read(options configmanager.RawOptions) (statemanager.ResourceStatus, error) {
11-
var err error
12-
defer func() {
13-
HandleErrLogsWithPlugin(err, Name)
14-
}()
15-
1610
// Initialize Operator with Operations
1711
operator := &installer.Operator{
1812
PreExecuteOperations: installer.PreExecuteOperations{
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
package cigeneric
2-
3-
const Name = "ci-generic"

0 commit comments

Comments
 (0)