diff --git a/go.mod b/go.mod index 8dcf5bf1f7..2690e1bf5d 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( k8s.io/code-generator v0.21.1 k8s.io/component-base v0.21.0 k8s.io/component-helpers v0.21.0 + k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.8.0 k8s.io/kube-aggregator v0.21.0 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 @@ -78,3 +79,5 @@ replace ( k8s.io/mount-utils => k8s.io/mount-utils v0.21.0 k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.0 ) + +replace github.com/openshift/api => github.com/candita/api v0.0.0-20210625204430-e467f417c5b3 diff --git a/go.sum b/go.sum index 7372529c36..367a1edc45 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,8 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= +github.com/candita/api v0.0.0-20210625204430-e467f417c5b3 h1:qHQhdAnMtJ531zm2Hd4SOnQf3J4PA6SGiflowbVf8KM= +github.com/candita/api v0.0.0-20210625204430-e467f417c5b3/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -140,8 +142,6 @@ github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreydaley/api v0.0.0-20210611190050-d0f48cbf0ba3 h1:baI2LyZ7k/5h2GhUUqsbkNb3a/cz1yPa1lebaVugobA= -github.com/coreydaley/api v0.0.0-20210611190050-d0f48cbf0ba3/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -526,16 +526,6 @@ github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84 github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/openshift/api v0.0.0-20210331162552-3e31249e6a55/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio= -github.com/openshift/api v0.0.0-20210331193751-3acddb19d360/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio= -github.com/openshift/api v0.0.0-20210603185846-379093ab5d80 h1:CSaMNuLE1JbHMLbPilrrEIutoYXdFJFw452s9Jfe+hc= -github.com/openshift/api v0.0.0-20210603185846-379093ab5d80/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= -github.com/openshift/api v0.0.0-20210617200138-9f677aa140c1 h1:qwYANvePJZhyBTFPn6kMPqyuPq4Zh8fmgWRtfOPLHgM= -github.com/openshift/api v0.0.0-20210617200138-9f677aa140c1/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= -github.com/openshift/api v0.0.0-20210621070332-ea13be50ba2d h1:8+4jIjWRI2FUVq2REmv4XW3bD/Ty2pKIxbC6nGKo4ic= -github.com/openshift/api v0.0.0-20210621070332-ea13be50ba2d/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= -github.com/openshift/api v0.0.0-20210624153211-ae79113891b0 h1:Wbo6MbFHqjoPNV5iSONP3VZV50RR6CS8MYoVHFlKIuQ= -github.com/openshift/api v0.0.0-20210624153211-ae79113891b0/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= github.com/openshift/apiserver-library-go v0.0.0-20210426120049-59b0e972bfb7 h1:eJDIx4xV8J+9Zg1W8UJPv5SME0pGNmXttWIUU5Fg6O4= github.com/openshift/apiserver-library-go v0.0.0-20210426120049-59b0e972bfb7/go.mod h1:nqn2IWld2A+Q9Lp/xGsbmUr2RyDCQixRU83yqAbymUM= github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= diff --git a/hack/openapi-violation.list b/hack/openapi-violation.list index 5c25cb4d9e..5a34ce8ed4 100644 --- a/hack/openapi-violation.list +++ b/hack/openapi-violation.list @@ -3,342 +3,7 @@ API rule violation: list_type_missing,github.com/openshift/api/apiserver/v1,APIR API rule violation: list_type_missing,github.com/openshift/api/apiserver/v1,PerNodeAPIRequestLog,ByUser API rule violation: list_type_missing,github.com/openshift/api/apiserver/v1,PerResourceAPIRequestLog,ByNode API rule violation: list_type_missing,github.com/openshift/api/apiserver/v1,PerUserAPIRequestCount,ByVerb -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,CustomDeploymentStrategyParams,Command -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,CustomDeploymentStrategyParams,Environment -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,DeploymentConfigStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,DeploymentDetails,Causes -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,DeploymentRequest,ExcludeTriggers -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,DeploymentTriggerImageChangeParams,ContainerNames -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,ExecNewPodHook,Command -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,ExecNewPodHook,Env -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,ExecNewPodHook,Volumes -API rule violation: list_type_missing,github.com/openshift/api/apps/v1,LifecycleHook,TagImages -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ClusterRole,Rules -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ClusterRoleBinding,Subjects -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,GroupRestriction,Groups -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,GroupRestriction,Selectors -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,LocalSubjectAccessReview,GroupsSlice -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,PolicyRule,APIGroups -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,PolicyRule,NonResourceURLsSlice -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,PolicyRule,ResourceNames -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,PolicyRule,Resources -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,PolicyRule,Verbs -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ResourceAccessReviewResponse,GroupsSlice -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ResourceAccessReviewResponse,UsersSlice -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,Role,Rules -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,RoleBinding,Subjects -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ServiceAccountRestriction,Namespaces -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,ServiceAccountRestriction,ServiceAccounts -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,SubjectAccessReview,GroupsSlice -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,SubjectRulesReviewSpec,Groups -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,SubjectRulesReviewStatus,Rules -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,UserRestriction,Groups -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,UserRestriction,Selectors -API rule violation: list_type_missing,github.com/openshift/api/authorization/v1,UserRestriction,Users -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildConfigSpec,Triggers -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildConfigStatus,ImageChangeTriggers -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildOutput,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildPostCommitSpec,Args -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildPostCommitSpec,Command -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildRequest,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildRequest,TriggeredBy -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildSource,ConfigMaps -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildSource,Images -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildSource,Secrets -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildSpec,TriggeredBy -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/build/v1,BuildStatus,Stages -API rule violation: list_type_missing,github.com/openshift/api/build/v1,CustomBuildStrategy,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,CustomBuildStrategy,Secrets -API rule violation: list_type_missing,github.com/openshift/api/build/v1,DockerBuildStrategy,BuildArgs -API rule violation: list_type_missing,github.com/openshift/api/build/v1,DockerBuildStrategy,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,DockerStrategyOptions,BuildArgs -API rule violation: list_type_missing,github.com/openshift/api/build/v1,GenericWebHookEvent,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,GitInfo,Refs -API rule violation: list_type_missing,github.com/openshift/api/build/v1,ImageSource,As -API rule violation: list_type_missing,github.com/openshift/api/build/v1,ImageSource,Paths -API rule violation: list_type_missing,github.com/openshift/api/build/v1,JenkinsPipelineBuildStrategy,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,SourceBuildStrategy,Env -API rule violation: list_type_missing,github.com/openshift/api/build/v1,StageInfo,Steps API rule violation: list_type_missing,github.com/openshift/api/cloudnetwork/v1,CloudPrivateIPConfigStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/config/v1,APIServerNamedServingCert,Names -API rule violation: list_type_missing,github.com/openshift/api/config/v1,APIServerServingCerts,NamedCertificates -API rule violation: list_type_missing,github.com/openshift/api/config/v1,APIServerSpec,AdditionalCORSAllowedOrigins -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AWSPlatformSpec,ServiceEndpoints -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AWSPlatformStatus,ResourceTags -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AWSPlatformStatus,ServiceEndpoints -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AdmissionConfig,DisabledAdmissionPlugins -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AdmissionConfig,EnabledAdmissionPlugins -API rule violation: list_type_missing,github.com/openshift/api/config/v1,AuthenticationSpec,WebhookTokenAuthenticators -API rule violation: list_type_missing,github.com/openshift/api/config/v1,BuildDefaults,Env -API rule violation: list_type_missing,github.com/openshift/api/config/v1,BuildDefaults,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/config/v1,BuildOverrides,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/config/v1,BuildOverrides,Tolerations -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterOperatorStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterOperatorStatus,RelatedObjects -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterOperatorStatus,Versions -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterVersionSpec,Overrides -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterVersionStatus,AvailableUpdates -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterVersionStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ClusterVersionStatus,History -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ComponentRouteStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ComponentRouteStatus,ConsumingUsers -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ComponentRouteStatus,CurrentHostnames -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ComponentRouteStatus,RelatedObjects -API rule violation: list_type_missing,github.com/openshift/api/config/v1,CustomFeatureGates,Disabled -API rule violation: list_type_missing,github.com/openshift/api/config/v1,CustomFeatureGates,Enabled -API rule violation: list_type_missing,github.com/openshift/api/config/v1,EtcdConnectionInfo,URLs -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ExternalIPConfig,AutoAssignCIDRs -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ExternalIPPolicy,AllowedCIDRs -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ExternalIPPolicy,RejectedCIDRs -API rule violation: list_type_missing,github.com/openshift/api/config/v1,FeatureGateEnabledDisabled,Disabled -API rule violation: list_type_missing,github.com/openshift/api/config/v1,FeatureGateEnabledDisabled,Enabled -API rule violation: list_type_missing,github.com/openshift/api/config/v1,GenericAPIServerConfig,CORSAllowedOrigins -API rule violation: list_type_missing,github.com/openshift/api/config/v1,GitHubIdentityProvider,Organizations -API rule violation: list_type_missing,github.com/openshift/api/config/v1,GitHubIdentityProvider,Teams -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ImageSpec,AllowedRegistriesForImport -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ImageSpec,ExternalRegistryHostnames -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ImageStatus,ExternalRegistryHostnames -API rule violation: list_type_missing,github.com/openshift/api/config/v1,IngressSpec,ComponentRoutes -API rule violation: list_type_missing,github.com/openshift/api/config/v1,IngressStatus,ComponentRoutes -API rule violation: list_type_missing,github.com/openshift/api/config/v1,LDAPAttributeMapping,Email -API rule violation: list_type_missing,github.com/openshift/api/config/v1,LDAPAttributeMapping,ID -API rule violation: list_type_missing,github.com/openshift/api/config/v1,LDAPAttributeMapping,Name -API rule violation: list_type_missing,github.com/openshift/api/config/v1,LDAPAttributeMapping,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/config/v1,NamedCertificate,Names -API rule violation: list_type_missing,github.com/openshift/api/config/v1,NetworkSpec,ClusterNetwork -API rule violation: list_type_missing,github.com/openshift/api/config/v1,NetworkSpec,ServiceNetwork -API rule violation: list_type_missing,github.com/openshift/api/config/v1,NetworkStatus,ClusterNetwork -API rule violation: list_type_missing,github.com/openshift/api/config/v1,NetworkStatus,ServiceNetwork -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OAuthSpec,IdentityProviders -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OpenIDClaims,Email -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OpenIDClaims,Name -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OpenIDClaims,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OpenIDIdentityProvider,ExtraScopes -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OperatorHubSpec,Sources -API rule violation: list_type_missing,github.com/openshift/api/config/v1,OperatorHubStatus,Sources -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ProxySpec,ReadinessEndpoints -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RegistrySources,AllowedRegistries -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RegistrySources,BlockedRegistries -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RegistrySources,InsecureRegistries -API rule violation: list_type_missing,github.com/openshift/api/config/v1,Release,Channels -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,ClientCommonNames -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,EmailHeaders -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,Headers -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,NameHeaders -API rule violation: list_type_missing,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,PreferredUsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ServingInfo,CipherSuites -API rule violation: list_type_missing,github.com/openshift/api/config/v1,ServingInfo,NamedCertificates -API rule violation: list_type_missing,github.com/openshift/api/config/v1,TLSProfileSpec,Ciphers -API rule violation: list_type_missing,github.com/openshift/api/config/v1,featureSetBuilder,forceOff -API rule violation: list_type_missing,github.com/openshift/api/config/v1,featureSetBuilder,forceOn -API rule violation: list_type_missing,github.com/openshift/api/helm/v1beta1,HelmChartRepositoryStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/image/v1,Image,DockerImageLayers -API rule violation: list_type_missing,github.com/openshift/api/image/v1,Image,DockerImageSignatures -API rule violation: list_type_missing,github.com/openshift/api/image/v1,Image,Signatures -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageBlobReferences,Layers -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageSignature,Conditions -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageSignature,Content -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageStreamImportSpec,Images -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageStreamImportStatus,Images -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageStreamSpec,Tags -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageStreamStatus,Tags -API rule violation: list_type_missing,github.com/openshift/api/image/v1,ImageStreamTag,Conditions -API rule violation: list_type_missing,github.com/openshift/api/image/v1,NamedTagEventList,Conditions -API rule violation: list_type_missing,github.com/openshift/api/image/v1,NamedTagEventList,Items -API rule violation: list_type_missing,github.com/openshift/api/image/v1,RepositoryImportStatus,AdditionalTags -API rule violation: list_type_missing,github.com/openshift/api/image/v1,RepositoryImportStatus,Images -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,KubeAPIServerConfig,ServiceAccountPublicKeyFiles -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,KubeAPIServerImagePolicyConfig,ExternalRegistryHostnames -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,MasterAuthConfig,WebhookTokenAuthenticators -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,RequestHeaderAuthenticationOptions,ClientCommonNames -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,RequestHeaderAuthenticationOptions,ExtraHeaderPrefixes -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,RequestHeaderAuthenticationOptions,GroupHeaders -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,RequestHeaderAuthenticationOptions,UsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,UserAgentMatchRule,HTTPVerbs -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,UserAgentMatchingConfig,DeniedClients -API rule violation: list_type_missing,github.com/openshift/api/kubecontrolplane/v1,UserAgentMatchingConfig,RequiredClients -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ActiveDirectoryConfig,GroupMembershipAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ActiveDirectoryConfig,UserNameAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,AdmissionConfig,PluginOrderOverride -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,AugmentedActiveDirectoryConfig,GroupMembershipAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,AugmentedActiveDirectoryConfig,GroupNameAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,AugmentedActiveDirectoryConfig,UserNameAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,BuildDefaultsConfig,Env -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,BuildDefaultsConfig,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,BuildOverridesConfig,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,BuildOverridesConfig,Tolerations -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ControllerConfig,Controllers -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,EtcdConnectionInfo,URLs -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,GitHubIdentityProvider,Organizations -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,GitHubIdentityProvider,Teams -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,KubernetesMasterConfig,APILevels -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,LDAPAttributeMapping,Email -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,LDAPAttributeMapping,ID -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,LDAPAttributeMapping,Name -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,LDAPAttributeMapping,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,MasterAuthConfig,WebhookTokenAuthenticators -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,MasterConfig,APILevels -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,MasterConfig,CORSAllowedOrigins -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,MasterNetworkConfig,ClusterNetworks -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,MasterNetworkConfig,ExternalIPNetworkCIDRs -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,NamedCertificate,Names -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,NodeConfig,DNSNameservers -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OAuthConfig,IdentityProviders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OpenIDClaims,Email -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OpenIDClaims,ID -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OpenIDClaims,Name -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OpenIDClaims,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,OpenIDIdentityProvider,ExtraScopes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RFC2307Config,GroupMembershipAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RFC2307Config,GroupNameAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RFC2307Config,UserNameAttributes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderAuthenticationOptions,ClientCommonNames -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderAuthenticationOptions,ExtraHeaderPrefixes -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderAuthenticationOptions,GroupHeaders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderAuthenticationOptions,UsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderIdentityProvider,ClientCommonNames -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderIdentityProvider,EmailHeaders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderIdentityProvider,Headers -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderIdentityProvider,NameHeaders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,RequestHeaderIdentityProvider,PreferredUsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ServiceAccountConfig,ManagedNames -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ServiceAccountConfig,PublicKeyFiles -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ServingInfo,CipherSuites -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,ServingInfo,NamedCertificates -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,SessionSecrets,Secrets -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,UserAgentMatchRule,HTTPVerbs -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,UserAgentMatchingConfig,DeniedClients -API rule violation: list_type_missing,github.com/openshift/api/legacyconfig/v1,UserAgentMatchingConfig,RequiredClients -API rule violation: list_type_missing,github.com/openshift/api/network/v1,ClusterNetwork,ClusterNetworks -API rule violation: list_type_missing,github.com/openshift/api/network/v1,EgressNetworkPolicySpec,Egress -API rule violation: list_type_missing,github.com/openshift/api/network/v1,HostSubnet,EgressCIDRs -API rule violation: list_type_missing,github.com/openshift/api/network/v1,HostSubnet,EgressIPs -API rule violation: list_type_missing,github.com/openshift/api/network/v1,NetNamespace,EgressIPs -API rule violation: list_type_missing,github.com/openshift/api/networkoperator/v1,EgressRouterSpec,Addresses -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,ClusterRoleScopeRestriction,Namespaces -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,ClusterRoleScopeRestriction,RoleNames -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthAccessToken,Scopes -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthAuthorizeToken,Scopes -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthClient,AdditionalSecrets -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthClient,RedirectURIs -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthClient,ScopeRestrictions -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,OAuthClientAuthorization,Scopes -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,ScopeRestriction,ExactValues -API rule violation: list_type_missing,github.com/openshift/api/oauth/v1,UserOAuthAccessToken,Scopes -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,BuildDefaultsConfig,Env -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,BuildDefaultsConfig,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,BuildOverridesConfig,ImageLabels -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,BuildOverridesConfig,Tolerations -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,DockerPullSecretControllerConfig,RegistryURLs -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,FrontProxyConfig,AllowedNames -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,FrontProxyConfig,ExtraHeaderPrefixes -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,FrontProxyConfig,GroupHeaders -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,FrontProxyConfig,UsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,ImagePolicyConfig,ExternalRegistryHostnames -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,NetworkControllerConfig,ClusterNetworks -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,OpenShiftControllerManagerConfig,Controllers -API rule violation: list_type_missing,github.com/openshift/api/openshiftcontrolplane/v1,ServiceAccountControllerConfig,ManagedNames -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,AccessLogging,HTTPCaptureCookies -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,AddPage,DisabledActions -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,ConsoleSpec,Plugins -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DNSNodePlacement,Tolerations -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DNSSpec,Servers -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DNSStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DeveloperConsoleCatalogCategory,Subcategories -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DeveloperConsoleCatalogCategoryMeta,Tags -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,DeveloperConsoleCatalogCustomization,Categories -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,ForwardPlugin,Upstreams -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,HybridOverlayConfig,HybridClusterNetwork -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,IPFIXConfig,Collectors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,IngressControllerCaptureHTTPHeaders,Request -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,IngressControllerCaptureHTTPHeaders,Response -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,IngressControllerHTTPHeaders,HeaderNameCaseAdjustments -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,IngressControllerStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NetFlowConfig,Collectors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NetworkSpec,AdditionalNetworks -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NetworkSpec,ClusterNetwork -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NetworkSpec,ServiceNetwork -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NodePlacement,Tolerations -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,NodeStatus,LastFailedRevisionErrors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,OperatorStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,OperatorStatus,Generations -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,ProjectAccess,AvailableClusterRoles -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,QuickStarts,Disabled -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,SFlowConfig,Collectors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,Server,Zones -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,StaticIPAMConfig,Addresses -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,StaticIPAMConfig,Routes -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,StaticIPAMDNS,Nameservers -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,StaticIPAMDNS,Search -API rule violation: list_type_missing,github.com/openshift/api/operator/v1,StaticPodOperatorStatus,NodeStatuses -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,ImageContentSourcePolicySpec,RepositoryDigestMirrors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,NodeStatus,LastFailedDeploymentErrors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,OperatorStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,RepositoryDigestMirrors,Mirrors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,StaticPodOperatorStatus,NodeStatuses -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,VersionAvailability,Errors -API rule violation: list_type_missing,github.com/openshift/api/operator/v1alpha1,VersionAvailability,Generations -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,OutageEntry,EndLogs -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,OutageEntry,StartLogs -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,PodNetworkConnectivityCheckStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,PodNetworkConnectivityCheckStatus,Failures -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,PodNetworkConnectivityCheckStatus,Outages -API rule violation: list_type_missing,github.com/openshift/api/operatorcontrolplane/v1alpha1,PodNetworkConnectivityCheckStatus,Successes -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,GitHubIdentityProvider,Organizations -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,GitHubIdentityProvider,Teams -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,LDAPAttributeMapping,Email -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,LDAPAttributeMapping,ID -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,LDAPAttributeMapping,Name -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,LDAPAttributeMapping,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OAuthConfig,IdentityProviders -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OpenIDClaims,Email -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OpenIDClaims,ID -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OpenIDClaims,Name -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OpenIDClaims,PreferredUsername -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,OpenIDIdentityProvider,ExtraScopes -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,RequestHeaderIdentityProvider,ClientCommonNames -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,RequestHeaderIdentityProvider,EmailHeaders -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,RequestHeaderIdentityProvider,Headers -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,RequestHeaderIdentityProvider,NameHeaders -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,RequestHeaderIdentityProvider,PreferredUsernameHeaders -API rule violation: list_type_missing,github.com/openshift/api/osin/v1,SessionSecrets,Secrets -API rule violation: list_type_missing,github.com/openshift/api/project/v1,ProjectSpec,Finalizers -API rule violation: list_type_missing,github.com/openshift/api/project/v1,ProjectStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/route/v1,RouteIngress,Conditions -API rule violation: list_type_missing,github.com/openshift/api/route/v1,RouteSpec,AlternateBackends -API rule violation: list_type_missing,github.com/openshift/api/route/v1,RouteStatus,Ingress -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigSpec,Architectures -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigSpec,SkippedImagestreams -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigSpec,SkippedTemplates -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigStatus,Architectures -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigStatus,SkippedImagestreams -API rule violation: list_type_missing,github.com/openshift/api/samples/v1,ConfigStatus,SkippedTemplates -API rule violation: list_type_missing,github.com/openshift/api/security/v1,FSGroupStrategyOptions,Ranges -API rule violation: list_type_missing,github.com/openshift/api/security/v1,PodSecurityPolicyReviewSpec,ServiceAccountNames -API rule violation: list_type_missing,github.com/openshift/api/security/v1,PodSecurityPolicyReviewStatus,AllowedServiceAccounts -API rule violation: list_type_missing,github.com/openshift/api/security/v1,PodSecurityPolicySubjectReviewSpec,Groups -API rule violation: list_type_missing,github.com/openshift/api/security/v1,RangeAllocation,Data -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,AllowedCapabilities -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,AllowedFlexVolumes -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,AllowedUnsafeSysctls -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,DefaultAddCapabilities -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,ForbiddenSysctls -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,Groups -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,RequiredDropCapabilities -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,SeccompProfiles -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,Users -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SecurityContextConstraints,Volumes -API rule violation: list_type_missing,github.com/openshift/api/security/v1,SupplementalGroupsStrategyOptions,Ranges -API rule violation: list_type_missing,github.com/openshift/api/template/v1,BrokerTemplateInstanceSpec,BindingIDs -API rule violation: list_type_missing,github.com/openshift/api/template/v1,Template,Objects -API rule violation: list_type_missing,github.com/openshift/api/template/v1,Template,Parameters -API rule violation: list_type_missing,github.com/openshift/api/template/v1,TemplateInstanceRequester,Groups -API rule violation: list_type_missing,github.com/openshift/api/template/v1,TemplateInstanceStatus,Conditions -API rule violation: list_type_missing,github.com/openshift/api/template/v1,TemplateInstanceStatus,Objects -API rule violation: list_type_missing,github.com/openshift/api/user/v1,User,Groups -API rule violation: list_type_missing,github.com/openshift/api/user/v1,User,Identities API rule violation: list_type_missing,k8s.io/api/admissionregistration/v1,MutatingWebhook,AdmissionReviewVersions API rule violation: list_type_missing,k8s.io/api/admissionregistration/v1,MutatingWebhook,Rules API rule violation: list_type_missing,k8s.io/api/admissionregistration/v1,MutatingWebhookConfiguration,Webhooks @@ -709,110 +374,6 @@ API rule violation: list_type_missing,k8s.io/apiserver/pkg/apis/audit/v1beta1,Po API rule violation: list_type_missing,k8s.io/controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Controllers API rule violation: list_type_missing,k8s.io/controller-manager/config/v1alpha1,LeaderMigrationConfiguration,ControllerLeaders API rule violation: names_match,github.com/openshift/api/apiserver/v1,PerUserAPIRequestCount,UserName -API rule violation: names_match,github.com/openshift/api/apps/v1,DeploymentLogOptions,NoWait -API rule violation: names_match,github.com/openshift/api/authorization/v1,Action,Group -API rule violation: names_match,github.com/openshift/api/authorization/v1,Action,Version -API rule violation: names_match,github.com/openshift/api/authorization/v1,GroupRestriction,Selectors -API rule violation: names_match,github.com/openshift/api/authorization/v1,LocalSubjectAccessReview,GroupsSlice -API rule violation: names_match,github.com/openshift/api/authorization/v1,PolicyRule,NonResourceURLsSlice -API rule violation: names_match,github.com/openshift/api/authorization/v1,ResourceAccessReviewResponse,EvaluationError -API rule violation: names_match,github.com/openshift/api/authorization/v1,ResourceAccessReviewResponse,GroupsSlice -API rule violation: names_match,github.com/openshift/api/authorization/v1,ResourceAccessReviewResponse,UsersSlice -API rule violation: names_match,github.com/openshift/api/authorization/v1,RoleBindingRestrictionSpec,GroupRestriction -API rule violation: names_match,github.com/openshift/api/authorization/v1,RoleBindingRestrictionSpec,ServiceAccountRestriction -API rule violation: names_match,github.com/openshift/api/authorization/v1,RoleBindingRestrictionSpec,UserRestriction -API rule violation: names_match,github.com/openshift/api/authorization/v1,ServiceAccountRestriction,ServiceAccounts -API rule violation: names_match,github.com/openshift/api/authorization/v1,SubjectAccessReview,GroupsSlice -API rule violation: names_match,github.com/openshift/api/authorization/v1,UserRestriction,Selectors -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,AuthorEmail -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,AuthorName -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,Commit -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,CommitterEmail -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,CommitterName -API rule violation: names_match,github.com/openshift/api/build/v1,BinaryBuildRequestOptions,Message -API rule violation: names_match,github.com/openshift/api/build/v1,BuildLogOptions,NoWait -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerCause,GitHubWebHook -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerCause,GitLabWebHook -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerPolicy,BitbucketWebHook -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerPolicy,GenericWebHook -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerPolicy,GitHubWebHook -API rule violation: names_match,github.com/openshift/api/build/v1,BuildTriggerPolicy,GitLabWebHook -API rule violation: names_match,github.com/openshift/api/config/v1,AdmissionConfig,DisabledAdmissionPlugins -API rule violation: names_match,github.com/openshift/api/config/v1,AdmissionConfig,EnabledAdmissionPlugins -API rule violation: names_match,github.com/openshift/api/config/v1,AuthenticationSpec,OAuthMetadata -API rule violation: names_match,github.com/openshift/api/config/v1,EtcdConnectionInfo,URLs -API rule violation: names_match,github.com/openshift/api/config/v1,FeatureGateEnabledDisabled,Disabled -API rule violation: names_match,github.com/openshift/api/config/v1,FeatureGateEnabledDisabled,Enabled -API rule violation: names_match,github.com/openshift/api/config/v1,GenericAPIServerConfig,AdmissionConfig -API rule violation: names_match,github.com/openshift/api/config/v1,IdentityProviderConfig,GitHub -API rule violation: names_match,github.com/openshift/api/config/v1,IdentityProviderConfig,GitLab -API rule violation: names_match,github.com/openshift/api/config/v1,IdentityProviderConfig,HTPasswd -API rule violation: names_match,github.com/openshift/api/config/v1,InfrastructureStatus,APIServerInternalURL -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformSpec,BareMetal -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformSpec,IBMCloud -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformSpec,OpenStack -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformSpec,VSphere -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformStatus,BareMetal -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformStatus,IBMCloud -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformStatus,OpenStack -API rule violation: names_match,github.com/openshift/api/config/v1,PlatformStatus,VSphere -API rule violation: names_match,github.com/openshift/api/config/v1,RequestHeaderIdentityProvider,ClientCA -API rule violation: names_match,github.com/openshift/api/config/v1,featureSetBuilder,forceOff -API rule violation: names_match,github.com/openshift/api/config/v1,featureSetBuilder,forceOn -API rule violation: names_match,github.com/openshift/api/helm/v1beta1,HelmChartRepositorySpec,DisplayName -API rule violation: names_match,github.com/openshift/api/image/v1,DockerImageReference,ID -API rule violation: names_match,github.com/openshift/api/image/v1,DockerImageReference,Name -API rule violation: names_match,github.com/openshift/api/image/v1,DockerImageReference,Namespace -API rule violation: names_match,github.com/openshift/api/image/v1,DockerImageReference,Registry -API rule violation: names_match,github.com/openshift/api/image/v1,DockerImageReference,Tag -API rule violation: names_match,github.com/openshift/api/image/v1,ImageLayer,LayerSize -API rule violation: names_match,github.com/openshift/api/image/v1,ImageLayerData,LayerSize -API rule violation: names_match,github.com/openshift/api/kubecontrolplane/v1,KubeAPIServerConfig,OAuthConfig -API rule violation: names_match,github.com/openshift/api/kubecontrolplane/v1,MasterAuthConfig,OAuthMetadataFile -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,ActiveDirectoryConfig,AllUsersQuery -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,AugmentedActiveDirectoryConfig,AllGroupsQuery -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,AugmentedActiveDirectoryConfig,AllUsersQuery -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,DockerConfig,DockershimRootDirectory -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,EtcdConfig,StorageDir -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,EtcdConnectionInfo,URLs -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,IdentityProvider,UseAsChallenger -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,IdentityProvider,UseAsLogin -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,LDAPQuery,TimeLimit -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,LDAPSyncConfig,ActiveDirectoryConfig -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,LDAPSyncConfig,AugmentedActiveDirectoryConfig -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,LDAPSyncConfig,LDAPGroupUIDToOpenShiftGroupNameMapping -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,LDAPSyncConfig,RFC2307Config -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterAuthConfig,OAuthMetadataFile -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterClients,OpenShiftLoopbackClientConnectionOverrides -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterClients,OpenShiftLoopbackKubeConfig -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterConfig,OAuthConfig -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterNetworkConfig,DeprecatedClusterNetworkCIDR -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,MasterNetworkConfig,DeprecatedHostSubnetLength -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,NodeConfig,DeprecatedNetworkPluginName -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,NodeConfig,IPTablesSyncPeriod -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,OpenIDIdentityProvider,URLs -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,RFC2307Config,AllGroupsQuery -API rule violation: names_match,github.com/openshift/api/legacyconfig/v1,RFC2307Config,AllUsersQuery -API rule violation: names_match,github.com/openshift/api/network/v1,ClusterNetwork,HostSubnetLength -API rule violation: names_match,github.com/openshift/api/network/v1,ClusterNetworkEntry,CIDR -API rule violation: names_match,github.com/openshift/api/network/v1,NetNamespace,NetID -API rule violation: names_match,github.com/openshift/api/network/v1,NetNamespace,NetName -API rule violation: names_match,github.com/openshift/api/oauth/v1,ScopeRestriction,ExactValues -API rule violation: names_match,github.com/openshift/api/operator/v1,AWSLoadBalancerParameters,ClassicLoadBalancerParameters -API rule violation: names_match,github.com/openshift/api/operator/v1,AWSLoadBalancerParameters,NetworkLoadBalancerParameters -API rule violation: names_match,github.com/openshift/api/operator/v1,AuthenticationStatus,OAuthAPIServer -API rule violation: names_match,github.com/openshift/api/operator/v1,DefaultNetworkDefinition,OpenShiftSDNConfig -API rule violation: names_match,github.com/openshift/api/operator/v1,OVNKubernetesConfig,IPsecConfig -API rule violation: names_match,github.com/openshift/api/operator/v1alpha1,OperatorStatus,CurrentAvailability -API rule violation: names_match,github.com/openshift/api/operator/v1alpha1,OperatorStatus,TargetAvailability -API rule violation: names_match,github.com/openshift/api/operatorcontrolplane/v1alpha1,LogEntry,Start -API rule violation: names_match,github.com/openshift/api/osin/v1,IdentityProvider,UseAsChallenger -API rule violation: names_match,github.com/openshift/api/osin/v1,IdentityProvider,UseAsLogin -API rule violation: names_match,github.com/openshift/api/osin/v1,OpenIDIdentityProvider,URLs -API rule violation: names_match,github.com/openshift/api/osin/v1,OsinServerConfig,OAuthConfig -API rule violation: names_match,github.com/openshift/api/quota/v1,ClusterResourceQuotaSelector,AnnotationSelector -API rule violation: names_match,github.com/openshift/api/quota/v1,ClusterResourceQuotaSelector,LabelSelector -API rule violation: names_match,github.com/openshift/api/template/v1,Template,ObjectLabels API rule violation: names_match,k8s.io/api/authorization/v1beta1,SubjectAccessReviewSpec,Groups API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState @@ -922,5 +483,3 @@ API rule violation: names_match,k8s.io/controller-manager/config/v1alpha1,Generi API rule violation: names_match,k8s.io/controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,LeaderMigrationEnabled API rule violation: names_match,k8s.io/controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,MinResyncPeriod API rule violation: names_match,k8s.io/controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Port -API rule violation: omitempty_match_case,github.com/openshift/api/operator/v1,StaticPodOperatorStatus,LatestAvailableRevision -API rule violation: omitempty_match_case,github.com/openshift/api/operator/v1,StaticPodOperatorStatus,LatestAvailableRevisionReason diff --git a/pkg/cmd/openshift-apiserver/openshiftadmission/register.go b/pkg/cmd/openshift-apiserver/openshiftadmission/register.go index ec9d79bcdd..99a5647d76 100644 --- a/pkg/cmd/openshift-apiserver/openshiftadmission/register.go +++ b/pkg/cmd/openshift-apiserver/openshiftadmission/register.go @@ -12,6 +12,7 @@ import ( buildstrategyrestrictions "github.com/openshift/openshift-apiserver/pkg/build/apiserver/admission/strategyrestrictions" imageadmission "github.com/openshift/openshift-apiserver/pkg/image/apiserver/admission/limitrange" projectrequestlimit "github.com/openshift/openshift-apiserver/pkg/project/apiserver/admission/requestlimit" + requiredrouteannotations "github.com/openshift/openshift-apiserver/pkg/route/apiserver/admission/requiredrouteannotations" ) // TODO register this per apiserver or at least per process @@ -38,6 +39,7 @@ func RegisterOpenshiftAdmissionPlugins(plugins *admission.Plugins) { imageadmission.Register(plugins) imagepolicy.Register(plugins) quotaclusterresourcequota.Register(plugins) + requiredrouteannotations.Register(plugins) } var ( @@ -54,6 +56,7 @@ var ( "image.openshift.io/ImageLimitRange", "image.openshift.io/ImagePolicy", "quota.openshift.io/ClusterResourceQuota", + "route.openshift.io/RequiredRouteAnnotations", // the rest of the kube chain goes here "MutatingAdmissionWebhook", diff --git a/pkg/route/apiserver/admission/requiredrouteannotations/admission.go b/pkg/route/apiserver/admission/requiredrouteannotations/admission.go new file mode 100644 index 0000000000..faf7a6c53d --- /dev/null +++ b/pkg/route/apiserver/admission/requiredrouteannotations/admission.go @@ -0,0 +1,321 @@ +package requiredrouteannotations + +import ( + "context" + "errors" + "fmt" + "io" + "regexp" + "strconv" + "strings" + "time" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apiserver/pkg/admission" + "k8s.io/apiserver/pkg/admission/initializer" + "k8s.io/client-go/informers" + corev1listers "k8s.io/client-go/listers/core/v1" + "k8s.io/client-go/rest" + logger "k8s.io/klog/klogr" + + configv1 "github.com/openshift/api/config/v1" + routev1 "github.com/openshift/api/route/v1" + configtypedclient "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + routetypedclient "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1" + "github.com/openshift/library-go/pkg/apiserver/admission/admissionrestconfig" + routeapi "github.com/openshift/openshift-apiserver/pkg/route/apis/route" +) + +var Logger = logger.New() +var log = Logger.WithName("admission") + +const ( + pluginName = "route.openshift.io/RequiredRouteAnnotations" + timeToWaitForCacheSync = 10 * time.Second +) + +func Register(plugins *admission.Plugins) { + plugins.Register(pluginName, + func(_ io.Reader) (admission.Interface, error) { + return NewRequiredRouteAnnotations() + }) +} + +type requiredRouteAnnotations struct { + *admission.Handler + routeClient routetypedclient.RoutesGetter + configClient configtypedclient.IngressesGetter + nsLister corev1listers.NamespaceLister + nsListerSynced func() bool +} + +// Ensure that the required OpenShift admission interfaces are implemented. +var _ = initializer.WantsExternalKubeInformerFactory(&requiredRouteAnnotations{}) +var _ = admissionrestconfig.WantsRESTClientConfig(&requiredRouteAnnotations{}) +var _ = admission.ValidationInterface(&requiredRouteAnnotations{}) + +const hstsAnnotation = "haproxy.router.openshift.io/hsts_header" + +// Validate ensures that routes specify required annotations, and returns nil if valid. +func (o *requiredRouteAnnotations) Validate(ctx context.Context, a admission.Attributes, _ admission.ObjectInterfaces) (err error) { + if a.GetResource().GroupResource() != routev1.Resource("routes") { + return nil + } + if _, isRoute := a.GetObject().(*routeapi.Route); !isRoute { + return nil + } + + if !o.waitForSyncedStore(time.After(timeToWaitForCacheSync)) { + return admission.NewForbidden(a, errors.New(pluginName+": caches not synchronized")) + } + + ingress, err := o.configClient.Ingresses().Get(ctx, "cluster", metav1.GetOptions{}) + if err != nil { + return admission.NewForbidden(a, err) + } + + newRoute := a.GetObject().(*routeapi.Route) + if old := a.GetOldObject(); old != nil { + oldRoute := old.(*routeapi.Route) + // if this is an update and the annotation in question is the same, then we know the update will be allowed + if a.GetOperation() == admission.Update && newRoute.Annotations[hstsAnnotation] == oldRoute.Annotations[hstsAnnotation] { + return nil + } + } + + namespace, err := o.nsLister.Get(newRoute.Namespace) + if err != nil { + return admission.NewForbidden(a, err) + } + + if err = isRouteHSTSAllowed(ingress, newRoute, namespace); err != nil { + return admission.NewForbidden(a, err) + } + return nil +} + +func (o *requiredRouteAnnotations) SetRESTClientConfig(restClientConfig rest.Config) { + var err error + // TODO: Use an informer for config. + o.configClient, err = configtypedclient.NewForConfig(&restClientConfig) + if err != nil { + utilruntime.HandleError(err) + return + } + o.routeClient, err = routetypedclient.NewForConfig(&restClientConfig) + if err != nil { + utilruntime.HandleError(err) + return + } +} + +func (o *requiredRouteAnnotations) SetExternalKubeInformerFactory(kubeInformers informers.SharedInformerFactory) { + o.nsLister = kubeInformers.Core().V1().Namespaces().Lister() + o.nsListerSynced = kubeInformers.Core().V1().Namespaces().Informer().HasSynced +} + +func (o *requiredRouteAnnotations) waitForSyncedStore(timeout <-chan time.Time) bool { + for !o.nsListerSynced() { + select { + case <-time.After(100 * time.Millisecond): + case <-timeout: + return o.nsListerSynced() + } + } + + return true +} + +func (o *requiredRouteAnnotations) ValidateInitialization() error { + if o.configClient == nil { + return fmt.Errorf(pluginName + " plugin needs a config client") + } + if o.routeClient == nil { + return fmt.Errorf(pluginName + " plugin needs a route client") + } + if o.nsLister == nil { + return fmt.Errorf(pluginName + " plugin needs a namespace lister") + } + if o.nsListerSynced == nil { + return fmt.Errorf(pluginName + " plugin needs a namespace lister synced") + } + return nil +} + +func NewRequiredRouteAnnotations() (admission.Interface, error) { + return &requiredRouteAnnotations{ + Handler: admission.NewHandler(admission.Create, admission.Update), + }, nil +} + +// isRouteHSTSAllowed returns nil if the route is allowed. Otherwise, returns details and a suggestion in the error +func isRouteHSTSAllowed(ingress *configv1.Ingress, newRoute *routeapi.Route, namespace *corev1.Namespace) error { + // Invalid if a HSTS Policy is specified but this route is not TLS. Just log a warning. + if tls := newRoute.Spec.TLS; tls != nil { + switch termination := tls.Termination; termination { + case routeapi.TLSTerminationEdge, routeapi.TLSTerminationReencrypt: + // Valid case + default: + // Non-tls routes will not get HSTS headers, but can still be valid + log.Info("HSTS Policy not accepted for %s, termination type: %s", newRoute.Name, termination) + return nil + } + } else { + return fmt.Errorf("termination type is empty, must be %s or %s", routev1.TLSTerminationEdge, routev1.TLSTerminationReencrypt) + } + + requirements := ingress.Spec.RequiredHSTSPolicies + for _, requirement := range requirements { + if matches, err := requiredHSTSMatchesRoute(requirement, newRoute, namespace); err != nil { + return err + } else if !matches { + continue + } + + routeHSTS, err := hstsConfigFromRoute(newRoute) + if err != nil { + return err + } + + requirementErr := routeHSTS.meetsRequirements(requirement) + if requirementErr != nil { + return requirementErr + } + // Validation only checks the first matching required HSTS rule. + return nil + } + + // None of the requirements matched this route's domain/namespace, it is automatically allowed + return nil +} + +type hstsConfig struct { + maxAge int32 + preload bool + includeSubDomains bool +} + +// Parse out the hstsConfig fields from the annotation +func hstsConfigFromRoute(route *routeapi.Route) (hstsConfig, error) { + ret := hstsConfig{} + ret.maxAge = -1 + tokens := strings.Split(route.Annotations[hstsAnnotation], ";") + for _, token := range tokens { + trimmed := strings.Trim(token, " ") + if strings.EqualFold(trimmed, "includeSubDomains") { + ret.includeSubDomains = true + } + if strings.EqualFold(trimmed, "preload") { + ret.preload = true + } + if strings.HasPrefix(strings.ToLower(trimmed), "max-age=") { + age, err := strconv.ParseInt(trimmed[len("max-age="):], 10, 32) + if err != nil { + return hstsConfig{}, err + } + ret.maxAge = int32(age) + } + // unrecognized tokens are ignored + } + + return ret, nil +} + +// Make sure the given requirement meets the configured HSTS policy, validating: +// - existence and range for maxAge +// - preloadPolicy +// - includeSubDomainsPolicy +func (c hstsConfig) meetsRequirements(requirement configv1.RequiredHSTSPolicy) error { + configHasMaxAge := c.maxAge >= 0 + if !configHasMaxAge { + return fmt.Errorf("max age is required") + } + if requirement.MaxAge.LargestMaxAge >= 0 && c.maxAge > requirement.MaxAge.LargestMaxAge { + return fmt.Errorf("does not match maximum age %d", requirement.MaxAge.LargestMaxAge) + } + if requirement.MaxAge.SmallestMaxAge >= 0 && c.maxAge < requirement.MaxAge.SmallestMaxAge { + return fmt.Errorf("does not match minimum age %d", requirement.MaxAge.SmallestMaxAge) + } + + switch requirement.PreloadPolicy { + case configv1.DefaultPreloadPolicy, configv1.NoOpinionPreloadPolicy: + // anything is allowed, do nothing + case configv1.RequirePreloadPolicy: + if !c.preload { + return fmt.Errorf("preload must be specified") + } + case configv1.RequireNoPreloadPolicy: + if c.preload { + return fmt.Errorf("preload must not be specified") + } + } + + switch requirement.IncludeSubDomainsPolicy { + case configv1.DefaultIncludeSubDomains, configv1.NoOpinionIncludeSubDomains: + // anything is allowed, do nothing + case configv1.RequireIncludeSubDomains: + if !c.includeSubDomains { + return fmt.Errorf("includeSubDomains must be specified") + } + case configv1.RequireNotIncludeSubDomains: + if c.includeSubDomains { + return fmt.Errorf("includeSubDomains must not be specified") + } + } + + return nil +} + +// Check if the route matches the required domain/namespace in the HSTS Policy +func requiredHSTSMatchesRoute(requirement configv1.RequiredHSTSPolicy, route *routeapi.Route, namespace *corev1.Namespace) (bool, error) { + matchesNamespace, err := matchesNamespaceSelector(requirement.NamespaceSelector, namespace) + if err != nil { + return false, err + } + if !matchesNamespace { + return false, nil + } + routeDomains := []string{route.Spec.Host} + for _, ingress := range route.Status.Ingress { + routeDomains = append(routeDomains, ingress.Host) + } + if matchesDomain(requirement.DomainPatterns, routeDomains) { + return true, nil + } + + return false, nil +} + +// Check all of the required domainMatcher patterns against all provided domains, +// first match returns true. If none match, return false. +func matchesDomain(domainMatchers []string, domains []string) bool { + for _, matcher := range domainMatchers { + match := regexp.MustCompile(fmt.Sprintf("^%s$", matcher)) + for _, candidate := range domains { + if match.MatchString(candidate) { + return true + } + } + } + + return false +} + +func matchesNamespaceSelector(nsSelector *metav1.LabelSelector, namespace *corev1.Namespace) (bool, error) { + if nsSelector == nil { + return true, nil + } + selector, err := getParsedNamespaceSelector(nsSelector) + if err != nil { + return false, err + } + return selector.Matches(labels.Set(namespace.Labels)), nil +} + +func getParsedNamespaceSelector(nsSelector *metav1.LabelSelector) (labels.Selector, error) { + // TODO cache this result to save time + return metav1.LabelSelectorAsSelector(nsSelector) +} diff --git a/pkg/route/apiserver/admission/requiredrouteannotations/admission_test.go b/pkg/route/apiserver/admission/requiredrouteannotations/admission_test.go new file mode 100644 index 0000000000..69a71f7e97 --- /dev/null +++ b/pkg/route/apiserver/admission/requiredrouteannotations/admission_test.go @@ -0,0 +1,215 @@ +package requiredrouteannotations + +import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "testing" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/admission" + "k8s.io/apiserver/pkg/authentication/user" + corev1listers "k8s.io/client-go/listers/core/v1" + clientgotesting "k8s.io/client-go/testing" + "k8s.io/client-go/tools/cache" + + configv1 "github.com/openshift/api/config/v1" + route "github.com/openshift/api/route" + fakeconfigclient "github.com/openshift/client-go/config/clientset/versioned/fake" + fakerouteclient "github.com/openshift/client-go/route/clientset/versioned/fake" + routeapi "github.com/openshift/openshift-apiserver/pkg/route/apis/route" +) + +// TestValidate verifies that the RequiredRouteAnnotations plugin properly +// validates newly created routes' annotations. +func TestValidate(t *testing.T) { + emptyConfig := &configv1.Ingress{} + nonemptyConfig := &configv1.Ingress{ + Spec: configv1.IngressSpec{ + RequiredHSTSPolicies: []configv1.RequiredHSTSPolicy{{ + DomainPatterns: []string{ + "abc.foo.com", + "www.foo.com", + }, + MaxAge: configv1.MaxAgePolicy{LargestMaxAge: 99999, SmallestMaxAge: 0}, + PreloadPolicy: configv1.RequirePreloadPolicy, + IncludeSubDomainsPolicy: configv1.NoOpinionIncludeSubDomains, + }}, + }, + } + namespaceMatchConfig := &configv1.Ingress{ + Spec: configv1.IngressSpec{ + RequiredHSTSPolicies: []configv1.RequiredHSTSPolicy{{ + NamespaceSelector: &metav1.LabelSelector{ + MatchLabels: map[string]string{"www.foo.com": "bar"}, + MatchExpressions: nil, + }, + DomainPatterns: []string{ + "abc.foo.com", + "www.foo.com", + }, + MaxAge: configv1.MaxAgePolicy{LargestMaxAge: 99999, SmallestMaxAge: 0}, + PreloadPolicy: configv1.RequirePreloadPolicy, + IncludeSubDomainsPolicy: configv1.NoOpinionIncludeSubDomains, + }}, + }, + } + + nsLister := fakeNamespaceLister(map[string]map[string]string{ + "labeledNamespace": {"www.foo.com": "bar"}, + "unlabeledNamespace": {"default": ""}, + "matchingDomainNamespace": {"abc.foo.com": ""}, + "nonmatchingDomainNamespace": {"abc.com": ""}, + }) + + tests := []struct { + description string + config *configv1.Ingress + routeAnnotations map[string]string + namespace string + name string + spec *routeapi.RouteSpec + expectForbidden bool + }{ + { + description: "unannotated route, no required annotations in ingress config", + config: emptyConfig, + namespace: "unlabeledNamespace", + spec: &routeapi.RouteSpec{TLS: &routeapi.TLSConfig{Termination: routeapi.TLSTerminationReencrypt}}, + name: "config1", + expectForbidden: false, + }, + { + description: "appropriately annotated route for required annotations in ingress config", + config: nonemptyConfig, + routeAnnotations: map[string]string{ + hstsAnnotation: "max-age=9000;preload", + }, + namespace: "matchingDomainNamespace", + spec: &routeapi.RouteSpec{Host: "abc.foo.com", + TLS: &routeapi.TLSConfig{Termination: routeapi.TLSTerminationReencrypt}, + }, + name: "config2", + expectForbidden: false, + }, + { + description: "route missing some required annotations that are in ingress config", + config: nonemptyConfig, + routeAnnotations: map[string]string{ + hstsAnnotation: "max-age=9000; misspeledpreload", + }, + namespace: "matchingDomainNamespace", + name: "config3", + spec: &routeapi.RouteSpec{Host: "abc.foo.com", + TLS: &routeapi.TLSConfig{Termination: routeapi.TLSTerminationReencrypt}, + }, + expectForbidden: true, + }, + { + description: "route not in matching domain, missing some required annotations that are in ingress config", + config: nonemptyConfig, + routeAnnotations: map[string]string{ + hstsAnnotation: "max-age=9000; misspeledpreload", + }, + namespace: "nonmatchingDomainNamespace", + name: "config4", + spec: &routeapi.RouteSpec{Host: "def.com", + TLS: &routeapi.TLSConfig{Termination: routeapi.TLSTerminationReencrypt}, + }, + expectForbidden: false, + }, + { + description: "route in matching labeled namespace, missing some required annotations that are in ingress config", + config: namespaceMatchConfig, + routeAnnotations: map[string]string{ + hstsAnnotation: "max-age=9000; misspeledpreload", + }, + namespace: "labeledNamespace", + name: "config5", + spec: &routeapi.RouteSpec{Host: "abc.foo.com", + TLS: &routeapi.TLSConfig{Termination: routeapi.TLSTerminationReencrypt}, + }, + expectForbidden: true, + }, + } + + for _, tc := range tests { + routeClient := fakerouteclient.NewSimpleClientset() + routeClient.PrependReactor("get", "routes", + routeFn(map[string]map[string]string{"route1": {"default": ""}, "route2": {"foo": "bar"}, "route3": {"abc.foo.com": "bar"}}, tc.spec)) + configClient := fakeconfigclient.NewSimpleClientset() + configClient.PrependReactor("get", "ingresses", configFn(tc.config)) + admitter, err := NewRequiredRouteAnnotations() + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + admitter.(*requiredRouteAnnotations).configClient = configClient.ConfigV1() + admitter.(*requiredRouteAnnotations).routeClient = routeClient.RouteV1() + admitter.(*requiredRouteAnnotations).nsLister = nsLister + admitter.(*requiredRouteAnnotations).nsListerSynced = func() bool { return true } + if err = admitter.(admission.InitializationValidator).ValidateInitialization(); err != nil { + t.Fatalf("validation error: %v", err) + } + a := admission.NewAttributesRecord( + fakeRoute("test-route", tc.namespace, tc.spec, tc.routeAnnotations), + nil, + route.Kind("Route").WithVersion("version"), + tc.namespace, + tc.name, + route.Resource("routes").WithVersion("version"), + "", + "CREATE", + nil, + false, + &user.DefaultInfo{Name: "test-user"}, + ) + err = admitter.(admission.ValidationInterface).Validate(context.TODO(), a, nil) + switch { + case !tc.expectForbidden && err != nil: + t.Errorf("%q: got unexpected error for: %v", tc.description, err) + case tc.expectForbidden && !apierrors.IsForbidden(err): + t.Errorf("%q: expecting forbidden error, got %v", tc.description, err) + } + } +} + +func fakeNamespace(name string, labels map[string]string) *corev1.Namespace { + ns := &corev1.Namespace{} + ns.Name = name + ns.Labels = labels + return ns +} + +func fakeRoute(name string, namespace string, spec *routeapi.RouteSpec, annotations map[string]string) *routeapi.Route { + route := &routeapi.Route{} + route.Name = name + route.Namespace = namespace + route.Annotations = annotations + route.Spec.TLS = spec.TLS + route.Spec.Host = spec.Host + return route +} + +func fakeNamespaceLister(namespacesAndLabels map[string]map[string]string) corev1listers.NamespaceLister { + indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) + for namespace, labels := range namespacesAndLabels { + indexer.Add(fakeNamespace(namespace, labels)) + } + return corev1listers.NewNamespaceLister(indexer) +} + +func routeFn(routeAndAnnotations map[string]map[string]string, spec *routeapi.RouteSpec) clientgotesting.ReactionFunc { + return func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { + name := action.(clientgotesting.GetAction).GetName() + namespace := action.(clientgotesting.GetAction).GetNamespace() + + return true, fakeRoute(name, namespace, spec, map[string]string(routeAndAnnotations[name])), nil + } +} + +func configFn(config *configv1.Ingress) clientgotesting.ReactionFunc { + return func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { + return true, config, nil + } +} diff --git a/pkg/template/apis/template/v1/zz_generated.conversion.go b/pkg/template/apis/template/v1/zz_generated.conversion.go index 622f43cbb9..52101881c3 100644 --- a/pkg/template/apis/template/v1/zz_generated.conversion.go +++ b/pkg/template/apis/template/v1/zz_generated.conversion.go @@ -5,15 +5,7 @@ package v1 import ( - unsafe "unsafe" - - v1 "github.com/openshift/api/template/v1" - template "github.com/openshift/openshift-apiserver/pkg/template/apis/template" - apicorev1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - core "k8s.io/kubernetes/pkg/apis/core" - corev1 "k8s.io/kubernetes/pkg/apis/core/v1" ) func init() { @@ -23,595 +15,5 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*v1.BrokerTemplateInstance)(nil), (*template.BrokerTemplateInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance(a.(*v1.BrokerTemplateInstance), b.(*template.BrokerTemplateInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.BrokerTemplateInstance)(nil), (*v1.BrokerTemplateInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance(a.(*template.BrokerTemplateInstance), b.(*v1.BrokerTemplateInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.BrokerTemplateInstanceList)(nil), (*template.BrokerTemplateInstanceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_BrokerTemplateInstanceList_To_template_BrokerTemplateInstanceList(a.(*v1.BrokerTemplateInstanceList), b.(*template.BrokerTemplateInstanceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.BrokerTemplateInstanceList)(nil), (*v1.BrokerTemplateInstanceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList(a.(*template.BrokerTemplateInstanceList), b.(*v1.BrokerTemplateInstanceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.BrokerTemplateInstanceSpec)(nil), (*template.BrokerTemplateInstanceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec(a.(*v1.BrokerTemplateInstanceSpec), b.(*template.BrokerTemplateInstanceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.BrokerTemplateInstanceSpec)(nil), (*v1.BrokerTemplateInstanceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec(a.(*template.BrokerTemplateInstanceSpec), b.(*v1.BrokerTemplateInstanceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Parameter)(nil), (*template.Parameter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_Parameter_To_template_Parameter(a.(*v1.Parameter), b.(*template.Parameter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.Parameter)(nil), (*v1.Parameter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_Parameter_To_v1_Parameter(a.(*template.Parameter), b.(*v1.Parameter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Template)(nil), (*template.Template)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_Template_To_template_Template(a.(*v1.Template), b.(*template.Template), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.Template)(nil), (*v1.Template)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_Template_To_v1_Template(a.(*template.Template), b.(*v1.Template), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstance)(nil), (*template.TemplateInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstance_To_template_TemplateInstance(a.(*v1.TemplateInstance), b.(*template.TemplateInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstance)(nil), (*v1.TemplateInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstance_To_v1_TemplateInstance(a.(*template.TemplateInstance), b.(*v1.TemplateInstance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceCondition)(nil), (*template.TemplateInstanceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceCondition_To_template_TemplateInstanceCondition(a.(*v1.TemplateInstanceCondition), b.(*template.TemplateInstanceCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceCondition)(nil), (*v1.TemplateInstanceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceCondition_To_v1_TemplateInstanceCondition(a.(*template.TemplateInstanceCondition), b.(*v1.TemplateInstanceCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceList)(nil), (*template.TemplateInstanceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceList_To_template_TemplateInstanceList(a.(*v1.TemplateInstanceList), b.(*template.TemplateInstanceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceList)(nil), (*v1.TemplateInstanceList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceList_To_v1_TemplateInstanceList(a.(*template.TemplateInstanceList), b.(*v1.TemplateInstanceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceObject)(nil), (*template.TemplateInstanceObject)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject(a.(*v1.TemplateInstanceObject), b.(*template.TemplateInstanceObject), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceObject)(nil), (*v1.TemplateInstanceObject)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject(a.(*template.TemplateInstanceObject), b.(*v1.TemplateInstanceObject), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceRequester)(nil), (*template.TemplateInstanceRequester)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(a.(*v1.TemplateInstanceRequester), b.(*template.TemplateInstanceRequester), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceRequester)(nil), (*v1.TemplateInstanceRequester)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceRequester_To_v1_TemplateInstanceRequester(a.(*template.TemplateInstanceRequester), b.(*v1.TemplateInstanceRequester), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceSpec)(nil), (*template.TemplateInstanceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec(a.(*v1.TemplateInstanceSpec), b.(*template.TemplateInstanceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceSpec)(nil), (*v1.TemplateInstanceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec(a.(*template.TemplateInstanceSpec), b.(*v1.TemplateInstanceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateInstanceStatus)(nil), (*template.TemplateInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus(a.(*v1.TemplateInstanceStatus), b.(*template.TemplateInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateInstanceStatus)(nil), (*v1.TemplateInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus(a.(*template.TemplateInstanceStatus), b.(*v1.TemplateInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TemplateList)(nil), (*template.TemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TemplateList_To_template_TemplateList(a.(*v1.TemplateList), b.(*template.TemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*template.TemplateList)(nil), (*v1.TemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_template_TemplateList_To_v1_TemplateList(a.(*template.TemplateList), b.(*v1.TemplateList), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance(in *v1.BrokerTemplateInstance, out *template.BrokerTemplateInstance, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance is an autogenerated conversion function. -func Convert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance(in *v1.BrokerTemplateInstance, out *template.BrokerTemplateInstance, s conversion.Scope) error { - return autoConvert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance(in, out, s) -} - -func autoConvert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance(in *template.BrokerTemplateInstance, out *v1.BrokerTemplateInstance, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance is an autogenerated conversion function. -func Convert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance(in *template.BrokerTemplateInstance, out *v1.BrokerTemplateInstance, s conversion.Scope) error { - return autoConvert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance(in, out, s) -} - -func autoConvert_v1_BrokerTemplateInstanceList_To_template_BrokerTemplateInstanceList(in *v1.BrokerTemplateInstanceList, out *template.BrokerTemplateInstanceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]template.BrokerTemplateInstance, len(*in)) - for i := range *in { - if err := Convert_v1_BrokerTemplateInstance_To_template_BrokerTemplateInstance(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_BrokerTemplateInstanceList_To_template_BrokerTemplateInstanceList is an autogenerated conversion function. -func Convert_v1_BrokerTemplateInstanceList_To_template_BrokerTemplateInstanceList(in *v1.BrokerTemplateInstanceList, out *template.BrokerTemplateInstanceList, s conversion.Scope) error { - return autoConvert_v1_BrokerTemplateInstanceList_To_template_BrokerTemplateInstanceList(in, out, s) -} - -func autoConvert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList(in *template.BrokerTemplateInstanceList, out *v1.BrokerTemplateInstanceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.BrokerTemplateInstance, len(*in)) - for i := range *in { - if err := Convert_template_BrokerTemplateInstance_To_v1_BrokerTemplateInstance(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList is an autogenerated conversion function. -func Convert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList(in *template.BrokerTemplateInstanceList, out *v1.BrokerTemplateInstanceList, s conversion.Scope) error { - return autoConvert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList(in, out, s) -} - -func autoConvert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec(in *v1.BrokerTemplateInstanceSpec, out *template.BrokerTemplateInstanceSpec, s conversion.Scope) error { - if err := corev1.Convert_v1_ObjectReference_To_core_ObjectReference(&in.TemplateInstance, &out.TemplateInstance, s); err != nil { - return err - } - if err := corev1.Convert_v1_ObjectReference_To_core_ObjectReference(&in.Secret, &out.Secret, s); err != nil { - return err - } - out.BindingIDs = *(*[]string)(unsafe.Pointer(&in.BindingIDs)) - return nil -} - -// Convert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec is an autogenerated conversion function. -func Convert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec(in *v1.BrokerTemplateInstanceSpec, out *template.BrokerTemplateInstanceSpec, s conversion.Scope) error { - return autoConvert_v1_BrokerTemplateInstanceSpec_To_template_BrokerTemplateInstanceSpec(in, out, s) -} - -func autoConvert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec(in *template.BrokerTemplateInstanceSpec, out *v1.BrokerTemplateInstanceSpec, s conversion.Scope) error { - if err := corev1.Convert_core_ObjectReference_To_v1_ObjectReference(&in.TemplateInstance, &out.TemplateInstance, s); err != nil { - return err - } - if err := corev1.Convert_core_ObjectReference_To_v1_ObjectReference(&in.Secret, &out.Secret, s); err != nil { - return err - } - out.BindingIDs = *(*[]string)(unsafe.Pointer(&in.BindingIDs)) - return nil -} - -// Convert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec is an autogenerated conversion function. -func Convert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec(in *template.BrokerTemplateInstanceSpec, out *v1.BrokerTemplateInstanceSpec, s conversion.Scope) error { - return autoConvert_template_BrokerTemplateInstanceSpec_To_v1_BrokerTemplateInstanceSpec(in, out, s) -} - -func autoConvert_v1_Parameter_To_template_Parameter(in *v1.Parameter, out *template.Parameter, s conversion.Scope) error { - out.Name = in.Name - out.DisplayName = in.DisplayName - out.Description = in.Description - out.Value = in.Value - out.Generate = in.Generate - out.From = in.From - out.Required = in.Required return nil } - -// Convert_v1_Parameter_To_template_Parameter is an autogenerated conversion function. -func Convert_v1_Parameter_To_template_Parameter(in *v1.Parameter, out *template.Parameter, s conversion.Scope) error { - return autoConvert_v1_Parameter_To_template_Parameter(in, out, s) -} - -func autoConvert_template_Parameter_To_v1_Parameter(in *template.Parameter, out *v1.Parameter, s conversion.Scope) error { - out.Name = in.Name - out.DisplayName = in.DisplayName - out.Description = in.Description - out.Value = in.Value - out.Generate = in.Generate - out.From = in.From - out.Required = in.Required - return nil -} - -// Convert_template_Parameter_To_v1_Parameter is an autogenerated conversion function. -func Convert_template_Parameter_To_v1_Parameter(in *template.Parameter, out *v1.Parameter, s conversion.Scope) error { - return autoConvert_template_Parameter_To_v1_Parameter(in, out, s) -} - -func autoConvert_v1_Template_To_template_Template(in *v1.Template, out *template.Template, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Message = in.Message - if in.Objects != nil { - in, out := &in.Objects, &out.Objects - *out = make([]runtime.Object, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Objects = nil - } - out.Parameters = *(*[]template.Parameter)(unsafe.Pointer(&in.Parameters)) - out.ObjectLabels = *(*map[string]string)(unsafe.Pointer(&in.ObjectLabels)) - return nil -} - -// Convert_v1_Template_To_template_Template is an autogenerated conversion function. -func Convert_v1_Template_To_template_Template(in *v1.Template, out *template.Template, s conversion.Scope) error { - return autoConvert_v1_Template_To_template_Template(in, out, s) -} - -func autoConvert_template_Template_To_v1_Template(in *template.Template, out *v1.Template, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Message = in.Message - out.Parameters = *(*[]v1.Parameter)(unsafe.Pointer(&in.Parameters)) - if in.Objects != nil { - in, out := &in.Objects, &out.Objects - *out = make([]runtime.RawExtension, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Objects = nil - } - out.ObjectLabels = *(*map[string]string)(unsafe.Pointer(&in.ObjectLabels)) - return nil -} - -// Convert_template_Template_To_v1_Template is an autogenerated conversion function. -func Convert_template_Template_To_v1_Template(in *template.Template, out *v1.Template, s conversion.Scope) error { - return autoConvert_template_Template_To_v1_Template(in, out, s) -} - -func autoConvert_v1_TemplateInstance_To_template_TemplateInstance(in *v1.TemplateInstance, out *template.TemplateInstance, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_TemplateInstance_To_template_TemplateInstance is an autogenerated conversion function. -func Convert_v1_TemplateInstance_To_template_TemplateInstance(in *v1.TemplateInstance, out *template.TemplateInstance, s conversion.Scope) error { - return autoConvert_v1_TemplateInstance_To_template_TemplateInstance(in, out, s) -} - -func autoConvert_template_TemplateInstance_To_v1_TemplateInstance(in *template.TemplateInstance, out *v1.TemplateInstance, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_template_TemplateInstance_To_v1_TemplateInstance is an autogenerated conversion function. -func Convert_template_TemplateInstance_To_v1_TemplateInstance(in *template.TemplateInstance, out *v1.TemplateInstance, s conversion.Scope) error { - return autoConvert_template_TemplateInstance_To_v1_TemplateInstance(in, out, s) -} - -func autoConvert_v1_TemplateInstanceCondition_To_template_TemplateInstanceCondition(in *v1.TemplateInstanceCondition, out *template.TemplateInstanceCondition, s conversion.Scope) error { - out.Type = template.TemplateInstanceConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_TemplateInstanceCondition_To_template_TemplateInstanceCondition is an autogenerated conversion function. -func Convert_v1_TemplateInstanceCondition_To_template_TemplateInstanceCondition(in *v1.TemplateInstanceCondition, out *template.TemplateInstanceCondition, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceCondition_To_template_TemplateInstanceCondition(in, out, s) -} - -func autoConvert_template_TemplateInstanceCondition_To_v1_TemplateInstanceCondition(in *template.TemplateInstanceCondition, out *v1.TemplateInstanceCondition, s conversion.Scope) error { - out.Type = v1.TemplateInstanceConditionType(in.Type) - out.Status = apicorev1.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_template_TemplateInstanceCondition_To_v1_TemplateInstanceCondition is an autogenerated conversion function. -func Convert_template_TemplateInstanceCondition_To_v1_TemplateInstanceCondition(in *template.TemplateInstanceCondition, out *v1.TemplateInstanceCondition, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceCondition_To_v1_TemplateInstanceCondition(in, out, s) -} - -func autoConvert_v1_TemplateInstanceList_To_template_TemplateInstanceList(in *v1.TemplateInstanceList, out *template.TemplateInstanceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]template.TemplateInstance, len(*in)) - for i := range *in { - if err := Convert_v1_TemplateInstance_To_template_TemplateInstance(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_TemplateInstanceList_To_template_TemplateInstanceList is an autogenerated conversion function. -func Convert_v1_TemplateInstanceList_To_template_TemplateInstanceList(in *v1.TemplateInstanceList, out *template.TemplateInstanceList, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceList_To_template_TemplateInstanceList(in, out, s) -} - -func autoConvert_template_TemplateInstanceList_To_v1_TemplateInstanceList(in *template.TemplateInstanceList, out *v1.TemplateInstanceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.TemplateInstance, len(*in)) - for i := range *in { - if err := Convert_template_TemplateInstance_To_v1_TemplateInstance(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_template_TemplateInstanceList_To_v1_TemplateInstanceList is an autogenerated conversion function. -func Convert_template_TemplateInstanceList_To_v1_TemplateInstanceList(in *template.TemplateInstanceList, out *v1.TemplateInstanceList, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceList_To_v1_TemplateInstanceList(in, out, s) -} - -func autoConvert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject(in *v1.TemplateInstanceObject, out *template.TemplateInstanceObject, s conversion.Scope) error { - if err := corev1.Convert_v1_ObjectReference_To_core_ObjectReference(&in.Ref, &out.Ref, s); err != nil { - return err - } - return nil -} - -// Convert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject is an autogenerated conversion function. -func Convert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject(in *v1.TemplateInstanceObject, out *template.TemplateInstanceObject, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject(in, out, s) -} - -func autoConvert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject(in *template.TemplateInstanceObject, out *v1.TemplateInstanceObject, s conversion.Scope) error { - if err := corev1.Convert_core_ObjectReference_To_v1_ObjectReference(&in.Ref, &out.Ref, s); err != nil { - return err - } - return nil -} - -// Convert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject is an autogenerated conversion function. -func Convert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject(in *template.TemplateInstanceObject, out *v1.TemplateInstanceObject, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject(in, out, s) -} - -func autoConvert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(in *v1.TemplateInstanceRequester, out *template.TemplateInstanceRequester, s conversion.Scope) error { - out.Username = in.Username - out.UID = in.UID - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - out.Extra = *(*map[string]template.ExtraValue)(unsafe.Pointer(&in.Extra)) - return nil -} - -// Convert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester is an autogenerated conversion function. -func Convert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(in *v1.TemplateInstanceRequester, out *template.TemplateInstanceRequester, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceRequester_To_template_TemplateInstanceRequester(in, out, s) -} - -func autoConvert_template_TemplateInstanceRequester_To_v1_TemplateInstanceRequester(in *template.TemplateInstanceRequester, out *v1.TemplateInstanceRequester, s conversion.Scope) error { - out.Username = in.Username - out.UID = in.UID - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - out.Extra = *(*map[string]v1.ExtraValue)(unsafe.Pointer(&in.Extra)) - return nil -} - -// Convert_template_TemplateInstanceRequester_To_v1_TemplateInstanceRequester is an autogenerated conversion function. -func Convert_template_TemplateInstanceRequester_To_v1_TemplateInstanceRequester(in *template.TemplateInstanceRequester, out *v1.TemplateInstanceRequester, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceRequester_To_v1_TemplateInstanceRequester(in, out, s) -} - -func autoConvert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec(in *v1.TemplateInstanceSpec, out *template.TemplateInstanceSpec, s conversion.Scope) error { - if err := Convert_v1_Template_To_template_Template(&in.Template, &out.Template, s); err != nil { - return err - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(core.LocalObjectReference) - if err := corev1.Convert_v1_LocalObjectReference_To_core_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - out.Requester = (*template.TemplateInstanceRequester)(unsafe.Pointer(in.Requester)) - return nil -} - -// Convert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec is an autogenerated conversion function. -func Convert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec(in *v1.TemplateInstanceSpec, out *template.TemplateInstanceSpec, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceSpec_To_template_TemplateInstanceSpec(in, out, s) -} - -func autoConvert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec(in *template.TemplateInstanceSpec, out *v1.TemplateInstanceSpec, s conversion.Scope) error { - if err := Convert_template_Template_To_v1_Template(&in.Template, &out.Template, s); err != nil { - return err - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(apicorev1.LocalObjectReference) - if err := corev1.Convert_core_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - out.Requester = (*v1.TemplateInstanceRequester)(unsafe.Pointer(in.Requester)) - return nil -} - -// Convert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec is an autogenerated conversion function. -func Convert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec(in *template.TemplateInstanceSpec, out *v1.TemplateInstanceSpec, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceSpec_To_v1_TemplateInstanceSpec(in, out, s) -} - -func autoConvert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus(in *v1.TemplateInstanceStatus, out *template.TemplateInstanceStatus, s conversion.Scope) error { - out.Conditions = *(*[]template.TemplateInstanceCondition)(unsafe.Pointer(&in.Conditions)) - if in.Objects != nil { - in, out := &in.Objects, &out.Objects - *out = make([]template.TemplateInstanceObject, len(*in)) - for i := range *in { - if err := Convert_v1_TemplateInstanceObject_To_template_TemplateInstanceObject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Objects = nil - } - return nil -} - -// Convert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus is an autogenerated conversion function. -func Convert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus(in *v1.TemplateInstanceStatus, out *template.TemplateInstanceStatus, s conversion.Scope) error { - return autoConvert_v1_TemplateInstanceStatus_To_template_TemplateInstanceStatus(in, out, s) -} - -func autoConvert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus(in *template.TemplateInstanceStatus, out *v1.TemplateInstanceStatus, s conversion.Scope) error { - out.Conditions = *(*[]v1.TemplateInstanceCondition)(unsafe.Pointer(&in.Conditions)) - if in.Objects != nil { - in, out := &in.Objects, &out.Objects - *out = make([]v1.TemplateInstanceObject, len(*in)) - for i := range *in { - if err := Convert_template_TemplateInstanceObject_To_v1_TemplateInstanceObject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Objects = nil - } - return nil -} - -// Convert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus is an autogenerated conversion function. -func Convert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus(in *template.TemplateInstanceStatus, out *v1.TemplateInstanceStatus, s conversion.Scope) error { - return autoConvert_template_TemplateInstanceStatus_To_v1_TemplateInstanceStatus(in, out, s) -} - -func autoConvert_v1_TemplateList_To_template_TemplateList(in *v1.TemplateList, out *template.TemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]template.Template, len(*in)) - for i := range *in { - if err := Convert_v1_Template_To_template_Template(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_TemplateList_To_template_TemplateList is an autogenerated conversion function. -func Convert_v1_TemplateList_To_template_TemplateList(in *v1.TemplateList, out *template.TemplateList, s conversion.Scope) error { - return autoConvert_v1_TemplateList_To_template_TemplateList(in, out, s) -} - -func autoConvert_template_TemplateList_To_v1_TemplateList(in *template.TemplateList, out *v1.TemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.Template, len(*in)) - for i := range *in { - if err := Convert_template_Template_To_v1_Template(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_template_TemplateList_To_v1_TemplateList is an autogenerated conversion function. -func Convert_template_TemplateList_To_v1_TemplateList(in *template.TemplateList, out *v1.TemplateList, s conversion.Scope) error { - return autoConvert_template_TemplateList_To_v1_TemplateList(in, out, s) -} diff --git a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml index b45c74cdb7..feea21e183 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_10_config-operator_01_ingress.crd.yaml @@ -77,6 +77,65 @@ spec: domain: description: "domain is used to generate a default host name for a route when the route's host name is empty. The generated host name will follow this pattern: \"..\". \n It is also used as the default wildcard domain suffix for ingress. The default ingresscontroller domain will follow this pattern: \"*.\". \n Once set, changing domain is not currently supported." type: string + requiredHSTSPolicies: + description: requiredHSTSPolicies specifies HSTS policies that are required to be set on newly created routes matching criteria that are specified in the policy. - If there are no RequiredHSTSPolicies, any route annotation is valid. - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, a DomainPattern it specifies, and NamespaceSelector it specifies (if any), the route is admitted. - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, a DomainPattern it specifies, but doesn't match a NamespaceSelector it specifies, the route is rejected with a message indicating the suggested policy value. - If the route specifies a HSTS annotation that doesn't match a RequiredHSTSPolicy, but matches a DomainPattern, the route is rejected with a message indicating the suggested policy value. - If the route specifies a HSTS annotation that doesn't match a RequiredHSTSPolicy, and also doesn't match a DomainPattern, the route is admitted. + type: array + items: + type: object + properties: + domainPatterns: + description: "domainPatterns is an optional list of domains for which these annotations are required. If domainPatterns is specified and a route is created with a spec.host matching one of the domains, the route must specify the annotations specified in requiredAnnotations. If domainPatterns is empty, the specified annotations are IGNORED. \n The use of wildcards is allowed like this: *.foo.com matches everything under foo.com. foo.com only matches foo.com, so to cover foo.com and everything under it, you must specify *both*." + type: array + items: + type: string + includeSubDomainsPolicy: + description: 'includeSubDomainsPolicy means the HSTS Policy should apply to any subdomains of the host''s domain name. Thus, for the host bar.foo.com, if includeSubDomainsPolicy was set to RequireIncludeSubDomains: - the host app.bar.foo.com would inherit the HSTS Policy of bar.foo.com - the host bar.foo.com would inherit the HSTS Policy of bar.foo.com - the host foo.com would NOT inherit the HSTS Policy of bar.foo.com - the host def.foo.com would NOT inherit the HSTS Policy of bar.foo.com' + type: string + maxage: + description: maxAge is the delta time range in seconds during which hosts are regarded as HSTS hosts. If set to 0, it negates the effect, and hosts are removed as HSTS hosts. If set to 0 and includeSubdomains is specified, all subdomains of the host are also removed as HSTS hosts. maxAge is a time-to-live value, and if this policy is not refreshed on a client, the HSTS policy will eventually expire on that client. + type: object + properties: + largestMaxAge: + description: -1 means no opinion omitempty + type: integer + format: int32 + smallestMaxAge: + description: -1 means no opinion. To set max-age=0 allows the deletion of an existing HSTS header from a host. This is a necessary tool for administrators to quickly correct mistakes. The minimum `max-age` default is -1 instead of 0. If it is set to 1 in MaxAgePolicy, then the HSTS policy may not be deleted. omitempty + type: integer + format: int32 + namespaceSelector: + description: namespaceSelector specifies a label selector such that the policy applies only to those objects that are in namespaces with labels that match the selector, and are in one of the DomainPatterns. Defaults to the empty LabelSelector, which matches everything. A domain MUST be specified in order for namespaceSelector to apply + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + preloadPolicy: + description: preloadPolicy directs the client to include hosts in its host preload list so that it never needs to do an initial load to get the HSTS header (note that this is not defined in RFC 6797 and is therefore client implementation-dependent). + type: string status: description: status holds observed values from the cluster. They may not be overridden. type: object diff --git a/vendor/github.com/openshift/api/config/v1/types.go b/vendor/github.com/openshift/api/config/v1/types.go index 1427484236..d69cd030f2 100644 --- a/vendor/github.com/openshift/api/config/v1/types.go +++ b/vendor/github.com/openshift/api/config/v1/types.go @@ -310,3 +310,74 @@ type DelegatedAuthorization struct { // disabled indicates that authorization should be disabled. By default it will use delegated authorization. Disabled bool `json:"disabled,omitempty"` } +type RequiredHSTSPolicy struct { + // namespaceSelector specifies a label selector such that the policy applies only to those objects that + // are in namespaces with labels that match the selector, and are in one of the DomainPatterns. + // Defaults to the empty LabelSelector, which matches everything. + // A domain MUST be specified in order for namespaceSelector to apply + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,5,opt,name=namespaceSelector"` + + // domainPatterns is an optional list of domains for which these annotations are required. + // If domainPatterns is specified and a route is created with a spec.host matching one of the domains, + // the route must specify the annotations specified in requiredAnnotations. If domainPatterns is empty, + // the specified annotations are IGNORED. + // + // The use of wildcards is allowed like this: *.foo.com matches everything under foo.com. + // foo.com only matches foo.com, so to cover foo.com and everything under it, you must specify *both*. + // +optional + DomainPatterns []string `json:"domainPatterns,omitempty"` + + // maxAge is the delta time range in seconds during which hosts are regarded as HSTS hosts. + // If set to 0, it negates the effect, and hosts are removed as HSTS hosts. + // If set to 0 and includeSubdomains is specified, all subdomains of the host are also removed as HSTS hosts. + // maxAge is a time-to-live value, and if this policy is not refreshed on a client, the HSTS + // policy will eventually expire on that client. + // +required + MaxAge MaxAgePolicy `json:"maxage"` + + // preloadPolicy directs the client to include hosts in its host preload list so that + // it never needs to do an initial load to get the HSTS header (note that this is not defined + // in RFC 6797 and is therefore client implementation-dependent). + // +optional + PreloadPolicy PreloadPolicy `json:"preloadPolicy,omitempty"` + + // includeSubDomainsPolicy means the HSTS Policy should apply to any subdomains of the host's + // domain name. Thus, for the host bar.foo.com, if includeSubDomainsPolicy was set to RequireIncludeSubDomains: + // - the host app.bar.foo.com would inherit the HSTS Policy of bar.foo.com + // - the host bar.foo.com would inherit the HSTS Policy of bar.foo.com + // - the host foo.com would NOT inherit the HSTS Policy of bar.foo.com + // - the host def.foo.com would NOT inherit the HSTS Policy of bar.foo.com + // +optional + IncludeSubDomainsPolicy IncludeSubDomainsPolicy `json:"includeSubDomainsPolicy,omitempty"` +} + +type MaxAgePolicy struct { + // -1 means no opinion + // omitempty + LargestMaxAge int32 `json:"largestMaxAge,omitempty"` + // -1 means no opinion. + // To set max-age=0 allows the deletion of an existing HSTS header from a host. This is a necessary + // tool for administrators to quickly correct mistakes. The minimum `max-age` default is -1 instead of 0. + // If it is set to 1 in MaxAgePolicy, then the HSTS policy may not be deleted. + // omitempty + SmallestMaxAge int32 `json:"smallestMaxAge,omitempty"` +} + +type PreloadPolicy string + +var ( + RequirePreloadPolicy PreloadPolicy = "RequirePreload" + RequireNoPreloadPolicy PreloadPolicy = "RequireNotPreload" + NoOpinionPreloadPolicy PreloadPolicy = "NoOpinion" + DefaultPreloadPolicy PreloadPolicy = "" +) + +type IncludeSubDomainsPolicy string + +var ( + RequireIncludeSubDomains IncludeSubDomainsPolicy = "RequireIncludeSubDomains" + RequireNotIncludeSubDomains IncludeSubDomainsPolicy = "RequireNotIncludeSubDomains" + NoOpinionIncludeSubDomains IncludeSubDomainsPolicy = "NoOpinion" + DefaultIncludeSubDomains IncludeSubDomainsPolicy = "" +) diff --git a/vendor/github.com/openshift/api/config/v1/types_ingress.go b/vendor/github.com/openshift/api/config/v1/types_ingress.go index 9451adc278..d6af77ca02 100644 --- a/vendor/github.com/openshift/api/config/v1/types_ingress.go +++ b/vendor/github.com/openshift/api/config/v1/types_ingress.go @@ -54,6 +54,22 @@ type IngressSpec struct { // configurable routes. // +optional ComponentRoutes []ComponentRouteSpec `json:"componentRoutes,omitempty"` + + // requiredHSTSPolicies specifies HSTS policies that are required to be set on + // newly created routes matching criteria that are specified in the policy. + // - If there are no RequiredHSTSPolicies, any route annotation is valid. + // - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, + // a DomainPattern it specifies, and NamespaceSelector it specifies (if any), the route is admitted. + // - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, + // a DomainPattern it specifies, but doesn't match a NamespaceSelector it specifies, the route is + // rejected with a message indicating the suggested policy value. + // - If the route specifies a HSTS annotation that doesn't match a + // RequiredHSTSPolicy, but matches a DomainPattern, the route is rejected with a message + // indicating the suggested policy value. + // - If the route specifies a HSTS annotation that doesn't match a + // RequiredHSTSPolicy, and also doesn't match a DomainPattern, the route is admitted. + // +optional + RequiredHSTSPolicies []RequiredHSTSPolicy `json:"requiredHSTSPolicies,omitempty"` } // ConsumingUser is an alias for string which we add validation to. Currently only service accounts are supported. diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go index cb933dac08..8a8fa36c50 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go @@ -2293,6 +2293,13 @@ func (in *IngressSpec) DeepCopyInto(out *IngressSpec) { *out = make([]ComponentRouteSpec, len(*in)) copy(*out, *in) } + if in.RequiredHSTSPolicies != nil { + in, out := &in.RequiredHSTSPolicies, &out.RequiredHSTSPolicies + *out = make([]RequiredHSTSPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -2485,6 +2492,22 @@ func (in *LeaderElection) DeepCopy() *LeaderElection { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaxAgePolicy) DeepCopyInto(out *MaxAgePolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaxAgePolicy. +func (in *MaxAgePolicy) DeepCopy() *MaxAgePolicy { + if in == nil { + return nil + } + out := new(MaxAgePolicy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ModernTLSProfile) DeepCopyInto(out *ModernTLSProfile) { *out = *in @@ -3536,6 +3559,33 @@ func (in *RequestHeaderIdentityProvider) DeepCopy() *RequestHeaderIdentityProvid return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredHSTSPolicy) DeepCopyInto(out *RequiredHSTSPolicy) { + *out = *in + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.DomainPatterns != nil { + in, out := &in.DomainPatterns, &out.DomainPatterns + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.MaxAge = in.MaxAge + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredHSTSPolicy. +func (in *RequiredHSTSPolicy) DeepCopy() *RequiredHSTSPolicy { + if in == nil { + return nil + } + out := new(RequiredHSTSPolicy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Scheduler) DeepCopyInto(out *Scheduler) { *out = *in 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 7581d57434..2242733fdb 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 @@ -181,6 +181,15 @@ func (LeaderElection) SwaggerDoc() map[string]string { return map_LeaderElection } +var map_MaxAgePolicy = map[string]string{ + "largestMaxAge": "-1 means no opinion omitempty", + "smallestMaxAge": "-1 means no opinion. To set max-age=0 allows the deletion of an existing HSTS header from a host. This is a necessary tool for administrators to quickly correct mistakes. The minimum `max-age` default is -1 instead of 0. If it is set to 1 in MaxAgePolicy, then the HSTS policy may not be deleted. omitempty", +} + +func (MaxAgePolicy) SwaggerDoc() map[string]string { + return map_MaxAgePolicy +} + var map_NamedCertificate = map[string]string{ "": "NamedCertificate specifies a certificate/key, and the names it should be served for", "names": "Names is a list of DNS names this certificate should be used to secure A name can be a normal DNS name, or can contain leading wildcard segments.", @@ -200,6 +209,18 @@ func (RemoteConnectionInfo) SwaggerDoc() map[string]string { return map_RemoteConnectionInfo } +var map_RequiredHSTSPolicy = map[string]string{ + "namespaceSelector": "namespaceSelector specifies a label selector such that the policy applies only to those objects that are in namespaces with labels that match the selector, and are in one of the DomainPatterns. Defaults to the empty LabelSelector, which matches everything. A domain MUST be specified in order for namespaceSelector to apply", + "domainPatterns": "domainPatterns is an optional list of domains for which these annotations are required. If domainPatterns is specified and a route is created with a spec.host matching one of the domains, the route must specify the annotations specified in requiredAnnotations. If domainPatterns is empty, the specified annotations are IGNORED.\n\nThe use of wildcards is allowed like this: *.foo.com matches everything under foo.com. foo.com only matches foo.com, so to cover foo.com and everything under it, you must specify *both*.", + "maxage": "maxAge is the delta time range in seconds during which hosts are regarded as HSTS hosts. If set to 0, it negates the effect, and hosts are removed as HSTS hosts. If set to 0 and includeSubdomains is specified, all subdomains of the host are also removed as HSTS hosts. maxAge is a time-to-live value, and if this policy is not refreshed on a client, the HSTS policy will eventually expire on that client.", + "preloadPolicy": "preloadPolicy directs the client to include hosts in its host preload list so that it never needs to do an initial load to get the HSTS header (note that this is not defined in RFC 6797 and is therefore client implementation-dependent).", + "includeSubDomainsPolicy": "includeSubDomainsPolicy means the HSTS Policy should apply to any subdomains of the host's domain name. Thus, for the host bar.foo.com, if includeSubDomainsPolicy was set to RequireIncludeSubDomains: - the host app.bar.foo.com would inherit the HSTS Policy of bar.foo.com - the host bar.foo.com would inherit the HSTS Policy of bar.foo.com - the host foo.com would NOT inherit the HSTS Policy of bar.foo.com - the host def.foo.com would NOT inherit the HSTS Policy of bar.foo.com", +} + +func (RequiredHSTSPolicy) SwaggerDoc() map[string]string { + return map_RequiredHSTSPolicy +} + var map_SecretNameReference = map[string]string{ "": "SecretNameReference references a secret in a specific namespace. The namespace must be specified at the point of use.", "name": "name is the metadata.name of the referenced secret", @@ -1042,9 +1063,10 @@ func (Ingress) SwaggerDoc() map[string]string { } var map_IngressSpec = map[string]string{ - "domain": "domain is used to generate a default host name for a route when the route's host name is empty. The generated host name will follow this pattern: \"..\".\n\nIt is also used as the default wildcard domain suffix for ingress. The default ingresscontroller domain will follow this pattern: \"*.\".\n\nOnce set, changing domain is not currently supported.", - "appsDomain": "appsDomain is an optional domain to use instead of the one specified in the domain field when a Route is created without specifying an explicit host. If appsDomain is nonempty, this value is used to generate default host values for Route. Unlike domain, appsDomain may be modified after installation. This assumes a new ingresscontroller has been setup with a wildcard certificate.", - "componentRoutes": "componentRoutes is an optional list of routes that are managed by OpenShift components that a cluster-admin is able to configure the hostname and serving certificate for. The namespace and name of each route in this list should match an existing entry in the status.componentRoutes list.\n\nTo determine the set of configurable Routes, look at namespace and name of entries in the .status.componentRoutes list, where participating operators write the status of configurable routes.", + "domain": "domain is used to generate a default host name for a route when the route's host name is empty. The generated host name will follow this pattern: \"..\".\n\nIt is also used as the default wildcard domain suffix for ingress. The default ingresscontroller domain will follow this pattern: \"*.\".\n\nOnce set, changing domain is not currently supported.", + "appsDomain": "appsDomain is an optional domain to use instead of the one specified in the domain field when a Route is created without specifying an explicit host. If appsDomain is nonempty, this value is used to generate default host values for Route. Unlike domain, appsDomain may be modified after installation. This assumes a new ingresscontroller has been setup with a wildcard certificate.", + "componentRoutes": "componentRoutes is an optional list of routes that are managed by OpenShift components that a cluster-admin is able to configure the hostname and serving certificate for. The namespace and name of each route in this list should match an existing entry in the status.componentRoutes list.\n\nTo determine the set of configurable Routes, look at namespace and name of entries in the .status.componentRoutes list, where participating operators write the status of configurable routes.", + "requiredHSTSPolicies": "requiredHSTSPolicies specifies HSTS policies that are required to be set on newly created routes matching criteria that are specified in the policy. - If there are no RequiredHSTSPolicies, any route annotation is valid. - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, a DomainPattern it specifies, and NamespaceSelector it specifies (if any), the route is admitted. - If the route specifies a HSTS annotation that matches one of the RequiredHSTSPolicies, a DomainPattern it specifies, but doesn't match a NamespaceSelector it specifies, the route is rejected with a message indicating the suggested policy value. - If the route specifies a HSTS annotation that doesn't match a RequiredHSTSPolicy, but matches a DomainPattern, the route is rejected with a message indicating the suggested policy value. - If the route specifies a HSTS annotation that doesn't match a RequiredHSTSPolicy, and also doesn't match a DomainPattern, the route is admitted.", } func (IngressSpec) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..08c7c431c4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,66 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/openshift/client-go/config/clientset/versioned" + configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + fakeconfigv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..3630ed1cd1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..94a788d5fb --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go @@ -0,0 +1,40 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + configv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go new file mode 100644 index 0000000000..2b5ba4c8e4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go new file mode 100644 index 0000000000..7e1e09a15e --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_apiserver.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAPIServers implements APIServerInterface +type FakeAPIServers struct { + Fake *FakeConfigV1 +} + +var apiserversResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "apiservers"} + +var apiserversKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "APIServer"} + +// Get takes name of the aPIServer, and returns the corresponding aPIServer object, and an error if there is any. +func (c *FakeAPIServers) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.APIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apiserversResource, name), &configv1.APIServer{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.APIServer), err +} + +// List takes label and field selectors, and returns the list of APIServers that match those selectors. +func (c *FakeAPIServers) List(ctx context.Context, opts v1.ListOptions) (result *configv1.APIServerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apiserversResource, apiserversKind, opts), &configv1.APIServerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.APIServerList{ListMeta: obj.(*configv1.APIServerList).ListMeta} + for _, item := range obj.(*configv1.APIServerList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested aPIServers. +func (c *FakeAPIServers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apiserversResource, opts)) +} + +// Create takes the representation of a aPIServer and creates it. Returns the server's representation of the aPIServer, and an error, if there is any. +func (c *FakeAPIServers) Create(ctx context.Context, aPIServer *configv1.APIServer, opts v1.CreateOptions) (result *configv1.APIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apiserversResource, aPIServer), &configv1.APIServer{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.APIServer), err +} + +// Update takes the representation of a aPIServer and updates it. Returns the server's representation of the aPIServer, and an error, if there is any. +func (c *FakeAPIServers) Update(ctx context.Context, aPIServer *configv1.APIServer, opts v1.UpdateOptions) (result *configv1.APIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apiserversResource, aPIServer), &configv1.APIServer{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.APIServer), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAPIServers) UpdateStatus(ctx context.Context, aPIServer *configv1.APIServer, opts v1.UpdateOptions) (*configv1.APIServer, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(apiserversResource, "status", aPIServer), &configv1.APIServer{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.APIServer), err +} + +// Delete takes name of the aPIServer and deletes it. Returns an error if one occurs. +func (c *FakeAPIServers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(apiserversResource, name), &configv1.APIServer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAPIServers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apiserversResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.APIServerList{}) + return err +} + +// Patch applies the patch and returns the patched aPIServer. +func (c *FakeAPIServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.APIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apiserversResource, name, pt, data, subresources...), &configv1.APIServer{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.APIServer), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go new file mode 100644 index 0000000000..90cd41c074 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAuthentications implements AuthenticationInterface +type FakeAuthentications struct { + Fake *FakeConfigV1 +} + +var authenticationsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "authentications"} + +var authenticationsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Authentication"} + +// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any. +func (c *FakeAuthentications) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authenticationsResource, name), &configv1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Authentication), err +} + +// List takes label and field selectors, and returns the list of Authentications that match those selectors. +func (c *FakeAuthentications) List(ctx context.Context, opts v1.ListOptions) (result *configv1.AuthenticationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authenticationsResource, authenticationsKind, opts), &configv1.AuthenticationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.AuthenticationList{ListMeta: obj.(*configv1.AuthenticationList).ListMeta} + for _, item := range obj.(*configv1.AuthenticationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested authentications. +func (c *FakeAuthentications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authenticationsResource, opts)) +} + +// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *FakeAuthentications) Create(ctx context.Context, authentication *configv1.Authentication, opts v1.CreateOptions) (result *configv1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authenticationsResource, authentication), &configv1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Authentication), err +} + +// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *FakeAuthentications) Update(ctx context.Context, authentication *configv1.Authentication, opts v1.UpdateOptions) (result *configv1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authenticationsResource, authentication), &configv1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Authentication), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAuthentications) UpdateStatus(ctx context.Context, authentication *configv1.Authentication, opts v1.UpdateOptions) (*configv1.Authentication, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(authenticationsResource, "status", authentication), &configv1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Authentication), err +} + +// Delete takes name of the authentication and deletes it. Returns an error if one occurs. +func (c *FakeAuthentications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(authenticationsResource, name), &configv1.Authentication{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthentications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authenticationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.AuthenticationList{}) + return err +} + +// Patch applies the patch and returns the patched authentication. +func (c *FakeAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authenticationsResource, name, pt, data, subresources...), &configv1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Authentication), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go new file mode 100644 index 0000000000..5232442e76 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go @@ -0,0 +1,106 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBuilds implements BuildInterface +type FakeBuilds struct { + Fake *FakeConfigV1 +} + +var buildsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "builds"} + +var buildsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Build"} + +// Get takes name of the build, and returns the corresponding build object, and an error if there is any. +func (c *FakeBuilds) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(buildsResource, name), &configv1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Build), err +} + +// List takes label and field selectors, and returns the list of Builds that match those selectors. +func (c *FakeBuilds) List(ctx context.Context, opts v1.ListOptions) (result *configv1.BuildList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(buildsResource, buildsKind, opts), &configv1.BuildList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.BuildList{ListMeta: obj.(*configv1.BuildList).ListMeta} + for _, item := range obj.(*configv1.BuildList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested builds. +func (c *FakeBuilds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(buildsResource, opts)) +} + +// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. +func (c *FakeBuilds) Create(ctx context.Context, build *configv1.Build, opts v1.CreateOptions) (result *configv1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(buildsResource, build), &configv1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Build), err +} + +// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. +func (c *FakeBuilds) Update(ctx context.Context, build *configv1.Build, opts v1.UpdateOptions) (result *configv1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(buildsResource, build), &configv1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Build), err +} + +// Delete takes name of the build and deletes it. Returns an error if one occurs. +func (c *FakeBuilds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(buildsResource, name), &configv1.Build{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBuilds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(buildsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.BuildList{}) + return err +} + +// Patch applies the patch and returns the patched build. +func (c *FakeBuilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(buildsResource, name, pt, data, subresources...), &configv1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Build), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go new file mode 100644 index 0000000000..8422324bba --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterOperators implements ClusterOperatorInterface +type FakeClusterOperators struct { + Fake *FakeConfigV1 +} + +var clusteroperatorsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "clusteroperators"} + +var clusteroperatorsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "ClusterOperator"} + +// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. +func (c *FakeClusterOperators) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusteroperatorsResource, name), &configv1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterOperator), err +} + +// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. +func (c *FakeClusterOperators) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ClusterOperatorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusteroperatorsResource, clusteroperatorsKind, opts), &configv1.ClusterOperatorList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ClusterOperatorList{ListMeta: obj.(*configv1.ClusterOperatorList).ListMeta} + for _, item := range obj.(*configv1.ClusterOperatorList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterOperators. +func (c *FakeClusterOperators) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusteroperatorsResource, opts)) +} + +// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *FakeClusterOperators) Create(ctx context.Context, clusterOperator *configv1.ClusterOperator, opts v1.CreateOptions) (result *configv1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusteroperatorsResource, clusterOperator), &configv1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterOperator), err +} + +// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *FakeClusterOperators) Update(ctx context.Context, clusterOperator *configv1.ClusterOperator, opts v1.UpdateOptions) (result *configv1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusteroperatorsResource, clusterOperator), &configv1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterOperator), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterOperators) UpdateStatus(ctx context.Context, clusterOperator *configv1.ClusterOperator, opts v1.UpdateOptions) (*configv1.ClusterOperator, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusteroperatorsResource, "status", clusterOperator), &configv1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterOperator), err +} + +// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. +func (c *FakeClusterOperators) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusteroperatorsResource, name), &configv1.ClusterOperator{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterOperators) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusteroperatorsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ClusterOperatorList{}) + return err +} + +// Patch applies the patch and returns the patched clusterOperator. +func (c *FakeClusterOperators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusteroperatorsResource, name, pt, data, subresources...), &configv1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterOperator), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go new file mode 100644 index 0000000000..6a4b8d890c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterVersions implements ClusterVersionInterface +type FakeClusterVersions struct { + Fake *FakeConfigV1 +} + +var clusterversionsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "clusterversions"} + +var clusterversionsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "ClusterVersion"} + +// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. +func (c *FakeClusterVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterversionsResource, name), &configv1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterVersion), err +} + +// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. +func (c *FakeClusterVersions) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ClusterVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterversionsResource, clusterversionsKind, opts), &configv1.ClusterVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ClusterVersionList{ListMeta: obj.(*configv1.ClusterVersionList).ListMeta} + for _, item := range obj.(*configv1.ClusterVersionList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterVersions. +func (c *FakeClusterVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterversionsResource, opts)) +} + +// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *FakeClusterVersions) Create(ctx context.Context, clusterVersion *configv1.ClusterVersion, opts v1.CreateOptions) (result *configv1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterversionsResource, clusterVersion), &configv1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterVersion), err +} + +// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *FakeClusterVersions) Update(ctx context.Context, clusterVersion *configv1.ClusterVersion, opts v1.UpdateOptions) (result *configv1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterversionsResource, clusterVersion), &configv1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterVersion), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterVersions) UpdateStatus(ctx context.Context, clusterVersion *configv1.ClusterVersion, opts v1.UpdateOptions) (*configv1.ClusterVersion, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusterversionsResource, "status", clusterVersion), &configv1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterVersion), err +} + +// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. +func (c *FakeClusterVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusterversionsResource, name), &configv1.ClusterVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterversionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ClusterVersionList{}) + return err +} + +// Patch applies the patch and returns the patched clusterVersion. +func (c *FakeClusterVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, name, pt, data, subresources...), &configv1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.ClusterVersion), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go new file mode 100644 index 0000000000..d743f46792 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go @@ -0,0 +1,88 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeConfigV1 struct { + *testing.Fake +} + +func (c *FakeConfigV1) APIServers() v1.APIServerInterface { + return &FakeAPIServers{c} +} + +func (c *FakeConfigV1) Authentications() v1.AuthenticationInterface { + return &FakeAuthentications{c} +} + +func (c *FakeConfigV1) Builds() v1.BuildInterface { + return &FakeBuilds{c} +} + +func (c *FakeConfigV1) ClusterOperators() v1.ClusterOperatorInterface { + return &FakeClusterOperators{c} +} + +func (c *FakeConfigV1) ClusterVersions() v1.ClusterVersionInterface { + return &FakeClusterVersions{c} +} + +func (c *FakeConfigV1) Consoles() v1.ConsoleInterface { + return &FakeConsoles{c} +} + +func (c *FakeConfigV1) DNSes() v1.DNSInterface { + return &FakeDNSes{c} +} + +func (c *FakeConfigV1) FeatureGates() v1.FeatureGateInterface { + return &FakeFeatureGates{c} +} + +func (c *FakeConfigV1) Images() v1.ImageInterface { + return &FakeImages{c} +} + +func (c *FakeConfigV1) Infrastructures() v1.InfrastructureInterface { + return &FakeInfrastructures{c} +} + +func (c *FakeConfigV1) Ingresses() v1.IngressInterface { + return &FakeIngresses{c} +} + +func (c *FakeConfigV1) Networks() v1.NetworkInterface { + return &FakeNetworks{c} +} + +func (c *FakeConfigV1) OAuths() v1.OAuthInterface { + return &FakeOAuths{c} +} + +func (c *FakeConfigV1) OperatorHubs() v1.OperatorHubInterface { + return &FakeOperatorHubs{c} +} + +func (c *FakeConfigV1) Projects() v1.ProjectInterface { + return &FakeProjects{c} +} + +func (c *FakeConfigV1) Proxies() v1.ProxyInterface { + return &FakeProxies{c} +} + +func (c *FakeConfigV1) Schedulers() v1.SchedulerInterface { + return &FakeSchedulers{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeConfigV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go new file mode 100644 index 0000000000..a275feeb3c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeConsoles implements ConsoleInterface +type FakeConsoles struct { + Fake *FakeConfigV1 +} + +var consolesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "consoles"} + +var consolesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Console"} + +// Get takes name of the console, and returns the corresponding console object, and an error if there is any. +func (c *FakeConsoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(consolesResource, name), &configv1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Console), err +} + +// List takes label and field selectors, and returns the list of Consoles that match those selectors. +func (c *FakeConsoles) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ConsoleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(consolesResource, consolesKind, opts), &configv1.ConsoleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ConsoleList{ListMeta: obj.(*configv1.ConsoleList).ListMeta} + for _, item := range obj.(*configv1.ConsoleList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested consoles. +func (c *FakeConsoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(consolesResource, opts)) +} + +// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any. +func (c *FakeConsoles) Create(ctx context.Context, console *configv1.Console, opts v1.CreateOptions) (result *configv1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(consolesResource, console), &configv1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Console), err +} + +// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any. +func (c *FakeConsoles) Update(ctx context.Context, console *configv1.Console, opts v1.UpdateOptions) (result *configv1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(consolesResource, console), &configv1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Console), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeConsoles) UpdateStatus(ctx context.Context, console *configv1.Console, opts v1.UpdateOptions) (*configv1.Console, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(consolesResource, "status", console), &configv1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Console), err +} + +// Delete takes name of the console and deletes it. Returns an error if one occurs. +func (c *FakeConsoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(consolesResource, name), &configv1.Console{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConsoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(consolesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ConsoleList{}) + return err +} + +// Patch applies the patch and returns the patched console. +func (c *FakeConsoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(consolesResource, name, pt, data, subresources...), &configv1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Console), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go new file mode 100644 index 0000000000..1aab6def6c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDNSes implements DNSInterface +type FakeDNSes struct { + Fake *FakeConfigV1 +} + +var dnsesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "dnses"} + +var dnsesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "DNS"} + +// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any. +func (c *FakeDNSes) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnsesResource, name), &configv1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.DNS), err +} + +// List takes label and field selectors, and returns the list of DNSes that match those selectors. +func (c *FakeDNSes) List(ctx context.Context, opts v1.ListOptions) (result *configv1.DNSList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnsesResource, dnsesKind, opts), &configv1.DNSList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.DNSList{ListMeta: obj.(*configv1.DNSList).ListMeta} + for _, item := range obj.(*configv1.DNSList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested dNSes. +func (c *FakeDNSes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnsesResource, opts)) +} + +// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *FakeDNSes) Create(ctx context.Context, dNS *configv1.DNS, opts v1.CreateOptions) (result *configv1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnsesResource, dNS), &configv1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.DNS), err +} + +// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *FakeDNSes) Update(ctx context.Context, dNS *configv1.DNS, opts v1.UpdateOptions) (result *configv1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnsesResource, dNS), &configv1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.DNS), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDNSes) UpdateStatus(ctx context.Context, dNS *configv1.DNS, opts v1.UpdateOptions) (*configv1.DNS, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(dnsesResource, "status", dNS), &configv1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.DNS), err +} + +// Delete takes name of the dNS and deletes it. Returns an error if one occurs. +func (c *FakeDNSes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnsesResource, name), &configv1.DNS{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnsesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.DNSList{}) + return err +} + +// Patch applies the patch and returns the patched dNS. +func (c *FakeDNSes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnsesResource, name, pt, data, subresources...), &configv1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.DNS), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go new file mode 100644 index 0000000000..8ad782e873 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_featuregate.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeFeatureGates implements FeatureGateInterface +type FakeFeatureGates struct { + Fake *FakeConfigV1 +} + +var featuregatesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "featuregates"} + +var featuregatesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "FeatureGate"} + +// Get takes name of the featureGate, and returns the corresponding featureGate object, and an error if there is any. +func (c *FakeFeatureGates) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.FeatureGate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(featuregatesResource, name), &configv1.FeatureGate{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.FeatureGate), err +} + +// List takes label and field selectors, and returns the list of FeatureGates that match those selectors. +func (c *FakeFeatureGates) List(ctx context.Context, opts v1.ListOptions) (result *configv1.FeatureGateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(featuregatesResource, featuregatesKind, opts), &configv1.FeatureGateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.FeatureGateList{ListMeta: obj.(*configv1.FeatureGateList).ListMeta} + for _, item := range obj.(*configv1.FeatureGateList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested featureGates. +func (c *FakeFeatureGates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(featuregatesResource, opts)) +} + +// Create takes the representation of a featureGate and creates it. Returns the server's representation of the featureGate, and an error, if there is any. +func (c *FakeFeatureGates) Create(ctx context.Context, featureGate *configv1.FeatureGate, opts v1.CreateOptions) (result *configv1.FeatureGate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(featuregatesResource, featureGate), &configv1.FeatureGate{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.FeatureGate), err +} + +// Update takes the representation of a featureGate and updates it. Returns the server's representation of the featureGate, and an error, if there is any. +func (c *FakeFeatureGates) Update(ctx context.Context, featureGate *configv1.FeatureGate, opts v1.UpdateOptions) (result *configv1.FeatureGate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(featuregatesResource, featureGate), &configv1.FeatureGate{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.FeatureGate), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeFeatureGates) UpdateStatus(ctx context.Context, featureGate *configv1.FeatureGate, opts v1.UpdateOptions) (*configv1.FeatureGate, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(featuregatesResource, "status", featureGate), &configv1.FeatureGate{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.FeatureGate), err +} + +// Delete takes name of the featureGate and deletes it. Returns an error if one occurs. +func (c *FakeFeatureGates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(featuregatesResource, name), &configv1.FeatureGate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFeatureGates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(featuregatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.FeatureGateList{}) + return err +} + +// Patch applies the patch and returns the patched featureGate. +func (c *FakeFeatureGates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.FeatureGate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(featuregatesResource, name, pt, data, subresources...), &configv1.FeatureGate{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.FeatureGate), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go new file mode 100644 index 0000000000..6cff256912 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeImages implements ImageInterface +type FakeImages struct { + Fake *FakeConfigV1 +} + +var imagesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "images"} + +var imagesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Image"} + +// Get takes name of the image, and returns the corresponding image object, and an error if there is any. +func (c *FakeImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(imagesResource, name), &configv1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Image), err +} + +// List takes label and field selectors, and returns the list of Images that match those selectors. +func (c *FakeImages) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(imagesResource, imagesKind, opts), &configv1.ImageList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ImageList{ListMeta: obj.(*configv1.ImageList).ListMeta} + for _, item := range obj.(*configv1.ImageList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested images. +func (c *FakeImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(imagesResource, opts)) +} + +// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any. +func (c *FakeImages) Create(ctx context.Context, image *configv1.Image, opts v1.CreateOptions) (result *configv1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(imagesResource, image), &configv1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Image), err +} + +// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any. +func (c *FakeImages) Update(ctx context.Context, image *configv1.Image, opts v1.UpdateOptions) (result *configv1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(imagesResource, image), &configv1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Image), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeImages) UpdateStatus(ctx context.Context, image *configv1.Image, opts v1.UpdateOptions) (*configv1.Image, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(imagesResource, "status", image), &configv1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Image), err +} + +// Delete takes name of the image and deletes it. Returns an error if one occurs. +func (c *FakeImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(imagesResource, name), &configv1.Image{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(imagesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ImageList{}) + return err +} + +// Patch applies the patch and returns the patched image. +func (c *FakeImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(imagesResource, name, pt, data, subresources...), &configv1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Image), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go new file mode 100644 index 0000000000..698db7184a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeInfrastructures implements InfrastructureInterface +type FakeInfrastructures struct { + Fake *FakeConfigV1 +} + +var infrastructuresResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "infrastructures"} + +var infrastructuresKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Infrastructure"} + +// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any. +func (c *FakeInfrastructures) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(infrastructuresResource, name), &configv1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Infrastructure), err +} + +// List takes label and field selectors, and returns the list of Infrastructures that match those selectors. +func (c *FakeInfrastructures) List(ctx context.Context, opts v1.ListOptions) (result *configv1.InfrastructureList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(infrastructuresResource, infrastructuresKind, opts), &configv1.InfrastructureList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.InfrastructureList{ListMeta: obj.(*configv1.InfrastructureList).ListMeta} + for _, item := range obj.(*configv1.InfrastructureList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested infrastructures. +func (c *FakeInfrastructures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(infrastructuresResource, opts)) +} + +// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *FakeInfrastructures) Create(ctx context.Context, infrastructure *configv1.Infrastructure, opts v1.CreateOptions) (result *configv1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(infrastructuresResource, infrastructure), &configv1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Infrastructure), err +} + +// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *FakeInfrastructures) Update(ctx context.Context, infrastructure *configv1.Infrastructure, opts v1.UpdateOptions) (result *configv1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(infrastructuresResource, infrastructure), &configv1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Infrastructure), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeInfrastructures) UpdateStatus(ctx context.Context, infrastructure *configv1.Infrastructure, opts v1.UpdateOptions) (*configv1.Infrastructure, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(infrastructuresResource, "status", infrastructure), &configv1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Infrastructure), err +} + +// Delete takes name of the infrastructure and deletes it. Returns an error if one occurs. +func (c *FakeInfrastructures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(infrastructuresResource, name), &configv1.Infrastructure{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInfrastructures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(infrastructuresResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.InfrastructureList{}) + return err +} + +// Patch applies the patch and returns the patched infrastructure. +func (c *FakeInfrastructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(infrastructuresResource, name, pt, data, subresources...), &configv1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Infrastructure), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go new file mode 100644 index 0000000000..7314198cdf --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeIngresses implements IngressInterface +type FakeIngresses struct { + Fake *FakeConfigV1 +} + +var ingressesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "ingresses"} + +var ingressesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Ingress"} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ingressesResource, name), &configv1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Ingress), err +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *configv1.IngressList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ingressesResource, ingressesKind, opts), &configv1.IngressList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.IngressList{ListMeta: obj.(*configv1.IngressList).ListMeta} + for _, item := range obj.(*configv1.IngressList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested ingresses. +func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ingressesResource, opts)) +} + +// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *FakeIngresses) Create(ctx context.Context, ingress *configv1.Ingress, opts v1.CreateOptions) (result *configv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ingressesResource, ingress), &configv1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Ingress), err +} + +// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *FakeIngresses) Update(ctx context.Context, ingress *configv1.Ingress, opts v1.UpdateOptions) (result *configv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ingressesResource, ingress), &configv1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Ingress), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *configv1.Ingress, opts v1.UpdateOptions) (*configv1.Ingress, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(ingressesResource, "status", ingress), &configv1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Ingress), err +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(ingressesResource, name), &configv1.Ingress{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ingressesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.IngressList{}) + return err +} + +// Patch applies the patch and returns the patched ingress. +func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ingressesResource, name, pt, data, subresources...), &configv1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Ingress), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go new file mode 100644 index 0000000000..a1953c5429 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworks implements NetworkInterface +type FakeNetworks struct { + Fake *FakeConfigV1 +} + +var networksResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "networks"} + +var networksKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Network"} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *FakeNetworks) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networksResource, name), &configv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Network), err +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *FakeNetworks) List(ctx context.Context, opts v1.ListOptions) (result *configv1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networksResource, networksKind, opts), &configv1.NetworkList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.NetworkList{ListMeta: obj.(*configv1.NetworkList).ListMeta} + for _, item := range obj.(*configv1.NetworkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested networks. +func (c *FakeNetworks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networksResource, opts)) +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Create(ctx context.Context, network *configv1.Network, opts v1.CreateOptions) (result *configv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networksResource, network), &configv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Network), err +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Update(ctx context.Context, network *configv1.Network, opts v1.UpdateOptions) (result *configv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networksResource, network), &configv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Network), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNetworks) UpdateStatus(ctx context.Context, network *configv1.Network, opts v1.UpdateOptions) (*configv1.Network, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(networksResource, "status", network), &configv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Network), err +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *FakeNetworks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networksResource, name), &configv1.Network{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networksResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.NetworkList{}) + return err +} + +// Patch applies the patch and returns the patched network. +func (c *FakeNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networksResource, name, pt, data, subresources...), &configv1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Network), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go new file mode 100644 index 0000000000..c5146adcf5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeOAuths implements OAuthInterface +type FakeOAuths struct { + Fake *FakeConfigV1 +} + +var oauthsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "oauths"} + +var oauthsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "OAuth"} + +// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any. +func (c *FakeOAuths) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(oauthsResource, name), &configv1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OAuth), err +} + +// List takes label and field selectors, and returns the list of OAuths that match those selectors. +func (c *FakeOAuths) List(ctx context.Context, opts v1.ListOptions) (result *configv1.OAuthList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(oauthsResource, oauthsKind, opts), &configv1.OAuthList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.OAuthList{ListMeta: obj.(*configv1.OAuthList).ListMeta} + for _, item := range obj.(*configv1.OAuthList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested oAuths. +func (c *FakeOAuths) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(oauthsResource, opts)) +} + +// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *FakeOAuths) Create(ctx context.Context, oAuth *configv1.OAuth, opts v1.CreateOptions) (result *configv1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(oauthsResource, oAuth), &configv1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OAuth), err +} + +// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *FakeOAuths) Update(ctx context.Context, oAuth *configv1.OAuth, opts v1.UpdateOptions) (result *configv1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(oauthsResource, oAuth), &configv1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OAuth), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeOAuths) UpdateStatus(ctx context.Context, oAuth *configv1.OAuth, opts v1.UpdateOptions) (*configv1.OAuth, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(oauthsResource, "status", oAuth), &configv1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OAuth), err +} + +// Delete takes name of the oAuth and deletes it. Returns an error if one occurs. +func (c *FakeOAuths) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(oauthsResource, name), &configv1.OAuth{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOAuths) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(oauthsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.OAuthList{}) + return err +} + +// Patch applies the patch and returns the patched oAuth. +func (c *FakeOAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(oauthsResource, name, pt, data, subresources...), &configv1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OAuth), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go new file mode 100644 index 0000000000..9da8b92884 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_operatorhub.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeOperatorHubs implements OperatorHubInterface +type FakeOperatorHubs struct { + Fake *FakeConfigV1 +} + +var operatorhubsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "operatorhubs"} + +var operatorhubsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "OperatorHub"} + +// Get takes name of the operatorHub, and returns the corresponding operatorHub object, and an error if there is any. +func (c *FakeOperatorHubs) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.OperatorHub, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(operatorhubsResource, name), &configv1.OperatorHub{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OperatorHub), err +} + +// List takes label and field selectors, and returns the list of OperatorHubs that match those selectors. +func (c *FakeOperatorHubs) List(ctx context.Context, opts v1.ListOptions) (result *configv1.OperatorHubList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(operatorhubsResource, operatorhubsKind, opts), &configv1.OperatorHubList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.OperatorHubList{ListMeta: obj.(*configv1.OperatorHubList).ListMeta} + for _, item := range obj.(*configv1.OperatorHubList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested operatorHubs. +func (c *FakeOperatorHubs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(operatorhubsResource, opts)) +} + +// Create takes the representation of a operatorHub and creates it. Returns the server's representation of the operatorHub, and an error, if there is any. +func (c *FakeOperatorHubs) Create(ctx context.Context, operatorHub *configv1.OperatorHub, opts v1.CreateOptions) (result *configv1.OperatorHub, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(operatorhubsResource, operatorHub), &configv1.OperatorHub{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OperatorHub), err +} + +// Update takes the representation of a operatorHub and updates it. Returns the server's representation of the operatorHub, and an error, if there is any. +func (c *FakeOperatorHubs) Update(ctx context.Context, operatorHub *configv1.OperatorHub, opts v1.UpdateOptions) (result *configv1.OperatorHub, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(operatorhubsResource, operatorHub), &configv1.OperatorHub{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OperatorHub), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeOperatorHubs) UpdateStatus(ctx context.Context, operatorHub *configv1.OperatorHub, opts v1.UpdateOptions) (*configv1.OperatorHub, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(operatorhubsResource, "status", operatorHub), &configv1.OperatorHub{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OperatorHub), err +} + +// Delete takes name of the operatorHub and deletes it. Returns an error if one occurs. +func (c *FakeOperatorHubs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(operatorhubsResource, name), &configv1.OperatorHub{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOperatorHubs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(operatorhubsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.OperatorHubList{}) + return err +} + +// Patch applies the patch and returns the patched operatorHub. +func (c *FakeOperatorHubs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.OperatorHub, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(operatorhubsResource, name, pt, data, subresources...), &configv1.OperatorHub{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.OperatorHub), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go new file mode 100644 index 0000000000..08ed1144f4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjects implements ProjectInterface +type FakeProjects struct { + Fake *FakeConfigV1 +} + +var projectsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "projects"} + +var projectsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Project"} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *FakeProjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectsResource, name), &configv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Project), err +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *FakeProjects) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ProjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &configv1.ProjectList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ProjectList{ListMeta: obj.(*configv1.ProjectList).ListMeta} + for _, item := range obj.(*configv1.ProjectList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *FakeProjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectsResource, opts)) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Create(ctx context.Context, project *configv1.Project, opts v1.CreateOptions) (result *configv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectsResource, project), &configv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Project), err +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Update(ctx context.Context, project *configv1.Project, opts v1.UpdateOptions) (result *configv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectsResource, project), &configv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Project), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjects) UpdateStatus(ctx context.Context, project *configv1.Project, opts v1.UpdateOptions) (*configv1.Project, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(projectsResource, "status", project), &configv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Project), err +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *FakeProjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectsResource, name), &configv1.Project{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectsResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ProjectList{}) + return err +} + +// Patch applies the patch and returns the patched project. +func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, pt, data, subresources...), &configv1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Project), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go new file mode 100644 index 0000000000..5bf694e723 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_proxy.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProxies implements ProxyInterface +type FakeProxies struct { + Fake *FakeConfigV1 +} + +var proxiesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "proxies"} + +var proxiesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Proxy"} + +// Get takes name of the proxy, and returns the corresponding proxy object, and an error if there is any. +func (c *FakeProxies) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Proxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(proxiesResource, name), &configv1.Proxy{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Proxy), err +} + +// List takes label and field selectors, and returns the list of Proxies that match those selectors. +func (c *FakeProxies) List(ctx context.Context, opts v1.ListOptions) (result *configv1.ProxyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(proxiesResource, proxiesKind, opts), &configv1.ProxyList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.ProxyList{ListMeta: obj.(*configv1.ProxyList).ListMeta} + for _, item := range obj.(*configv1.ProxyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested proxies. +func (c *FakeProxies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(proxiesResource, opts)) +} + +// Create takes the representation of a proxy and creates it. Returns the server's representation of the proxy, and an error, if there is any. +func (c *FakeProxies) Create(ctx context.Context, proxy *configv1.Proxy, opts v1.CreateOptions) (result *configv1.Proxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(proxiesResource, proxy), &configv1.Proxy{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Proxy), err +} + +// Update takes the representation of a proxy and updates it. Returns the server's representation of the proxy, and an error, if there is any. +func (c *FakeProxies) Update(ctx context.Context, proxy *configv1.Proxy, opts v1.UpdateOptions) (result *configv1.Proxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(proxiesResource, proxy), &configv1.Proxy{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Proxy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProxies) UpdateStatus(ctx context.Context, proxy *configv1.Proxy, opts v1.UpdateOptions) (*configv1.Proxy, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(proxiesResource, "status", proxy), &configv1.Proxy{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Proxy), err +} + +// Delete takes name of the proxy and deletes it. Returns an error if one occurs. +func (c *FakeProxies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(proxiesResource, name), &configv1.Proxy{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProxies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(proxiesResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.ProxyList{}) + return err +} + +// Patch applies the patch and returns the patched proxy. +func (c *FakeProxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Proxy, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(proxiesResource, name, pt, data, subresources...), &configv1.Proxy{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Proxy), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go new file mode 100644 index 0000000000..fb099606a1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduler.go @@ -0,0 +1,117 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSchedulers implements SchedulerInterface +type FakeSchedulers struct { + Fake *FakeConfigV1 +} + +var schedulersResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "schedulers"} + +var schedulersKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Scheduler"} + +// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. +func (c *FakeSchedulers) Get(ctx context.Context, name string, options v1.GetOptions) (result *configv1.Scheduler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(schedulersResource, name), &configv1.Scheduler{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Scheduler), err +} + +// List takes label and field selectors, and returns the list of Schedulers that match those selectors. +func (c *FakeSchedulers) List(ctx context.Context, opts v1.ListOptions) (result *configv1.SchedulerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(schedulersResource, schedulersKind, opts), &configv1.SchedulerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &configv1.SchedulerList{ListMeta: obj.(*configv1.SchedulerList).ListMeta} + for _, item := range obj.(*configv1.SchedulerList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested schedulers. +func (c *FakeSchedulers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(schedulersResource, opts)) +} + +// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. +func (c *FakeSchedulers) Create(ctx context.Context, scheduler *configv1.Scheduler, opts v1.CreateOptions) (result *configv1.Scheduler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(schedulersResource, scheduler), &configv1.Scheduler{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Scheduler), err +} + +// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. +func (c *FakeSchedulers) Update(ctx context.Context, scheduler *configv1.Scheduler, opts v1.UpdateOptions) (result *configv1.Scheduler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(schedulersResource, scheduler), &configv1.Scheduler{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Scheduler), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSchedulers) UpdateStatus(ctx context.Context, scheduler *configv1.Scheduler, opts v1.UpdateOptions) (*configv1.Scheduler, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(schedulersResource, "status", scheduler), &configv1.Scheduler{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Scheduler), err +} + +// Delete takes name of the scheduler and deletes it. Returns an error if one occurs. +func (c *FakeSchedulers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(schedulersResource, name), &configv1.Scheduler{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSchedulers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(schedulersResource, listOpts) + + _, err := c.Fake.Invokes(action, &configv1.SchedulerList{}) + return err +} + +// Patch applies the patch and returns the patched scheduler. +func (c *FakeSchedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1.Scheduler, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(schedulersResource, name, pt, data, subresources...), &configv1.Scheduler{}) + if obj == nil { + return nil, err + } + return obj.(*configv1.Scheduler), err +} diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..ece58dc0bf --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,66 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/openshift/client-go/route/clientset/versioned" + routev1 "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1" + fakeroutev1 "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// RouteV1 retrieves the RouteV1Client +func (c *Clientset) RouteV1() routev1.RouteV1Interface { + return &fakeroutev1.FakeRouteV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..3630ed1cd1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/register.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..279f25d9de --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/fake/register.go @@ -0,0 +1,40 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + routev1 "github.com/openshift/api/route/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + routev1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/doc.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/doc.go new file mode 100644 index 0000000000..2b5ba4c8e4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route.go new file mode 100644 index 0000000000..42a44545a7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route.go @@ -0,0 +1,126 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + routev1 "github.com/openshift/api/route/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRoutes implements RouteInterface +type FakeRoutes struct { + Fake *FakeRouteV1 + ns string +} + +var routesResource = schema.GroupVersionResource{Group: "route.openshift.io", Version: "v1", Resource: "routes"} + +var routesKind = schema.GroupVersionKind{Group: "route.openshift.io", Version: "v1", Kind: "Route"} + +// Get takes name of the route, and returns the corresponding route object, and an error if there is any. +func (c *FakeRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *routev1.Route, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(routesResource, c.ns, name), &routev1.Route{}) + + if obj == nil { + return nil, err + } + return obj.(*routev1.Route), err +} + +// List takes label and field selectors, and returns the list of Routes that match those selectors. +func (c *FakeRoutes) List(ctx context.Context, opts v1.ListOptions) (result *routev1.RouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(routesResource, routesKind, c.ns, opts), &routev1.RouteList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &routev1.RouteList{ListMeta: obj.(*routev1.RouteList).ListMeta} + for _, item := range obj.(*routev1.RouteList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested routes. +func (c *FakeRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(routesResource, c.ns, opts)) + +} + +// Create takes the representation of a route and creates it. Returns the server's representation of the route, and an error, if there is any. +func (c *FakeRoutes) Create(ctx context.Context, route *routev1.Route, opts v1.CreateOptions) (result *routev1.Route, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(routesResource, c.ns, route), &routev1.Route{}) + + if obj == nil { + return nil, err + } + return obj.(*routev1.Route), err +} + +// Update takes the representation of a route and updates it. Returns the server's representation of the route, and an error, if there is any. +func (c *FakeRoutes) Update(ctx context.Context, route *routev1.Route, opts v1.UpdateOptions) (result *routev1.Route, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(routesResource, c.ns, route), &routev1.Route{}) + + if obj == nil { + return nil, err + } + return obj.(*routev1.Route), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRoutes) UpdateStatus(ctx context.Context, route *routev1.Route, opts v1.UpdateOptions) (*routev1.Route, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(routesResource, "status", c.ns, route), &routev1.Route{}) + + if obj == nil { + return nil, err + } + return obj.(*routev1.Route), err +} + +// Delete takes name of the route and deletes it. Returns an error if one occurs. +func (c *FakeRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(routesResource, c.ns, name), &routev1.Route{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(routesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &routev1.RouteList{}) + return err +} + +// Patch applies the patch and returns the patched route. +func (c *FakeRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *routev1.Route, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(routesResource, c.ns, name, pt, data, subresources...), &routev1.Route{}) + + if obj == nil { + return nil, err + } + return obj.(*routev1.Route), err +} diff --git a/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route_client.go b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route_client.go new file mode 100644 index 0000000000..f942964366 --- /dev/null +++ b/vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake/fake_route_client.go @@ -0,0 +1,24 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeRouteV1 struct { + *testing.Fake +} + +func (c *FakeRouteV1) Routes(namespace string) v1.RouteInterface { + return &FakeRoutes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeRouteV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/k8s.io/klog/.travis.yml b/vendor/k8s.io/klog/.travis.yml new file mode 100644 index 0000000000..5677664c21 --- /dev/null +++ b/vendor/k8s.io/klog/.travis.yml @@ -0,0 +1,16 @@ +language: go +go_import_path: k8s.io/klog +dist: xenial +go: + - 1.9.x + - 1.10.x + - 1.11.x + - 1.12.x +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - diff -u <(echo -n) <(golint $(go list -e ./...)) + - go tool vet . || go vet . + - go test -v -race ./... +install: + - go get golang.org/x/lint/golint diff --git a/vendor/k8s.io/klog/CONTRIBUTING.md b/vendor/k8s.io/klog/CONTRIBUTING.md new file mode 100644 index 0000000000..574a56abbb --- /dev/null +++ b/vendor/k8s.io/klog/CONTRIBUTING.md @@ -0,0 +1,22 @@ +# Contributing Guidelines + +Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: + +_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ + +## Getting Started + +We have full documentation on how to get started contributing here: + +- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests +- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) +- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers + +## Mentorship + +- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! + +## Contact Information + +- [Slack](https://kubernetes.slack.com/messages/sig-architecture) +- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture) diff --git a/vendor/k8s.io/klog/LICENSE b/vendor/k8s.io/klog/LICENSE new file mode 100644 index 0000000000..37ec93a14f --- /dev/null +++ b/vendor/k8s.io/klog/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/k8s.io/klog/OWNERS b/vendor/k8s.io/klog/OWNERS new file mode 100644 index 0000000000..380e514f28 --- /dev/null +++ b/vendor/k8s.io/klog/OWNERS @@ -0,0 +1,19 @@ +# See the OWNERS docs at https://go.k8s.io/owners +reviewers: + - jayunit100 + - hoegaarden + - andyxning + - neolit123 + - pohly + - yagonobre + - vincepri + - detiber +approvers: + - dims + - thockin + - justinsb + - tallclair + - piosz + - brancz + - DirectXMan12 + - lavalamp diff --git a/vendor/k8s.io/klog/README.md b/vendor/k8s.io/klog/README.md new file mode 100644 index 0000000000..841468b4b6 --- /dev/null +++ b/vendor/k8s.io/klog/README.md @@ -0,0 +1,97 @@ +klog +==== + +klog is a permanent fork of https://github.com/golang/glog. + +## Why was klog created? + +The decision to create klog was one that wasn't made lightly, but it was necessary due to some +drawbacks that are present in [glog](https://github.com/golang/glog). Ultimately, the fork was created due to glog not being under active development; this can be seen in the glog README: + +> The code in this repo [...] is not itself under development + +This makes us unable to solve many use cases without a fork. The factors that contributed to needing feature development are listed below: + + * `glog` [presents a lot "gotchas"](https://github.com/kubernetes/kubernetes/issues/61006) and introduces challenges in containerized environments, all of which aren't well documented. + * `glog` doesn't provide an easy way to test logs, which detracts from the stability of software using it + * A long term goal is to implement a logging interface that allows us to add context, change output format, etc. + +Historical context is available here: + + * https://github.com/kubernetes/kubernetes/issues/61006 + * https://github.com/kubernetes/kubernetes/issues/70264 + * https://groups.google.com/forum/#!msg/kubernetes-sig-architecture/wCWiWf3Juzs/hXRVBH90CgAJ + * https://groups.google.com/forum/#!msg/kubernetes-dev/7vnijOMhLS0/1oRiNtigBgAJ + +---- + +How to use klog +=============== +- Replace imports for `github.com/golang/glog` with `k8s.io/klog` +- Use `klog.InitFlags(nil)` explicitly for initializing global flags as we no longer use `init()` method to register the flags +- You can now use `log-file` instead of `log-dir` for logging to a single file (See `examples/log_file/usage_log_file.go`) +- If you want to redirect everything logged using klog somewhere else (say syslog!), you can use `klog.SetOutput()` method and supply a `io.Writer`. (See `examples/set_output/usage_set_output.go`) +- For more logging conventions (See [Logging Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)) + +### Coexisting with glog +This package can be used side by side with glog. [This example](examples/coexist_glog/coexist_glog.go) shows how to initialize and syncronize flags from the global `flag.CommandLine` FlagSet. In addition, the example makes use of stderr as combined output by setting `alsologtostderr` (or `logtostderr`) to `true`. + +## Community, discussion, contribution, and support + +Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). + +You can reach the maintainers of this project at: + +- [Slack](https://kubernetes.slack.com/messages/sig-architecture) +- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture) + +### Code of conduct + +Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). + +---- + +glog +==== + +Leveled execution logs for Go. + +This is an efficient pure Go implementation of leveled logs in the +manner of the open source C++ package + https://github.com/google/glog + +By binding methods to booleans it is possible to use the log package +without paying the expense of evaluating the arguments to the log. +Through the -vmodule flag, the package also provides fine-grained +control over logging at the file level. + +The comment from glog.go introduces the ideas: + + Package glog implements logging analogous to the Google-internal + C++ INFO/ERROR/V setup. It provides functions Info, Warning, + Error, Fatal, plus formatting variants such as Infof. It + also provides V-style logging controlled by the -v and + -vmodule=file=2 flags. + + Basic examples: + + glog.Info("Prepare to repel boarders") + + glog.Fatalf("Initialization failed: %s", err) + + See the documentation for the V function for an explanation + of these examples: + + if glog.V(2) { + glog.Info("Starting transaction...") + } + + glog.V(2).Infoln("Processed", nItems, "elements") + + +The repository contains an open source version of the log package +used inside Google. The master copy of the source lives inside +Google, not here. The code in this repo is for export only and is not itself +under development. Feature requests will be ignored. + +Send bug reports to golang-nuts@googlegroups.com. diff --git a/vendor/k8s.io/klog/RELEASE.md b/vendor/k8s.io/klog/RELEASE.md new file mode 100644 index 0000000000..b53eb960ce --- /dev/null +++ b/vendor/k8s.io/klog/RELEASE.md @@ -0,0 +1,9 @@ +# Release Process + +The `klog` is released on an as-needed basis. The process is as follows: + +1. An issue is proposing a new release with a changelog since the last release +1. All [OWNERS](OWNERS) must LGTM this release +1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` +1. The release issue is closed +1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released` diff --git a/vendor/k8s.io/klog/SECURITY_CONTACTS b/vendor/k8s.io/klog/SECURITY_CONTACTS new file mode 100644 index 0000000000..6128a58699 --- /dev/null +++ b/vendor/k8s.io/klog/SECURITY_CONTACTS @@ -0,0 +1,20 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Committee to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +dims +thockin +justinsb +tallclair +piosz +brancz +DirectXMan12 +lavalamp diff --git a/vendor/k8s.io/klog/code-of-conduct.md b/vendor/k8s.io/klog/code-of-conduct.md new file mode 100644 index 0000000000..0d15c00cf3 --- /dev/null +++ b/vendor/k8s.io/klog/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/k8s.io/klog/go.mod b/vendor/k8s.io/klog/go.mod new file mode 100644 index 0000000000..3877d8546a --- /dev/null +++ b/vendor/k8s.io/klog/go.mod @@ -0,0 +1,5 @@ +module k8s.io/klog + +go 1.12 + +require github.com/go-logr/logr v0.1.0 diff --git a/vendor/k8s.io/klog/go.sum b/vendor/k8s.io/klog/go.sum new file mode 100644 index 0000000000..fb64d277a7 --- /dev/null +++ b/vendor/k8s.io/klog/go.sum @@ -0,0 +1,2 @@ +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= diff --git a/vendor/k8s.io/klog/klog.go b/vendor/k8s.io/klog/klog.go new file mode 100644 index 0000000000..2712ce0afc --- /dev/null +++ b/vendor/k8s.io/klog/klog.go @@ -0,0 +1,1308 @@ +// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ +// +// Copyright 2013 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package klog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. +// It provides functions Info, Warning, Error, Fatal, plus formatting variants such as +// Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. +// +// Basic examples: +// +// klog.Info("Prepare to repel boarders") +// +// klog.Fatalf("Initialization failed: %s", err) +// +// See the documentation for the V function for an explanation of these examples: +// +// if klog.V(2) { +// klog.Info("Starting transaction...") +// } +// +// klog.V(2).Infoln("Processed", nItems, "elements") +// +// Log output is buffered and written periodically using Flush. Programs +// should call Flush before exiting to guarantee all log output is written. +// +// By default, all log statements write to standard error. +// This package provides several flags that modify this behavior. +// As a result, flag.Parse must be called before any logging is done. +// +// -logtostderr=true +// Logs are written to standard error instead of to files. +// -alsologtostderr=false +// Logs are written to standard error as well as to files. +// -stderrthreshold=ERROR +// Log events at or above this severity are logged to standard +// error as well as to files. +// -log_dir="" +// Log files will be written to this directory instead of the +// default temporary directory. +// +// Other flags provide aids to debugging. +// +// -log_backtrace_at="" +// When set to a file and line number holding a logging statement, +// such as +// -log_backtrace_at=gopherflakes.go:234 +// a stack trace will be written to the Info log whenever execution +// hits that statement. (Unlike with -vmodule, the ".go" must be +// present.) +// -v=0 +// Enable V-leveled logging at the specified level. +// -vmodule="" +// The syntax of the argument is a comma-separated list of pattern=N, +// where pattern is a literal file name (minus the ".go" suffix) or +// "glob" pattern and N is a V level. For instance, +// -vmodule=gopher*=3 +// sets the V level to 3 in all Go files whose names begin "gopher". +// +package klog + +import ( + "bufio" + "bytes" + "errors" + "flag" + "fmt" + "io" + stdLog "log" + "math" + "os" + "path/filepath" + "runtime" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" +) + +// severity identifies the sort of log: info, warning etc. It also implements +// the flag.Value interface. The -stderrthreshold flag is of type severity and +// should be modified only through the flag.Value interface. The values match +// the corresponding constants in C++. +type severity int32 // sync/atomic int32 + +// These constants identify the log levels in order of increasing severity. +// A message written to a high-severity log file is also written to each +// lower-severity log file. +const ( + infoLog severity = iota + warningLog + errorLog + fatalLog + numSeverity = 4 +) + +const severityChar = "IWEF" + +var severityName = []string{ + infoLog: "INFO", + warningLog: "WARNING", + errorLog: "ERROR", + fatalLog: "FATAL", +} + +// get returns the value of the severity. +func (s *severity) get() severity { + return severity(atomic.LoadInt32((*int32)(s))) +} + +// set sets the value of the severity. +func (s *severity) set(val severity) { + atomic.StoreInt32((*int32)(s), int32(val)) +} + +// String is part of the flag.Value interface. +func (s *severity) String() string { + return strconv.FormatInt(int64(*s), 10) +} + +// Get is part of the flag.Value interface. +func (s *severity) Get() interface{} { + return *s +} + +// Set is part of the flag.Value interface. +func (s *severity) Set(value string) error { + var threshold severity + // Is it a known name? + if v, ok := severityByName(value); ok { + threshold = v + } else { + v, err := strconv.ParseInt(value, 10, 32) + if err != nil { + return err + } + threshold = severity(v) + } + logging.stderrThreshold.set(threshold) + return nil +} + +func severityByName(s string) (severity, bool) { + s = strings.ToUpper(s) + for i, name := range severityName { + if name == s { + return severity(i), true + } + } + return 0, false +} + +// OutputStats tracks the number of output lines and bytes written. +type OutputStats struct { + lines int64 + bytes int64 +} + +// Lines returns the number of lines written. +func (s *OutputStats) Lines() int64 { + return atomic.LoadInt64(&s.lines) +} + +// Bytes returns the number of bytes written. +func (s *OutputStats) Bytes() int64 { + return atomic.LoadInt64(&s.bytes) +} + +// Stats tracks the number of lines of output and number of bytes +// per severity level. Values must be read with atomic.LoadInt64. +var Stats struct { + Info, Warning, Error OutputStats +} + +var severityStats = [numSeverity]*OutputStats{ + infoLog: &Stats.Info, + warningLog: &Stats.Warning, + errorLog: &Stats.Error, +} + +// Level is exported because it appears in the arguments to V and is +// the type of the v flag, which can be set programmatically. +// It's a distinct type because we want to discriminate it from logType. +// Variables of type level are only changed under logging.mu. +// The -v flag is read only with atomic ops, so the state of the logging +// module is consistent. + +// Level is treated as a sync/atomic int32. + +// Level specifies a level of verbosity for V logs. *Level implements +// flag.Value; the -v flag is of type Level and should be modified +// only through the flag.Value interface. +type Level int32 + +// get returns the value of the Level. +func (l *Level) get() Level { + return Level(atomic.LoadInt32((*int32)(l))) +} + +// set sets the value of the Level. +func (l *Level) set(val Level) { + atomic.StoreInt32((*int32)(l), int32(val)) +} + +// String is part of the flag.Value interface. +func (l *Level) String() string { + return strconv.FormatInt(int64(*l), 10) +} + +// Get is part of the flag.Value interface. +func (l *Level) Get() interface{} { + return *l +} + +// Set is part of the flag.Value interface. +func (l *Level) Set(value string) error { + v, err := strconv.ParseInt(value, 10, 32) + if err != nil { + return err + } + logging.mu.Lock() + defer logging.mu.Unlock() + logging.setVState(Level(v), logging.vmodule.filter, false) + return nil +} + +// moduleSpec represents the setting of the -vmodule flag. +type moduleSpec struct { + filter []modulePat +} + +// modulePat contains a filter for the -vmodule flag. +// It holds a verbosity level and a file pattern to match. +type modulePat struct { + pattern string + literal bool // The pattern is a literal string + level Level +} + +// match reports whether the file matches the pattern. It uses a string +// comparison if the pattern contains no metacharacters. +func (m *modulePat) match(file string) bool { + if m.literal { + return file == m.pattern + } + match, _ := filepath.Match(m.pattern, file) + return match +} + +func (m *moduleSpec) String() string { + // Lock because the type is not atomic. TODO: clean this up. + logging.mu.Lock() + defer logging.mu.Unlock() + var b bytes.Buffer + for i, f := range m.filter { + if i > 0 { + b.WriteRune(',') + } + fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) + } + return b.String() +} + +// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the +// struct is not exported. +func (m *moduleSpec) Get() interface{} { + return nil +} + +var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") + +// Syntax: -vmodule=recordio=2,file=1,gfs*=3 +func (m *moduleSpec) Set(value string) error { + var filter []modulePat + for _, pat := range strings.Split(value, ",") { + if len(pat) == 0 { + // Empty strings such as from a trailing comma can be ignored. + continue + } + patLev := strings.Split(pat, "=") + if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 { + return errVmoduleSyntax + } + pattern := patLev[0] + v, err := strconv.ParseInt(patLev[1], 10, 32) + if err != nil { + return errors.New("syntax error: expect comma-separated list of filename=N") + } + if v < 0 { + return errors.New("negative value for vmodule level") + } + if v == 0 { + continue // Ignore. It's harmless but no point in paying the overhead. + } + // TODO: check syntax of filter? + filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) + } + logging.mu.Lock() + defer logging.mu.Unlock() + logging.setVState(logging.verbosity, filter, true) + return nil +} + +// isLiteral reports whether the pattern is a literal string, that is, has no metacharacters +// that require filepath.Match to be called to match the pattern. +func isLiteral(pattern string) bool { + return !strings.ContainsAny(pattern, `\*?[]`) +} + +// traceLocation represents the setting of the -log_backtrace_at flag. +type traceLocation struct { + file string + line int +} + +// isSet reports whether the trace location has been specified. +// logging.mu is held. +func (t *traceLocation) isSet() bool { + return t.line > 0 +} + +// match reports whether the specified file and line matches the trace location. +// The argument file name is the full path, not the basename specified in the flag. +// logging.mu is held. +func (t *traceLocation) match(file string, line int) bool { + if t.line != line { + return false + } + if i := strings.LastIndex(file, "/"); i >= 0 { + file = file[i+1:] + } + return t.file == file +} + +func (t *traceLocation) String() string { + // Lock because the type is not atomic. TODO: clean this up. + logging.mu.Lock() + defer logging.mu.Unlock() + return fmt.Sprintf("%s:%d", t.file, t.line) +} + +// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the +// struct is not exported +func (t *traceLocation) Get() interface{} { + return nil +} + +var errTraceSyntax = errors.New("syntax error: expect file.go:234") + +// Syntax: -log_backtrace_at=gopherflakes.go:234 +// Note that unlike vmodule the file extension is included here. +func (t *traceLocation) Set(value string) error { + if value == "" { + // Unset. + t.line = 0 + t.file = "" + } + fields := strings.Split(value, ":") + if len(fields) != 2 { + return errTraceSyntax + } + file, line := fields[0], fields[1] + if !strings.Contains(file, ".") { + return errTraceSyntax + } + v, err := strconv.Atoi(line) + if err != nil { + return errTraceSyntax + } + if v <= 0 { + return errors.New("negative or zero value for level") + } + logging.mu.Lock() + defer logging.mu.Unlock() + t.line = v + t.file = file + return nil +} + +// flushSyncWriter is the interface satisfied by logging destinations. +type flushSyncWriter interface { + Flush() error + Sync() error + io.Writer +} + +// init sets up the defaults and runs flushDaemon. +func init() { + logging.stderrThreshold = errorLog // Default stderrThreshold is ERROR. + logging.setVState(0, nil, false) + logging.logDir = "" + logging.logFile = "" + logging.logFileMaxSizeMB = 1800 + logging.toStderr = true + logging.alsoToStderr = false + logging.skipHeaders = false + logging.addDirHeader = false + logging.skipLogHeaders = false + go logging.flushDaemon() +} + +// InitFlags is for explicitly initializing the flags. +func InitFlags(flagset *flag.FlagSet) { + if flagset == nil { + flagset = flag.CommandLine + } + + flagset.StringVar(&logging.logDir, "log_dir", logging.logDir, "If non-empty, write log files in this directory") + flagset.StringVar(&logging.logFile, "log_file", logging.logFile, "If non-empty, use this log file") + flagset.Uint64Var(&logging.logFileMaxSizeMB, "log_file_max_size", logging.logFileMaxSizeMB, + "Defines the maximum size a log file can grow to. Unit is megabytes. "+ + "If the value is 0, the maximum file size is unlimited.") + flagset.BoolVar(&logging.toStderr, "logtostderr", logging.toStderr, "log to standard error instead of files") + flagset.BoolVar(&logging.alsoToStderr, "alsologtostderr", logging.alsoToStderr, "log to standard error as well as files") + flagset.Var(&logging.verbosity, "v", "number for the log level verbosity") + flagset.BoolVar(&logging.skipHeaders, "add_dir_header", logging.addDirHeader, "If true, adds the file directory to the header") + flagset.BoolVar(&logging.skipHeaders, "skip_headers", logging.skipHeaders, "If true, avoid header prefixes in the log messages") + flagset.BoolVar(&logging.skipLogHeaders, "skip_log_headers", logging.skipLogHeaders, "If true, avoid headers when opening log files") + flagset.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr") + flagset.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") + flagset.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") +} + +// Flush flushes all pending log I/O. +func Flush() { + logging.lockAndFlushAll() +} + +// loggingT collects all the global state of the logging setup. +type loggingT struct { + // Boolean flags. Not handled atomically because the flag.Value interface + // does not let us avoid the =true, and that shorthand is necessary for + // compatibility. TODO: does this matter enough to fix? Seems unlikely. + toStderr bool // The -logtostderr flag. + alsoToStderr bool // The -alsologtostderr flag. + + // Level flag. Handled atomically. + stderrThreshold severity // The -stderrthreshold flag. + + // freeList is a list of byte buffers, maintained under freeListMu. + freeList *buffer + // freeListMu maintains the free list. It is separate from the main mutex + // so buffers can be grabbed and printed to without holding the main lock, + // for better parallelization. + freeListMu sync.Mutex + + // mu protects the remaining elements of this structure and is + // used to synchronize logging. + mu sync.Mutex + // file holds writer for each of the log types. + file [numSeverity]flushSyncWriter + // pcs is used in V to avoid an allocation when computing the caller's PC. + pcs [1]uintptr + // vmap is a cache of the V Level for each V() call site, identified by PC. + // It is wiped whenever the vmodule flag changes state. + vmap map[uintptr]Level + // filterLength stores the length of the vmodule filter chain. If greater + // than zero, it means vmodule is enabled. It may be read safely + // using sync.LoadInt32, but is only modified under mu. + filterLength int32 + // traceLocation is the state of the -log_backtrace_at flag. + traceLocation traceLocation + // These flags are modified only under lock, although verbosity may be fetched + // safely using atomic.LoadInt32. + vmodule moduleSpec // The state of the -vmodule flag. + verbosity Level // V logging level, the value of the -v flag/ + + // If non-empty, overrides the choice of directory in which to write logs. + // See createLogDirs for the full list of possible destinations. + logDir string + + // If non-empty, specifies the path of the file to write logs. mutually exclusive + // with the log-dir option. + logFile string + + // When logFile is specified, this limiter makes sure the logFile won't exceeds a certain size. When exceeds, the + // logFile will be cleaned up. If this value is 0, no size limitation will be applied to logFile. + logFileMaxSizeMB uint64 + + // If true, do not add the prefix headers, useful when used with SetOutput + skipHeaders bool + + // If true, do not add the headers to log files + skipLogHeaders bool + + // If true, add the file directory to the header + addDirHeader bool +} + +// buffer holds a byte Buffer for reuse. The zero value is ready for use. +type buffer struct { + bytes.Buffer + tmp [64]byte // temporary byte array for creating headers. + next *buffer +} + +var logging loggingT + +// setVState sets a consistent state for V logging. +// l.mu is held. +func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) { + // Turn verbosity off so V will not fire while we are in transition. + logging.verbosity.set(0) + // Ditto for filter length. + atomic.StoreInt32(&logging.filterLength, 0) + + // Set the new filters and wipe the pc->Level map if the filter has changed. + if setFilter { + logging.vmodule.filter = filter + logging.vmap = make(map[uintptr]Level) + } + + // Things are consistent now, so enable filtering and verbosity. + // They are enabled in order opposite to that in V. + atomic.StoreInt32(&logging.filterLength, int32(len(filter))) + logging.verbosity.set(verbosity) +} + +// getBuffer returns a new, ready-to-use buffer. +func (l *loggingT) getBuffer() *buffer { + l.freeListMu.Lock() + b := l.freeList + if b != nil { + l.freeList = b.next + } + l.freeListMu.Unlock() + if b == nil { + b = new(buffer) + } else { + b.next = nil + b.Reset() + } + return b +} + +// putBuffer returns a buffer to the free list. +func (l *loggingT) putBuffer(b *buffer) { + if b.Len() >= 256 { + // Let big buffers die a natural death. + return + } + l.freeListMu.Lock() + b.next = l.freeList + l.freeList = b + l.freeListMu.Unlock() +} + +var timeNow = time.Now // Stubbed out for testing. + +/* +header formats a log header as defined by the C++ implementation. +It returns a buffer containing the formatted header and the user's file and line number. +The depth specifies how many stack frames above lives the source line to be identified in the log message. + +Log lines have this form: + Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... +where the fields are defined as follows: + L A single character, representing the log level (eg 'I' for INFO) + mm The month (zero padded; ie May is '05') + dd The day (zero padded) + hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds + threadid The space-padded thread ID as returned by GetTID() + file The file name + line The line number + msg The user-supplied message +*/ +func (l *loggingT) header(s severity, depth int) (*buffer, string, int) { + _, file, line, ok := runtime.Caller(3 + depth) + if !ok { + file = "???" + line = 1 + } else { + if slash := strings.LastIndex(file, "/"); slash >= 0 { + path := file + file = path[slash+1:] + if l.addDirHeader { + if dirsep := strings.LastIndex(path[:slash], "/"); dirsep >= 0 { + file = path[dirsep+1:] + } + } + } + } + return l.formatHeader(s, file, line), file, line +} + +// formatHeader formats a log header using the provided file name and line number. +func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { + now := timeNow() + if line < 0 { + line = 0 // not a real line number, but acceptable to someDigits + } + if s > fatalLog { + s = infoLog // for safety. + } + buf := l.getBuffer() + if l.skipHeaders { + return buf + } + + // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. + // It's worth about 3X. Fprintf is hard. + _, month, day := now.Date() + hour, minute, second := now.Clock() + // Lmmdd hh:mm:ss.uuuuuu threadid file:line] + buf.tmp[0] = severityChar[s] + buf.twoDigits(1, int(month)) + buf.twoDigits(3, day) + buf.tmp[5] = ' ' + buf.twoDigits(6, hour) + buf.tmp[8] = ':' + buf.twoDigits(9, minute) + buf.tmp[11] = ':' + buf.twoDigits(12, second) + buf.tmp[14] = '.' + buf.nDigits(6, 15, now.Nanosecond()/1000, '0') + buf.tmp[21] = ' ' + buf.nDigits(7, 22, pid, ' ') // TODO: should be TID + buf.tmp[29] = ' ' + buf.Write(buf.tmp[:30]) + buf.WriteString(file) + buf.tmp[0] = ':' + n := buf.someDigits(1, line) + buf.tmp[n+1] = ']' + buf.tmp[n+2] = ' ' + buf.Write(buf.tmp[:n+3]) + return buf +} + +// Some custom tiny helper functions to print the log header efficiently. + +const digits = "0123456789" + +// twoDigits formats a zero-prefixed two-digit integer at buf.tmp[i]. +func (buf *buffer) twoDigits(i, d int) { + buf.tmp[i+1] = digits[d%10] + d /= 10 + buf.tmp[i] = digits[d%10] +} + +// nDigits formats an n-digit integer at buf.tmp[i], +// padding with pad on the left. +// It assumes d >= 0. +func (buf *buffer) nDigits(n, i, d int, pad byte) { + j := n - 1 + for ; j >= 0 && d > 0; j-- { + buf.tmp[i+j] = digits[d%10] + d /= 10 + } + for ; j >= 0; j-- { + buf.tmp[i+j] = pad + } +} + +// someDigits formats a zero-prefixed variable-width integer at buf.tmp[i]. +func (buf *buffer) someDigits(i, d int) int { + // Print into the top, then copy down. We know there's space for at least + // a 10-digit number. + j := len(buf.tmp) + for { + j-- + buf.tmp[j] = digits[d%10] + d /= 10 + if d == 0 { + break + } + } + return copy(buf.tmp[i:], buf.tmp[j:]) +} + +func (l *loggingT) println(s severity, args ...interface{}) { + buf, file, line := l.header(s, 0) + fmt.Fprintln(buf, args...) + l.output(s, buf, file, line, false) +} + +func (l *loggingT) print(s severity, args ...interface{}) { + l.printDepth(s, 1, args...) +} + +func (l *loggingT) printDepth(s severity, depth int, args ...interface{}) { + buf, file, line := l.header(s, depth) + fmt.Fprint(buf, args...) + if buf.Bytes()[buf.Len()-1] != '\n' { + buf.WriteByte('\n') + } + l.output(s, buf, file, line, false) +} + +func (l *loggingT) printf(s severity, format string, args ...interface{}) { + buf, file, line := l.header(s, 0) + fmt.Fprintf(buf, format, args...) + if buf.Bytes()[buf.Len()-1] != '\n' { + buf.WriteByte('\n') + } + l.output(s, buf, file, line, false) +} + +// printWithFileLine behaves like print but uses the provided file and line number. If +// alsoLogToStderr is true, the log message always appears on standard error; it +// will also appear in the log file unless --logtostderr is set. +func (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) { + buf := l.formatHeader(s, file, line) + fmt.Fprint(buf, args...) + if buf.Bytes()[buf.Len()-1] != '\n' { + buf.WriteByte('\n') + } + l.output(s, buf, file, line, alsoToStderr) +} + +// redirectBuffer is used to set an alternate destination for the logs +type redirectBuffer struct { + w io.Writer +} + +func (rb *redirectBuffer) Sync() error { + return nil +} + +func (rb *redirectBuffer) Flush() error { + return nil +} + +func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) { + return rb.w.Write(bytes) +} + +// SetOutput sets the output destination for all severities +func SetOutput(w io.Writer) { + logging.mu.Lock() + defer logging.mu.Unlock() + for s := fatalLog; s >= infoLog; s-- { + rb := &redirectBuffer{ + w: w, + } + logging.file[s] = rb + } +} + +// SetOutputBySeverity sets the output destination for specific severity +func SetOutputBySeverity(name string, w io.Writer) { + logging.mu.Lock() + defer logging.mu.Unlock() + sev, ok := severityByName(name) + if !ok { + panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name)) + } + rb := &redirectBuffer{ + w: w, + } + logging.file[sev] = rb +} + +// output writes the data to the log files and releases the buffer. +func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) { + l.mu.Lock() + if l.traceLocation.isSet() { + if l.traceLocation.match(file, line) { + buf.Write(stacks(false)) + } + } + data := buf.Bytes() + if l.toStderr { + os.Stderr.Write(data) + } else { + if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { + os.Stderr.Write(data) + } + + if logging.logFile != "" { + // Since we are using a single log file, all of the items in l.file array + // will point to the same file, so just use one of them to write data. + if l.file[infoLog] == nil { + if err := l.createFiles(infoLog); err != nil { + os.Stderr.Write(data) // Make sure the message appears somewhere. + l.exit(err) + } + } + l.file[infoLog].Write(data) + } else { + if l.file[s] == nil { + if err := l.createFiles(s); err != nil { + os.Stderr.Write(data) // Make sure the message appears somewhere. + l.exit(err) + } + } + + switch s { + case fatalLog: + l.file[fatalLog].Write(data) + fallthrough + case errorLog: + l.file[errorLog].Write(data) + fallthrough + case warningLog: + l.file[warningLog].Write(data) + fallthrough + case infoLog: + l.file[infoLog].Write(data) + } + } + } + if s == fatalLog { + // If we got here via Exit rather than Fatal, print no stacks. + if atomic.LoadUint32(&fatalNoStacks) > 0 { + l.mu.Unlock() + timeoutFlush(10 * time.Second) + os.Exit(1) + } + // Dump all goroutine stacks before exiting. + // First, make sure we see the trace for the current goroutine on standard error. + // If -logtostderr has been specified, the loop below will do that anyway + // as the first stack in the full dump. + if !l.toStderr { + os.Stderr.Write(stacks(false)) + } + // Write the stack trace for all goroutines to the files. + trace := stacks(true) + logExitFunc = func(error) {} // If we get a write error, we'll still exit below. + for log := fatalLog; log >= infoLog; log-- { + if f := l.file[log]; f != nil { // Can be nil if -logtostderr is set. + f.Write(trace) + } + } + l.mu.Unlock() + timeoutFlush(10 * time.Second) + os.Exit(255) // C++ uses -1, which is silly because it's anded with 255 anyway. + } + l.putBuffer(buf) + l.mu.Unlock() + if stats := severityStats[s]; stats != nil { + atomic.AddInt64(&stats.lines, 1) + atomic.AddInt64(&stats.bytes, int64(len(data))) + } +} + +// timeoutFlush calls Flush and returns when it completes or after timeout +// elapses, whichever happens first. This is needed because the hooks invoked +// by Flush may deadlock when klog.Fatal is called from a hook that holds +// a lock. +func timeoutFlush(timeout time.Duration) { + done := make(chan bool, 1) + go func() { + Flush() // calls logging.lockAndFlushAll() + done <- true + }() + select { + case <-done: + case <-time.After(timeout): + fmt.Fprintln(os.Stderr, "klog: Flush took longer than", timeout) + } +} + +// stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines. +func stacks(all bool) []byte { + // We don't know how big the traces are, so grow a few times if they don't fit. Start large, though. + n := 10000 + if all { + n = 100000 + } + var trace []byte + for i := 0; i < 5; i++ { + trace = make([]byte, n) + nbytes := runtime.Stack(trace, all) + if nbytes < len(trace) { + return trace[:nbytes] + } + n *= 2 + } + return trace +} + +// logExitFunc provides a simple mechanism to override the default behavior +// of exiting on error. Used in testing and to guarantee we reach a required exit +// for fatal logs. Instead, exit could be a function rather than a method but that +// would make its use clumsier. +var logExitFunc func(error) + +// exit is called if there is trouble creating or writing log files. +// It flushes the logs and exits the program; there's no point in hanging around. +// l.mu is held. +func (l *loggingT) exit(err error) { + fmt.Fprintf(os.Stderr, "log: exiting because of error: %s\n", err) + // If logExitFunc is set, we do that instead of exiting. + if logExitFunc != nil { + logExitFunc(err) + return + } + l.flushAll() + os.Exit(2) +} + +// syncBuffer joins a bufio.Writer to its underlying file, providing access to the +// file's Sync method and providing a wrapper for the Write method that provides log +// file rotation. There are conflicting methods, so the file cannot be embedded. +// l.mu is held for all its methods. +type syncBuffer struct { + logger *loggingT + *bufio.Writer + file *os.File + sev severity + nbytes uint64 // The number of bytes written to this file + maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up. +} + +func (sb *syncBuffer) Sync() error { + return sb.file.Sync() +} + +// CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options. +func CalculateMaxSize() uint64 { + if logging.logFile != "" { + if logging.logFileMaxSizeMB == 0 { + // If logFileMaxSizeMB is zero, we don't have limitations on the log size. + return math.MaxUint64 + } + // Flag logFileMaxSizeMB is in MB for user convenience. + return logging.logFileMaxSizeMB * 1024 * 1024 + } + // If "log_file" flag is not specified, the target file (sb.file) will be cleaned up when reaches a fixed size. + return MaxSize +} + +func (sb *syncBuffer) Write(p []byte) (n int, err error) { + if sb.nbytes+uint64(len(p)) >= sb.maxbytes { + if err := sb.rotateFile(time.Now(), false); err != nil { + sb.logger.exit(err) + } + } + n, err = sb.Writer.Write(p) + sb.nbytes += uint64(n) + if err != nil { + sb.logger.exit(err) + } + return +} + +// rotateFile closes the syncBuffer's file and starts a new one. +// The startup argument indicates whether this is the initial startup of klog. +// If startup is true, existing files are opened for appending instead of truncated. +func (sb *syncBuffer) rotateFile(now time.Time, startup bool) error { + if sb.file != nil { + sb.Flush() + sb.file.Close() + } + var err error + sb.file, _, err = create(severityName[sb.sev], now, startup) + sb.nbytes = 0 + if err != nil { + return err + } + + sb.Writer = bufio.NewWriterSize(sb.file, bufferSize) + + if sb.logger.skipLogHeaders { + return nil + } + + // Write header. + var buf bytes.Buffer + fmt.Fprintf(&buf, "Log file created at: %s\n", now.Format("2006/01/02 15:04:05")) + fmt.Fprintf(&buf, "Running on machine: %s\n", host) + fmt.Fprintf(&buf, "Binary: Built with %s %s for %s/%s\n", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH) + fmt.Fprintf(&buf, "Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\n") + n, err := sb.file.Write(buf.Bytes()) + sb.nbytes += uint64(n) + return err +} + +// bufferSize sizes the buffer associated with each log file. It's large +// so that log records can accumulate without the logging thread blocking +// on disk I/O. The flushDaemon will block instead. +const bufferSize = 256 * 1024 + +// createFiles creates all the log files for severity from sev down to infoLog. +// l.mu is held. +func (l *loggingT) createFiles(sev severity) error { + now := time.Now() + // Files are created in decreasing severity order, so as soon as we find one + // has already been created, we can stop. + for s := sev; s >= infoLog && l.file[s] == nil; s-- { + sb := &syncBuffer{ + logger: l, + sev: s, + maxbytes: CalculateMaxSize(), + } + if err := sb.rotateFile(now, true); err != nil { + return err + } + l.file[s] = sb + } + return nil +} + +const flushInterval = 5 * time.Second + +// flushDaemon periodically flushes the log file buffers. +func (l *loggingT) flushDaemon() { + for range time.NewTicker(flushInterval).C { + l.lockAndFlushAll() + } +} + +// lockAndFlushAll is like flushAll but locks l.mu first. +func (l *loggingT) lockAndFlushAll() { + l.mu.Lock() + l.flushAll() + l.mu.Unlock() +} + +// flushAll flushes all the logs and attempts to "sync" their data to disk. +// l.mu is held. +func (l *loggingT) flushAll() { + // Flush from fatal down, in case there's trouble flushing. + for s := fatalLog; s >= infoLog; s-- { + file := l.file[s] + if file != nil { + file.Flush() // ignore error + file.Sync() // ignore error + } + } +} + +// CopyStandardLogTo arranges for messages written to the Go "log" package's +// default logs to also appear in the Google logs for the named and lower +// severities. Subsequent changes to the standard log's default output location +// or format may break this behavior. +// +// Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not +// recognized, CopyStandardLogTo panics. +func CopyStandardLogTo(name string) { + sev, ok := severityByName(name) + if !ok { + panic(fmt.Sprintf("log.CopyStandardLogTo(%q): unrecognized severity name", name)) + } + // Set a log format that captures the user's file and line: + // d.go:23: message + stdLog.SetFlags(stdLog.Lshortfile) + stdLog.SetOutput(logBridge(sev)) +} + +// logBridge provides the Write method that enables CopyStandardLogTo to connect +// Go's standard logs to the logs provided by this package. +type logBridge severity + +// Write parses the standard logging line and passes its components to the +// logger for severity(lb). +func (lb logBridge) Write(b []byte) (n int, err error) { + var ( + file = "???" + line = 1 + text string + ) + // Split "d.go:23: message" into "d.go", "23", and "message". + if parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 { + text = fmt.Sprintf("bad log format: %s", b) + } else { + file = string(parts[0]) + text = string(parts[2][1:]) // skip leading space + line, err = strconv.Atoi(string(parts[1])) + if err != nil { + text = fmt.Sprintf("bad line number: %s", b) + line = 1 + } + } + // printWithFileLine with alsoToStderr=true, so standard log messages + // always appear on standard error. + logging.printWithFileLine(severity(lb), file, line, true, text) + return len(b), nil +} + +// setV computes and remembers the V level for a given PC +// when vmodule is enabled. +// File pattern matching takes the basename of the file, stripped +// of its .go suffix, and uses filepath.Match, which is a little more +// general than the *? matching used in C++. +// l.mu is held. +func (l *loggingT) setV(pc uintptr) Level { + fn := runtime.FuncForPC(pc) + file, _ := fn.FileLine(pc) + // The file is something like /a/b/c/d.go. We want just the d. + if strings.HasSuffix(file, ".go") { + file = file[:len(file)-3] + } + if slash := strings.LastIndex(file, "/"); slash >= 0 { + file = file[slash+1:] + } + for _, filter := range l.vmodule.filter { + if filter.match(file) { + l.vmap[pc] = filter.level + return filter.level + } + } + l.vmap[pc] = 0 + return 0 +} + +// Verbose is a boolean type that implements Infof (like Printf) etc. +// See the documentation of V for more information. +type Verbose bool + +// V reports whether verbosity at the call site is at least the requested level. +// The returned value is a boolean of type Verbose, which implements Info, Infoln +// and Infof. These methods will write to the Info log if called. +// Thus, one may write either +// if klog.V(2) { klog.Info("log this") } +// or +// klog.V(2).Info("log this") +// The second form is shorter but the first is cheaper if logging is off because it does +// not evaluate its arguments. +// +// Whether an individual call to V generates a log record depends on the setting of +// the -v and --vmodule flags; both are off by default. If the level in the call to +// V is at least the value of -v, or of -vmodule for the source file containing the +// call, the V call will log. +func V(level Level) Verbose { + // This function tries hard to be cheap unless there's work to do. + // The fast path is two atomic loads and compares. + + // Here is a cheap but safe test to see if V logging is enabled globally. + if logging.verbosity.get() >= level { + return Verbose(true) + } + + // It's off globally but it vmodule may still be set. + // Here is another cheap but safe test to see if vmodule is enabled. + if atomic.LoadInt32(&logging.filterLength) > 0 { + // Now we need a proper lock to use the logging structure. The pcs field + // is shared so we must lock before accessing it. This is fairly expensive, + // but if V logging is enabled we're slow anyway. + logging.mu.Lock() + defer logging.mu.Unlock() + if runtime.Callers(2, logging.pcs[:]) == 0 { + return Verbose(false) + } + v, ok := logging.vmap[logging.pcs[0]] + if !ok { + v = logging.setV(logging.pcs[0]) + } + return Verbose(v >= level) + } + return Verbose(false) +} + +// Info is equivalent to the global Info function, guarded by the value of v. +// See the documentation of V for usage. +func (v Verbose) Info(args ...interface{}) { + if v { + logging.print(infoLog, args...) + } +} + +// Infoln is equivalent to the global Infoln function, guarded by the value of v. +// See the documentation of V for usage. +func (v Verbose) Infoln(args ...interface{}) { + if v { + logging.println(infoLog, args...) + } +} + +// Infof is equivalent to the global Infof function, guarded by the value of v. +// See the documentation of V for usage. +func (v Verbose) Infof(format string, args ...interface{}) { + if v { + logging.printf(infoLog, format, args...) + } +} + +// Info logs to the INFO log. +// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. +func Info(args ...interface{}) { + logging.print(infoLog, args...) +} + +// InfoDepth acts as Info but uses depth to determine which call frame to log. +// InfoDepth(0, "msg") is the same as Info("msg"). +func InfoDepth(depth int, args ...interface{}) { + logging.printDepth(infoLog, depth, args...) +} + +// Infoln logs to the INFO log. +// Arguments are handled in the manner of fmt.Println; a newline is always appended. +func Infoln(args ...interface{}) { + logging.println(infoLog, args...) +} + +// Infof logs to the INFO log. +// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. +func Infof(format string, args ...interface{}) { + logging.printf(infoLog, format, args...) +} + +// Warning logs to the WARNING and INFO logs. +// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. +func Warning(args ...interface{}) { + logging.print(warningLog, args...) +} + +// WarningDepth acts as Warning but uses depth to determine which call frame to log. +// WarningDepth(0, "msg") is the same as Warning("msg"). +func WarningDepth(depth int, args ...interface{}) { + logging.printDepth(warningLog, depth, args...) +} + +// Warningln logs to the WARNING and INFO logs. +// Arguments are handled in the manner of fmt.Println; a newline is always appended. +func Warningln(args ...interface{}) { + logging.println(warningLog, args...) +} + +// Warningf logs to the WARNING and INFO logs. +// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. +func Warningf(format string, args ...interface{}) { + logging.printf(warningLog, format, args...) +} + +// Error logs to the ERROR, WARNING, and INFO logs. +// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. +func Error(args ...interface{}) { + logging.print(errorLog, args...) +} + +// ErrorDepth acts as Error but uses depth to determine which call frame to log. +// ErrorDepth(0, "msg") is the same as Error("msg"). +func ErrorDepth(depth int, args ...interface{}) { + logging.printDepth(errorLog, depth, args...) +} + +// Errorln logs to the ERROR, WARNING, and INFO logs. +// Arguments are handled in the manner of fmt.Println; a newline is always appended. +func Errorln(args ...interface{}) { + logging.println(errorLog, args...) +} + +// Errorf logs to the ERROR, WARNING, and INFO logs. +// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. +func Errorf(format string, args ...interface{}) { + logging.printf(errorLog, format, args...) +} + +// Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, +// including a stack trace of all running goroutines, then calls os.Exit(255). +// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. +func Fatal(args ...interface{}) { + logging.print(fatalLog, args...) +} + +// FatalDepth acts as Fatal but uses depth to determine which call frame to log. +// FatalDepth(0, "msg") is the same as Fatal("msg"). +func FatalDepth(depth int, args ...interface{}) { + logging.printDepth(fatalLog, depth, args...) +} + +// Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, +// including a stack trace of all running goroutines, then calls os.Exit(255). +// Arguments are handled in the manner of fmt.Println; a newline is always appended. +func Fatalln(args ...interface{}) { + logging.println(fatalLog, args...) +} + +// Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, +// including a stack trace of all running goroutines, then calls os.Exit(255). +// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. +func Fatalf(format string, args ...interface{}) { + logging.printf(fatalLog, format, args...) +} + +// fatalNoStacks is non-zero if we are to exit without dumping goroutine stacks. +// It allows Exit and relatives to use the Fatal logs. +var fatalNoStacks uint32 + +// Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). +// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. +func Exit(args ...interface{}) { + atomic.StoreUint32(&fatalNoStacks, 1) + logging.print(fatalLog, args...) +} + +// ExitDepth acts as Exit but uses depth to determine which call frame to log. +// ExitDepth(0, "msg") is the same as Exit("msg"). +func ExitDepth(depth int, args ...interface{}) { + atomic.StoreUint32(&fatalNoStacks, 1) + logging.printDepth(fatalLog, depth, args...) +} + +// Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). +func Exitln(args ...interface{}) { + atomic.StoreUint32(&fatalNoStacks, 1) + logging.println(fatalLog, args...) +} + +// Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). +// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. +func Exitf(format string, args ...interface{}) { + atomic.StoreUint32(&fatalNoStacks, 1) + logging.printf(fatalLog, format, args...) +} diff --git a/vendor/k8s.io/klog/klog_file.go b/vendor/k8s.io/klog/klog_file.go new file mode 100644 index 0000000000..e4010ad4df --- /dev/null +++ b/vendor/k8s.io/klog/klog_file.go @@ -0,0 +1,139 @@ +// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ +// +// Copyright 2013 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// File I/O for logs. + +package klog + +import ( + "errors" + "fmt" + "os" + "os/user" + "path/filepath" + "strings" + "sync" + "time" +) + +// MaxSize is the maximum size of a log file in bytes. +var MaxSize uint64 = 1024 * 1024 * 1800 + +// logDirs lists the candidate directories for new log files. +var logDirs []string + +func createLogDirs() { + if logging.logDir != "" { + logDirs = append(logDirs, logging.logDir) + } + logDirs = append(logDirs, os.TempDir()) +} + +var ( + pid = os.Getpid() + program = filepath.Base(os.Args[0]) + host = "unknownhost" + userName = "unknownuser" +) + +func init() { + h, err := os.Hostname() + if err == nil { + host = shortHostname(h) + } + + current, err := user.Current() + if err == nil { + userName = current.Username + } + + // Sanitize userName since it may contain filepath separators on Windows. + userName = strings.Replace(userName, `\`, "_", -1) +} + +// shortHostname returns its argument, truncating at the first period. +// For instance, given "www.google.com" it returns "www". +func shortHostname(hostname string) string { + if i := strings.Index(hostname, "."); i >= 0 { + return hostname[:i] + } + return hostname +} + +// logName returns a new log file name containing tag, with start time t, and +// the name for the symlink for tag. +func logName(tag string, t time.Time) (name, link string) { + name = fmt.Sprintf("%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d", + program, + host, + userName, + tag, + t.Year(), + t.Month(), + t.Day(), + t.Hour(), + t.Minute(), + t.Second(), + pid) + return name, program + "." + tag +} + +var onceLogDirs sync.Once + +// create creates a new log file and returns the file and its filename, which +// contains tag ("INFO", "FATAL", etc.) and t. If the file is created +// successfully, create also attempts to update the symlink for that tag, ignoring +// errors. +// The startup argument indicates whether this is the initial startup of klog. +// If startup is true, existing files are opened for appending instead of truncated. +func create(tag string, t time.Time, startup bool) (f *os.File, filename string, err error) { + if logging.logFile != "" { + f, err := openOrCreate(logging.logFile, startup) + if err == nil { + return f, logging.logFile, nil + } + return nil, "", fmt.Errorf("log: unable to create log: %v", err) + } + onceLogDirs.Do(createLogDirs) + if len(logDirs) == 0 { + return nil, "", errors.New("log: no log dirs") + } + name, link := logName(tag, t) + var lastErr error + for _, dir := range logDirs { + fname := filepath.Join(dir, name) + f, err := openOrCreate(fname, startup) + if err == nil { + symlink := filepath.Join(dir, link) + os.Remove(symlink) // ignore err + os.Symlink(name, symlink) // ignore err + return f, fname, nil + } + lastErr = err + } + return nil, "", fmt.Errorf("log: cannot create log: %v", lastErr) +} + +// The startup argument indicates whether this is the initial startup of klog. +// If startup is true, existing files are opened for appending instead of truncated. +func openOrCreate(name string, startup bool) (*os.File, error) { + if startup { + f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + return f, err + } + f, err := os.Create(name) + return f, err +} diff --git a/vendor/k8s.io/klog/klogr/README.md b/vendor/k8s.io/klog/klogr/README.md new file mode 100644 index 0000000000..cfa5de617d --- /dev/null +++ b/vendor/k8s.io/klog/klogr/README.md @@ -0,0 +1,8 @@ +# Minimal Go logging using klog + +This package implements the [logr interface](https://github.com/go-logr/logr) +in terms of Kubernetes' [klog](https://github.com/kubernetes/klog). This +provides a relatively minimalist API to logging in Go, backed by a well-proven +implementation. + +This is a BETA grade implementation. diff --git a/vendor/k8s.io/klog/klogr/klogr.go b/vendor/k8s.io/klog/klogr/klogr.go new file mode 100644 index 0000000000..e145950867 --- /dev/null +++ b/vendor/k8s.io/klog/klogr/klogr.go @@ -0,0 +1,193 @@ +// Package klogr implements github.com/go-logr/logr.Logger in terms of +// k8s.io/klog. +package klogr + +import ( + "bytes" + "encoding/json" + "fmt" + "runtime" + "sort" + + "github.com/go-logr/logr" + "k8s.io/klog" +) + +// New returns a logr.Logger which is implemented by klog. +func New() logr.Logger { + return klogger{ + level: 0, + prefix: "", + values: nil, + } +} + +type klogger struct { + level int + prefix string + values []interface{} +} + +func (l klogger) clone() klogger { + return klogger{ + level: l.level, + prefix: l.prefix, + values: copySlice(l.values), + } +} + +func copySlice(in []interface{}) []interface{} { + out := make([]interface{}, len(in)) + copy(out, in) + return out +} + +// Magic string for intermediate frames that we should ignore. +const autogeneratedFrameName = "" + +// Discover how many frames we need to climb to find the caller. This approach +// was suggested by Ian Lance Taylor of the Go team, so it *should* be safe +// enough (famous last words). +func framesToCaller() int { + // 1 is the immediate caller. 3 should be too many. + for i := 1; i < 3; i++ { + _, file, _, _ := runtime.Caller(i + 1) // +1 for this function's frame + if file != autogeneratedFrameName { + return i + } + } + return 1 // something went wrong, this is safe +} + +// trimDuplicates will deduplicates elements provided in multiple KV tuple +// slices, whilst maintaining the distinction between where the items are +// contained. +func trimDuplicates(kvLists ...[]interface{}) [][]interface{} { + // maintain a map of all seen keys + seenKeys := map[interface{}]struct{}{} + // build the same number of output slices as inputs + outs := make([][]interface{}, len(kvLists)) + // iterate over the input slices backwards, as 'later' kv specifications + // of the same key will take precedence over earlier ones + for i := len(kvLists) - 1; i >= 0; i-- { + // initialise this output slice + outs[i] = []interface{}{} + // obtain a reference to the kvList we are processing + kvList := kvLists[i] + + // start iterating at len(kvList) - 2 (i.e. the 2nd last item) for + // slices that have an even number of elements. + // We add (len(kvList) % 2) here to handle the case where there is an + // odd number of elements in a kvList. + // If there is an odd number, then the last element in the slice will + // have the value 'null'. + for i2 := len(kvList) - 2 + (len(kvList) % 2); i2 >= 0; i2 -= 2 { + k := kvList[i2] + // if we have already seen this key, do not include it again + if _, ok := seenKeys[k]; ok { + continue + } + // make a note that we've observed a new key + seenKeys[k] = struct{}{} + // attempt to obtain the value of the key + var v interface{} + // i2+1 should only ever be out of bounds if we handling the first + // iteration over a slice with an odd number of elements + if i2+1 < len(kvList) { + v = kvList[i2+1] + } + // add this KV tuple to the *start* of the output list to maintain + // the original order as we are iterating over the slice backwards + outs[i] = append([]interface{}{k, v}, outs[i]...) + } + } + return outs +} + +func flatten(kvList ...interface{}) string { + keys := make([]string, 0, len(kvList)) + vals := make(map[string]interface{}, len(kvList)) + for i := 0; i < len(kvList); i += 2 { + k, ok := kvList[i].(string) + if !ok { + panic(fmt.Sprintf("key is not a string: %s", pretty(kvList[i]))) + } + var v interface{} + if i+1 < len(kvList) { + v = kvList[i+1] + } + keys = append(keys, k) + vals[k] = v + } + sort.Strings(keys) + buf := bytes.Buffer{} + for i, k := range keys { + v := vals[k] + if i > 0 { + buf.WriteRune(' ') + } + buf.WriteString(pretty(k)) + buf.WriteString("=") + buf.WriteString(pretty(v)) + } + return buf.String() +} + +func pretty(value interface{}) string { + jb, _ := json.Marshal(value) + return string(jb) +} + +func (l klogger) Info(msg string, kvList ...interface{}) { + if l.Enabled() { + msgStr := flatten("msg", msg) + trimmed := trimDuplicates(l.values, kvList) + fixedStr := flatten(trimmed[0]...) + userStr := flatten(trimmed[1]...) + klog.InfoDepth(framesToCaller(), l.prefix, " ", msgStr, " ", fixedStr, " ", userStr) + } +} + +func (l klogger) Enabled() bool { + return bool(klog.V(klog.Level(l.level))) +} + +func (l klogger) Error(err error, msg string, kvList ...interface{}) { + msgStr := flatten("msg", msg) + var loggableErr interface{} + if err != nil { + loggableErr = err.Error() + } + errStr := flatten("error", loggableErr) + trimmed := trimDuplicates(l.values, kvList) + fixedStr := flatten(trimmed[0]...) + userStr := flatten(trimmed[1]...) + klog.ErrorDepth(framesToCaller(), l.prefix, " ", msgStr, " ", errStr, " ", fixedStr, " ", userStr) +} + +func (l klogger) V(level int) logr.InfoLogger { + new := l.clone() + new.level = level + return new +} + +// WithName returns a new logr.Logger with the specified name appended. klogr +// uses '/' characters to separate name elements. Callers should not pass '/' +// in the provided name string, but this library does not actually enforce that. +func (l klogger) WithName(name string) logr.Logger { + new := l.clone() + if len(l.prefix) > 0 { + new.prefix = l.prefix + "/" + } + new.prefix += name + return new +} + +func (l klogger) WithValues(kvList ...interface{}) logr.Logger { + new := l.clone() + new.values = append(new.values, kvList...) + return new +} + +var _ logr.Logger = klogger{} +var _ logr.InfoLogger = klogger{} diff --git a/vendor/modules.txt b/vendor/modules.txt index 49b6e752ff..52e030273e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -248,7 +248,7 @@ github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runc v1.0.0-rc93 github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user -# github.com/openshift/api v0.0.0-20210624153211-ae79113891b0 +# github.com/openshift/api v0.0.0-20210624153211-ae79113891b0 => github.com/candita/api v0.0.0-20210625204430-e467f417c5b3 ## explicit github.com/openshift/api github.com/openshift/api/annotations @@ -359,8 +359,10 @@ github.com/openshift/client-go/build/clientset/versioned/scheme github.com/openshift/client-go/build/clientset/versioned/typed/build/v1 github.com/openshift/client-go/build/clientset/versioned/typed/build/v1/fake github.com/openshift/client-go/config/clientset/versioned +github.com/openshift/client-go/config/clientset/versioned/fake github.com/openshift/client-go/config/clientset/versioned/scheme github.com/openshift/client-go/config/clientset/versioned/typed/config/v1 +github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake github.com/openshift/client-go/image/clientset/versioned github.com/openshift/client-go/image/clientset/versioned/fake github.com/openshift/client-go/image/clientset/versioned/scheme @@ -402,8 +404,10 @@ github.com/openshift/client-go/quota/informers/externalversions/quota github.com/openshift/client-go/quota/informers/externalversions/quota/v1 github.com/openshift/client-go/quota/listers/quota/v1 github.com/openshift/client-go/route/clientset/versioned +github.com/openshift/client-go/route/clientset/versioned/fake github.com/openshift/client-go/route/clientset/versioned/scheme github.com/openshift/client-go/route/clientset/versioned/typed/route/v1 +github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake github.com/openshift/client-go/route/informers/externalversions github.com/openshift/client-go/route/informers/externalversions/internalinterfaces github.com/openshift/client-go/route/informers/externalversions/route @@ -1439,6 +1443,10 @@ k8s.io/gengo/generator k8s.io/gengo/namer k8s.io/gengo/parser k8s.io/gengo/types +# k8s.io/klog v1.0.0 +## explicit +k8s.io/klog +k8s.io/klog/klogr # k8s.io/klog/v2 v2.8.0 ## explicit k8s.io/klog/v2 @@ -1783,3 +1791,4 @@ sigs.k8s.io/yaml # k8s.io/metrics => k8s.io/metrics v0.21.0 # k8s.io/mount-utils => k8s.io/mount-utils v0.21.0 # k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.0 +# github.com/openshift/api => github.com/candita/api v0.0.0-20210625204430-e467f417c5b3