mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Use HasSuffixI utility function
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
ec661c67d7
commit
ae5b93a264
@ -15,6 +15,7 @@ import (
|
||||
"time"
|
||||
|
||||
errors2 "github.com/pkg/errors"
|
||||
"github.com/rancher/k3s/pkg/agent/util"
|
||||
v12 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
v1 "github.com/rancher/k3s/pkg/generated/controllers/k3s.cattle.io/v1"
|
||||
"github.com/rancher/wrangler/pkg/apply"
|
||||
@ -309,11 +310,7 @@ func skipFile(fileName string, skips map[string]bool) bool {
|
||||
return true
|
||||
case skips[fileName]:
|
||||
return true
|
||||
case strings.HasSuffix(fileName, ".json"):
|
||||
return false
|
||||
case strings.HasSuffix(fileName, ".yml"):
|
||||
return false
|
||||
case strings.HasSuffix(fileName, ".yaml"):
|
||||
case util.HasSuffixI(fileName, ".yaml", ".yml", ".json"):
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
@ -329,11 +326,7 @@ func shouldDisableService(base, fileName string, disables map[string]bool) bool
|
||||
return true
|
||||
}
|
||||
}
|
||||
switch {
|
||||
case strings.HasSuffix(fileName, ".json"):
|
||||
case strings.HasSuffix(fileName, ".yml"):
|
||||
case strings.HasSuffix(fileName, ".yaml"):
|
||||
default:
|
||||
if !util.HasSuffixI(fileName, ".yaml", ".yml", ".json") {
|
||||
return false
|
||||
}
|
||||
baseFile := filepath.Base(fileName)
|
||||
|
Loading…
Reference in New Issue
Block a user