@@ -18,6 +18,7 @@ package flux
18
18
19
19
import (
20
20
"context"
21
+ "errors"
21
22
"fmt"
22
23
23
24
"sigs.k8s.io/e2e-framework/pkg/env"
@@ -44,7 +45,7 @@ func InstallFlux(opts ...Option) env.Func {
44
45
func CreateGitRepo (gitRepoName , gitRepoURL string , opts ... Option ) env.Func {
45
46
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
46
47
if manager == nil {
47
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
48
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
48
49
}
49
50
err := manager .createSource (Git , gitRepoName , gitRepoURL , opts ... )
50
51
if err != nil {
@@ -58,7 +59,7 @@ func CreateGitRepo(gitRepoName, gitRepoURL string, opts ...Option) env.Func {
58
59
func CreateHelmRepository (name , url string , opts ... Option ) env.Func {
59
60
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
60
61
if manager == nil {
61
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
62
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
62
63
}
63
64
err := manager .createSource (Helm , name , url , opts ... )
64
65
if err != nil {
@@ -72,7 +73,7 @@ func CreateHelmRepository(name, url string, opts ...Option) env.Func {
72
73
func CreateKustomization (kustomizationName , sourceRef string , opts ... Option ) env.Func {
73
74
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
74
75
if manager == nil {
75
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
76
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
76
77
}
77
78
err := manager .createKustomization (kustomizationName , sourceRef , opts ... )
78
79
if err != nil {
@@ -87,7 +88,7 @@ func CreateKustomization(kustomizationName, sourceRef string, opts ...Option) en
87
88
func CreateHelmRelease (name , source , chart string , opts ... Option ) env.Func {
88
89
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
89
90
if manager == nil {
90
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
91
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
91
92
}
92
93
err := manager .createHelmRelease (name , source , chart , opts ... )
93
94
if err != nil {
@@ -101,7 +102,7 @@ func CreateHelmRelease(name, source, chart string, opts ...Option) env.Func {
101
102
func UninstallFlux (opts ... Option ) env.Func {
102
103
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
103
104
if manager == nil {
104
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
105
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
105
106
}
106
107
err := manager .uninstallFlux (opts ... )
107
108
if err != nil {
@@ -115,7 +116,7 @@ func UninstallFlux(opts ...Option) env.Func {
115
116
func DeleteKustomization (kustomizationName string , opts ... Option ) env.Func {
116
117
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
117
118
if manager == nil {
118
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
119
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
119
120
}
120
121
err := manager .deleteKustomization (kustomizationName , opts ... )
121
122
if err != nil {
@@ -129,7 +130,7 @@ func DeleteKustomization(kustomizationName string, opts ...Option) env.Func {
129
130
func DeleteHelmRelease (name string , opts ... Option ) env.Func {
130
131
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
131
132
if manager == nil {
132
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
133
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
133
134
}
134
135
err := manager .deleteHelmRelease (name , opts ... )
135
136
if err != nil {
@@ -143,7 +144,7 @@ func DeleteHelmRelease(name string, opts ...Option) env.Func {
143
144
func DeleteGitRepo (gitRepoName string , opts ... Option ) env.Func {
144
145
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
145
146
if manager == nil {
146
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
147
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
147
148
}
148
149
err := manager .deleteSource (Git , gitRepoName , opts ... )
149
150
if err != nil {
@@ -157,7 +158,7 @@ func DeleteGitRepo(gitRepoName string, opts ...Option) env.Func {
157
158
func DeleteHelmRepo (name string , opts ... Option ) env.Func {
158
159
return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
159
160
if manager == nil {
160
- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
161
+ return ctx , errors . New (NoFluxInstallationFoundMsg )
161
162
}
162
163
err := manager .deleteSource (Helm , name , opts ... )
163
164
if err != nil {
0 commit comments