Skip to content

Commit 69f76a7

Browse files
committed
backend: kubeconfig: Export ShouldBeSkippedFunc
1 parent 1b562b0 commit 69f76a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

backend/pkg/kubeconfig/kubeconfig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ func GetInClusterContext(oidcIssuerURL string,
969969

970970
// Func type for context filter, if the func return true,
971971
// the context will be skipped otherwise the context will be used.
972-
type shouldBeSkippedFunc = func(kubeContext Context) bool
972+
type ShouldBeSkippedFunc = func(kubeContext Context) bool
973973

974974
// AllowAllKubeContext will keep all contexts.
975975
func AllowAllKubeContext(_ Context) bool {
@@ -980,7 +980,7 @@ func AllowAllKubeContext(_ Context) bool {
980980
// whose names are in the given comma-separated string.
981981
// For example, if pass the "a,b" for blackKubeContextNameStr,
982982
// the contexts named "a" and "b" will be skipped.
983-
func SkipKubeContextInCommaSeparatedString(blackKubeContextNameStr string) shouldBeSkippedFunc {
983+
func SkipKubeContextInCommaSeparatedString(blackKubeContextNameStr string) ShouldBeSkippedFunc {
984984
blackKubeContextNameList := strings.Split(blackKubeContextNameStr, ",")
985985
blackKubeContextNameMap := map[string]bool{}
986986

@@ -999,7 +999,7 @@ func SkipKubeContextInCommaSeparatedString(blackKubeContextNameStr string) shoul
999999
// Note: No need to remove contexts from the store, since
10001000
// adding a context with the same name will overwrite the old one.
10011001
func LoadAndStoreKubeConfigs(kubeConfigStore ContextStore, kubeConfigs string, source int,
1002-
ignoreFunc shouldBeSkippedFunc,
1002+
ignoreFunc ShouldBeSkippedFunc,
10031003
) error {
10041004
var errs []error //nolint:prealloc
10051005

backend/pkg/kubeconfig/watcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
const watchInterval = 10 * time.Second
1515

1616
// LoadAndWatchFiles loads kubeconfig files and watches them for changes.
17-
func LoadAndWatchFiles(kubeConfigStore ContextStore, paths string, source int, ignoreFunc shouldBeSkippedFunc) {
17+
func LoadAndWatchFiles(kubeConfigStore ContextStore, paths string, source int, ignoreFunc ShouldBeSkippedFunc) {
1818
// create ticker
1919
ticker := time.NewTicker(watchInterval)
2020

@@ -106,7 +106,7 @@ func addFilesToWatcher(watcher *fsnotify.Watcher, paths []string) {
106106
}
107107

108108
// syncContexts synchronizes the contexts in the store with the ones in the kubeconfig files.
109-
func syncContexts(kubeConfigStore ContextStore, paths string, source int, ignoreFunc shouldBeSkippedFunc) error {
109+
func syncContexts(kubeConfigStore ContextStore, paths string, source int, ignoreFunc ShouldBeSkippedFunc) error {
110110
// First read all kubeconfig files to get new contexts
111111
newContexts, _, err := LoadContextsFromMultipleFiles(paths, source)
112112
if err != nil {

0 commit comments

Comments
 (0)