diff --git a/go.mod b/go.mod index e81656282d..266195df43 100644 --- a/go.mod +++ b/go.mod @@ -41,10 +41,10 @@ require ( github.com/moby/buildkit v0.0.0-20181107081847-c3a857e3fca0 github.com/mtrmac/gpgme v0.1.2 // indirect github.com/opencontainers/go-digest v1.0.0-rc1 - github.com/openshift/api v0.0.0-20200424083944-0422dc17083e + github.com/openshift/api v0.0.0-20200429152225-b98a784d8e6d github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc github.com/openshift/client-go v0.0.0-20200422192633-6f6c07fc2a70 - github.com/openshift/library-go v0.0.0-20200427130628-9b02543ac833 + github.com/openshift/library-go v0.0.0-20200506083334-710b0bd21d0c github.com/operator-framework/operator-registry v1.8.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.1.0 @@ -89,8 +89,8 @@ replace ( k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.2 k8s.io/apimachinery => github.com/openshift/kubernetes-apimachinery v0.0.0-20200427132717-228307e8b83c k8s.io/apiserver => k8s.io/apiserver v0.18.2 - k8s.io/cli-runtime => github.com/openshift/kubernetes-cli-runtime v0.0.0-20200427133506-c9b12ef3d51a - k8s.io/client-go => github.com/openshift/kubernetes-client-go v0.0.0-20200427132843-d2e6d74049b0 + k8s.io/cli-runtime => github.com/openshift/kubernetes-cli-runtime v0.0.0-20200507115657-2fb95e953778 + k8s.io/client-go => github.com/openshift/kubernetes-client-go v0.0.0-20200507115529-5e2a2d83bced k8s.io/cloud-provider => k8s.io/cloud-provider v0.18.2 k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.18.2 k8s.io/code-generator => k8s.io/code-generator v0.18.2 @@ -101,7 +101,7 @@ replace ( k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.18.2 k8s.io/kube-proxy => k8s.io/kube-proxy v0.18.2 k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.18.2 - k8s.io/kubectl => github.com/openshift/kubernetes-kubectl v0.0.0-20200427133609-5c71e22e20a8 + k8s.io/kubectl => github.com/openshift/kubernetes-kubectl v0.0.0-20200507115706-2f87de22f81a k8s.io/kubelet => k8s.io/kubelet v0.18.2 k8s.io/kubernetes => github.com/openshift/kubernetes v1.17.0-alpha.0.0.20200427141011-f0879866c662 k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.18.2 diff --git a/go.sum b/go.sum index e1b46878b1..4a04f97a53 100644 --- a/go.sum +++ b/go.sum @@ -696,6 +696,8 @@ github.com/opencontainers/selinux v1.3.1-0.20190929122143-5215b1806f52/go.mod h1 github.com/openshift/api v0.0.0-20200326152221-912866ddb162/go.mod h1:RKMJ5CBnljLfnej+BJ/xnOWc3kZDvJUaIAEq2oKSPtE= github.com/openshift/api v0.0.0-20200424083944-0422dc17083e h1:VDcwVyMEVbLyekLmtob1TEf8GfP454Afc2hO3FkgBps= github.com/openshift/api v0.0.0-20200424083944-0422dc17083e/go.mod h1:VnbEzX8SAaRj7Yfl836NykdQIlbEjfL6/CD+AaJQg5Q= +github.com/openshift/api v0.0.0-20200429152225-b98a784d8e6d h1:E6wmob+4UwmxOWf/yA26q2PTBtLdAjo/aY5gAUfGS+E= +github.com/openshift/api v0.0.0-20200429152225-b98a784d8e6d/go.mod h1:VnbEzX8SAaRj7Yfl836NykdQIlbEjfL6/CD+AaJQg5Q= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160 h1:V4E6yt4XWiBEPKnJbs/E8pgUq9AjZqzQfsL3eeT84Qs= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc h1:Bu1p7+ItPqhJhmMve7sVluKCYV+o+x1Ede0WY2/BI8Q= @@ -712,14 +714,14 @@ github.com/openshift/kubernetes v1.17.0-alpha.0.0.20200427141011-f0879866c662 h1 github.com/openshift/kubernetes v1.17.0-alpha.0.0.20200427141011-f0879866c662/go.mod h1:l5Qoty3tTpZSF5aAnv62M9T8pCqZlT3Z29/s20L+iCU= github.com/openshift/kubernetes-apimachinery v0.0.0-20200427132717-228307e8b83c h1:+ZHd0MXIlWjlqVDCRmTBYWQrZ/gRPnHJmWJVdvmXNHI= github.com/openshift/kubernetes-apimachinery v0.0.0-20200427132717-228307e8b83c/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -github.com/openshift/kubernetes-cli-runtime v0.0.0-20200427133506-c9b12ef3d51a h1:EOB0Yti66MFVgruQBLxrfgdUk7FYK1/QIDFmQcmro2E= -github.com/openshift/kubernetes-cli-runtime v0.0.0-20200427133506-c9b12ef3d51a/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= -github.com/openshift/kubernetes-client-go v0.0.0-20200427132843-d2e6d74049b0 h1:5oNXG0OExnatj38vFey8iXYJrBnH0Gw/qWLBn1PxtIU= -github.com/openshift/kubernetes-client-go v0.0.0-20200427132843-d2e6d74049b0/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -github.com/openshift/kubernetes-kubectl v0.0.0-20200427133609-5c71e22e20a8 h1:tKQtgLeIHG2+1SsAxTx0y8hS7+tn4V5nDCbuB1jwiW8= -github.com/openshift/kubernetes-kubectl v0.0.0-20200427133609-5c71e22e20a8/go.mod h1:OdgFa3AlsPKRpFFYE7ICTwulXOcMGXHTc+UKhHKvrb4= -github.com/openshift/library-go v0.0.0-20200427130628-9b02543ac833 h1:glEuGTvwkQJXfCzVfosZ3oq73L8QltO6Xyxo1oTf5Ig= -github.com/openshift/library-go v0.0.0-20200427130628-9b02543ac833/go.mod h1:2kWwXTkpoQJUN3jZ3QW88EIY1hdRMqxgRs2hheEW/pg= +github.com/openshift/kubernetes-cli-runtime v0.0.0-20200507115657-2fb95e953778 h1:AEnwBRfIJpuaSGvNrpfykz8QPNALp0t3nIGr9a/BIF0= +github.com/openshift/kubernetes-cli-runtime v0.0.0-20200507115657-2fb95e953778/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= +github.com/openshift/kubernetes-client-go v0.0.0-20200507115529-5e2a2d83bced h1:tFIeR3M66xC/l+tuhlZKfK+OCMNk7ZfqeJQaR1ofoRo= +github.com/openshift/kubernetes-client-go v0.0.0-20200507115529-5e2a2d83bced/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +github.com/openshift/kubernetes-kubectl v0.0.0-20200507115706-2f87de22f81a h1:BG3HbZLvm1NlUkDoelF+vPG+Lnz6mKu0cPNAD800TDU= +github.com/openshift/kubernetes-kubectl v0.0.0-20200507115706-2f87de22f81a/go.mod h1:OdgFa3AlsPKRpFFYE7ICTwulXOcMGXHTc+UKhHKvrb4= +github.com/openshift/library-go v0.0.0-20200506083334-710b0bd21d0c h1:mo1sYI/JNNgXhoaSzGQdQceyWDC3Q1VYkFMmu1TQ6nc= +github.com/openshift/library-go v0.0.0-20200506083334-710b0bd21d0c/go.mod h1:2kWwXTkpoQJUN3jZ3QW88EIY1hdRMqxgRs2hheEW/pg= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/operator-framework/api v0.1.1 h1:DbfxRJUPMQlQW6nbfoNzWLxv1rIv13Gt8GbsF2aglFk= github.com/operator-framework/api v0.1.1/go.mod h1:yzNYR7qyJqRGOOp+bT6Z/iYSbSPNxeh3Si93Gx/3OBY= diff --git a/pkg/cli/shim_kubectl.go b/pkg/cli/shim_kubectl.go index 3924287bf2..bfff8a699f 100644 --- a/pkg/cli/shim_kubectl.go +++ b/pkg/cli/shim_kubectl.go @@ -17,7 +17,7 @@ import ( func shimKubectlForOc() { // we only need this change for `oc`. `kubectl` should behave as close to `kubectl` as we can // if we call this factory construction method, we want the openshift style config loading - kclientcmd.ErrEmptyConfig = genericclioptions.NewErrConfigurationMissing() + kclientcmd.ErrEmptyConfig = genericclioptions.ErrEmptyConfig kcmdset.ParseDockerImageReferenceToStringFunc = clientcmd.ParseDockerImageReferenceToStringFunc openshiftpatch.OAPIToGroupified = legacygroupification.OAPIToGroupified openshiftpatch.OAPIToGroupifiedGVK = legacygroupification.OAPIToGroupifiedGVK diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_oauth.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_oauth.crd.yaml index fd763d0477..7b2e45a5ee 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_oauth.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_oauth.crd.yaml @@ -637,17 +637,8 @@ spec: type: object properties: accessTokenInactivityTimeoutSeconds: - description: 'accessTokenInactivityTimeoutSeconds defines the default - token inactivity timeout for tokens granted by any client. The - value represents the maximum amount of time that can occur between - consecutive uses of the token. Tokens become invalid if they are - not used within this temporal window. The user will need to acquire - a new token to regain access once a token times out. Valid values - are integer values: x < 0 Tokens time out is enabled but tokens - never timeout unless configured per client (e.g. `-1`) x = 0 Tokens - time out is disabled (default) x > 0 Tokens time out if there - is no activity for x seconds The current minimum allowed value - for X is 300 (5 minutes)' + description: 'accessTokenInactivityTimeoutSeconds - DEPRECATED: + setting this field has no effect.' type: integer format: int32 accessTokenMaxAgeSeconds: diff --git a/vendor/github.com/openshift/api/config/v1/types_oauth.go b/vendor/github.com/openshift/api/config/v1/types_oauth.go index 15bc5b1c1a..3ca73930b4 100644 --- a/vendor/github.com/openshift/api/config/v1/types_oauth.go +++ b/vendor/github.com/openshift/api/config/v1/types_oauth.go @@ -47,17 +47,7 @@ type TokenConfig struct { // accessTokenMaxAgeSeconds defines the maximum age of access tokens AccessTokenMaxAgeSeconds int32 `json:"accessTokenMaxAgeSeconds"` - // accessTokenInactivityTimeoutSeconds defines the default token - // inactivity timeout for tokens granted by any client. - // The value represents the maximum amount of time that can occur between - // consecutive uses of the token. Tokens become invalid if they are not - // used within this temporal window. The user will need to acquire a new - // token to regain access once a token times out. - // Valid values are integer values: - // x < 0 Tokens time out is enabled but tokens never timeout unless configured per client (e.g. `-1`) - // x = 0 Tokens time out is disabled (default) - // x > 0 Tokens time out if there is no activity for x seconds - // The current minimum allowed value for X is 300 (5 minutes) + // accessTokenInactivityTimeoutSeconds - DEPRECATED: setting this field has no effect. // +optional AccessTokenInactivityTimeoutSeconds int32 `json:"accessTokenInactivityTimeoutSeconds,omitempty"` } diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index 1b850ea5b4..21c53d589d 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -1208,7 +1208,7 @@ func (RequestHeaderIdentityProvider) SwaggerDoc() map[string]string { var map_TokenConfig = map[string]string{ "": "TokenConfig holds the necessary configuration options for authorization and access tokens", "accessTokenMaxAgeSeconds": "accessTokenMaxAgeSeconds defines the maximum age of access tokens", - "accessTokenInactivityTimeoutSeconds": "accessTokenInactivityTimeoutSeconds defines the default token inactivity timeout for tokens granted by any client. The value represents the maximum amount of time that can occur between consecutive uses of the token. Tokens become invalid if they are not used within this temporal window. The user will need to acquire a new token to regain access once a token times out. Valid values are integer values:\n x < 0 Tokens time out is enabled but tokens never timeout unless configured per client (e.g. `-1`)\n x = 0 Tokens time out is disabled (default)\n x > 0 Tokens time out if there is no activity for x seconds\nThe current minimum allowed value for X is 300 (5 minutes)", + "accessTokenInactivityTimeoutSeconds": "accessTokenInactivityTimeoutSeconds - DEPRECATED: setting this field has no effect.", } func (TokenConfig) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go b/vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go index df743e53e9..20da536578 100644 --- a/vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go +++ b/vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go @@ -17,7 +17,6 @@ limitations under the License. package genericclioptions import ( - "errors" "os" "path/filepath" "regexp" @@ -60,7 +59,8 @@ const ( var ( defaultCacheDir = filepath.Join(homedir.HomeDir(), ".kube", "http-cache") - ErrEmptyConfig = errors.New(`Missing or incomplete configuration info. Please point to an existing, complete config file: + ErrEmptyConfig = clientcmd.NewEmptyConfigError(`Missing or incomplete configuration info. Please point to an existing, complete config file: + 1. Via the command-line flag --kubeconfig 2. Via the KUBECONFIG environment variable diff --git a/vendor/k8s.io/cli-runtime/pkg/genericclioptions/patch_config_flags.go b/vendor/k8s.io/cli-runtime/pkg/genericclioptions/patch_config_flags.go index 26530b2cdd..e5c3547f49 100644 --- a/vendor/k8s.io/cli-runtime/pkg/genericclioptions/patch_config_flags.go +++ b/vendor/k8s.io/cli-runtime/pkg/genericclioptions/patch_config_flags.go @@ -1,16 +1,5 @@ package genericclioptions -import "fmt" - // OpenShiftKubeConfigFlagName exists only so that we can track down all non-standard offenders +// This was deprecated in 4.4, so we can entirely remove it in 4.8. const OpenShiftKubeConfigFlagName = "config" - -func NewErrConfigurationMissing() error { - return fmt.Errorf(`Missing or incomplete configuration info. Please login or point to an existing, complete config file: - - 1. Via the command-line flag --kubeconfig - 2. Via the KUBECONFIG environment variable - 3. In your home directory as ~/.kube/config - -To view or setup config directly use the 'config' command.`) -} diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation.go b/vendor/k8s.io/client-go/tools/clientcmd/validation.go index afe6f80b39..a480bdf0d6 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation.go @@ -30,11 +30,24 @@ import ( var ( ErrNoContext = errors.New("no context chosen") - ErrEmptyConfig = errors.New("no configuration has been provided, try setting KUBERNETES_MASTER environment variable") + ErrEmptyConfig = NewEmptyConfigError("no configuration has been provided, try setting KUBERNETES_MASTER environment variable") // message is for consistency with old behavior ErrEmptyCluster = errors.New("cluster has no server defined") ) +// NewEmptyConfigError returns an error wrapping the given message which IsEmptyConfig() will recognize as an empty config error +func NewEmptyConfigError(message string) error { + return &errEmptyConfig{message} +} + +type errEmptyConfig struct { + message string +} + +func (e *errEmptyConfig) Error() string { + return e.message +} + type errContextNotFound struct { ContextName string } @@ -60,9 +73,14 @@ func IsContextNotFound(err error) bool { func IsEmptyConfig(err error) bool { switch t := err.(type) { case errConfigurationInvalid: - return len(t) == 1 && t[0] == ErrEmptyConfig + if len(t) != 1 { + return false + } + _, ok := t[0].(*errEmptyConfig) + return ok } - return err == ErrEmptyConfig + _, ok := err.(*errEmptyConfig) + return ok } // errConfigurationInvalid is a set of errors indicating the configuration is invalid. diff --git a/vendor/k8s.io/kubectl/pkg/cmd/create/create_job.go b/vendor/k8s.io/kubectl/pkg/cmd/create/create_job.go index a295b6a097..364b9a2a37 100644 --- a/vendor/k8s.io/kubectl/pkg/cmd/create/create_job.go +++ b/vendor/k8s.io/kubectl/pkg/cmd/create/create_job.go @@ -22,7 +22,6 @@ import ( "github.com/spf13/cobra" - appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" corev1 "k8s.io/api/core/v1" @@ -259,7 +258,7 @@ func (o *CreateJobOptions) createJobFromCronJob(cronJob *batchv1beta1.CronJob) * Annotations: annotations, Labels: cronJob.Spec.JobTemplate.Labels, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cronJob, appsv1.SchemeGroupVersion.WithKind("CronJob")), + *metav1.NewControllerRef(cronJob, cronJob.GroupVersionKind()), }, }, Spec: cronJob.Spec.JobTemplate.Spec, diff --git a/vendor/k8s.io/kubectl/pkg/cmd/get/get.go b/vendor/k8s.io/kubectl/pkg/cmd/get/get.go index ab157bd767..d50edfc48e 100644 --- a/vendor/k8s.io/kubectl/pkg/cmd/get/get.go +++ b/vendor/k8s.io/kubectl/pkg/cmd/get/get.go @@ -529,6 +529,7 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e separatorWriter := &separatorWriterWrapper{Delegate: trackingWriter} w := printers.GetNewTabWriter(separatorWriter) + allResourcesNamespaced := !o.AllNamespaces for ix := range objs { var mapping *meta.RESTMapping var info *resource.Info @@ -540,6 +541,7 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e mapping = info.Mapping } + allResourcesNamespaced = allResourcesNamespaced && info.Namespaced() printWithNamespace := o.AllNamespaces if mapping != nil && mapping.Scope.Name() == meta.RESTScopeNameRoot { @@ -583,7 +585,7 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e w.Flush() if trackingWriter.Written == 0 && !o.IgnoreNotFound && len(allErrs) == 0 { // if we wrote no output, and had no errors, and are not ignoring NotFound, be sure we output something - if !o.AllNamespaces { + if allResourcesNamespaced { fmt.Fprintln(o.ErrOut, fmt.Sprintf("No resources found in %s namespace.", o.Namespace)) } else { fmt.Fprintln(o.ErrOut, fmt.Sprintf("No resources found")) diff --git a/vendor/modules.txt b/vendor/modules.txt index e5d569be96..dab21980f3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -369,7 +369,7 @@ github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runc v1.0.0-rc9 github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user -# github.com/openshift/api v0.0.0-20200424083944-0422dc17083e +# github.com/openshift/api v0.0.0-20200429152225-b98a784d8e6d github.com/openshift/api github.com/openshift/api/annotations github.com/openshift/api/apps @@ -489,7 +489,7 @@ github.com/openshift/client-go/user/clientset/versioned/fake github.com/openshift/client-go/user/clientset/versioned/scheme github.com/openshift/client-go/user/clientset/versioned/typed/user/v1 github.com/openshift/client-go/user/clientset/versioned/typed/user/v1/fake -# github.com/openshift/library-go v0.0.0-20200427130628-9b02543ac833 +# github.com/openshift/library-go v0.0.0-20200506083334-710b0bd21d0c github.com/openshift/library-go/pkg/apps/appsserialization github.com/openshift/library-go/pkg/apps/appsutil github.com/openshift/library-go/pkg/authorization/authorizationutil @@ -809,7 +809,7 @@ k8s.io/apiserver/pkg/server/healthz k8s.io/apiserver/pkg/server/httplog k8s.io/apiserver/pkg/storage/names k8s.io/apiserver/pkg/util/feature -# k8s.io/cli-runtime v0.18.2 => github.com/openshift/kubernetes-cli-runtime v0.0.0-20200427133506-c9b12ef3d51a +# k8s.io/cli-runtime v0.18.2 => github.com/openshift/kubernetes-cli-runtime v0.0.0-20200507115657-2fb95e953778 k8s.io/cli-runtime/pkg/genericclioptions k8s.io/cli-runtime/pkg/genericclioptions/openshiftpatch k8s.io/cli-runtime/pkg/kustomize @@ -823,7 +823,7 @@ k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch k8s.io/cli-runtime/pkg/kustomize/k8sdeps/validator k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource -# k8s.io/client-go v8.0.0+incompatible => github.com/openshift/kubernetes-client-go v0.0.0-20200427132843-d2e6d74049b0 +# k8s.io/client-go v8.0.0+incompatible => github.com/openshift/kubernetes-client-go v0.0.0-20200507115529-5e2a2d83bced k8s.io/client-go/discovery k8s.io/client-go/discovery/cached/disk k8s.io/client-go/discovery/fake @@ -976,7 +976,7 @@ k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/proto/testing k8s.io/kube-openapi/pkg/util/proto/validation -# k8s.io/kubectl v0.18.2 => github.com/openshift/kubernetes-kubectl v0.0.0-20200427133609-5c71e22e20a8 +# k8s.io/kubectl v0.18.2 => github.com/openshift/kubernetes-kubectl v0.0.0-20200507115706-2f87de22f81a k8s.io/kubectl/pkg/apps k8s.io/kubectl/pkg/cmd k8s.io/kubectl/pkg/cmd/annotate