@@ -63,6 +63,7 @@ func Run(cmd *exec.Cmd) (string, error) {
63
63
// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
64
64
func InstallPrometheusOperator () error {
65
65
url := fmt .Sprintf (prometheusOperatorURL , prometheusOperatorVersion )
66
+ // #nosec G204
66
67
cmd := exec .Command ("kubectl" , "create" , "-f" , url )
67
68
_ , err := Run (cmd )
68
69
return err
@@ -71,6 +72,7 @@ func InstallPrometheusOperator() error {
71
72
// UninstallPrometheusOperator uninstalls the prometheus
72
73
func UninstallPrometheusOperator () {
73
74
url := fmt .Sprintf (prometheusOperatorURL , prometheusOperatorVersion )
75
+ // #nosec G204
74
76
cmd := exec .Command ("kubectl" , "delete" , "-f" , url )
75
77
if _ , err := Run (cmd ); err != nil {
76
78
warnError (err )
@@ -107,6 +109,7 @@ func IsPrometheusCRDsInstalled() bool {
107
109
// UninstallCertManager uninstalls the cert manager
108
110
func UninstallCertManager () {
109
111
url := fmt .Sprintf (certmanagerURLTmpl , certmanagerVersion )
112
+ // #nosec G204
110
113
cmd := exec .Command ("kubectl" , "delete" , "-f" , url )
111
114
if _ , err := Run (cmd ); err != nil {
112
115
warnError (err )
@@ -116,6 +119,7 @@ func UninstallCertManager() {
116
119
// InstallCertManager installs the cert manager bundle.
117
120
func InstallCertManager () error {
118
121
url := fmt .Sprintf (certmanagerURLTmpl , certmanagerVersion )
122
+ // #nosec G204
119
123
cmd := exec .Command ("kubectl" , "apply" , "-f" , url )
120
124
if _ , err := Run (cmd ); err != nil {
121
125
return err
@@ -172,6 +176,7 @@ func LoadImageToKindClusterWithName(name string) error {
172
176
cluster = v
173
177
}
174
178
kindOptions := []string {"load" , "docker-image" , name , "--name" , cluster }
179
+ // #nosec G204
175
180
cmd := exec .Command ("kind" , kindOptions ... )
176
181
_ , err := Run (cmd )
177
182
return err
@@ -206,6 +211,7 @@ func GetProjectDir() (string, error) {
206
211
func UncommentCode (filename , target , prefix string ) error {
207
212
// false positive
208
213
// nolint:gosec
214
+ // #nosec G304
209
215
content , err := os .ReadFile (filename )
210
216
if err != nil {
211
217
return err
@@ -247,5 +253,6 @@ func UncommentCode(filename, target, prefix string) error {
247
253
}
248
254
// false positive
249
255
// nolint:gosec
256
+ // #nosec G306
250
257
return os .WriteFile (filename , out .Bytes (), 0644 )
251
258
}
0 commit comments