File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
cmd/local-artifact-mirror Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 7
7
"os"
8
8
"os/exec"
9
9
"path/filepath"
10
+ "slices"
10
11
11
12
"github.com/sirupsen/logrus"
12
13
"github.com/urfave/cli/v2"
@@ -140,7 +141,7 @@ var helmChartsCommand = &cli.Command{
140
141
return fmt .Errorf ("unable to read directory: %w" , err )
141
142
}
142
143
for _ , f := range files {
143
- if ! contains (newFiles , f .Name ()) {
144
+ if ! slices . Contains (newFiles , f .Name ()) {
144
145
fp := filepath .Join (dst , f .Name ())
145
146
logrus .Infof ("removing %s" , fp )
146
147
if err := os .RemoveAll (fp ); err != nil {
@@ -154,15 +155,6 @@ var helmChartsCommand = &cli.Command{
154
155
},
155
156
}
156
157
157
- func contains (haystack []string , needle string ) bool {
158
- for _ , h := range haystack {
159
- if h == needle {
160
- return true
161
- }
162
- }
163
- return false
164
- }
165
-
166
158
// binariesCommands pulls the binary artifact from the registry running in the cluster and stores
167
159
// it locally. This command is used during cluster upgrades when we want to fetch the most up to
168
160
// date binaries. The binaries is stored in the /usr/local/bin directory and they overwrite the
You can’t perform that action at this time.
0 commit comments