@@ -18,6 +18,7 @@ package flux
1818
1919import (
2020 "context"
21+ "errors"
2122 "fmt"
2223
2324 "sigs.k8s.io/e2e-framework/pkg/env"
@@ -44,7 +45,7 @@ func InstallFlux(opts ...Option) env.Func {
4445func CreateGitRepo (gitRepoName , gitRepoURL string , opts ... Option ) env.Func {
4546 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
4647 if manager == nil {
47- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
48+ return ctx , errors . New (NoFluxInstallationFoundMsg )
4849 }
4950 err := manager .createSource (Git , gitRepoName , gitRepoURL , opts ... )
5051 if err != nil {
@@ -58,7 +59,7 @@ func CreateGitRepo(gitRepoName, gitRepoURL string, opts ...Option) env.Func {
5859func CreateHelmRepository (name , url string , opts ... Option ) env.Func {
5960 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
6061 if manager == nil {
61- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
62+ return ctx , errors . New (NoFluxInstallationFoundMsg )
6263 }
6364 err := manager .createSource (Helm , name , url , opts ... )
6465 if err != nil {
@@ -72,7 +73,7 @@ func CreateHelmRepository(name, url string, opts ...Option) env.Func {
7273func CreateKustomization (kustomizationName , sourceRef string , opts ... Option ) env.Func {
7374 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
7475 if manager == nil {
75- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
76+ return ctx , errors . New (NoFluxInstallationFoundMsg )
7677 }
7778 err := manager .createKustomization (kustomizationName , sourceRef , opts ... )
7879 if err != nil {
@@ -87,7 +88,7 @@ func CreateKustomization(kustomizationName, sourceRef string, opts ...Option) en
8788func CreateHelmRelease (name , source , chart string , opts ... Option ) env.Func {
8889 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
8990 if manager == nil {
90- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
91+ return ctx , errors . New (NoFluxInstallationFoundMsg )
9192 }
9293 err := manager .createHelmRelease (name , source , chart , opts ... )
9394 if err != nil {
@@ -101,7 +102,7 @@ func CreateHelmRelease(name, source, chart string, opts ...Option) env.Func {
101102func UninstallFlux (opts ... Option ) env.Func {
102103 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
103104 if manager == nil {
104- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
105+ return ctx , errors . New (NoFluxInstallationFoundMsg )
105106 }
106107 err := manager .uninstallFlux (opts ... )
107108 if err != nil {
@@ -115,7 +116,7 @@ func UninstallFlux(opts ...Option) env.Func {
115116func DeleteKustomization (kustomizationName string , opts ... Option ) env.Func {
116117 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
117118 if manager == nil {
118- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
119+ return ctx , errors . New (NoFluxInstallationFoundMsg )
119120 }
120121 err := manager .deleteKustomization (kustomizationName , opts ... )
121122 if err != nil {
@@ -129,7 +130,7 @@ func DeleteKustomization(kustomizationName string, opts ...Option) env.Func {
129130func DeleteHelmRelease (name string , opts ... Option ) env.Func {
130131 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
131132 if manager == nil {
132- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
133+ return ctx , errors . New (NoFluxInstallationFoundMsg )
133134 }
134135 err := manager .deleteHelmRelease (name , opts ... )
135136 if err != nil {
@@ -143,7 +144,7 @@ func DeleteHelmRelease(name string, opts ...Option) env.Func {
143144func DeleteGitRepo (gitRepoName string , opts ... Option ) env.Func {
144145 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
145146 if manager == nil {
146- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
147+ return ctx , errors . New (NoFluxInstallationFoundMsg )
147148 }
148149 err := manager .deleteSource (Git , gitRepoName , opts ... )
149150 if err != nil {
@@ -157,7 +158,7 @@ func DeleteGitRepo(gitRepoName string, opts ...Option) env.Func {
157158func DeleteHelmRepo (name string , opts ... Option ) env.Func {
158159 return func (ctx context.Context , c * envconf.Config ) (context.Context , error ) {
159160 if manager == nil {
160- return ctx , fmt . Errorf (NoFluxInstallationFoundMsg )
161+ return ctx , errors . New (NoFluxInstallationFoundMsg )
161162 }
162163 err := manager .deleteSource (Helm , name , opts ... )
163164 if err != nil {
0 commit comments