diff --git a/go.mod b/go.mod index e34bd0a9f..d1e7cf160 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( k8s.io/apimachinery v0.21.4 k8s.io/cli-runtime v0.21.4 k8s.io/client-go v0.21.4 - knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f + knative.dev/client v0.27.0 knative.dev/eventing v0.27.0 knative.dev/hack v0.0.0-20211101195839-11d193bf617b knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc diff --git a/go.sum b/go.sum index 1e649e2e0..6b8556a1b 100644 --- a/go.sum +++ b/go.sum @@ -1677,27 +1677,19 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/caching v0.0.0-20211029072651-f2af269b6d90/go.mod h1:5lh1DR0ZI/mCx7SRwbH5K8Vy1b0AIbxOaJlcLVx9E3o= knative.dev/caching v0.0.0-20211101215439-72577a3c0ce1/go.mod h1:hz6tnVAmRLvPoprw+0wsA9IrZC3MF5l2Hn/2JT28Yk0= -knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f h1:G0WwxABLhyMYNrDLTScbLcSt/4fAi0OT8v8rT0J3VR0= -knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f/go.mod h1:NVN+hzUIcqnEv9HCLvWj+tqiW0aT5txGFuWsXwdRjq4= -knative.dev/eventing v0.26.1-0.20211029100351-4de0da062efa/go.mod h1:n0CQNBQIeUqNfjgnywUykDXVKWDSlUVG3cUoK7WHxhk= +knative.dev/client v0.27.0 h1:qZkdFFCjPDsQrfHQMd1vPanDxEVloEJeUrrC3a52pK4= +knative.dev/client v0.27.0/go.mod h1:FmXziLwolJtqaH3Jxe8cxqWjBUHXU6LsRsMyzlMSFFM= knative.dev/eventing v0.27.0 h1:P9rqKvsCeFb8sEhfK32WFTG7awdOAa7XO6p3umSq/wU= knative.dev/eventing v0.27.0/go.mod h1:4ppWQEQ/2B66/YFENDmV1Gjxs4meLpz6UTUgLkkINt4= -knative.dev/hack v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20211101195839-11d193bf617b h1:DaW1iliZlBAwq/I8gTqVu8UnfGxyb5yR7CDsJi5jyWk= knative.dev/hack v0.0.0-20211101195839-11d193bf617b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/hack/schema v0.0.0-20211028194650-b96d65a5ff5e/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0= knative.dev/hack/schema v0.0.0-20211101195839-11d193bf617b/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0= -knative.dev/networking v0.0.0-20211029072251-c3606d9f7b38/go.mod h1:Ehgk5lhjcXSngdOv0fQu0vPXRivhx4JtS9uEhlm4fug= knative.dev/networking v0.0.0-20211101215640-8c71a2708e7d h1:nCnuNfcLWuyAdZYgVfwSooa3+p2ebx+V+qhGXXF/FIk= knative.dev/networking v0.0.0-20211101215640-8c71a2708e7d/go.mod h1:7SKKM4MsBANrXNRZhb/zMkNjTdxYbNjwQDWgu+Fyye4= -knative.dev/pkg v0.0.0-20211028235650-5d9d300c2e40/go.mod h1:HyEqMTLzT2hGCisGaRMGzEE8b4Ym+7mhmVx5ygiX+fY= knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc h1:ldjbTpoMXUTgzw0IJsAFLdyA6/6QYRvz8IGPZOknEDg= knative.dev/pkg v0.0.0-20211101212339-96c0204a70dc/go.mod h1:SkfDk9bWIiNZD7XtILGkG7AKVyF/M6M0bGxLgl0SYL8= -knative.dev/reconciler-test v0.0.0-20211029073051-cff9b538d33c/go.mod h1:PIwtS0at/rtnsNCxcZUAZUmWKKasTUYJ/w1Mk94bOdA= knative.dev/reconciler-test v0.0.0-20211101214439-9839937c9b13/go.mod h1:gTsbLk496j/M9xqMpx/liyCQ0X3bwDpRtcs2Zzws364= -knative.dev/serving v0.26.1-0.20211101141423-4317e47d4207/go.mod h1:1w3kpOAeaJTtnidzEbMvjtkwNm3/QlSQFZWN1bmM/FM= knative.dev/serving v0.27.0 h1:pstGHQ8aSJsIwdofkjJV6TrmPN09u/2qN1Mgfc92LQs= knative.dev/serving v0.27.0/go.mod h1:Lcqv3K/DeDt6ZoeWTgpjxc/0teS7uMebnnU+gXIw99c= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= diff --git a/vendor/knative.dev/client/pkg/kn/config/config.go b/vendor/knative.dev/client/pkg/kn/config/config.go index fd3abfd25..e1b6340ce 100644 --- a/vendor/knative.dev/client/pkg/kn/config/config.go +++ b/vendor/knative.dev/client/pkg/kn/config/config.go @@ -39,7 +39,6 @@ var bootstrapDefaults = initDefaults() const configContentDefaults = `# Taken from https://github.com/knative/client/blob/main/docs/README.md#options # #plugins: -# path-lookup: true # directory: ~/.config/kn/plugins #eventing: # sink-mappings: @@ -89,13 +88,7 @@ func (c *config) PluginsDir() string { // LookupPluginsInPath returns true if plugins should be also checked in the pat func (c *config) LookupPluginsInPath() bool { - if viper.IsSet(deprecatedKeyPluginsLookupInPath) { - return viper.GetBool(deprecatedKeyPluginsLookupInPath) - } else { - // If legacy branch is removed, switch to setting the default to viper - // See TODO comment below. - return bootstrapDefaults.lookupPluginsInPath - } + return bootstrapDefaults.lookupPluginsInPath } func (c *config) SinkMappings() []SinkMapping { @@ -132,10 +125,6 @@ func BootstrapConfig() error { if err != nil { return err } - err = viper.BindPFlag(deprecatedKeyPluginsLookupInPath, bootstrapFlagSet.Lookup(flagPluginsLookupInPath)) - if err != nil { - return err - } viper.SetConfigFile(GlobalConfig.ConfigFile()) configFile := GlobalConfig.ConfigFile() @@ -145,10 +134,12 @@ func BootstrapConfig() error { return fmt.Errorf("cannot stat configfile %s: %w", configFile, err) } if err := os.MkdirAll(filepath.Dir(viper.ConfigFileUsed()), 0775); err != nil { - return err + // Can't create config directory, proceed silently without reading the config + return nil } if err := os.WriteFile(viper.ConfigFileUsed(), []byte(configContentDefaults), 0600); err != nil { - fmt.Fprintf(os.Stderr, "WARNING: failed writing config file to %q: %s\n", configFile, err) + // Can't create config file, proceed silently without reading the config + return nil } } @@ -158,7 +149,6 @@ func BootstrapConfig() error { // TODO: Re-enable when legacy handling for plugin config has been removed // For now default handling is happening directly in the getter of GlobalConfig // viper.SetDefault(keyPluginsDirectory, bootstrapDefaults.pluginsDir) - // viper.SetDefault(deprecatedKeyPluginsLookupInPath, bootstrapDefaults.lookupPluginsInPath) // If a config file is found, read it in. err = viper.ReadInConfig() @@ -181,10 +171,8 @@ func BootstrapConfig() error { func AddBootstrapFlags(flags *flag.FlagSet) { flags.StringVar(&globalConfig.configFile, "config", "", fmt.Sprintf("kn configuration file (default: %s)", defaultConfigFileForUsageMessage())) flags.String(flagPluginsDir, "", "Directory holding kn plugins") - flags.Bool(flagPluginsLookupInPath, false, "Search kn plugins also in $PATH") // Let's try that and mark the flags as hidden: (as those configuration is a permanent choice of operation) - flags.MarkHidden(flagPluginsLookupInPath) flags.MarkHidden(flagPluginsDir) } diff --git a/vendor/knative.dev/client/pkg/kn/config/types.go b/vendor/knative.dev/client/pkg/kn/config/types.go index b801c58dd..2ef7dc8de 100644 --- a/vendor/knative.dev/client/pkg/kn/config/types.go +++ b/vendor/knative.dev/client/pkg/kn/config/types.go @@ -70,10 +70,9 @@ type ChannelTypeMapping struct { // config Keys for looking up in viper const ( - keyPluginsDirectory = "plugins.directory" - deprecatedKeyPluginsLookupInPath = "plugins.path-lookup" - keySinkMappings = "eventing.sink-mappings" - keyChannelTypeMappings = "eventing.channel-type-mappings" + keyPluginsDirectory = "plugins.directory" + keySinkMappings = "eventing.sink-mappings" + keyChannelTypeMappings = "eventing.channel-type-mappings" ) // legacy config keys, deprecated @@ -85,6 +84,5 @@ const ( // Global (hidden) flags // TODO: Remove me if decided that they are not needed const ( - flagPluginsDir = "plugins-dir" - flagPluginsLookupInPath = "lookup-plugins" + flagPluginsDir = "plugins-dir" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 218c5c750..2d813d7cf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -637,7 +637,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/client v0.26.1-0.20211102100340-09d48d5f4c2f +# knative.dev/client v0.27.0 ## explicit knative.dev/client/pkg/config knative.dev/client/pkg/dynamic