diff --git a/glide.lock b/glide.lock index 32d634b286fb..b66d1581a9b7 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: f673b06826e9fa526bda285c5109b133989e188db2d8aca9dbc6913af034857d -updated: 2019-02-14T09:27:38.097476078-05:00 +updated: 2019-02-19T14:54:01.742954187-05:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -884,7 +884,7 @@ imports: - go-selinux - go-selinux/label - name: github.com/openshift/api - version: e6677f05850ac442a176c46830ad5dba6e78907a + version: 296f4c423703bb8b5b7e122cd4b3fc4153ef1130 subpackages: - apps - apps/v1 @@ -930,7 +930,7 @@ imports: - webconsole - webconsole/v1 - name: github.com/openshift/client-go - version: f49852c26e1c452e40cdeba5e002adef447659cd + version: 31ef839c86359881d2c312c4f0131febc6662400 subpackages: - apps/clientset/versioned - apps/clientset/versioned/fake @@ -1054,7 +1054,7 @@ imports: - user/informers/externalversions/user/v1 - user/listers/user/v1 - name: github.com/openshift/library-go - version: 542c9e40fe4d41146488fc2823a466f31452d77d + version: ee5bfa80f8ddbd75f848cbd53f048a060a67ecf3 subpackages: - pkg/config/configdefaults - pkg/config/helpers @@ -1751,7 +1751,7 @@ imports: - plugin/pkg/authenticator/token/webhook - plugin/pkg/authorizer/webhook - name: k8s.io/cli-runtime - version: 8cbe064267b9b95e174259c5ef25816b041e3fb0 + version: b10fb72c9643daeb8be9b0d848f292f87d6eecff repo: https://github.com/openshift/kubernetes-cli-runtime.git subpackages: - pkg/genericclioptions @@ -1759,7 +1759,7 @@ imports: - pkg/genericclioptions/printers - pkg/genericclioptions/resource - name: k8s.io/client-go - version: 4d0490f4cb111e4b782f5bb2b9e3afa0f88c1904 + version: c43ca1ccdbf97c87929fdc4612eaf3738d1a835f repo: https://github.com/openshift/kubernetes-client-go.git subpackages: - discovery @@ -1964,12 +1964,12 @@ imports: version: 0581eeac5aced8f4935d973acfca5feee20766d0 repo: https://github.com/openshift/kubernetes-code-generator.git - name: k8s.io/component-base - version: 8791bf4a9cd291543acf800d1e972ecc8ba68e57 + version: 6a8d1ba53a0f47609768b3a7a3a74cfb87fab784 subpackages: - config - config/v1alpha1 - name: k8s.io/csi-api - version: 912199f9a195058f50bc3dd1968727d4cb1c64a8 + version: 4354234adf749e8062c33d3233cc22fca13359a5 subpackages: - pkg/apis/csi/v1alpha1 - pkg/client/clientset/versioned @@ -1988,7 +1988,7 @@ imports: subpackages: - metrics/api/v1/types - name: k8s.io/kube-aggregator - version: c71997c1d01c7f0c299d25b65af99c72b3e51539 + version: 24abe20328224720694af125086d1ff3f030391f repo: https://github.com/openshift/kubernetes-kube-aggregator.git subpackages: - pkg/apis/apiregistration @@ -2018,7 +2018,7 @@ imports: - pkg/registry/apiservice/etcd - pkg/registry/apiservice/rest - name: k8s.io/kube-controller-manager - version: 58144a281884b4871146ed52d775a74e6272a3ae + version: 1ea98d106cbae6d9b348c3ada4d44ee37bfac512 subpackages: - config/v1alpha1 - name: k8s.io/kube-openapi @@ -2034,15 +2034,15 @@ imports: - pkg/util/proto/testing - pkg/util/proto/validation - name: k8s.io/kube-proxy - version: 30e63035f31fd35368eec2221222cb4022cceaf4 + version: 65a06ce235bd2151c63c586c843269773241c37d subpackages: - config/v1alpha1 - name: k8s.io/kubelet - version: 9c44a397c7166476e3baf1257f94b8177201731d + version: 80add6525af10c696792916ee25d651c0f89ff20 subpackages: - config/v1beta1 - name: k8s.io/kubernetes - version: df0ca88634234264c8addaa1cf9f309495a63d93 + version: 9d7f228fb2e77b2e370efe973482320af9551fa8 repo: https://github.com/openshift/kubernetes.git subpackages: - cmd/cloud-controller-manager/app/apis/config @@ -2822,6 +2822,7 @@ imports: - test/e2e/apps - test/e2e/auth - test/e2e/autoscaling + - test/e2e/chaosmonkey - test/e2e/common - test/e2e/framework - test/e2e/framework/ginkgowrapper @@ -2850,6 +2851,8 @@ imports: - test/e2e/storage/testsuites - test/e2e/storage/utils - test/e2e/storage/vsphere + - test/e2e/upgrades + - test/e2e/upgrades/apps - test/images/net/common - test/images/net/nat - test/integration @@ -2857,6 +2860,7 @@ imports: - test/integration/framework - test/utils - test/utils/image + - test/utils/junit - third_party/forked/golang/expansion - third_party/forked/gonum/graph - third_party/forked/gonum/graph/internal/linear @@ -2882,7 +2886,7 @@ imports: - pkg/client/custom_metrics/scheme - pkg/client/external_metrics - name: k8s.io/sample-apiserver - version: 1783668fb5b3881282e1e71fc856a7bb8f1585a4 + version: 641ad9abc85358e8a5481fa3ac62cd9494c8e78c subpackages: - pkg/apis/wardle - pkg/apis/wardle/v1alpha1 diff --git a/pkg/admission/customresourcevalidation/customresourcevalidationregistration/cr_validation_registration.go b/pkg/admission/customresourcevalidation/customresourcevalidationregistration/cr_validation_registration.go index d171e7279572..d2f82d2c3d0a 100644 --- a/pkg/admission/customresourcevalidation/customresourcevalidationregistration/cr_validation_registration.go +++ b/pkg/admission/customresourcevalidation/customresourcevalidationregistration/cr_validation_registration.go @@ -4,6 +4,7 @@ import ( "k8s.io/apiserver/pkg/admission" "github.com/openshift/origin/pkg/admission/customresourcevalidation/authentication" + "github.com/openshift/origin/pkg/admission/customresourcevalidation/features" "github.com/openshift/origin/pkg/admission/customresourcevalidation/image" "github.com/openshift/origin/pkg/admission/customresourcevalidation/oauth" "github.com/openshift/origin/pkg/admission/customresourcevalidation/project" @@ -12,6 +13,8 @@ import ( // AllCustomResourceValidators are the names of all custom resource validators that should be registered var AllCustomResourceValidators = []string{ authentication.PluginName, + features.DenyDeleteFeaturesPluginName, + features.PluginName, image.PluginName, oauth.PluginName, project.PluginName, @@ -19,6 +22,8 @@ var AllCustomResourceValidators = []string{ func RegisterCustomResourceValidation(plugins *admission.Plugins) { authentication.Register(plugins) + features.RegisterDenyDeleteFeatures(plugins) + features.Register(plugins) image.Register(plugins) oauth.Register(plugins) project.Register(plugins) diff --git a/pkg/admission/customresourcevalidation/features/OWNERS b/pkg/admission/customresourcevalidation/features/OWNERS new file mode 100644 index 000000000000..4288d85c678e --- /dev/null +++ b/pkg/admission/customresourcevalidation/features/OWNERS @@ -0,0 +1,8 @@ +reviewers: + - deads + - derekwaynecarr + - sjenning +approvers: + - deads + - derekwaynecarr + - sjenning diff --git a/pkg/admission/customresourcevalidation/features/deny_delete_features.go b/pkg/admission/customresourcevalidation/features/deny_delete_features.go new file mode 100644 index 000000000000..18e72388340d --- /dev/null +++ b/pkg/admission/customresourcevalidation/features/deny_delete_features.go @@ -0,0 +1,42 @@ +package features + +import ( + "fmt" + "io" + + "k8s.io/apimachinery/pkg/runtime/schema" + + "k8s.io/apiserver/pkg/admission" +) + +const DenyDeleteFeaturesPluginName = "config.openshift.io/DenyDeleteFeatures" + +func RegisterDenyDeleteFeatures(plugins *admission.Plugins) { + plugins.Register(DenyDeleteFeaturesPluginName, func(config io.Reader) (admission.Interface, error) { + return newDenyDeleteFeatures() + }) +} + +// denyDeleteFeatures prevents anyone from deleting features.config.openshift.io +type denyDeleteFeatures struct { + *admission.Handler +} + +func newDenyDeleteFeatures() (admission.Interface, error) { + return &denyDeleteFeatures{ + Handler: admission.NewHandler(admission.Delete), + }, nil +} + +var _ admission.ValidationInterface = &denyDeleteFeatures{} + +func (a *denyDeleteFeatures) Validate(attributes admission.Attributes) error { + if len(attributes.GetSubresource()) > 0 { + return nil + } + if attributes.GetResource().GroupResource() != (schema.GroupResource{Group: "config.openshift.io", Resource: "features"}) { + return nil + } + + return admission.NewForbidden(attributes, fmt.Errorf("deleting features.config.openshift.io is not allowed")) +} diff --git a/pkg/admission/customresourcevalidation/features/validate_features.go b/pkg/admission/customresourcevalidation/features/validate_features.go new file mode 100644 index 000000000000..f145781db463 --- /dev/null +++ b/pkg/admission/customresourcevalidation/features/validate_features.go @@ -0,0 +1,125 @@ +package features + +import ( + "fmt" + "io" + + "k8s.io/apimachinery/pkg/util/sets" + + "k8s.io/apimachinery/pkg/api/validation" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/apiserver/pkg/admission" + + configv1 "github.com/openshift/api/config/v1" + "github.com/openshift/origin/pkg/admission/customresourcevalidation" +) + +const PluginName = "config.openshift.io/ValidateFeatures" + +// Register registers a plugin +func Register(plugins *admission.Plugins) { + plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) { + return customresourcevalidation.NewValidator( + map[schema.GroupResource]bool{ + configv1.Resource("features"): true, + }, + map[schema.GroupVersionKind]customresourcevalidation.ObjectValidator{ + configv1.GroupVersion.WithKind("Feature"): featuresV1{}, + }) + }) +} + +func toFeatureV1(uncastObj runtime.Object) (*configv1.Features, field.ErrorList) { + if uncastObj == nil { + return nil, nil + } + + allErrs := field.ErrorList{} + + obj, ok := uncastObj.(*configv1.Features) + if !ok { + return nil, append(allErrs, + field.NotSupported(field.NewPath("kind"), fmt.Sprintf("%T", uncastObj), []string{"Features"}), + field.NotSupported(field.NewPath("apiVersion"), fmt.Sprintf("%T", uncastObj), []string{"config.openshift.io/v1"})) + } + + return obj, nil +} + +type featuresV1 struct { +} + +var knownFeatureSets = sets.NewString("", string(configv1.TechPreviewNoUpgrade)) + +func validateFeatureSpecCreate(spec configv1.FeaturesSpec) field.ErrorList { + allErrs := field.ErrorList{} + + // on create, we only allow values that we are aware of + if !knownFeatureSets.Has(string(spec.FeatureSet)) { + allErrs = append(allErrs, field.NotSupported(field.NewPath("spec.featureSet"), spec.FeatureSet, knownFeatureSets.List())) + } + + return allErrs +} + +func validateFeatureSpecUpdate(spec, oldSpec configv1.FeaturesSpec) field.ErrorList { + allErrs := field.ErrorList{} + + // on update, we don't fail validation on a field we don't recognize as long as it is not changing + if !knownFeatureSets.Has(string(spec.FeatureSet)) && oldSpec.FeatureSet != spec.FeatureSet { + allErrs = append(allErrs, field.NotSupported(field.NewPath("spec.featureSet"), spec.FeatureSet, knownFeatureSets.List())) + } + + // we do not allow anyone to take back TechPreview + if oldSpec.FeatureSet == configv1.TechPreviewNoUpgrade && spec.FeatureSet != configv1.TechPreviewNoUpgrade { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.featureSet"), "once enabled, tech preview features may not be disabled")) + } + + return allErrs +} + +func (featuresV1) ValidateCreate(uncastObj runtime.Object) field.ErrorList { + obj, allErrs := toFeatureV1(uncastObj) + if len(allErrs) > 0 { + return allErrs + } + + allErrs = append(allErrs, validation.ValidateObjectMeta(&obj.ObjectMeta, false, customresourcevalidation.RequireNameCluster, field.NewPath("metadata"))...) + allErrs = append(allErrs, validateFeatureSpecCreate(obj.Spec)...) + + return allErrs +} + +func (featuresV1) ValidateUpdate(uncastObj runtime.Object, uncastOldObj runtime.Object) field.ErrorList { + obj, allErrs := toFeatureV1(uncastObj) + if len(allErrs) > 0 { + return allErrs + } + oldObj, allErrs := toFeatureV1(uncastOldObj) + if len(allErrs) > 0 { + return allErrs + } + + allErrs = append(allErrs, validation.ValidateObjectMetaUpdate(&obj.ObjectMeta, &oldObj.ObjectMeta, field.NewPath("metadata"))...) + allErrs = append(allErrs, validateFeatureSpecUpdate(obj.Spec, oldObj.Spec)...) + + return allErrs +} + +func (featuresV1) ValidateStatusUpdate(uncastObj runtime.Object, uncastOldObj runtime.Object) field.ErrorList { + obj, errs := toFeatureV1(uncastObj) + if len(errs) > 0 { + return errs + } + oldObj, errs := toFeatureV1(uncastOldObj) + if len(errs) > 0 { + return errs + } + + // TODO validate the obj. remember that status validation should *never* fail on spec validation errors. + errs = append(errs, validation.ValidateObjectMetaUpdate(&obj.ObjectMeta, &oldObj.ObjectMeta, field.NewPath("metadata"))...) + + return errs +} diff --git a/pkg/admission/customresourcevalidation/features/validate_features_test.go b/pkg/admission/customresourcevalidation/features/validate_features_test.go new file mode 100644 index 000000000000..ad589e5314d5 --- /dev/null +++ b/pkg/admission/customresourcevalidation/features/validate_features_test.go @@ -0,0 +1,121 @@ +package features + +import ( + "strings" + "testing" + + configv1 "github.com/openshift/api/config/v1" +) + +func TestValidateCreateSpec(t *testing.T) { + tests := []struct { + name string + featureSet string + expectedErr string + }{ + { + name: "empty", + featureSet: "", + expectedErr: "", + }, + { + name: "techpreview", + featureSet: string(configv1.TechPreviewNoUpgrade), + expectedErr: "", + }, + { + name: "not real", + featureSet: "fake-value", + expectedErr: "Unsupported value", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + actual := validateFeatureSpecCreate(configv1.FeaturesSpec{FeatureSet: configv1.FeatureSet(tc.featureSet)}) + switch { + case len(actual) == 0 && len(tc.expectedErr) == 0: + case len(actual) == 0 && len(tc.expectedErr) != 0: + t.Fatal(tc.expectedErr) + case len(actual) != 0 && len(tc.expectedErr) == 0: + t.Fatal(actual) + case len(actual) != 0 && len(tc.expectedErr) != 0: + found := false + for _, actualErr := range actual { + found = found || strings.Contains(actualErr.Error(), tc.expectedErr) + } + if !found { + t.Fatal(actual) + } + default: + } + + }) + } +} + +func TestValidateUpdateSpec(t *testing.T) { + tests := []struct { + name string + featureSet string + oldFeatureSet string + expectedErr string + }{ + { + name: "empty", + featureSet: "", + oldFeatureSet: "", + expectedErr: "", + }, + { + name: "change to techpreview", + featureSet: string(configv1.TechPreviewNoUpgrade), + oldFeatureSet: "", + expectedErr: "", + }, + { + name: "change from techpreview", + featureSet: "", + oldFeatureSet: string(configv1.TechPreviewNoUpgrade), + expectedErr: "once enabled, tech preview features may not be disabled", + }, + { + name: "unknown, but no change", + featureSet: "fake-value", + oldFeatureSet: "fake-value", + expectedErr: "", + }, + { + name: "unknown, with change", + featureSet: "fake-value", + oldFeatureSet: "fake-value-2", + expectedErr: "Unsupported value", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + actual := validateFeatureSpecUpdate( + configv1.FeaturesSpec{FeatureSet: configv1.FeatureSet(tc.featureSet)}, + configv1.FeaturesSpec{FeatureSet: configv1.FeatureSet(tc.oldFeatureSet)}, + ) + switch { + case len(actual) == 0 && len(tc.expectedErr) == 0: + case len(actual) == 0 && len(tc.expectedErr) != 0: + t.Fatal(tc.expectedErr) + case len(actual) != 0 && len(tc.expectedErr) == 0: + t.Fatal(actual) + case len(actual) != 0 && len(tc.expectedErr) != 0: + found := false + for _, actualErr := range actual { + found = found || strings.Contains(actualErr.Error(), tc.expectedErr) + } + if !found { + t.Fatal(actual) + } + default: + } + + }) + } +} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 5e64c7544e3d..4c290afc0a81 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -173,7 +173,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/config/v1.DelegatedAuthorization": schema_openshift_api_config_v1_DelegatedAuthorization(ref), "github.com/openshift/api/config/v1.EtcdConnectionInfo": schema_openshift_api_config_v1_EtcdConnectionInfo(ref), "github.com/openshift/api/config/v1.EtcdStorageConfig": schema_openshift_api_config_v1_EtcdStorageConfig(ref), - "github.com/openshift/api/config/v1.FeatureCondition": schema_openshift_api_config_v1_FeatureCondition(ref), "github.com/openshift/api/config/v1.Features": schema_openshift_api_config_v1_Features(ref), "github.com/openshift/api/config/v1.FeaturesList": schema_openshift_api_config_v1_FeaturesList(ref), "github.com/openshift/api/config/v1.FeaturesSpec": schema_openshift_api_config_v1_FeaturesSpec(ref), @@ -221,7 +220,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/config/v1.OpenIDIdentityProvider": schema_openshift_api_config_v1_OpenIDIdentityProvider(ref), "github.com/openshift/api/config/v1.OpenIDURLs": schema_openshift_api_config_v1_OpenIDURLs(ref), "github.com/openshift/api/config/v1.OperandVersion": schema_openshift_api_config_v1_OperandVersion(ref), - "github.com/openshift/api/config/v1.OperatorFeatureCondition": schema_openshift_api_config_v1_OperatorFeatureCondition(ref), "github.com/openshift/api/config/v1.Project": schema_openshift_api_config_v1_Project(ref), "github.com/openshift/api/config/v1.ProjectList": schema_openshift_api_config_v1_ProjectList(ref), "github.com/openshift/api/config/v1.ProjectSpec": schema_openshift_api_config_v1_ProjectSpec(ref), @@ -229,7 +227,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/config/v1.Proxy": schema_openshift_api_config_v1_Proxy(ref), "github.com/openshift/api/config/v1.ProxyList": schema_openshift_api_config_v1_ProxyList(ref), "github.com/openshift/api/config/v1.ProxySpec": schema_openshift_api_config_v1_ProxySpec(ref), - "github.com/openshift/api/config/v1.RegistriesConfig": schema_openshift_api_config_v1_RegistriesConfig(ref), "github.com/openshift/api/config/v1.RegistryLocation": schema_openshift_api_config_v1_RegistryLocation(ref), "github.com/openshift/api/config/v1.RegistrySources": schema_openshift_api_config_v1_RegistrySources(ref), "github.com/openshift/api/config/v1.RemoteConnectionInfo": schema_openshift_api_config_v1_RemoteConnectionInfo(ref), @@ -470,6 +467,14 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/operator/v1.ServiceCAList": schema_openshift_api_operator_v1_ServiceCAList(ref), "github.com/openshift/api/operator/v1.ServiceCASpec": schema_openshift_api_operator_v1_ServiceCASpec(ref), "github.com/openshift/api/operator/v1.ServiceCAStatus": schema_openshift_api_operator_v1_ServiceCAStatus(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServer": schema_openshift_api_operator_v1_ServiceCatalogAPIServer(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServerList": schema_openshift_api_operator_v1_ServiceCatalogAPIServerList(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServerSpec": schema_openshift_api_operator_v1_ServiceCatalogAPIServerSpec(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServerStatus": schema_openshift_api_operator_v1_ServiceCatalogAPIServerStatus(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManager": schema_openshift_api_operator_v1_ServiceCatalogControllerManager(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerList": schema_openshift_api_operator_v1_ServiceCatalogControllerManagerList(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerSpec": schema_openshift_api_operator_v1_ServiceCatalogControllerManagerSpec(ref), + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerStatus": schema_openshift_api_operator_v1_ServiceCatalogControllerManagerStatus(ref), "github.com/openshift/api/operator/v1.StaticPodOperatorSpec": schema_openshift_api_operator_v1_StaticPodOperatorSpec(ref), "github.com/openshift/api/operator/v1.StaticPodOperatorStatus": schema_openshift_api_operator_v1_StaticPodOperatorStatus(ref), "github.com/openshift/api/operator/v1alpha1.DelegatedAuthentication": schema_openshift_api_operator_v1alpha1_DelegatedAuthentication(ref), @@ -7538,17 +7543,11 @@ func schema_openshift_api_config_v1_BuildDefaults(ref common.ReferenceCallback) Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, - "registriesConfig": { - SchemaProps: spec.SchemaProps{ - Description: "RegistriesConfig controls the registries allowed for image pull and push.", - Ref: ref("github.com/openshift/api/config/v1.RegistriesConfig"), - }, - }, }, }, }, Dependencies: []string{ - "github.com/openshift/api/config/v1.ImageLabel", "github.com/openshift/api/config/v1.ProxySpec", "github.com/openshift/api/config/v1.RegistriesConfig", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements"}, + "github.com/openshift/api/config/v1.ImageLabel", "github.com/openshift/api/config/v1.ProxySpec", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements"}, } } @@ -8798,35 +8797,6 @@ func schema_openshift_api_config_v1_EtcdStorageConfig(ref common.ReferenceCallba } } -func schema_openshift_api_config_v1_FeatureCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "operatorConditions": { - SchemaProps: spec.SchemaProps{ - Description: "operatorCondition holds information about each operator that attempted to handle a particular feature. It is keyed by the operator name and indicates success or failure with a message. No entry for an operator means that the operator did not know about or acknowledge your feature.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/openshift/api/config/v1.OperatorFeatureCondition"), - }, - }, - }, - }, - }, - }, - Required: []string{"operatorConditions"}, - }, - }, - Dependencies: []string{ - "github.com/openshift/api/config/v1.OperatorFeatureCondition"}, - } -} - func schema_openshift_api_config_v1_Features(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8928,32 +8898,11 @@ func schema_openshift_api_config_v1_FeaturesSpec(ref common.ReferenceCallback) c SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "enabled": { - SchemaProps: spec.SchemaProps{ - Description: "enabled holds a list of features that should be enabled. You only need to enter in the exceptional cases. Most features that should be enabled are enabled out of the box. Often times, setting a feature enabled can cause your cluster to be unstable. If that is the case, status will be updated. Because of the nature of feature gates, the full list isn't known by a single entity making static validation unrealistic. You can watch status of this resource to figure out where your feature was respected.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "disabled": { + "featureSet": { SchemaProps: spec.SchemaProps{ - Description: "disabled holds a list of features that should be disabled. You only need to enter in the exceptional cases. Most features that should be disabled are disabled out of the box. Often times, setting a feature disabled can cause your cluster to be unstable. If that is the case, status will be updated. Because of the nature of feature gates, the full list isn't known by a single entity making static validation unrealistic. You can watch status of this resource to figure out where your feature was respected.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, + Description: "featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. Turning on or off features may cause irreversible changes in your cluster which cannot be undone.", + Type: []string{"string"}, + Format: "", }, }, }, @@ -8967,27 +8916,8 @@ func schema_openshift_api_config_v1_FeaturesStatus(ref common.ReferenceCallback) Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "featureConditions": { - SchemaProps: spec.SchemaProps{ - Description: "featureConditions holds information about each enabled or disabled feature as aggregated from multiple operators. It is keyed by name.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/openshift/api/config/v1.FeatureCondition"), - }, - }, - }, - }, - }, - }, - Required: []string{"featureConditions"}, }, }, - Dependencies: []string{ - "github.com/openshift/api/config/v1.FeatureCondition"}, } } @@ -10979,32 +10909,6 @@ func schema_openshift_api_config_v1_OperandVersion(ref common.ReferenceCallback) } } -func schema_openshift_api_config_v1_OperatorFeatureCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "failure": { - SchemaProps: spec.SchemaProps{ - Description: "failure is a message indicating that the operator had trouble handling a feature and explaining why.", - Type: []string{"string"}, - Format: "", - }, - }, - "success": { - SchemaProps: spec.SchemaProps{ - Description: "success is a message indicating that the operator honored a feature.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - func schema_openshift_api_config_v1_Project(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -11260,60 +11164,6 @@ func schema_openshift_api_config_v1_ProxySpec(ref common.ReferenceCallback) comm } } -func schema_openshift_api_config_v1_RegistriesConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "insecureRegistries": { - SchemaProps: spec.SchemaProps{ - Description: "InsecureRegistries are registries which do not have a valid SSL certificate or only support HTTP connections.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "blockedRegistries": { - SchemaProps: spec.SchemaProps{ - Description: "BlockedRegistries are blacklisted from image pull/push. All other registries are allowed.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "allowedRegistries": { - SchemaProps: spec.SchemaProps{ - Description: "AllowedRegistries are whitelisted for image pull/push. All other registries are blocked.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - func schema_openshift_api_config_v1_RegistryLocation(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -22576,6 +22426,20 @@ func schema_openshift_api_operator_v1_KubeSchedulerSpec(ref common.ReferenceCall Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, + "failedRevisionLimit": { + SchemaProps: spec.SchemaProps{ + Description: "failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "succeededRevisionLimit": { + SchemaProps: spec.SchemaProps{ + Description: "succeededRevisionLimit is the number of successful static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", + Type: []string{"integer"}, + Format: "int32", + }, + }, "forceRedeploymentReason": { SchemaProps: spec.SchemaProps{ Description: "forceRedeploymentReason can be used to force the redeployment of the kube-scheduler by providing a unique string. This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work this time instead of failing again on the same config.", @@ -23788,6 +23652,424 @@ func schema_openshift_api_operator_v1_ServiceCAStatus(ref common.ReferenceCallba } } +func schema_openshift_api_operator_v1_ServiceCatalogAPIServer(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCatalogAPIServer provides information to configure an operator to manage Service Catalog API Server", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogAPIServerSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogAPIServerStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServerSpec", "github.com/openshift/api/operator/v1.ServiceCatalogAPIServerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogAPIServerList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCatalogAPIServerList is a collection of items", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items contains the items", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogAPIServer"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ServiceCatalogAPIServer", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogAPIServerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "managementState": { + SchemaProps: spec.SchemaProps{ + Description: "managementState indicates whether and how the operator should manage the component", + Type: []string{"string"}, + Format: "", + }, + }, + "logLevel": { + SchemaProps: spec.SchemaProps{ + Description: "logLevel is an intent based logging for an overall component. It does not give fine grained control, but it is a simple way to manage coarse grained logging choices that operators have to interpret for their operands.", + Type: []string{"string"}, + Format: "", + }, + }, + "operandSpecs": { + SchemaProps: spec.SchemaProps{ + Description: "operandSpecs provide customization for functional units within the component", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.OperandSpec"), + }, + }, + }, + }, + }, + "unsupportedConfigOverrides": { + SchemaProps: spec.SchemaProps{ + Description: "unsupportedConfigOverrides holds a sparse config that will override any previously set options. It only needs to be the fields to override it will end up overlaying in the following order: 1. hardcoded defaults 2. observedConfig 3. unsupportedConfigOverrides", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + "observedConfig": { + SchemaProps: spec.SchemaProps{ + Description: "observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because it is an input to the level for the operator", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"managementState", "logLevel", "operandSpecs", "unsupportedConfigOverrides", "observedConfig"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.OperandSpec", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogAPIServerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the last generation change you've dealt with", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions is a list of conditions and their status", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.OperatorCondition"), + }, + }, + }, + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the level this availability applies to", + Type: []string{"string"}, + Format: "", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas indicates how many replicas are ready and at the desired state", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "generations": { + SchemaProps: spec.SchemaProps{ + Description: "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.GenerationStatus"), + }, + }, + }, + }, + }, + }, + Required: []string{"version", "readyReplicas", "generations"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.GenerationStatus", "github.com/openshift/api/operator/v1.OperatorCondition"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogControllerManager(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCatalogControllerManager provides information to configure an operator to manage Service Catalog Controller Manager", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerSpec", "github.com/openshift/api/operator/v1.ServiceCatalogControllerManagerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogControllerManagerList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCatalogControllerManagerList is a collection of items", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items contains the items", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.ServiceCatalogControllerManager"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.ServiceCatalogControllerManager", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogControllerManagerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "managementState": { + SchemaProps: spec.SchemaProps{ + Description: "managementState indicates whether and how the operator should manage the component", + Type: []string{"string"}, + Format: "", + }, + }, + "logLevel": { + SchemaProps: spec.SchemaProps{ + Description: "logLevel is an intent based logging for an overall component. It does not give fine grained control, but it is a simple way to manage coarse grained logging choices that operators have to interpret for their operands.", + Type: []string{"string"}, + Format: "", + }, + }, + "operandSpecs": { + SchemaProps: spec.SchemaProps{ + Description: "operandSpecs provide customization for functional units within the component", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.OperandSpec"), + }, + }, + }, + }, + }, + "unsupportedConfigOverrides": { + SchemaProps: spec.SchemaProps{ + Description: "unsupportedConfigOverrides holds a sparse config that will override any previously set options. It only needs to be the fields to override it will end up overlaying in the following order: 1. hardcoded defaults 2. observedConfig 3. unsupportedConfigOverrides", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + "observedConfig": { + SchemaProps: spec.SchemaProps{ + Description: "observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because it is an input to the level for the operator", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"managementState", "logLevel", "operandSpecs", "unsupportedConfigOverrides", "observedConfig"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.OperandSpec", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_openshift_api_operator_v1_ServiceCatalogControllerManagerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the last generation change you've dealt with", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions is a list of conditions and their status", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.OperatorCondition"), + }, + }, + }, + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the level this availability applies to", + Type: []string{"string"}, + Format: "", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas indicates how many replicas are ready and at the desired state", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "generations": { + SchemaProps: spec.SchemaProps{ + Description: "generations are used to determine when an item needs to be reconciled or has changed in a way that needs a reaction.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/openshift/api/operator/v1.GenerationStatus"), + }, + }, + }, + }, + }, + }, + Required: []string{"version", "readyReplicas", "generations"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1.GenerationStatus", "github.com/openshift/api/operator/v1.OperatorCondition"}, + } +} + func schema_openshift_api_operator_v1_StaticPodOperatorSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/github.com/openshift/api/config/v1/type_features.go b/vendor/github.com/openshift/api/config/v1/type_features.go deleted file mode 100644 index c943cf133a04..000000000000 --- a/vendor/github.com/openshift/api/config/v1/type_features.go +++ /dev/null @@ -1,70 +0,0 @@ -package v1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Features holds cluster-wide information about feature gates. The canonical name is `cluster` -type Features struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - metav1.ObjectMeta `json:"metadata,omitempty"` - - // spec holds user settable values for configuration - Spec FeaturesSpec `json:"spec"` - // status holds observed values from the cluster. They may not be overridden. - Status FeaturesStatus `json:"status"` -} - -type FeaturesSpec struct { - // enabled holds a list of features that should be enabled. You only need to enter in the exceptional - // cases. Most features that should be enabled are enabled out of the box. Often times, setting a feature - // enabled can cause your cluster to be unstable. If that is the case, status will be updated. - // Because of the nature of feature gates, - // the full list isn't known by a single entity making static validation unrealistic. You can watch - // status of this resource to figure out where your feature was respected. - // +optional - Enabled []string `json:"enabled"` - - // disabled holds a list of features that should be disabled. You only need to enter in the exceptional - // cases. Most features that should be disabled are disabled out of the box. Often times, setting a feature - // disabled can cause your cluster to be unstable. If that is the case, status will be updated. - // Because of the nature of feature gates, - // the full list isn't known by a single entity making static validation unrealistic. You can watch - // status of this resource to figure out where your feature was respected. - // +optional - Disabled []string `json:"disabled"` -} - -type FeaturesStatus struct { - // featureConditions holds information about each enabled or disabled feature as aggregated from multiple - // operators. It is keyed by name. - FeatureConditions map[string]FeatureCondition `json:"featureConditions"` -} - -type FeatureCondition struct { - // operatorCondition holds information about each operator that attempted to handle a particular feature. - // It is keyed by the operator name and indicates success or failure with a message. No entry for an operator - // means that the operator did not know about or acknowledge your feature. - OperatorConditions map[string]OperatorFeatureCondition `json:"operatorConditions"` -} - -type OperatorFeatureCondition struct { - // failure is a message indicating that the operator had trouble handling a feature and explaining why. - // +optional - Failure string `json:"failure,omitempty"` - // success is a message indicating that the operator honored a feature. - // +optional - Success string `json:"success,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type FeaturesList struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - metav1.ListMeta `json:"metadata,omitempty"` - Items []Features `json:"items"` -} diff --git a/vendor/github.com/openshift/api/config/v1/types_build.go b/vendor/github.com/openshift/api/config/v1/types_build.go index fa852c7ef437..839a1422caab 100644 --- a/vendor/github.com/openshift/api/config/v1/types_build.go +++ b/vendor/github.com/openshift/api/config/v1/types_build.go @@ -62,10 +62,6 @@ type BuildDefaults struct { // Resources defines resource requirements to execute the build. // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty"` - - // RegistriesConfig controls the registries allowed for image pull and push. - // +optional - RegistriesConfig RegistriesConfig `json:"registriesConfig,omitempty"` } type ImageLabel struct { @@ -77,22 +73,6 @@ type ImageLabel struct { Value string `json:"value,omitempty"` } -type RegistriesConfig struct { - // InsecureRegistries are registries which do not have a valid SSL certificate or only support HTTP connections. - // +optional - InsecureRegistries []string `json:"insecureRegistries,omitempty"` - // BlockedRegistries are blacklisted from image pull/push. All other registries are allowed. - // - // Only one of BlockedRegistries or AllowedRegistries may be set. - // +optional - BlockedRegistries []string `json:"blockedRegistries,omitempty"` - // AllowedRegistries are whitelisted for image pull/push. All other registries are blocked. - // - // Only one of BlockedRegistries or AllowedRegistries may be set. - // +optional - AllowedRegistries []string `json:"allowedRegistries,omitempty"` -} - type BuildOverrides struct { // ImageLabels is a list of docker labels that are applied to the resulting image. // If user provided a label in their Build/BuildConfig with the same name as one in this diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go b/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go index 543c078c73e1..67178c4e24fc 100644 --- a/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go +++ b/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go @@ -112,18 +112,24 @@ type ClusterOperatorStatusCondition struct { type ClusterStatusConditionType string const ( - // OperatorAvailable indicates that the binary maintained by the operator (eg: openshift-apiserver for the + // Available indicates that the binary maintained by the operator (eg: openshift-apiserver for the // openshift-apiserver-operator), is functional and available in the cluster. OperatorAvailable ClusterStatusConditionType = "Available" - // OperatorProgressing indicates that the operator is actively making changes to the binary maintained by the + // Progressing indicates that the operator is actively making changes to the binary maintained by the // operator (eg: openshift-apiserver for the openshift-apiserver-operator). OperatorProgressing ClusterStatusConditionType = "Progressing" - // OperatorFailing indicates that the operator has encountered an error that is preventing it from working properly. + // Failing indicates that the operator has encountered an error that is preventing it from working properly. // The binary maintained by the operator (eg: openshift-apiserver for the openshift-apiserver-operator) may still be // available, but the user intent cannot be fulfilled. OperatorFailing ClusterStatusConditionType = "Failing" + + // Upgradeable indicates whether the operator is in a state that is safe to upgrade. When status is `False` + // administrators should not upgrade their cluster and the message field should contain a human readable description + // of what the administrator should do to allow the operator to successfully update. A missing condition, True, + // and Unknown are all treated by the CVO as allowing an upgrade. + OperatorUpgradeable ClusterStatusConditionType = "Upgradeable" ) // ClusterOperatorList is a list of OperatorStatus resources. diff --git a/vendor/github.com/openshift/api/config/v1/types_features.go b/vendor/github.com/openshift/api/config/v1/types_features.go new file mode 100644 index 000000000000..d5661a63a9f2 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_features.go @@ -0,0 +1,65 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Features holds cluster-wide information about feature gates. The canonical name is `cluster` +type Features struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec FeaturesSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status FeaturesStatus `json:"status"` +} + +type FeatureSet string + +var ( + // TechPreviewNoUpgrade turns on tech preview features that are not part of the normal supported platform. Turning + // this feature set on CANNOT BE UNDONE and PREVENTS UPGRADES. + TechPreviewNoUpgrade FeatureSet = "TechPreviewNoUpgrade" +) + +type FeaturesSpec struct { + // featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. + // Turning on or off features may cause irreversible changes in your cluster which cannot be undone. + FeatureSet FeatureSet `json:"featureSet,omitempty"` +} + +type FeaturesStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type FeaturesList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Features `json:"items"` +} + +var ( + // TechPreviewEnabledKubeFeatures is a list of features to turn on when TechPreviewNoUpgrade is turned on. Only the exceptions + // are listed here. The feature gates left in their default state not listed. + TechPreviewEnabledKubeFeatures = []string{} + + // TechPreviewDisabledKubeFeatures is a list of features to turn on when TechPreviewNoUpgrade is turned on. Only the exceptions + // are listed here. The feature gates left in their default state not listed. + TechPreviewDisabledKubeFeatures = []string{} + + // DefaultEnabledKubeFeatures is a list of features to turn on when the default featureset is turned on. Only the exceptions + // are listed here. The feature gates left in their default state not listed. + DefaultEnabledKubeFeatures = []string{} + + // DefaultDisabledKubeFeatures is a list of features to turn off when the default featureset is turned on. Only the exceptions + // are listed here. The feature gates left in their default state not listed. + DefaultDisabledKubeFeatures = []string{ + "PersistentLocalVolumes", // disable local volumes for 4.0, owned by sig-storage/hekumar@redhat.com + } +) 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 9340a14a15bd..a7626667c09e 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 @@ -397,7 +397,6 @@ func (in *BuildDefaults) DeepCopyInto(out *BuildDefaults) { copy(*out, *in) } in.Resources.DeepCopyInto(&out.Resources) - in.RegistriesConfig.DeepCopyInto(&out.RegistriesConfig) return } @@ -1164,36 +1163,13 @@ func (in *EtcdStorageConfig) DeepCopy() *EtcdStorageConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeatureCondition) DeepCopyInto(out *FeatureCondition) { - *out = *in - if in.OperatorConditions != nil { - in, out := &in.OperatorConditions, &out.OperatorConditions - *out = make(map[string]OperatorFeatureCondition, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureCondition. -func (in *FeatureCondition) DeepCopy() *FeatureCondition { - if in == nil { - return nil - } - out := new(FeatureCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Features) DeepCopyInto(out *Features) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) + out.Spec = in.Spec + out.Status = in.Status return } @@ -1251,16 +1227,6 @@ func (in *FeaturesList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FeaturesSpec) DeepCopyInto(out *FeaturesSpec) { *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Disabled != nil { - in, out := &in.Disabled, &out.Disabled - *out = make([]string, len(*in)) - copy(*out, *in) - } return } @@ -1277,15 +1243,6 @@ func (in *FeaturesSpec) DeepCopy() *FeaturesSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FeaturesStatus) DeepCopyInto(out *FeaturesStatus) { *out = *in - if in.FeatureConditions != nil { - in, out := &in.FeatureConditions, &out.FeatureConditions - *out = make(map[string]FeatureCondition, len(*in)) - for key, val := range *in { - newVal := new(FeatureCondition) - val.DeepCopyInto(newVal) - (*out)[key] = *newVal - } - } return } @@ -2371,22 +2328,6 @@ func (in *OperandVersion) DeepCopy() *OperandVersion { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OperatorFeatureCondition) DeepCopyInto(out *OperatorFeatureCondition) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorFeatureCondition. -func (in *OperatorFeatureCondition) DeepCopy() *OperatorFeatureCondition { - if in == nil { - return nil - } - out := new(OperatorFeatureCondition) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Project) DeepCopyInto(out *Project) { *out = *in @@ -2557,37 +2498,6 @@ func (in *ProxySpec) DeepCopy() *ProxySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistriesConfig) DeepCopyInto(out *RegistriesConfig) { - *out = *in - if in.InsecureRegistries != nil { - in, out := &in.InsecureRegistries, &out.InsecureRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.BlockedRegistries != nil { - in, out := &in.BlockedRegistries, &out.BlockedRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AllowedRegistries != nil { - in, out := &in.AllowedRegistries, &out.AllowedRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistriesConfig. -func (in *RegistriesConfig) DeepCopy() *RegistriesConfig { - if in == nil { - return nil - } - out := new(RegistriesConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistryLocation) DeepCopyInto(out *RegistryLocation) { *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 2220bfefba03..e38f76541e3b 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 @@ -335,12 +335,11 @@ func (Build) SwaggerDoc() map[string]string { } var map_BuildDefaults = map[string]string{ - "defaultProxy": "DefaultProxy contains the default proxy settings for all build operations, including image pull/push and source download.\n\nValues can be overrode by setting the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables in the build config's strategy.", - "gitProxy": "GitProxy contains the proxy settings for git operations only. If set, this will override any Proxy settings for all git commands, such as git clone.\n\nValues that are not set here will be inherited from DefaultProxy.", - "env": "Env is a set of default environment variables that will be applied to the build if the specified variables do not exist on the build", - "imageLabels": "ImageLabels is a list of docker labels that are applied to the resulting image. User can override a default label by providing a label with the same name in their Build/BuildConfig.", - "resources": "Resources defines resource requirements to execute the build.", - "registriesConfig": "RegistriesConfig controls the registries allowed for image pull and push.", + "defaultProxy": "DefaultProxy contains the default proxy settings for all build operations, including image pull/push and source download.\n\nValues can be overrode by setting the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables in the build config's strategy.", + "gitProxy": "GitProxy contains the proxy settings for git operations only. If set, this will override any Proxy settings for all git commands, such as git clone.\n\nValues that are not set here will be inherited from DefaultProxy.", + "env": "Env is a set of default environment variables that will be applied to the build if the specified variables do not exist on the build", + "imageLabels": "ImageLabels is a list of docker labels that are applied to the resulting image. User can override a default label by providing a label with the same name in their Build/BuildConfig.", + "resources": "Resources defines resource requirements to execute the build.", } func (BuildDefaults) SwaggerDoc() map[string]string { @@ -384,16 +383,6 @@ func (ImageLabel) SwaggerDoc() map[string]string { return map_ImageLabel } -var map_RegistriesConfig = map[string]string{ - "insecureRegistries": "InsecureRegistries are registries which do not have a valid SSL certificate or only support HTTP connections.", - "blockedRegistries": "BlockedRegistries are blacklisted from image pull/push. All other registries are allowed.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", - "allowedRegistries": "AllowedRegistries are whitelisted for image pull/push. All other registries are blocked.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", -} - -func (RegistriesConfig) SwaggerDoc() map[string]string { - return map_RegistriesConfig -} - var map_ClusterOperator = map[string]string{ "": "ClusterOperator is the Custom Resource object which holds the current state of an operator. This object is used by operators to convey their state to the rest of the cluster.", "spec": "spec hold the intent of how this operator should behave.", @@ -621,6 +610,33 @@ func (DNSZone) SwaggerDoc() map[string]string { return map_DNSZone } +var map_Features = map[string]string{ + "": "Features holds cluster-wide information about feature gates. The canonical name is `cluster`", + "metadata": "Standard object's metadata.", + "spec": "spec holds user settable values for configuration", + "status": "status holds observed values from the cluster. They may not be overridden.", +} + +func (Features) SwaggerDoc() map[string]string { + return map_Features +} + +var map_FeaturesList = map[string]string{ + "metadata": "Standard object's metadata.", +} + +func (FeaturesList) SwaggerDoc() map[string]string { + return map_FeaturesList +} + +var map_FeaturesSpec = map[string]string{ + "featureSet": "featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. Turning on or off features may cause irreversible changes in your cluster which cannot be undone.", +} + +func (FeaturesSpec) SwaggerDoc() map[string]string { + return map_FeaturesSpec +} + var map_Image = map[string]string{ "": "Image holds cluster-wide information about how to handle images. The canonical name is `cluster`", "metadata": "Standard object's metadata.", diff --git a/vendor/github.com/openshift/api/operator/v1/register.go b/vendor/github.com/openshift/api/operator/v1/register.go index 4758202a0a41..2cee2d65dd98 100644 --- a/vendor/github.com/openshift/api/operator/v1/register.go +++ b/vendor/github.com/openshift/api/operator/v1/register.go @@ -50,6 +50,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &OpenShiftControllerManagerList{}, &ServiceCA{}, &ServiceCAList{}, + &ServiceCatalogAPIServer{}, + &ServiceCatalogAPIServerList{}, + &ServiceCatalogControllerManager{}, + &ServiceCatalogControllerManagerList{}, ) return nil diff --git a/vendor/github.com/openshift/api/operator/v1/types_scheduler.go b/vendor/github.com/openshift/api/operator/v1/types_scheduler.go index 14ac1240580c..d25e21091f06 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_scheduler.go +++ b/vendor/github.com/openshift/api/operator/v1/types_scheduler.go @@ -18,7 +18,8 @@ type KubeScheduler struct { } type KubeSchedulerSpec struct { - OperatorSpec `json:",inline"` + StaticPodOperatorSpec `json:",inline"` + // forceRedeploymentReason can be used to force the redeployment of the kube-scheduler by providing a unique string. // This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work // this time instead of failing again on the same config. diff --git a/vendor/github.com/openshift/api/operator/v1/types_servicecatalogapiserver.go b/vendor/github.com/openshift/api/operator/v1/types_servicecatalogapiserver.go new file mode 100644 index 000000000000..fd04366cf275 --- /dev/null +++ b/vendor/github.com/openshift/api/operator/v1/types_servicecatalogapiserver.go @@ -0,0 +1,37 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceCatalogAPIServer provides information to configure an operator to manage Service Catalog API Server +type ServiceCatalogAPIServer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ServiceCatalogAPIServerSpec `json:"spec,omitempty"` + Status ServiceCatalogAPIServerStatus `json:"status,omitempty"` +} + +type ServiceCatalogAPIServerSpec struct { + OperatorSpec `json:",inline"` +} + +type ServiceCatalogAPIServerStatus struct { + OperatorStatus `json:",inline"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceCatalogAPIServerList is a collection of items +type ServiceCatalogAPIServerList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + // Items contains the items + Items []ServiceCatalogAPIServer `json:"items"` +} diff --git a/vendor/github.com/openshift/api/operator/v1/types_servicecatalogcontrollermanager.go b/vendor/github.com/openshift/api/operator/v1/types_servicecatalogcontrollermanager.go new file mode 100644 index 000000000000..c848dd0a77ab --- /dev/null +++ b/vendor/github.com/openshift/api/operator/v1/types_servicecatalogcontrollermanager.go @@ -0,0 +1,37 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceCatalogControllerManager provides information to configure an operator to manage Service Catalog Controller Manager +type ServiceCatalogControllerManager struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ServiceCatalogControllerManagerSpec `json:"spec,omitempty"` + Status ServiceCatalogControllerManagerStatus `json:"status,omitempty"` +} + +type ServiceCatalogControllerManagerSpec struct { + OperatorSpec `json:",inline"` +} + +type ServiceCatalogControllerManagerStatus struct { + OperatorStatus `json:",inline"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceCatalogControllerManagerList is a collection of items +type ServiceCatalogControllerManagerList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + // Items contains the items + Items []ServiceCatalogControllerManager `json:"items"` +} diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go index bdc4fb7c5ca2..623142c04991 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go @@ -581,7 +581,7 @@ func (in *KubeSchedulerList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeSchedulerSpec) DeepCopyInto(out *KubeSchedulerSpec) { *out = *in - in.OperatorSpec.DeepCopyInto(&out.OperatorSpec) + in.StaticPodOperatorSpec.DeepCopyInto(&out.StaticPodOperatorSpec) return } @@ -1111,6 +1111,196 @@ func (in *ServiceCAStatus) DeepCopy() *ServiceCAStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogAPIServer) DeepCopyInto(out *ServiceCatalogAPIServer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogAPIServer. +func (in *ServiceCatalogAPIServer) DeepCopy() *ServiceCatalogAPIServer { + if in == nil { + return nil + } + out := new(ServiceCatalogAPIServer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCatalogAPIServer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogAPIServerList) DeepCopyInto(out *ServiceCatalogAPIServerList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceCatalogAPIServer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogAPIServerList. +func (in *ServiceCatalogAPIServerList) DeepCopy() *ServiceCatalogAPIServerList { + if in == nil { + return nil + } + out := new(ServiceCatalogAPIServerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCatalogAPIServerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogAPIServerSpec) DeepCopyInto(out *ServiceCatalogAPIServerSpec) { + *out = *in + in.OperatorSpec.DeepCopyInto(&out.OperatorSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogAPIServerSpec. +func (in *ServiceCatalogAPIServerSpec) DeepCopy() *ServiceCatalogAPIServerSpec { + if in == nil { + return nil + } + out := new(ServiceCatalogAPIServerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogAPIServerStatus) DeepCopyInto(out *ServiceCatalogAPIServerStatus) { + *out = *in + in.OperatorStatus.DeepCopyInto(&out.OperatorStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogAPIServerStatus. +func (in *ServiceCatalogAPIServerStatus) DeepCopy() *ServiceCatalogAPIServerStatus { + if in == nil { + return nil + } + out := new(ServiceCatalogAPIServerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogControllerManager) DeepCopyInto(out *ServiceCatalogControllerManager) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogControllerManager. +func (in *ServiceCatalogControllerManager) DeepCopy() *ServiceCatalogControllerManager { + if in == nil { + return nil + } + out := new(ServiceCatalogControllerManager) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCatalogControllerManager) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogControllerManagerList) DeepCopyInto(out *ServiceCatalogControllerManagerList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceCatalogControllerManager, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogControllerManagerList. +func (in *ServiceCatalogControllerManagerList) DeepCopy() *ServiceCatalogControllerManagerList { + if in == nil { + return nil + } + out := new(ServiceCatalogControllerManagerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceCatalogControllerManagerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogControllerManagerSpec) DeepCopyInto(out *ServiceCatalogControllerManagerSpec) { + *out = *in + in.OperatorSpec.DeepCopyInto(&out.OperatorSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogControllerManagerSpec. +func (in *ServiceCatalogControllerManagerSpec) DeepCopy() *ServiceCatalogControllerManagerSpec { + if in == nil { + return nil + } + out := new(ServiceCatalogControllerManagerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceCatalogControllerManagerStatus) DeepCopyInto(out *ServiceCatalogControllerManagerStatus) { + *out = *in + in.OperatorStatus.DeepCopyInto(&out.OperatorStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceCatalogControllerManagerStatus. +func (in *ServiceCatalogControllerManagerStatus) DeepCopy() *ServiceCatalogControllerManagerStatus { + if in == nil { + return nil + } + out := new(ServiceCatalogControllerManagerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StaticPodOperatorSpec) DeepCopyInto(out *StaticPodOperatorSpec) { *out = *in diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index 3187f3426ec6..22d026ac9881 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -320,4 +320,40 @@ func (ServiceCAList) SwaggerDoc() map[string]string { return map_ServiceCAList } +var map_ServiceCatalogAPIServer = map[string]string{ + "": "ServiceCatalogAPIServer provides information to configure an operator to manage Service Catalog API Server", +} + +func (ServiceCatalogAPIServer) SwaggerDoc() map[string]string { + return map_ServiceCatalogAPIServer +} + +var map_ServiceCatalogAPIServerList = map[string]string{ + "": "ServiceCatalogAPIServerList is a collection of items", + "metadata": "Standard object's metadata.", + "items": "Items contains the items", +} + +func (ServiceCatalogAPIServerList) SwaggerDoc() map[string]string { + return map_ServiceCatalogAPIServerList +} + +var map_ServiceCatalogControllerManager = map[string]string{ + "": "ServiceCatalogControllerManager provides information to configure an operator to manage Service Catalog Controller Manager", +} + +func (ServiceCatalogControllerManager) SwaggerDoc() map[string]string { + return map_ServiceCatalogControllerManager +} + +var map_ServiceCatalogControllerManagerList = map[string]string{ + "": "ServiceCatalogControllerManagerList is a collection of items", + "metadata": "Standard object's metadata.", + "items": "Items contains the items", +} + +func (ServiceCatalogControllerManagerList) SwaggerDoc() map[string]string { + return map_ServiceCatalogControllerManagerList +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/github.com/openshift/client-go/glide.lock b/vendor/github.com/openshift/client-go/glide.lock index 8638a83662a3..9fa3b00998ae 100644 --- a/vendor/github.com/openshift/client-go/glide.lock +++ b/vendor/github.com/openshift/client-go/glide.lock @@ -1,5 +1,5 @@ hash: 2bc7f2365f88b3af5dd5bc4bc234144b18e67928f8169661cd2fa2b48c389650 -updated: 2019-02-13T15:25:15.63152362-05:00 +updated: 2019-02-14T13:57:47.634189874-05:00 imports: - name: github.com/davecgh/go-spew version: 782f4967f2dc4564575ca782fe2d04090b5faca8 @@ -49,7 +49,7 @@ imports: - name: github.com/modern-go/reflect2 version: 05fbef0ca5da472bbf96c9322b84a53edc03c9fd - name: github.com/openshift/api - version: e6677f05850ac442a176c46830ad5dba6e78907a + version: ea5d05408a95a765d44b5a4b31561b530f0b1f4c subpackages: - apps/v1 - authorization/v1 @@ -115,7 +115,7 @@ imports: subpackages: - imports - name: google.golang.org/appengine - version: 99bc4335fe23898c0a61f5b35afabb6d11f29094 + version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 subpackages: - internal - internal/base diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_operator_client.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_operator_client.go index 9fe1326effa6..e9c56582ac0a 100644 --- a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_operator_client.go +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_operator_client.go @@ -48,6 +48,14 @@ func (c *FakeOperatorV1) ServiceCAs() v1.ServiceCAInterface { return &FakeServiceCAs{c} } +func (c *FakeOperatorV1) ServiceCatalogAPIServers() v1.ServiceCatalogAPIServerInterface { + return &FakeServiceCatalogAPIServers{c} +} + +func (c *FakeOperatorV1) ServiceCatalogControllerManagers() v1.ServiceCatalogControllerManagerInterface { + return &FakeServiceCatalogControllerManagers{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeOperatorV1) RESTClient() rest.Interface { diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogapiserver.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogapiserver.go new file mode 100644 index 000000000000..7dcc3d5dcea7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogapiserver.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + operator_v1 "github.com/openshift/api/operator/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" +) + +// FakeServiceCatalogAPIServers implements ServiceCatalogAPIServerInterface +type FakeServiceCatalogAPIServers struct { + Fake *FakeOperatorV1 +} + +var servicecatalogapiserversResource = schema.GroupVersionResource{Group: "operator.openshift.io", Version: "v1", Resource: "servicecatalogapiservers"} + +var servicecatalogapiserversKind = schema.GroupVersionKind{Group: "operator.openshift.io", Version: "v1", Kind: "ServiceCatalogAPIServer"} + +// Get takes name of the serviceCatalogAPIServer, and returns the corresponding serviceCatalogAPIServer object, and an error if there is any. +func (c *FakeServiceCatalogAPIServers) Get(name string, options v1.GetOptions) (result *operator_v1.ServiceCatalogAPIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicecatalogapiserversResource, name), &operator_v1.ServiceCatalogAPIServer{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogAPIServer), err +} + +// List takes label and field selectors, and returns the list of ServiceCatalogAPIServers that match those selectors. +func (c *FakeServiceCatalogAPIServers) List(opts v1.ListOptions) (result *operator_v1.ServiceCatalogAPIServerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicecatalogapiserversResource, servicecatalogapiserversKind, opts), &operator_v1.ServiceCatalogAPIServerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &operator_v1.ServiceCatalogAPIServerList{ListMeta: obj.(*operator_v1.ServiceCatalogAPIServerList).ListMeta} + for _, item := range obj.(*operator_v1.ServiceCatalogAPIServerList).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 serviceCatalogAPIServers. +func (c *FakeServiceCatalogAPIServers) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicecatalogapiserversResource, opts)) +} + +// Create takes the representation of a serviceCatalogAPIServer and creates it. Returns the server's representation of the serviceCatalogAPIServer, and an error, if there is any. +func (c *FakeServiceCatalogAPIServers) Create(serviceCatalogAPIServer *operator_v1.ServiceCatalogAPIServer) (result *operator_v1.ServiceCatalogAPIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicecatalogapiserversResource, serviceCatalogAPIServer), &operator_v1.ServiceCatalogAPIServer{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogAPIServer), err +} + +// Update takes the representation of a serviceCatalogAPIServer and updates it. Returns the server's representation of the serviceCatalogAPIServer, and an error, if there is any. +func (c *FakeServiceCatalogAPIServers) Update(serviceCatalogAPIServer *operator_v1.ServiceCatalogAPIServer) (result *operator_v1.ServiceCatalogAPIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicecatalogapiserversResource, serviceCatalogAPIServer), &operator_v1.ServiceCatalogAPIServer{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogAPIServer), 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 *FakeServiceCatalogAPIServers) UpdateStatus(serviceCatalogAPIServer *operator_v1.ServiceCatalogAPIServer) (*operator_v1.ServiceCatalogAPIServer, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(servicecatalogapiserversResource, "status", serviceCatalogAPIServer), &operator_v1.ServiceCatalogAPIServer{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogAPIServer), err +} + +// Delete takes name of the serviceCatalogAPIServer and deletes it. Returns an error if one occurs. +func (c *FakeServiceCatalogAPIServers) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicecatalogapiserversResource, name), &operator_v1.ServiceCatalogAPIServer{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceCatalogAPIServers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicecatalogapiserversResource, listOptions) + + _, err := c.Fake.Invokes(action, &operator_v1.ServiceCatalogAPIServerList{}) + return err +} + +// Patch applies the patch and returns the patched serviceCatalogAPIServer. +func (c *FakeServiceCatalogAPIServers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *operator_v1.ServiceCatalogAPIServer, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicecatalogapiserversResource, name, data, subresources...), &operator_v1.ServiceCatalogAPIServer{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogAPIServer), err +} diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogcontrollermanager.go new file mode 100644 index 000000000000..4a147260a16b --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/fake/fake_servicecatalogcontrollermanager.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + operator_v1 "github.com/openshift/api/operator/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" +) + +// FakeServiceCatalogControllerManagers implements ServiceCatalogControllerManagerInterface +type FakeServiceCatalogControllerManagers struct { + Fake *FakeOperatorV1 +} + +var servicecatalogcontrollermanagersResource = schema.GroupVersionResource{Group: "operator.openshift.io", Version: "v1", Resource: "servicecatalogcontrollermanagers"} + +var servicecatalogcontrollermanagersKind = schema.GroupVersionKind{Group: "operator.openshift.io", Version: "v1", Kind: "ServiceCatalogControllerManager"} + +// Get takes name of the serviceCatalogControllerManager, and returns the corresponding serviceCatalogControllerManager object, and an error if there is any. +func (c *FakeServiceCatalogControllerManagers) Get(name string, options v1.GetOptions) (result *operator_v1.ServiceCatalogControllerManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(servicecatalogcontrollermanagersResource, name), &operator_v1.ServiceCatalogControllerManager{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogControllerManager), err +} + +// List takes label and field selectors, and returns the list of ServiceCatalogControllerManagers that match those selectors. +func (c *FakeServiceCatalogControllerManagers) List(opts v1.ListOptions) (result *operator_v1.ServiceCatalogControllerManagerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(servicecatalogcontrollermanagersResource, servicecatalogcontrollermanagersKind, opts), &operator_v1.ServiceCatalogControllerManagerList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &operator_v1.ServiceCatalogControllerManagerList{ListMeta: obj.(*operator_v1.ServiceCatalogControllerManagerList).ListMeta} + for _, item := range obj.(*operator_v1.ServiceCatalogControllerManagerList).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 serviceCatalogControllerManagers. +func (c *FakeServiceCatalogControllerManagers) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(servicecatalogcontrollermanagersResource, opts)) +} + +// Create takes the representation of a serviceCatalogControllerManager and creates it. Returns the server's representation of the serviceCatalogControllerManager, and an error, if there is any. +func (c *FakeServiceCatalogControllerManagers) Create(serviceCatalogControllerManager *operator_v1.ServiceCatalogControllerManager) (result *operator_v1.ServiceCatalogControllerManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(servicecatalogcontrollermanagersResource, serviceCatalogControllerManager), &operator_v1.ServiceCatalogControllerManager{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogControllerManager), err +} + +// Update takes the representation of a serviceCatalogControllerManager and updates it. Returns the server's representation of the serviceCatalogControllerManager, and an error, if there is any. +func (c *FakeServiceCatalogControllerManagers) Update(serviceCatalogControllerManager *operator_v1.ServiceCatalogControllerManager) (result *operator_v1.ServiceCatalogControllerManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(servicecatalogcontrollermanagersResource, serviceCatalogControllerManager), &operator_v1.ServiceCatalogControllerManager{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogControllerManager), 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 *FakeServiceCatalogControllerManagers) UpdateStatus(serviceCatalogControllerManager *operator_v1.ServiceCatalogControllerManager) (*operator_v1.ServiceCatalogControllerManager, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(servicecatalogcontrollermanagersResource, "status", serviceCatalogControllerManager), &operator_v1.ServiceCatalogControllerManager{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogControllerManager), err +} + +// Delete takes name of the serviceCatalogControllerManager and deletes it. Returns an error if one occurs. +func (c *FakeServiceCatalogControllerManagers) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(servicecatalogcontrollermanagersResource, name), &operator_v1.ServiceCatalogControllerManager{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceCatalogControllerManagers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(servicecatalogcontrollermanagersResource, listOptions) + + _, err := c.Fake.Invokes(action, &operator_v1.ServiceCatalogControllerManagerList{}) + return err +} + +// Patch applies the patch and returns the patched serviceCatalogControllerManager. +func (c *FakeServiceCatalogControllerManagers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *operator_v1.ServiceCatalogControllerManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(servicecatalogcontrollermanagersResource, name, data, subresources...), &operator_v1.ServiceCatalogControllerManager{}) + if obj == nil { + return nil, err + } + return obj.(*operator_v1.ServiceCatalogControllerManager), err +} diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/generated_expansion.go index b91936fe48fc..358e3f0b89a4 100644 --- a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/generated_expansion.go +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/generated_expansion.go @@ -19,3 +19,7 @@ type OpenShiftAPIServerExpansion interface{} type OpenShiftControllerManagerExpansion interface{} type ServiceCAExpansion interface{} + +type ServiceCatalogAPIServerExpansion interface{} + +type ServiceCatalogControllerManagerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/operator_client.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/operator_client.go index 762c823bb7f4..b466d17d5377 100644 --- a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/operator_client.go +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/operator_client.go @@ -20,6 +20,8 @@ type OperatorV1Interface interface { OpenShiftAPIServersGetter OpenShiftControllerManagersGetter ServiceCAsGetter + ServiceCatalogAPIServersGetter + ServiceCatalogControllerManagersGetter } // OperatorV1Client is used to interact with features provided by the operator.openshift.io group. @@ -63,6 +65,14 @@ func (c *OperatorV1Client) ServiceCAs() ServiceCAInterface { return newServiceCAs(c) } +func (c *OperatorV1Client) ServiceCatalogAPIServers() ServiceCatalogAPIServerInterface { + return newServiceCatalogAPIServers(c) +} + +func (c *OperatorV1Client) ServiceCatalogControllerManagers() ServiceCatalogControllerManagerInterface { + return newServiceCatalogControllerManagers(c) +} + // NewForConfig creates a new OperatorV1Client for the given config. func NewForConfig(c *rest.Config) (*OperatorV1Client, error) { config := *c diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogapiserver.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogapiserver.go new file mode 100644 index 000000000000..1b8e25d94ed3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogapiserver.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/operator/v1" + scheme "github.com/openshift/client-go/operator/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ServiceCatalogAPIServersGetter has a method to return a ServiceCatalogAPIServerInterface. +// A group's client should implement this interface. +type ServiceCatalogAPIServersGetter interface { + ServiceCatalogAPIServers() ServiceCatalogAPIServerInterface +} + +// ServiceCatalogAPIServerInterface has methods to work with ServiceCatalogAPIServer resources. +type ServiceCatalogAPIServerInterface interface { + Create(*v1.ServiceCatalogAPIServer) (*v1.ServiceCatalogAPIServer, error) + Update(*v1.ServiceCatalogAPIServer) (*v1.ServiceCatalogAPIServer, error) + UpdateStatus(*v1.ServiceCatalogAPIServer) (*v1.ServiceCatalogAPIServer, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ServiceCatalogAPIServer, error) + List(opts meta_v1.ListOptions) (*v1.ServiceCatalogAPIServerList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceCatalogAPIServer, err error) + ServiceCatalogAPIServerExpansion +} + +// serviceCatalogAPIServers implements ServiceCatalogAPIServerInterface +type serviceCatalogAPIServers struct { + client rest.Interface +} + +// newServiceCatalogAPIServers returns a ServiceCatalogAPIServers +func newServiceCatalogAPIServers(c *OperatorV1Client) *serviceCatalogAPIServers { + return &serviceCatalogAPIServers{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceCatalogAPIServer, and returns the corresponding serviceCatalogAPIServer object, and an error if there is any. +func (c *serviceCatalogAPIServers) Get(name string, options meta_v1.GetOptions) (result *v1.ServiceCatalogAPIServer, err error) { + result = &v1.ServiceCatalogAPIServer{} + err = c.client.Get(). + Resource("servicecatalogapiservers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceCatalogAPIServers that match those selectors. +func (c *serviceCatalogAPIServers) List(opts meta_v1.ListOptions) (result *v1.ServiceCatalogAPIServerList, err error) { + result = &v1.ServiceCatalogAPIServerList{} + err = c.client.Get(). + Resource("servicecatalogapiservers"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceCatalogAPIServers. +func (c *serviceCatalogAPIServers) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("servicecatalogapiservers"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a serviceCatalogAPIServer and creates it. Returns the server's representation of the serviceCatalogAPIServer, and an error, if there is any. +func (c *serviceCatalogAPIServers) Create(serviceCatalogAPIServer *v1.ServiceCatalogAPIServer) (result *v1.ServiceCatalogAPIServer, err error) { + result = &v1.ServiceCatalogAPIServer{} + err = c.client.Post(). + Resource("servicecatalogapiservers"). + Body(serviceCatalogAPIServer). + Do(). + Into(result) + return +} + +// Update takes the representation of a serviceCatalogAPIServer and updates it. Returns the server's representation of the serviceCatalogAPIServer, and an error, if there is any. +func (c *serviceCatalogAPIServers) Update(serviceCatalogAPIServer *v1.ServiceCatalogAPIServer) (result *v1.ServiceCatalogAPIServer, err error) { + result = &v1.ServiceCatalogAPIServer{} + err = c.client.Put(). + Resource("servicecatalogapiservers"). + Name(serviceCatalogAPIServer.Name). + Body(serviceCatalogAPIServer). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *serviceCatalogAPIServers) UpdateStatus(serviceCatalogAPIServer *v1.ServiceCatalogAPIServer) (result *v1.ServiceCatalogAPIServer, err error) { + result = &v1.ServiceCatalogAPIServer{} + err = c.client.Put(). + Resource("servicecatalogapiservers"). + Name(serviceCatalogAPIServer.Name). + SubResource("status"). + Body(serviceCatalogAPIServer). + Do(). + Into(result) + return +} + +// Delete takes name of the serviceCatalogAPIServer and deletes it. Returns an error if one occurs. +func (c *serviceCatalogAPIServers) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicecatalogapiservers"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceCatalogAPIServers) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("servicecatalogapiservers"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched serviceCatalogAPIServer. +func (c *serviceCatalogAPIServers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceCatalogAPIServer, err error) { + result = &v1.ServiceCatalogAPIServer{} + err = c.client.Patch(pt). + Resource("servicecatalogapiservers"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogcontrollermanager.go new file mode 100644 index 000000000000..e2eb0a5fc30e --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/clientset/versioned/typed/operator/v1/servicecatalogcontrollermanager.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/operator/v1" + scheme "github.com/openshift/client-go/operator/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ServiceCatalogControllerManagersGetter has a method to return a ServiceCatalogControllerManagerInterface. +// A group's client should implement this interface. +type ServiceCatalogControllerManagersGetter interface { + ServiceCatalogControllerManagers() ServiceCatalogControllerManagerInterface +} + +// ServiceCatalogControllerManagerInterface has methods to work with ServiceCatalogControllerManager resources. +type ServiceCatalogControllerManagerInterface interface { + Create(*v1.ServiceCatalogControllerManager) (*v1.ServiceCatalogControllerManager, error) + Update(*v1.ServiceCatalogControllerManager) (*v1.ServiceCatalogControllerManager, error) + UpdateStatus(*v1.ServiceCatalogControllerManager) (*v1.ServiceCatalogControllerManager, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ServiceCatalogControllerManager, error) + List(opts meta_v1.ListOptions) (*v1.ServiceCatalogControllerManagerList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceCatalogControllerManager, err error) + ServiceCatalogControllerManagerExpansion +} + +// serviceCatalogControllerManagers implements ServiceCatalogControllerManagerInterface +type serviceCatalogControllerManagers struct { + client rest.Interface +} + +// newServiceCatalogControllerManagers returns a ServiceCatalogControllerManagers +func newServiceCatalogControllerManagers(c *OperatorV1Client) *serviceCatalogControllerManagers { + return &serviceCatalogControllerManagers{ + client: c.RESTClient(), + } +} + +// Get takes name of the serviceCatalogControllerManager, and returns the corresponding serviceCatalogControllerManager object, and an error if there is any. +func (c *serviceCatalogControllerManagers) Get(name string, options meta_v1.GetOptions) (result *v1.ServiceCatalogControllerManager, err error) { + result = &v1.ServiceCatalogControllerManager{} + err = c.client.Get(). + Resource("servicecatalogcontrollermanagers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceCatalogControllerManagers that match those selectors. +func (c *serviceCatalogControllerManagers) List(opts meta_v1.ListOptions) (result *v1.ServiceCatalogControllerManagerList, err error) { + result = &v1.ServiceCatalogControllerManagerList{} + err = c.client.Get(). + Resource("servicecatalogcontrollermanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceCatalogControllerManagers. +func (c *serviceCatalogControllerManagers) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("servicecatalogcontrollermanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a serviceCatalogControllerManager and creates it. Returns the server's representation of the serviceCatalogControllerManager, and an error, if there is any. +func (c *serviceCatalogControllerManagers) Create(serviceCatalogControllerManager *v1.ServiceCatalogControllerManager) (result *v1.ServiceCatalogControllerManager, err error) { + result = &v1.ServiceCatalogControllerManager{} + err = c.client.Post(). + Resource("servicecatalogcontrollermanagers"). + Body(serviceCatalogControllerManager). + Do(). + Into(result) + return +} + +// Update takes the representation of a serviceCatalogControllerManager and updates it. Returns the server's representation of the serviceCatalogControllerManager, and an error, if there is any. +func (c *serviceCatalogControllerManagers) Update(serviceCatalogControllerManager *v1.ServiceCatalogControllerManager) (result *v1.ServiceCatalogControllerManager, err error) { + result = &v1.ServiceCatalogControllerManager{} + err = c.client.Put(). + Resource("servicecatalogcontrollermanagers"). + Name(serviceCatalogControllerManager.Name). + Body(serviceCatalogControllerManager). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *serviceCatalogControllerManagers) UpdateStatus(serviceCatalogControllerManager *v1.ServiceCatalogControllerManager) (result *v1.ServiceCatalogControllerManager, err error) { + result = &v1.ServiceCatalogControllerManager{} + err = c.client.Put(). + Resource("servicecatalogcontrollermanagers"). + Name(serviceCatalogControllerManager.Name). + SubResource("status"). + Body(serviceCatalogControllerManager). + Do(). + Into(result) + return +} + +// Delete takes name of the serviceCatalogControllerManager and deletes it. Returns an error if one occurs. +func (c *serviceCatalogControllerManagers) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("servicecatalogcontrollermanagers"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceCatalogControllerManagers) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("servicecatalogcontrollermanagers"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched serviceCatalogControllerManager. +func (c *serviceCatalogControllerManagers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceCatalogControllerManager, err error) { + result = &v1.ServiceCatalogControllerManager{} + err = c.client.Patch(pt). + Resource("servicecatalogcontrollermanagers"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/operator/informers/externalversions/generic.go b/vendor/github.com/openshift/client-go/operator/informers/externalversions/generic.go index d698784609ed..41cda065f72b 100644 --- a/vendor/github.com/openshift/client-go/operator/informers/externalversions/generic.go +++ b/vendor/github.com/openshift/client-go/operator/informers/externalversions/generic.go @@ -55,6 +55,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1().OpenShiftControllerManagers().Informer()}, nil case v1.SchemeGroupVersion.WithResource("servicecas"): return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1().ServiceCAs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicecatalogapiservers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1().ServiceCatalogAPIServers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicecatalogcontrollermanagers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Operator().V1().ServiceCatalogControllerManagers().Informer()}, nil } diff --git a/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/interface.go b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/interface.go index 34237766fcc5..4cb3b98bfb86 100644 --- a/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/interface.go +++ b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/interface.go @@ -26,6 +26,10 @@ type Interface interface { OpenShiftControllerManagers() OpenShiftControllerManagerInformer // ServiceCAs returns a ServiceCAInformer. ServiceCAs() ServiceCAInformer + // ServiceCatalogAPIServers returns a ServiceCatalogAPIServerInformer. + ServiceCatalogAPIServers() ServiceCatalogAPIServerInformer + // ServiceCatalogControllerManagers returns a ServiceCatalogControllerManagerInformer. + ServiceCatalogControllerManagers() ServiceCatalogControllerManagerInformer } type version struct { @@ -83,3 +87,13 @@ func (v *version) OpenShiftControllerManagers() OpenShiftControllerManagerInform func (v *version) ServiceCAs() ServiceCAInformer { return &serviceCAInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ServiceCatalogAPIServers returns a ServiceCatalogAPIServerInformer. +func (v *version) ServiceCatalogAPIServers() ServiceCatalogAPIServerInformer { + return &serviceCatalogAPIServerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ServiceCatalogControllerManagers returns a ServiceCatalogControllerManagerInformer. +func (v *version) ServiceCatalogControllerManagers() ServiceCatalogControllerManagerInformer { + return &serviceCatalogControllerManagerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogapiserver.go b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogapiserver.go new file mode 100644 index 000000000000..5ade39f93d1a --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogapiserver.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + operator_v1 "github.com/openshift/api/operator/v1" + versioned "github.com/openshift/client-go/operator/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/operator/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/operator/listers/operator/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCatalogAPIServerInformer provides access to a shared informer and lister for +// ServiceCatalogAPIServers. +type ServiceCatalogAPIServerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceCatalogAPIServerLister +} + +type serviceCatalogAPIServerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceCatalogAPIServerInformer constructs a new informer for ServiceCatalogAPIServer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceCatalogAPIServerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceCatalogAPIServerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceCatalogAPIServerInformer constructs a new informer for ServiceCatalogAPIServer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceCatalogAPIServerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OperatorV1().ServiceCatalogAPIServers().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OperatorV1().ServiceCatalogAPIServers().Watch(options) + }, + }, + &operator_v1.ServiceCatalogAPIServer{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceCatalogAPIServerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceCatalogAPIServerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceCatalogAPIServerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&operator_v1.ServiceCatalogAPIServer{}, f.defaultInformer) +} + +func (f *serviceCatalogAPIServerInformer) Lister() v1.ServiceCatalogAPIServerLister { + return v1.NewServiceCatalogAPIServerLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogcontrollermanager.go new file mode 100644 index 000000000000..3c1da5f1e81c --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/informers/externalversions/operator/v1/servicecatalogcontrollermanager.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + operator_v1 "github.com/openshift/api/operator/v1" + versioned "github.com/openshift/client-go/operator/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/operator/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/operator/listers/operator/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCatalogControllerManagerInformer provides access to a shared informer and lister for +// ServiceCatalogControllerManagers. +type ServiceCatalogControllerManagerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceCatalogControllerManagerLister +} + +type serviceCatalogControllerManagerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceCatalogControllerManagerInformer constructs a new informer for ServiceCatalogControllerManager type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceCatalogControllerManagerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceCatalogControllerManagerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceCatalogControllerManagerInformer constructs a new informer for ServiceCatalogControllerManager type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceCatalogControllerManagerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OperatorV1().ServiceCatalogControllerManagers().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OperatorV1().ServiceCatalogControllerManagers().Watch(options) + }, + }, + &operator_v1.ServiceCatalogControllerManager{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceCatalogControllerManagerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceCatalogControllerManagerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceCatalogControllerManagerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&operator_v1.ServiceCatalogControllerManager{}, f.defaultInformer) +} + +func (f *serviceCatalogControllerManagerInformer) Lister() v1.ServiceCatalogControllerManagerLister { + return v1.NewServiceCatalogControllerManagerLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/operator/listers/operator/v1/expansion_generated.go b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/expansion_generated.go index 44209fb62e75..4aef92ccdce3 100644 --- a/vendor/github.com/openshift/client-go/operator/listers/operator/v1/expansion_generated.go +++ b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/expansion_generated.go @@ -37,3 +37,11 @@ type OpenShiftControllerManagerListerExpansion interface{} // ServiceCAListerExpansion allows custom methods to be added to // ServiceCALister. type ServiceCAListerExpansion interface{} + +// ServiceCatalogAPIServerListerExpansion allows custom methods to be added to +// ServiceCatalogAPIServerLister. +type ServiceCatalogAPIServerListerExpansion interface{} + +// ServiceCatalogControllerManagerListerExpansion allows custom methods to be added to +// ServiceCatalogControllerManagerLister. +type ServiceCatalogControllerManagerListerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogapiserver.go b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogapiserver.go new file mode 100644 index 000000000000..16ee91f98483 --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogapiserver.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/operator/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceCatalogAPIServerLister helps list ServiceCatalogAPIServers. +type ServiceCatalogAPIServerLister interface { + // List lists all ServiceCatalogAPIServers in the indexer. + List(selector labels.Selector) (ret []*v1.ServiceCatalogAPIServer, err error) + // Get retrieves the ServiceCatalogAPIServer from the index for a given name. + Get(name string) (*v1.ServiceCatalogAPIServer, error) + ServiceCatalogAPIServerListerExpansion +} + +// serviceCatalogAPIServerLister implements the ServiceCatalogAPIServerLister interface. +type serviceCatalogAPIServerLister struct { + indexer cache.Indexer +} + +// NewServiceCatalogAPIServerLister returns a new ServiceCatalogAPIServerLister. +func NewServiceCatalogAPIServerLister(indexer cache.Indexer) ServiceCatalogAPIServerLister { + return &serviceCatalogAPIServerLister{indexer: indexer} +} + +// List lists all ServiceCatalogAPIServers in the indexer. +func (s *serviceCatalogAPIServerLister) List(selector labels.Selector) (ret []*v1.ServiceCatalogAPIServer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceCatalogAPIServer)) + }) + return ret, err +} + +// Get retrieves the ServiceCatalogAPIServer from the index for a given name. +func (s *serviceCatalogAPIServerLister) Get(name string) (*v1.ServiceCatalogAPIServer, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicecatalogapiserver"), name) + } + return obj.(*v1.ServiceCatalogAPIServer), nil +} diff --git a/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogcontrollermanager.go b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogcontrollermanager.go new file mode 100644 index 000000000000..2bd57da10396 --- /dev/null +++ b/vendor/github.com/openshift/client-go/operator/listers/operator/v1/servicecatalogcontrollermanager.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/operator/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceCatalogControllerManagerLister helps list ServiceCatalogControllerManagers. +type ServiceCatalogControllerManagerLister interface { + // List lists all ServiceCatalogControllerManagers in the indexer. + List(selector labels.Selector) (ret []*v1.ServiceCatalogControllerManager, err error) + // Get retrieves the ServiceCatalogControllerManager from the index for a given name. + Get(name string) (*v1.ServiceCatalogControllerManager, error) + ServiceCatalogControllerManagerListerExpansion +} + +// serviceCatalogControllerManagerLister implements the ServiceCatalogControllerManagerLister interface. +type serviceCatalogControllerManagerLister struct { + indexer cache.Indexer +} + +// NewServiceCatalogControllerManagerLister returns a new ServiceCatalogControllerManagerLister. +func NewServiceCatalogControllerManagerLister(indexer cache.Indexer) ServiceCatalogControllerManagerLister { + return &serviceCatalogControllerManagerLister{indexer: indexer} +} + +// List lists all ServiceCatalogControllerManagers in the indexer. +func (s *serviceCatalogControllerManagerLister) List(selector labels.Selector) (ret []*v1.ServiceCatalogControllerManager, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceCatalogControllerManager)) + }) + return ret, err +} + +// Get retrieves the ServiceCatalogControllerManager from the index for a given name. +func (s *serviceCatalogControllerManagerLister) Get(name string) (*v1.ServiceCatalogControllerManager, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicecatalogcontrollermanager"), name) + } + return obj.(*v1.ServiceCatalogControllerManager), nil +} diff --git a/vendor/github.com/openshift/library-go/glide.lock b/vendor/github.com/openshift/library-go/glide.lock index bdd0067d9373..38add7b3e822 100644 --- a/vendor/github.com/openshift/library-go/glide.lock +++ b/vendor/github.com/openshift/library-go/glide.lock @@ -1,5 +1,5 @@ -hash: c8161b3b35173fc68d50dcacf28ff2a5696159b2882ab6e47cbf28a65eaa214c -updated: 2019-01-28T11:14:07.854686283-05:00 +hash: 6dba1fdcbca5b8cd27ff1f69ce80ee41c2c60087cbf3407dc847ac49e4878614 +updated: 2019-02-18T14:37:18.970240624-05:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -151,6 +151,41 @@ imports: - ptypes/any - ptypes/duration - ptypes/timestamp +- name: github.com/gonum/blas + version: f22b278b28ac9805aadd613a754a60c35b24ae69 + subpackages: + - blas64 + - native + - native/internal/math32 +- name: github.com/gonum/floats + version: c233463c7e827fd71a8cdb62dfda0e98f7c39ad5 +- name: github.com/gonum/graph + version: 50b27dea7ebbfb052dfaf91681afc6fde28d8796 + subpackages: + - encoding/dot + - formats/dot + - formats/dot/ast + - formats/dot/internal/astx + - formats/dot/internal/errors + - formats/dot/internal/lexer + - formats/dot/internal/parser + - formats/dot/internal/token + - internal/ordered + - simple +- name: github.com/gonum/internal + version: f884aa71402950fb2796dbea0d5aa9ef9cfad8ca + subpackages: + - asm/f32 + - asm/f64 +- name: github.com/gonum/lapack + version: e4cdc5a0bff924bb10be88482e635bd40429f65e + subpackages: + - lapack64 + - native +- name: github.com/gonum/matrix + version: c518dec07be9a636c38a4650e217be059b5952ec + subpackages: + - mat64 - name: github.com/google/btree version: 7d79101e329e5a3adf994758c578dab82b90c017 - name: github.com/google/gofuzz @@ -196,7 +231,7 @@ imports: - name: github.com/NYTimes/gziphandler version: 56545f4a5d46df9a6648819d1664c3a03a13ffdb - name: github.com/openshift/api - version: 130a85ac529b6626098a97be326c244a6bf380b5 + version: af79befc50a8223c8122e9e654f65763dd17a87e subpackages: - apps - apps/v1 @@ -242,7 +277,7 @@ imports: - webconsole - webconsole/v1 - name: github.com/openshift/client-go - version: 1540772775fa910515f0ff094d83ef41735d470b + version: 31ef839c86359881d2c312c4f0131febc6662400 subpackages: - config/clientset/versioned - config/clientset/versioned/fake @@ -338,8 +373,12 @@ imports: version: f51c12702a4d776e4c1fa9b0fabab841babae631 subpackages: - rate +- name: golang.org/x/tools + version: 8dcb7bc8c7fe0a895995c76c721cef79419ac98a + subpackages: + - container/intsets - name: google.golang.org/appengine - version: 12d5545dc1cfa6047a286d5e853841b6471f4c19 + version: 54a98f90d1c46b7731eb8fb305d2a321c30ef610 subpackages: - internal - internal/base @@ -720,6 +759,7 @@ imports: - plugin/pkg/client/auth/exec - rest - rest/watch + - restmapper - testing - tools/auth - tools/cache @@ -760,6 +800,6 @@ imports: - pkg/util/proto testImports: - name: vbom.ml/util - version: db5cfe13f5cc80a4990d98e2e1b0707a4d1a5394 + version: efcd4e0f97874370259c7d93e12aad57911dea81 subpackages: - sortorder diff --git a/vendor/github.com/openshift/library-go/glide.yaml b/vendor/github.com/openshift/library-go/glide.yaml index c2d8c3b121ad..50c0548fccc8 100644 --- a/vendor/github.com/openshift/library-go/glide.yaml +++ b/vendor/github.com/openshift/library-go/glide.yaml @@ -44,3 +44,8 @@ import: version: b38d23b8782a487059e8fc8773e9a5b228a77cb6 - package: github.com/imdario/mergo version: 9316a62528ac99aaecb4e47eadd6dc8aa6533d58 + + +# matches openshift/origin +- package: github.com/gonum/graph + version: 50b27dea7ebbfb052dfaf91681afc6fde28d8796 diff --git a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller.go b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller.go index 7cf79c203516..1714658d6d98 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller.go @@ -11,8 +11,6 @@ import ( "github.com/imdario/mergo" "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/rand" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -80,7 +78,7 @@ func NewConfigObserver( // sync reacts to a change in prereqs by finding information that is required to match another value in the cluster. This // must be information that is logically "owned" by another component. func (c ConfigObserver) sync() error { - originalSpec, _, resourceVersion, err := c.operatorConfigClient.GetOperatorState() + originalSpec, _, _, err := c.operatorConfigClient.GetOperatorState() if err != nil { return err } @@ -120,34 +118,29 @@ func (c ConfigObserver) sync() error { } if !equality.Semantic.DeepEqual(existingConfig, mergedObservedConfig) { - glog.Infof("writing updated observedConfig: %v", diff.ObjectDiff(existingConfig, mergedObservedConfig)) - spec.ObservedConfig = runtime.RawExtension{Object: &unstructured.Unstructured{Object: mergedObservedConfig}} - _, resourceVersion, err = c.operatorConfigClient.UpdateOperatorSpec(resourceVersion, spec) - if err != nil { + c.eventRecorder.Eventf("ObservedConfigChanged", "Writing updated observed config: %v", diff.ObjectDiff(existingConfig, mergedObservedConfig)) + if _, _, err := v1helpers.UpdateSpec(c.operatorConfigClient, v1helpers.UpdateObservedConfigFn(mergedObservedConfig)); err != nil { errs = append(errs, fmt.Errorf("error writing updated observed config: %v", err)) c.eventRecorder.Warningf("ObservedConfigWriteError", "Failed to write observed config: %v", err) - } else { - c.eventRecorder.Eventf("ObservedConfigChanged", "Writing updated observed config") } } - err = v1helpers.NewMultiLineAggregate(errs) + configError := v1helpers.NewMultiLineAggregate(errs) // update failing condition cond := operatorv1.OperatorCondition{ Type: operatorStatusTypeConfigObservationFailing, Status: operatorv1.ConditionFalse, } - if err != nil { + if configError != nil { cond.Status = operatorv1.ConditionTrue cond.Reason = "Error" - cond.Message = err.Error() + cond.Message = configError.Error() } if _, _, updateError := v1helpers.UpdateStatus(c.operatorConfigClient, v1helpers.UpdateConditionFn(cond)); updateError != nil { return updateError } - // explicitly ignore errs, we are requeued by input changes anyway - return nil + return configError } func (c *ConfigObserver) Run(workers int, stopCh <-chan struct{}) { diff --git a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller_test.go b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller_test.go index cf60d7d4fde3..f84a3e5b2444 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller_test.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/config_observer_controller_test.go @@ -3,6 +3,7 @@ package configobserver import ( "fmt" "reflect" + "strings" "testing" "github.com/openshift/library-go/pkg/operator/resourcesynccontroller" @@ -129,7 +130,7 @@ func TestSyncStatus(t *testing.T) { }, }, - expectError: false, + expectError: true, expectedObservedConfig: &unstructured.Unstructured{Object: map[string]interface{}{ "foo": "one", "bar": "two", @@ -150,6 +151,7 @@ func TestSyncStatus(t *testing.T) { } }, expectEvents: [][]string{ + {"ObservedConfigChanged", "Writing updated observed config"}, {"ObservedConfigWriteError", "Failed to write observed config: update spec failure"}, }, observers: []ObserveConfigFunc{ @@ -158,7 +160,7 @@ func TestSyncStatus(t *testing.T) { }, }, - expectError: false, + expectError: true, expectedObservedConfig: nil, expectedCondition: &operatorv1.OperatorCondition{ Type: operatorStatusTypeConfigObservationFailing, @@ -186,7 +188,7 @@ func TestSyncStatus(t *testing.T) { }, }, - expectError: false, + expectError: true, expectedCondition: &operatorv1.OperatorCondition{ Type: operatorStatusTypeConfigObservationFailing, Status: operatorv1.ConditionTrue, @@ -211,7 +213,7 @@ func TestSyncStatus(t *testing.T) { if tc.expectError && err == nil { t.Fatal("error expected") } - if err != nil { + if !tc.expectError && err != nil { t.Fatal(err) } @@ -227,8 +229,8 @@ func TestSyncStatus(t *testing.T) { if observedEvents[i][0] != event[0] { t.Errorf("expected %d event reason to be %q, got %q", i, event[0], observedEvents[i][0]) } - if observedEvents[i][1] != event[1] { - t.Errorf("expected %d event message to be %q, got %q", i, event[0], observedEvents[i][0]) + if !strings.HasPrefix(observedEvents[i][1], event[1]) { + t.Errorf("expected %d event message to be %q, got %q", i, event[1], observedEvents[i][1]) } } if len(tc.expectEvents) != len(observedEvents) { diff --git a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_network.go b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_network.go index af15f8d7e7a2..5a3f937dd5b1 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_network.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_network.go @@ -3,110 +3,57 @@ package network import ( "fmt" - "github.com/ghodss/yaml" - "github.com/golang/glog" - + configv1 "github.com/openshift/api/config" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/client-go/listers/core/v1" "github.com/openshift/library-go/pkg/operator/events" ) -const ( - clusterConfigNamespace = "kube-system" - clusterConfigName = "cluster-config-v1" -) - -// GetClusterCIDRs reads the cluster CIDRs from the install-config ConfigMap in the cluster. -func GetClusterCIDRs(lister v1.ConfigMapLister, recorder events.Recorder) ([]string, error) { - clusterConfig, err := lister.ConfigMaps(clusterConfigNamespace).Get(clusterConfigName) +// GetClusterCIDRs reads the cluster CIDRs from the global network configuration resource. Emits events if CIDRs are not found. +func GetClusterCIDRs(lister configlistersv1.NetworkLister, recorder events.Recorder) ([]string, error) { + network, err := lister.Get("cluster") if errors.IsNotFound(err) { - recorder.Warningf("ObserveClusterCIDRFailed", "Required %s/%s config map not found", clusterConfigNamespace, clusterConfigName) - glog.Warning("configmap/cluster-config-v1.kube-system: not found") + recorder.Warningf("ObserveRestrictedCIDRFailed", "Required networks.%s/cluster not found", configv1.GroupName) return nil, nil } if err != nil { + recorder.Warningf("ObserveRestrictedCIDRFailed", "error getting networks.%s/cluster: %v", configv1.GroupName, err) return nil, err } - installConfigYaml, ok := clusterConfig.Data["install-config"] - if !ok { - glog.Warning("configmap/cluster-config-v1.kube-system: install-config not found") - recorder.Warningf("ObserveClusterCIDRFailed", "ConfigMap %s/%s does not have required 'install-config'", clusterConfigNamespace, clusterConfigName) - return nil, nil - } - installConfig := map[string]interface{}{} - err = yaml.Unmarshal([]byte(installConfigYaml), &installConfig) - if err != nil { - recorder.Warningf("ObserveRestrictedCIDRFailed", "Unable to decode install config: %v'", err) - return nil, fmt.Errorf("unable to parse install-config: %s", err) + if len(network.Status.ClusterNetwork) == 0 { + recorder.Warningf("ObserveClusterCIDRFailed", "Required status.clusterNetwork field is not set in networks.%s/cluster", configv1.GroupName) + return nil, fmt.Errorf("networks.%s/cluster: status.clusterNetwork not found", configv1.GroupName) } var clusterCIDRs []string - clusterNetworks, _, err := unstructured.NestedSlice(installConfig, "networking", "clusterNetworks") - if err != nil { - return nil, fmt.Errorf("unabled to parse install-config: %s", err) - } - for i, n := range clusterNetworks { - obj, ok := n.(map[string]interface{}) - if !ok { - recorder.Warningf("ObserveRestrictedCIDRFailed", "Required networking.clusterNetworks field is not set in install-config") - return nil, fmt.Errorf("unabled to parse install-config: expected networking.clusterNetworks[%d] to be an object, got: %#v", i, n) - } - cidr, _, err := unstructured.NestedString(obj, "cidr") - if err != nil { - return nil, fmt.Errorf("unabled to parse install-config: %v", err) + for i, clusterNetwork := range network.Status.ClusterNetwork { + if len(clusterNetwork.CIDR) == 0 { + recorder.Warningf("ObserveRestrictedCIDRFailed", "Required status.clusterNetwork[%d].cidr field is not set in networks.%s/cluster", i, configv1.GroupName) + return nil, fmt.Errorf("networks.%s/cluster: status.clusterNetwork[%d].cidr not found", configv1.GroupName, i) } - clusterCIDRs = append(clusterCIDRs, cidr) + clusterCIDRs = append(clusterCIDRs, clusterNetwork.CIDR) } - // fallback to podCIDR - if clusterNetworks == nil { - podCIDR, _, err := unstructured.NestedString(installConfig, "networking", "podCIDR") - if err != nil { - return nil, fmt.Errorf("unable to parse install-config: %v", err) - } - if len(podCIDR) == 0 { - return nil, fmt.Errorf("configmap/cluster-config-v1.kube-system: install-config.networking.clusterNetworks and install-config.networking.podCIDR not found") - } - clusterCIDRs = append(clusterCIDRs, podCIDR) - } - + // TODO fallback to podCIDR? is that still a thing? return clusterCIDRs, nil } -// GetServiceCIDR reads the service IP range from the install-config ConfigMap in the cluster. -func GetServiceCIDR(lister v1.ConfigMapLister, recorder events.Recorder) (string, error) { - clusterConfig, err := lister.ConfigMaps(clusterConfigNamespace).Get(clusterConfigName) +// GetServiceCIDR reads the service IP range from the global network configuration resource. Emits events if CIDRs are not found. +func GetServiceCIDR(lister configlistersv1.NetworkLister, recorder events.Recorder) (string, error) { + network, err := lister.Get("cluster") if errors.IsNotFound(err) { - glog.Warning("configmap/cluster-config-v1.kube-system: not found") - recorder.Warningf("ObserveServiceClusterIPRangesFailed", "Required %s/%s config map not found", clusterConfigNamespace, clusterConfigName) + recorder.Warningf("ObserveServiceClusterIPRangesFailed", "Required networks.%s/cluster not found", configv1.GroupName) return "", nil } if err != nil { + recorder.Warningf("ObserveServiceClusterIPRangesFailed", "error getting networks.%s/cluster: %v", configv1.GroupName, err) return "", err } - installConfigYaml, ok := clusterConfig.Data["install-config"] - if !ok { - glog.Warning("configmap/cluster-config-v1.kube-system: install-config not found") - recorder.Warningf("ObserveServiceClusterIPRangesFailed", "ConfigMap %s/%s does not have required 'install-config'", clusterConfigNamespace, clusterConfigName) - return "", nil - } - installConfig := map[string]interface{}{} - err = yaml.Unmarshal([]byte(installConfigYaml), &installConfig) - if err != nil { - return "", fmt.Errorf("unable to parse install-config: %v", err) - } - - serviceCIDR, _, err := unstructured.NestedString(installConfig, "networking", "serviceCIDR") - if err != nil { - return "", fmt.Errorf("unable to parse install-config: %v", err) + if len(network.Status.ServiceNetwork) == 0 || len(network.Status.ServiceNetwork[0]) == 0 { + recorder.Warningf("ObserveServiceClusterIPRangesFailed", "Required status.serviceNetwork field is not set in networks.%s/cluster", configv1.GroupName) + return "", fmt.Errorf("networks.%s/cluster: status.serviceNetwork not found", configv1.GroupName) } - if len(serviceCIDR) == 0 { - recorder.Warningf("ObserveServiceClusterIPRangesFailed", "Required networking.serviceCIDR field is not set in install-config") - return "", fmt.Errorf("configmap/cluster-config-v1.kube-system: install-config.networking.serviceCIDR not found") - } - - return serviceCIDR, nil + return network.Status.ServiceNetwork[0], nil } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_networking_test.go b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_networking_test.go index 23bea7cd8888..a36682700887 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_networking_test.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/configobserver/network/observe_networking_test.go @@ -6,73 +6,32 @@ import ( "github.com/ghodss/yaml" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - corelistersv1 "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" + configv1 "github.com/openshift/api/config/v1" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" + "github.com/openshift/library-go/pkg/operator/events" ) func TestObserveClusterCIDRs(t *testing.T) { type Test struct { name string - config *corev1.ConfigMap + config *configv1.Network expected []string expectedError bool } tests := []Test{ - { - "podCIDR, empty old config", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking:\n podCIDR: podCIDR", - }, - }, - []string{"podCIDR"}, - false, - }, - { - "podCIDR, existing config", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking:\n podCIDR: podCIDR", - }, - }, - []string{"podCIDR"}, - false, - }, { "clusterNetworks", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking:\n clusterNetworks:\n - cidr: podCIDR1\n - cidr: podCIDR2", - }, - }, - []string{"podCIDR1", "podCIDR2"}, - false, - }, - { - "both podCIDR and clusterNetworks", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking:\n clusterNetworks:\n - cidr: podCIDR1\n - cidr: podCIDR2\n podCIDR: podCIDR", + &configv1.Network{ + ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, + Status: configv1.NetworkStatus{ + ClusterNetwork: []configv1.ClusterNetworkEntry{ + {CIDR: "podCIDR1"}, + {CIDR: "podCIDR2"}, + }, }, }, []string{"podCIDR1", "podCIDR2"}, @@ -80,28 +39,18 @@ func TestObserveClusterCIDRs(t *testing.T) { }, { "none, no old config", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking: {}\n", - }, + &configv1.Network{ + ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, + Status: configv1.NetworkStatus{}, }, nil, true, }, { "none, existing config", - &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking: {}\n", - }, + &configv1.Network{ + ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, + Status: configv1.NetworkStatus{}, }, nil, true, @@ -113,7 +62,7 @@ func TestObserveClusterCIDRs(t *testing.T) { if err := indexer.Add(test.config); err != nil { t.Fatal(err.Error()) } - result, err := GetClusterCIDRs(corelistersv1.NewConfigMapLister(indexer), events.NewInMemoryRecorder("network")) + result, err := GetClusterCIDRs(configlistersv1.NewNetworkLister(indexer), events.NewInMemoryRecorder("network")) if err != nil && !test.expectedError { t.Fatal(err) } else if err == nil { @@ -130,18 +79,16 @@ func TestObserveClusterCIDRs(t *testing.T) { func TestObserveServiceClusterIPRanges(t *testing.T) { indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{}) - if err := indexer.Add(&corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-config-v1", - Namespace: "kube-system", - }, - Data: map[string]string{ - "install-config": "networking:\n serviceCIDR: serviceCIDR", + if err := indexer.Add(&configv1.Network{ + ObjectMeta: metav1.ObjectMeta{Name: "cluster"}, + Status: configv1.NetworkStatus{ + ServiceNetwork: []string{"serviceCIDR"}, }, - }); err != nil { + }, + ); err != nil { t.Fatal(err.Error()) } - result, err := GetServiceCIDR(corelistersv1.NewConfigMapLister(indexer), events.NewInMemoryRecorder("network")) + result, err := GetServiceCIDR(configlistersv1.NewNetworkLister(indexer), events.NewInMemoryRecorder("network")) if err != nil { t.Fatal(err) } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiextensions.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiextensions.go index 99fff2483199..875084fd964a 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiextensions.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiextensions.go @@ -1,6 +1,8 @@ package resourceapply import ( + "github.com/golang/glog" + apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" apiextclientv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -23,12 +25,18 @@ func ApplyCustomResourceDefinition(client apiextclientv1beta1.CustomResourceDefi } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureCustomResourceDefinition(modified, existing, *required) + existingCopy := existing.DeepCopy() + resourcemerge.EnsureCustomResourceDefinition(modified, existingCopy, *required) if !*modified { return existing, false, nil } - actual, err := client.CustomResourceDefinitions().Update(existing) + if glog.V(4) { + glog.Infof("CustomResourceDefinition %q changes: %s", existing.Name, JSONPatch(existing, existingCopy)) + } + + actual, err := client.CustomResourceDefinitions().Update(existingCopy) reportUpdateEvent(recorder, required, err) + return actual, true, err } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiregistration.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiregistration.go index 3e4c2f59a801..275f35b359be 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiregistration.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apiregistration.go @@ -1,6 +1,8 @@ package resourceapply import ( + "github.com/golang/glog" + "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -22,17 +24,22 @@ func ApplyAPIService(client apiregistrationv1client.APIServicesGetter, required } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - serviceSame := equality.Semantic.DeepEqual(existing.Spec.Service, required.Spec.Service) - prioritySame := existing.Spec.VersionPriority == required.Spec.VersionPriority && existing.Spec.GroupPriorityMinimum == required.Spec.GroupPriorityMinimum - insecureSame := existing.Spec.InsecureSkipTLSVerify == required.Spec.InsecureSkipTLSVerify + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + serviceSame := equality.Semantic.DeepEqual(existingCopy.Spec.Service, required.Spec.Service) + prioritySame := existingCopy.Spec.VersionPriority == required.Spec.VersionPriority && existingCopy.Spec.GroupPriorityMinimum == required.Spec.GroupPriorityMinimum + insecureSame := existingCopy.Spec.InsecureSkipTLSVerify == required.Spec.InsecureSkipTLSVerify // there was no change to metadata, the service and priorities were right if !*modified && serviceSame && prioritySame && insecureSame { - return existing, false, nil + return existingCopy, false, nil } - existing.Spec = required.Spec + existingCopy.Spec = required.Spec - actual, err := client.APIServices().Update(existing) + if glog.V(4) { + glog.Infof("APIService %q changes: %s", existing.Name, JSONPatch(existing, existingCopy)) + } + actual, err := client.APIServices().Update(existingCopy) return actual, true, err } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apps.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apps.go index 460ab6637f59..cc2a330f85c0 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apps.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/apps.go @@ -1,6 +1,8 @@ package resourceapply import ( + "github.com/golang/glog" + appsv1 "k8s.io/api/apps/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,14 +27,16 @@ func ApplyDeployment(client appsclientv1.DeploymentsGetter, recorder events.Reco } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) // there was no change to metadata, the generation was right, and we weren't asked for force the deployment - if !*modified && existing.ObjectMeta.Generation == expectedGeneration && !forceRollout { - return existing, false, nil + if !*modified && existingCopy.ObjectMeta.Generation == expectedGeneration && !forceRollout { + return existingCopy, false, nil } // at this point we know that we're going to perform a write. We're just trying to get the object correct - toWrite := existing // shallow copy so the code reads easier + toWrite := existingCopy // shallow copy so the code reads easier toWrite.Spec = *required.Spec.DeepCopy() if forceRollout { // forces a deployment @@ -47,6 +51,10 @@ func ApplyDeployment(client appsclientv1.DeploymentsGetter, recorder events.Reco toWrite.Spec.Template.Annotations["operator.openshift.io/force"] = forceString } + if glog.V(4) { + glog.Infof("Deployment %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, toWrite)) + } + actual, err := client.Deployments(required.Namespace).Update(toWrite) reportUpdateEvent(recorder, required, err) return actual, true, err @@ -65,14 +73,16 @@ func ApplyDaemonSet(client appsclientv1.DaemonSetsGetter, recorder events.Record } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) // there was no change to metadata, the generation was right, and we weren't asked for force the deployment - if !*modified && existing.ObjectMeta.Generation == expectedGeneration && !forceRollout { - return existing, false, nil + if !*modified && existingCopy.ObjectMeta.Generation == expectedGeneration && !forceRollout { + return existingCopy, false, nil } // at this point we know that we're going to perform a write. We're just trying to get the object correct - toWrite := existing // shallow copy so the code reads easier + toWrite := existingCopy // shallow copy so the code reads easier toWrite.Spec = *required.Spec.DeepCopy() if forceRollout { // forces a deployment @@ -87,6 +97,9 @@ func ApplyDaemonSet(client appsclientv1.DaemonSetsGetter, recorder events.Record toWrite.Spec.Template.Annotations["operator.openshift.io/force"] = forceString } + if glog.V(4) { + glog.Infof("DaemonSet %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, toWrite)) + } actual, err := client.DaemonSets(required.Namespace).Update(toWrite) reportUpdateEvent(recorder, required, err) return actual, true, err diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core.go index 9ea28ebd8b99..9df2bad78d6d 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core.go @@ -5,6 +5,8 @@ import ( "sort" "strings" + "github.com/golang/glog" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -28,12 +30,18 @@ func ApplyNamespace(client coreclientv1.NamespacesGetter, recorder events.Record } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) if !*modified { - return existing, false, nil + return existingCopy, false, nil } - actual, err := client.Namespaces().Update(existing) + if glog.V(4) { + glog.Infof("Namespace %q changes: %v", required.Name, JSONPatch(existing, existingCopy)) + } + + actual, err := client.Namespaces().Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -53,24 +61,30 @@ func ApplyService(client coreclientv1.ServicesGetter, recorder events.Recorder, } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - selectorSame := equality.Semantic.DeepEqual(existing.Spec.Selector, required.Spec.Selector) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + selectorSame := equality.Semantic.DeepEqual(existingCopy.Spec.Selector, required.Spec.Selector) typeSame := false requiredIsEmpty := len(required.Spec.Type) == 0 - existingIsCluster := existing.Spec.Type == corev1.ServiceTypeClusterIP - if (requiredIsEmpty && existingIsCluster) || equality.Semantic.DeepEqual(existing.Spec.Type, required.Spec.Type) { + existingCopyIsCluster := existingCopy.Spec.Type == corev1.ServiceTypeClusterIP + if (requiredIsEmpty && existingCopyIsCluster) || equality.Semantic.DeepEqual(existingCopy.Spec.Type, required.Spec.Type) { typeSame = true } if selectorSame && typeSame && !*modified { - return existing, false, nil + return existingCopy, false, nil } - existing.Spec.Selector = required.Spec.Selector - existing.Spec.Type = required.Spec.Type // if this is different, the update will fail. Status will indicate it. + existingCopy.Spec.Selector = required.Spec.Selector + existingCopy.Spec.Type = required.Spec.Type // if this is different, the update will fail. Status will indicate it. - actual, err := client.Services(required.Namespace).Update(existing) + if glog.V(4) { + glog.Infof("Service %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, required)) + } + + actual, err := client.Services(required.Namespace).Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -88,12 +102,18 @@ func ApplyPod(client coreclientv1.PodsGetter, recorder events.Recorder, required } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) if !*modified { - return existing, false, nil + return existingCopy, false, nil + } + + if glog.V(4) { + glog.Infof("Pod %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, required)) } - actual, err := client.Pods(required.Namespace).Update(existing) + actual, err := client.Pods(required.Namespace).Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -111,12 +131,16 @@ func ApplyServiceAccount(client coreclientv1.ServiceAccountsGetter, recorder eve } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) if !*modified { - return existing, false, nil + return existingCopy, false, nil } - - actual, err := client.ServiceAccounts(required.Namespace).Update(existing) + if glog.V(4) { + glog.Infof("ServiceAccount %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, required)) + } + actual, err := client.ServiceAccounts(required.Namespace).Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -134,33 +158,38 @@ func ApplyConfigMap(client coreclientv1.ConfigMapsGetter, recorder events.Record } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) var modifiedKeys []string - for existingKey, existingValue := range existing.Data { - if requiredValue, ok := required.Data[existingKey]; !ok || (existingValue != requiredValue) { - modifiedKeys = append(modifiedKeys, "data."+existingKey) + for existingCopyKey, existingCopyValue := range existingCopy.Data { + if requiredValue, ok := required.Data[existingCopyKey]; !ok || (existingCopyValue != requiredValue) { + modifiedKeys = append(modifiedKeys, "data."+existingCopyKey) } } for requiredKey := range required.Data { - if _, ok := existing.Data[requiredKey]; !ok { + if _, ok := existingCopy.Data[requiredKey]; !ok { modifiedKeys = append(modifiedKeys, "data."+requiredKey) } } dataSame := len(modifiedKeys) == 0 if dataSame && !*modified { - return existing, false, nil + return existingCopy, false, nil } - existing.Data = required.Data + existingCopy.Data = required.Data - actual, err := client.ConfigMaps(required.Namespace).Update(existing) + actual, err := client.ConfigMaps(required.Namespace).Update(existingCopy) var details string if !dataSame { sort.Sort(sort.StringSlice(modifiedKeys)) details = fmt.Sprintf("cause by changes in %v", strings.Join(modifiedKeys, ",")) } + if glog.V(4) { + glog.Infof("ConfigMap %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, required)) + } reportUpdateEvent(recorder, required, err, details) return actual, true, err } @@ -178,14 +207,20 @@ func ApplySecret(client coreclientv1.SecretsGetter, recorder events.Recorder, re } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - dataSame := equality.Semantic.DeepEqual(existing.Data, required.Data) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + dataSame := equality.Semantic.DeepEqual(existingCopy.Data, required.Data) if dataSame && !*modified { - return existing, false, nil + return existingCopy, false, nil + } + existingCopy.Data = required.Data + + if glog.V(4) { + glog.Infof("Secret %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, required)) } - existing.Data = required.Data + actual, err := client.Secrets(required.Namespace).Update(existingCopy) - actual, err := client.Secrets(required.Namespace).Update(existing) reportUpdateEvent(recorder, required, err) return actual, true, err } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core_test.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core_test.go index e3401d2b0aeb..7b520ca2fc8a 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core_test.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/core_test.go @@ -9,7 +9,6 @@ import ( "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/diff" "k8s.io/client-go/kubernetes/fake" clienttesting "k8s.io/client-go/testing" @@ -47,7 +46,7 @@ func TestApplyConfigMap(t *testing.T) { } actual := actions[1].(clienttesting.CreateAction).GetObject().(*corev1.ConfigMap) if !equality.Semantic.DeepEqual(expected, actual) { - t.Error(diff.ObjectDiff(expected, actual)) + t.Error(JSONPatch(expected, actual)) } }, }, @@ -99,7 +98,7 @@ func TestApplyConfigMap(t *testing.T) { } actual := actions[1].(clienttesting.UpdateAction).GetObject().(*corev1.ConfigMap) if !equality.Semantic.DeepEqual(expected, actual) { - t.Error(diff.ObjectDiff(expected, actual)) + t.Error(JSONPatch(expected, actual)) } }, }, @@ -136,7 +135,7 @@ func TestApplyConfigMap(t *testing.T) { } actual := actions[1].(clienttesting.UpdateAction).GetObject().(*corev1.ConfigMap) if !equality.Semantic.DeepEqual(expected, actual) { - t.Error(diff.ObjectDiff(expected, actual)) + t.Error(JSONPatch(expected, actual)) } }, }, diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/event_helpers.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/event_helpers.go index 33b4a7b7fef9..a6a451a27b72 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/event_helpers.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/event_helpers.go @@ -11,6 +11,7 @@ import ( kubescheme "k8s.io/client-go/kubernetes/scheme" openshiftapi "github.com/openshift/api" + "github.com/openshift/library-go/pkg/operator/events" ) diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/generic_test.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/generic_test.go index 4a73c57b578c..1a62aff68fa8 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/generic_test.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/generic_test.go @@ -3,10 +3,11 @@ package resourceapply import ( "testing" - "github.com/openshift/library-go/pkg/operator/events" + "github.com/davecgh/go-spew/spew" + "k8s.io/client-go/kubernetes/fake" - "github.com/davecgh/go-spew/spew" + "github.com/openshift/library-go/pkg/operator/events" ) func TestApplyDirectly(t *testing.T) { diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers.go new file mode 100644 index 000000000000..c5077f48e812 --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers.go @@ -0,0 +1,33 @@ +package resourceapply + +import ( + "fmt" + + patch "github.com/evanphx/json-patch" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" +) + +// JSONPatch generates a JSON patch between original and modified objects and return the JSON as a string. +// In case of error, the returned string will contain the error messages. +func JSONPatch(original, modified runtime.Object) string { + if original == nil { + return "original object is nil" + } + if modified == nil { + return "modified object is nil" + } + originalJSON, err := runtime.Encode(unstructured.UnstructuredJSONScheme, original) + if err != nil { + return fmt.Sprintf("unable to decode original to JSON: %v", err) + } + modifiedJSON, err := runtime.Encode(unstructured.UnstructuredJSONScheme, modified) + if err != nil { + return fmt.Sprintf("unable to decode modified to JSON: %v", err) + } + patchBytes, err := patch.CreateMergePatch(originalJSON, modifiedJSON) + if err != nil { + return fmt.Sprintf("unable to create JSON patch: %v", err) + } + return string(patchBytes) +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers_test.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers_test.go new file mode 100644 index 000000000000..8c76fe399bcc --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/json_patch_helpers_test.go @@ -0,0 +1,89 @@ +package resourceapply + +import ( + "testing" + + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +func TestJSONPatch(t *testing.T) { + tests := []struct { + name string + original runtime.Object + modified runtime.Object + expected string + }{ + { + name: "simple diff in pod", + original: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Annotations: map[string]string{"foo": "bar"}}, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + modified: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Annotations: map[string]string{"foo": "nobar"}}, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + expected: `{"metadata":{"annotations":{"foo":"nobar"}}}`, + }, + { + name: "removing annotation in pod", + original: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Annotations: map[string]string{"foo": "bar"}}, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + modified: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod"}, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + expected: `{"metadata":{"annotations":null}}`, + }, + { + name: "modified is nil", + original: &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "test-pod", Annotations: map[string]string{"foo": "bar"}}, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + expected: `modified object is nil`, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + if output := JSONPatch(test.original, test.modified); output != test.expected { + t.Errorf("returned string:\n%s\n\n does not match expected string:\n%s\n", output, test.expected) + } + }) + } +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/monitoring.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/monitoring.go index f90ece3a7510..9dae74c8e14a 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/monitoring.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/monitoring.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/ghodss/yaml" + "github.com/golang/glog" "github.com/imdario/mergo" "k8s.io/apimachinery/pkg/api/equality" @@ -75,7 +76,9 @@ func ApplyServiceMonitor(client dynamic.Interface, recorder events.Recorder, ser return true, nil } - updated, endpointsModified, err := ensureServiceMonitorSpec(required, existing) + existingCopy := existing.DeepCopy() + + updated, endpointsModified, err := ensureServiceMonitorSpec(required, existingCopy) if err != nil { return false, err } @@ -84,6 +87,10 @@ func ApplyServiceMonitor(client dynamic.Interface, recorder events.Recorder, ser return false, nil } + if glog.V(4) { + glog.Infof("ServiceMonitor %q changes: %v", namespace+"/"+required.GetName(), JSONPatch(existing, existingCopy)) + } + if _, err = client.Resource(serviceMonitorGVR).Namespace(namespace).Update(updated, metav1.UpdateOptions{}); err != nil { recorder.Warningf("ServiceMonitorUpdateFailed", "Failed to update ServiceMonitor.monitoring.coreos.com/v1: %v", err) return true, err diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/rbac.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/rbac.go index a840ef3bc176..4c6b744e0364 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/rbac.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/rbac.go @@ -3,6 +3,8 @@ package resourceapply import ( "fmt" + "github.com/golang/glog" + rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -30,15 +32,22 @@ func ApplyClusterRole(client rbacclientv1.ClusterRolesGetter, recorder events.Re } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - contentSame := equality.Semantic.DeepEqual(existing.Rules, required.Rules) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + contentSame := equality.Semantic.DeepEqual(existingCopy.Rules, required.Rules) if contentSame && !*modified { - return existing, false, nil + return existingCopy, false, nil + } + + existingCopy.Rules = required.Rules + existingCopy.AggregationRule = nil + + if glog.V(4) { + glog.Infof("ClusterRole %q changes: %v", required.Name, JSONPatch(existing, existingCopy)) } - existing.Rules = required.Rules - existing.AggregationRule = nil - actual, err := client.ClusterRoles().Update(existing) + actual, err := client.ClusterRoles().Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -57,16 +66,26 @@ func ApplyClusterRoleBinding(client rbacclientv1.ClusterRoleBindingsGetter, reco } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - contentSame := equality.Semantic.DeepEqual(existing.Subjects, required.Subjects) && - deepEqualRoleRef(existing.RoleRef, required.RoleRef) + existingCopy := existing.DeepCopy() + + // Enforce apiGroup field + existingCopy.RoleRef.APIGroup = rbacv1.GroupName + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + contentSame := equality.Semantic.DeepEqual(existingCopy.Subjects, required.Subjects) && + deepEqualRoleRef(existingCopy.RoleRef, required.RoleRef) if contentSame && !*modified { - return existing, false, nil + return existingCopy, false, nil + } + + existingCopy.Subjects = required.Subjects + existingCopy.RoleRef = required.RoleRef + + if glog.V(4) { + glog.Infof("ClusterRoleBinding %q changes: %v", required.Name, JSONPatch(existing, existingCopy)) } - existing.Subjects = required.Subjects - existing.RoleRef = required.RoleRef - actual, err := client.ClusterRoleBindings().Update(existing) + actual, err := client.ClusterRoleBindings().Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } @@ -84,13 +103,18 @@ func ApplyRole(client rbacclientv1.RolesGetter, recorder events.Recorder, requir } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - contentSame := equality.Semantic.DeepEqual(existing.Rules, required.Rules) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + contentSame := equality.Semantic.DeepEqual(existingCopy.Rules, required.Rules) if contentSame && !*modified { - return existing, false, nil + return existingCopy, false, nil } - existing.Rules = required.Rules + existingCopy.Rules = required.Rules + if glog.V(4) { + glog.Infof("Role %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, existingCopy)) + } actual, err := client.Roles(required.Namespace).Update(existing) reportUpdateEvent(recorder, required, err) return actual, true, err @@ -110,16 +134,23 @@ func ApplyRoleBinding(client rbacclientv1.RoleBindingsGetter, recorder events.Re } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - contentSame := equality.Semantic.DeepEqual(existing.Subjects, required.Subjects) && - deepEqualRoleRef(existing.RoleRef, required.RoleRef) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + contentSame := equality.Semantic.DeepEqual(existingCopy.Subjects, required.Subjects) && + deepEqualRoleRef(existingCopy.RoleRef, required.RoleRef) if contentSame && !*modified { - return existing, false, nil + return existingCopy, false, nil + } + + existingCopy.Subjects = required.Subjects + existingCopy.RoleRef = required.RoleRef + + if glog.V(4) { + glog.Infof("RoleBinding %q changes: %v", required.Namespace+"/"+required.Name, JSONPatch(existing, existingCopy)) } - existing.Subjects = required.Subjects - existing.RoleRef = required.RoleRef - actual, err := client.RoleBindings(required.Namespace).Update(existing) + actual, err := client.RoleBindings(required.Namespace).Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/storage.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/storage.go index 9188deadf25f..1ec4eb87ae46 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/storage.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/storage.go @@ -1,6 +1,8 @@ package resourceapply import ( + "github.com/golang/glog" + storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -25,18 +27,24 @@ func ApplyStorageClass(client storageclientv1.StorageClassesGetter, recorder eve } modified := resourcemerge.BoolPtr(false) - resourcemerge.EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) - contentSame := equality.Semantic.DeepEqual(existing, required) + existingCopy := existing.DeepCopy() + + resourcemerge.EnsureObjectMeta(modified, &existingCopy.ObjectMeta, required.ObjectMeta) + contentSame := equality.Semantic.DeepEqual(existingCopy, required) if contentSame && !*modified { - return existing, false, nil + return existingCopy, false, nil } - objectMeta := existing.ObjectMeta.DeepCopy() - existing = required.DeepCopy() - existing.ObjectMeta = *objectMeta + objectMeta := existingCopy.ObjectMeta.DeepCopy() + existingCopy = required.DeepCopy() + existingCopy.ObjectMeta = *objectMeta + + if glog.V(4) { + glog.Infof("StorageClass %q changes: %v", required.Name, JSONPatch(existing, existingCopy)) + } // TODO if provisioner, parameters, reclaimpolicy, or volumebindingmode are different, update will fail so delete and recreate - actual, err := client.StorageClasses().Update(existing) + actual, err := client.StorageClasses().Update(existingCopy) reportUpdateEvent(recorder, required, err) return actual, true, err } diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/coordinates.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/coordinates.go new file mode 100644 index 000000000000..50458f784ddc --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/coordinates.go @@ -0,0 +1,16 @@ +package resourcegraph + +type ResourceCoordinates struct { + Group string + Resource string + Namespace string + Name string +} + +func (c ResourceCoordinates) String() string { + resource := c.Resource + if len(c.Group) > 0 { + resource = resource + "." + c.Group + } + return resource + "/" + c.Name + "[" + c.Namespace + "]" +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/interface.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/interface.go new file mode 100644 index 000000000000..a7402b8169be --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/interface.go @@ -0,0 +1,62 @@ +package resourcegraph + +import ( + "fmt" + + "github.com/gonum/graph" +) + +func NewResources() Resources { + return &resourcesImpl{} +} + +func NewResource(coordinates ResourceCoordinates) Resource { + return &simpleSource{coordinates: coordinates} +} + +func NewConfigMap(namespace, name string) Resource { + return NewResource(NewCoordinates("", "configmaps", namespace, name)) +} + +func NewSecret(namespace, name string) Resource { + return NewResource(NewCoordinates("", "secrets", namespace, name)) +} + +func NewOperator(name string) Resource { + return NewResource(NewCoordinates("config.openshift.io", "clusteroperators", "", name)) +} + +func NewConfig(resource string) Resource { + return NewResource(NewCoordinates("config.openshift.io", resource, "", "cluster")) +} + +type Resource interface { + Add(resources Resources) Resource + From(Resource) Resource + Note(note string) Resource + + fmt.Stringer + GetNote() string + Coordinates() ResourceCoordinates + Sources() []Resource + Dump(indentDepth int) []string + DumpSources(indentDepth int) []string +} + +type Resources interface { + Add(resource Resource) + Dump() []string + AllResources() []Resource + Resource(coordinates ResourceCoordinates) Resource + Roots() []Resource + NewGraph() graph.Directed +} + +func NewCoordinates(group, resource, namespace, name string) ResourceCoordinates { + return ResourceCoordinates{ + Group: group, + Resource: resource, + Namespace: namespace, + Name: name, + } +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resource.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resource.go new file mode 100644 index 000000000000..e3668e76c564 --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resource.go @@ -0,0 +1,73 @@ +package resourcegraph + +import ( + "fmt" +) + +type simpleSource struct { + coordinates ResourceCoordinates + note string + nested []Resource + sources []Resource +} + +func (r *simpleSource) Coordinates() ResourceCoordinates { + return r.coordinates +} + +func (s *simpleSource) Add(resources Resources) Resource { + resources.Add(s) + return s +} + +func (s *simpleSource) From(source Resource) Resource { + s.sources = append(s.sources, source) + return s +} + +func (s *simpleSource) Note(note string) Resource { + s.note = note + return s +} + +func (s *simpleSource) String() string { + return fmt.Sprintf("%v%s", s.coordinates, s.note) +} + +func (s *simpleSource) GetNote() string { + return s.note +} + +func (s *simpleSource) Sources() []Resource { + return s.sources +} + +func (r *simpleSource) Dump(indentDepth int) []string { + lines := []string{} + lines = append(lines, indent(indentDepth, r.String())) + + for _, nested := range r.nested { + lines = append(lines, nested.Dump(indentDepth+1)...) + } + + return lines +} + +func (r *simpleSource) DumpSources(indentDepth int) []string { + lines := []string{} + lines = append(lines, indent(indentDepth, r.String())) + + for _, source := range r.sources { + lines = append(lines, source.DumpSources(indentDepth+1)...) + } + + return lines +} + +func indent(depth int, in string) string { + indent := "" + for i := 0; i < depth; i++ { + indent = indent + " " + } + return indent + in +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resources.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resources.go new file mode 100644 index 000000000000..482ea9b8d56e --- /dev/null +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourcegraph/resources.go @@ -0,0 +1,126 @@ +package resourcegraph + +import ( + "fmt" + "strings" + + "github.com/gonum/graph" + "github.com/gonum/graph/encoding/dot" + "github.com/gonum/graph/simple" +) + +type resourcesImpl struct { + resources []Resource +} + +func (r *resourcesImpl) Add(resource Resource) { + r.resources = append(r.resources, resource) +} + +func (r *resourcesImpl) Dump() []string { + lines := []string{} + for _, root := range r.Roots() { + lines = append(lines, root.Dump(0)...) + } + return lines +} + +func (r *resourcesImpl) AllResources() []Resource { + ret := []Resource{} + for _, v := range r.resources { + ret = append(ret, v) + } + return ret +} + +func (r *resourcesImpl) Resource(coordinates ResourceCoordinates) Resource { + for _, v := range r.resources { + if v.Coordinates() == coordinates { + return v + } + } + return nil +} + +func (r *resourcesImpl) Roots() []Resource { + ret := []Resource{} + for _, resource := range r.AllResources() { + if len(resource.Sources()) > 0 { + continue + } + ret = append(ret, resource) + } + return ret +} + +type resourceGraphNode struct { + simple.Node + Resource Resource +} + +// DOTAttributes implements an attribute getter for the DOT encoding +func (n resourceGraphNode) DOTAttributes() []dot.Attribute { + color := "white" + switch { + case n.Resource.Coordinates().Resource == "clusteroperators": + color = `"#c8fbcd"` // green + case n.Resource.Coordinates().Resource == "configmaps": + color = `"#bdebfd"` // blue + case n.Resource.Coordinates().Resource == "secrets": + color = `"#fffdb8"` // yellow + case n.Resource.Coordinates().Resource == "pods": + color = `"#ffbfb8"` // red + case n.Resource.Coordinates().Group == "config.openshift.io": + color = `"#c7bfff"` // purple + } + resource := n.Resource.Coordinates().Resource + if len(n.Resource.Coordinates().Group) > 0 { + resource = resource + "." + n.Resource.Coordinates().Group + } + label := fmt.Sprintf("%s\n%s\n%s\n%s", resource, n.Resource.Coordinates().Name, n.Resource.Coordinates().Namespace, n.Resource.GetNote()) + return []dot.Attribute{ + {Key: "label", Value: fmt.Sprintf("%q", label)}, + {Key: "style", Value: "filled"}, + {Key: "fillcolor", Value: color}, + } +} + +func (r *resourcesImpl) NewGraph() graph.Directed { + g := simple.NewDirectedGraph(1.0, 0.0) + + coordinatesToNode := map[ResourceCoordinates]graph.Node{} + idToCoordinates := map[int]ResourceCoordinates{} + + // make all nodes + allResources := r.AllResources() + for i := range allResources { + resource := allResources[i] + id := g.NewNodeID() + node := resourceGraphNode{Node: simple.Node(id), Resource: resource} + + coordinatesToNode[resource.Coordinates()] = node + idToCoordinates[id] = resource.Coordinates() + g.AddNode(node) + } + + // make all edges + for i := range allResources { + resource := allResources[i] + + for _, source := range resource.Sources() { + from := coordinatesToNode[source.Coordinates()] + to := coordinatesToNode[resource.Coordinates()] + g.SetEdge(simple.Edge{F: from, T: to}) + } + } + + return g +} + +// Quote takes an arbitrary DOT ID and escapes any quotes that is contains. +// The resulting string is quoted again to guarantee that it is a valid ID. +// DOT graph IDs can be any double-quoted string +// See http://www.graphviz.org/doc/info/lang.html +func Quote(id string) string { + return fmt.Sprintf(`"%s"`, strings.Replace(id, `"`, `\"`, -1)) +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/revision/revision_controller_test.go b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/revision/revision_controller_test.go index 996dcaa349b9..3b65872073c8 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/revision/revision_controller_test.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/revision/revision_controller_test.go @@ -166,7 +166,7 @@ func TestRevisionController(t *testing.T) { t.Errorf("expected config to have name 'test-config-1', got %q", config.Name) } if len(config.OwnerReferences) != 1 { - t.Errorf("expected config to have ownerreferences set, got %q", config.OwnerReferences) + t.Errorf("expected config to have ownerreferences set, got %+v", config.OwnerReferences) } secret, hasSecret := createdObjects[2].(*v1.Secret) if !hasSecret { @@ -177,7 +177,7 @@ func TestRevisionController(t *testing.T) { t.Errorf("expected secret to have name 'test-secret-1', got %q", secret.Name) } if len(secret.OwnerReferences) != 1 { - t.Errorf("expected secret to have ownerreferences set, got %q", secret.OwnerReferences) + t.Errorf("expected secret to have ownerreferences set, got %+v", secret.OwnerReferences) } }, }, diff --git a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/staticpodstate/staticpodstate_controller.go b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/staticpodstate/staticpodstate_controller.go index 7ff42d616d8e..89860b8446a5 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/staticpodstate/staticpodstate_controller.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controller/staticpodstate/staticpodstate_controller.go @@ -2,10 +2,14 @@ package staticpodstate import ( "fmt" + "strings" "time" "github.com/golang/glog" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" @@ -13,10 +17,8 @@ import ( "k8s.io/client-go/util/workqueue" operatorv1 "github.com/openshift/api/operator/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/openshift/library-go/pkg/operator/events" + "github.com/openshift/library-go/pkg/operator/status" "github.com/openshift/library-go/pkg/operator/v1helpers" ) @@ -28,10 +30,14 @@ var ( // StaticPodStateController is a controller that watches static pods and will produce a failing status if the //// static pods start crashing for some reason. type StaticPodStateController struct { - targetNamespace, staticPodName string + targetNamespace string + staticPodName string + operandName string operatorConfigClient v1helpers.StaticPodOperatorClient + configMapGetter corev1client.ConfigMapsGetter podsGetter corev1client.PodsGetter + versionRecorder status.VersionGetter eventRecorder events.Recorder // queue only ever has one item, but it has nice error handling backoff/retry semantics @@ -41,18 +47,23 @@ type StaticPodStateController struct { // NewStaticPodStateController creates a controller that watches static pods and will produce a failing status if the // static pods start crashing for some reason. func NewStaticPodStateController( - targetNamespace, staticPodName string, + targetNamespace, operandName, staticPodName string, kubeInformersForTargetNamespace informers.SharedInformerFactory, operatorConfigClient v1helpers.StaticPodOperatorClient, + configMapGetter corev1client.ConfigMapsGetter, podsGetter corev1client.PodsGetter, + versionRecorder status.VersionGetter, eventRecorder events.Recorder, ) *StaticPodStateController { c := &StaticPodStateController{ targetNamespace: targetNamespace, staticPodName: staticPodName, + operandName: operandName, operatorConfigClient: operatorConfigClient, + configMapGetter: configMapGetter, podsGetter: podsGetter, + versionRecorder: versionRecorder, eventRecorder: eventRecorder, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "StaticPodStateController"), @@ -79,35 +90,67 @@ func (c *StaticPodStateController) sync() error { } errs := []error{} + failingErrorCount := 0 + images := sets.NewString() for _, node := range originalOperatorStatus.NodeStatuses { pod, err := c.podsGetter.Pods(c.targetNamespace).Get(mirrorPodNameForNode(c.staticPodName, node.NodeName), metav1.GetOptions{}) if err != nil { errs = append(errs, err) + failingErrorCount++ + continue } + images.Insert(pod.Spec.Containers[0].Image) for _, containerStatus := range pod.Status.ContainerStatuses { if !containerStatus.Ready { + // When container is not ready, we can't determine whether the operator is failing or not and every container will become not + // ready when created, so do not blip the failing state for it. + // We will still reflect the container not ready state in error conditions, but we don't set the operator as failed. errs = append(errs, fmt.Errorf("nodes/%s pods/%s container=%q is not ready", node.NodeName, pod.Name, containerStatus.Name)) } if containerStatus.State.Waiting != nil { errs = append(errs, fmt.Errorf("nodes/%s pods/%s container=%q is waiting: %q - %q", node.NodeName, pod.Name, containerStatus.Name, containerStatus.State.Waiting.Reason, containerStatus.State.Waiting.Message)) + failingErrorCount++ } if containerStatus.State.Terminated != nil { + // Containers can be terminated gracefully to trigger certificate reload, do not report these as failures. errs = append(errs, fmt.Errorf("nodes/%s pods/%s container=%q is terminated: %q - %q", node.NodeName, pod.Name, containerStatus.Name, containerStatus.State.Terminated.Reason, containerStatus.State.Terminated.Message)) + // Only in case when the termination was caused by error. + if containerStatus.State.Terminated.ExitCode != 0 { + failingErrorCount++ + } + } } } + if len(images) == 0 { + c.eventRecorder.Warningf("MissingVersion", "no image found for operand pod") + } else if len(images) > 1 { + c.eventRecorder.Eventf("MultipleVersions", "multiple versions found, probably in transition: %v", strings.Join(images.List(), ",")) + } else { + c.versionRecorder.SetVersion( + c.operandName, + status.VersionForOperand(c.targetNamespace, images.List()[0], c.configMapGetter, c.eventRecorder), + ) + } + // update failing condition cond := operatorv1.OperatorCondition{ Type: staticPodStateControllerFailing, Status: operatorv1.ConditionFalse, } - if len(errs) > 0 { + // Failing errors + if failingErrorCount > 0 { cond.Status = operatorv1.ConditionTrue cond.Reason = "Error" cond.Message = v1helpers.NewMultiLineAggregate(errs).Error() } + // Not failing errors + if failingErrorCount == 0 && len(errs) > 0 { + cond.Reason = "Error" + cond.Message = v1helpers.NewMultiLineAggregate(errs).Error() + } if _, _, updateError := v1helpers.UpdateStaticPodStatus(c.operatorConfigClient, v1helpers.UpdateStaticPodConditionFn(cond), v1helpers.UpdateStaticPodConditionFn(cond)); updateError != nil { if err == nil { return updateError diff --git a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controllers.go b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controllers.go index b8a284eae491..2e01e2b7ba8d 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controllers.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/staticpod/controllers.go @@ -1,10 +1,13 @@ package staticpod import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/errors" + + "github.com/openshift/library-go/pkg/operator/status" "k8s.io/client-go/dynamic" - "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" - corev1client "k8s.io/client-go/kubernetes/typed/core/v1" "github.com/openshift/library-go/pkg/operator/events" "github.com/openshift/library-go/pkg/operator/staticpod/controller/backingresource" @@ -17,111 +20,220 @@ import ( "github.com/openshift/library-go/pkg/operator/v1helpers" ) -type staticPodOperatorControllers struct { - revisionController *revision.RevisionController - installerController *installer.InstallerController - staticPodStateController *staticpodstate.StaticPodStateController - pruneController *prune.PruneController - nodeController *node.NodeController - backingResourceController *backingresource.BackingResourceController - monitoringResourceController *monitoring.MonitoringResourceController +type staticPodOperatorControllerBuilder struct { + // clients and related + staticPodOperatorClient v1helpers.StaticPodOperatorClient + kubeClient kubernetes.Interface + kubeInformers v1helpers.KubeInformersForNamespaces + dynamicClient dynamic.Interface + eventRecorder events.Recorder + + // resource information + operandNamespace string + staticPodName string + revisionConfigMaps []revision.RevisionResource + revisionSecrets []revision.RevisionResource + + // versioner information + versionRecorder status.VersionGetter + operatorNamespace string + operandName string + + // installer information + installCommand []string + + // pruning information + pruneCommand []string + // TODO de-dupe this. I think it's actually a directory name + staticPodPrefix string } -// NewControllers provides all control loops needed to run a static pod based operator. That includes: -// 1. RevisionController - this watches multiple resources for "latest" input that has changed from the most current revision. -// When a change is found, it creates a new revision by copying resources and adding the revision suffix to the names -// to make a theoretically immutable set of revision data. It then bumps the latestRevision and starts watching again. -// 2. InstallerController - this watches the latestRevision and the list of kubeletStatus (alpha-sorted list). When a latestRevision -// appears that doesn't match the current latest for first kubeletStatus and the first kubeletStatus isn't already transitioning, -// it kicks off an installer pod. If the next kubeletStatus doesn't match the immediate prior one, it kicks off that transition. -// 3. NodeController - watches nodes for master nodes and keeps the operator status up to date -// 4. BackingResourceController - this creates the backing resources needed for the operand, such as cluster rolebindings and installer service -// account. -// 5. MonitoringResourceController - this creates the service monitor used by prometheus to scrape metrics. -func NewControllers( - targetNamespaceName, staticPodName, podResourcePrefix string, - installerCommand, prunerCommand []string, - revisionConfigMaps, revisionSecrets []revision.RevisionResource, +func NewBuilder( staticPodOperatorClient v1helpers.StaticPodOperatorClient, - configMapGetter corev1client.ConfigMapsGetter, - secretGetter corev1client.SecretsGetter, - podsGetter corev1client.PodsGetter, kubeClient kubernetes.Interface, - dynamicClient dynamic.Interface, - kubeInformersNamespaceScoped, kubeInformersClusterScoped informers.SharedInformerFactory, - eventRecorder events.Recorder) *staticPodOperatorControllers { - - controller := &staticPodOperatorControllers{} - - controller.revisionController = revision.NewRevisionController( - targetNamespaceName, - revisionConfigMaps, - revisionSecrets, - kubeInformersNamespaceScoped, - staticPodOperatorClient, - configMapGetter, - secretGetter, - eventRecorder, - ) + kubeInformers v1helpers.KubeInformersForNamespaces, +) Builder { + return &staticPodOperatorControllerBuilder{ + staticPodOperatorClient: staticPodOperatorClient, + kubeClient: kubeClient, + kubeInformers: kubeInformers, + } +} - controller.installerController = installer.NewInstallerController( - targetNamespaceName, - staticPodName, - revisionConfigMaps, - revisionSecrets, - installerCommand, - kubeInformersNamespaceScoped, - staticPodOperatorClient, - configMapGetter, - podsGetter, - eventRecorder, - ) +// Builder allows the caller to construct a set of static pod controllers in pieces +type Builder interface { + WithEvents(eventRecorder events.Recorder) Builder + WithServiceMonitor(dynamicClient dynamic.Interface) Builder + WithVersioning(operatorNamespace, operandName string, versionRecorder status.VersionGetter) Builder + WithResources(operandNamespace, staticPodName string, revisionConfigMaps, revisionSecrets []revision.RevisionResource) Builder + WithInstaller(command []string) Builder + WithPruning(command []string, staticPodPrefix string) Builder + ToControllers() (*staticPodOperatorControllers, error) +} - controller.staticPodStateController = staticpodstate.NewStaticPodStateController( - targetNamespaceName, - staticPodName, - kubeInformersNamespaceScoped, - staticPodOperatorClient, - podsGetter, - eventRecorder, - ) +func (b *staticPodOperatorControllerBuilder) WithEvents(eventRecorder events.Recorder) Builder { + b.eventRecorder = eventRecorder + return b +} - controller.pruneController = prune.NewPruneController( - targetNamespaceName, - podResourcePrefix, - prunerCommand, - configMapGetter, - secretGetter, - podsGetter, - staticPodOperatorClient, - eventRecorder, - ) +func (b *staticPodOperatorControllerBuilder) WithServiceMonitor(dynamicClient dynamic.Interface) Builder { + b.dynamicClient = dynamicClient + return b +} - controller.nodeController = node.NewNodeController( - staticPodOperatorClient, - kubeInformersClusterScoped, - eventRecorder, - ) +func (b *staticPodOperatorControllerBuilder) WithVersioning(operatorNamespace, operandName string, versionRecorder status.VersionGetter) Builder { + b.operatorNamespace = operatorNamespace + b.operandName = operandName + b.versionRecorder = versionRecorder + return b +} + +func (b *staticPodOperatorControllerBuilder) WithResources(operandNamespace, staticPodName string, revisionConfigMaps, revisionSecrets []revision.RevisionResource) Builder { + b.operandNamespace = operandNamespace + b.staticPodName = staticPodName + b.revisionConfigMaps = revisionConfigMaps + b.revisionSecrets = revisionSecrets + return b +} + +func (b *staticPodOperatorControllerBuilder) WithInstaller(command []string) Builder { + b.installCommand = command + return b +} + +func (b *staticPodOperatorControllerBuilder) WithPruning(command []string, staticPodPrefix string) Builder { + b.pruneCommand = command + b.staticPodPrefix = staticPodPrefix + return b +} - controller.backingResourceController = backingresource.NewBackingResourceController( - targetNamespaceName, - staticPodOperatorClient, - kubeInformersNamespaceScoped, - kubeClient, +func (b *staticPodOperatorControllerBuilder) ToControllers() (*staticPodOperatorControllers, error) { + controllers := &staticPodOperatorControllers{} + + eventRecorder := b.eventRecorder + if eventRecorder == nil { + eventRecorder = events.NewLoggingEventRecorder() + } + versionRecorder := b.versionRecorder + if versionRecorder == nil { + versionRecorder = status.NewVersionGetter() + } + configMapClient := v1helpers.CachedConfigMapGetter(b.kubeClient.CoreV1(), b.kubeInformers) + secretClient := v1helpers.CachedSecretGetter(b.kubeClient.CoreV1(), b.kubeInformers) + podClient := b.kubeClient.CoreV1() + operandInformers := b.kubeInformers.InformersFor(b.operandNamespace) + clusterInformers := b.kubeInformers.InformersFor("") + + if len(b.operandNamespace) > 0 { + controllers.revisionController = revision.NewRevisionController( + b.operandNamespace, + b.revisionConfigMaps, + b.revisionSecrets, + operandInformers, + b.staticPodOperatorClient, + configMapClient, + secretClient, + eventRecorder, + ) + } + + if len(b.installCommand) > 0 { + controllers.installerController = installer.NewInstallerController( + b.operandNamespace, + b.staticPodName, + b.revisionConfigMaps, + b.revisionSecrets, + b.installCommand, + operandInformers, + b.staticPodOperatorClient, + configMapClient, + podClient, + eventRecorder, + ) + } + + if len(b.operandName) > 0 { + // TODO add handling for operator configmap changes to get version-mapping changes + controllers.staticPodStateController = staticpodstate.NewStaticPodStateController( + b.operandNamespace, + b.operandName, + b.staticPodName, + operandInformers, + b.staticPodOperatorClient, + configMapClient, + podClient, + versionRecorder, + eventRecorder, + ) + } + + if len(b.pruneCommand) > 0 { + controllers.pruneController = prune.NewPruneController( + b.operandNamespace, + b.staticPodPrefix, + b.pruneCommand, + configMapClient, + secretClient, + podClient, + b.staticPodOperatorClient, + eventRecorder, + ) + } + + controllers.nodeController = node.NewNodeController( + b.staticPodOperatorClient, + clusterInformers, eventRecorder, ) - controller.monitoringResourceController = monitoring.NewMonitoringResourceController( - targetNamespaceName, - targetNamespaceName, - staticPodOperatorClient, - kubeInformersNamespaceScoped, - kubeClient, - dynamicClient, + controllers.backingResourceController = backingresource.NewBackingResourceController( + b.operandNamespace, + b.staticPodOperatorClient, + operandInformers, + b.kubeClient, eventRecorder, ) - return controller + if b.dynamicClient != nil { + controllers.monitoringResourceController = monitoring.NewMonitoringResourceController( + b.operandNamespace, + b.operandNamespace, + b.staticPodOperatorClient, + operandInformers, + b.kubeClient, + b.dynamicClient, + eventRecorder, + ) + } + + errs := []error{} + if controllers.revisionController == nil { + errs = append(errs, fmt.Errorf("missing revisionController; cannot proceed")) + } + if controllers.installerController == nil { + errs = append(errs, fmt.Errorf("missing installerController; cannot proceed")) + } + if controllers.staticPodStateController == nil { + eventRecorder.Warning("StaticPodStateControllerMissing", "not enough information provided, not all functionality is present") + } + if controllers.pruneController == nil { + eventRecorder.Warning("PruningControllerMissing", "not enough information provided, not all functionality is present") + } + if controllers.monitoringResourceController == nil { + eventRecorder.Warning("MonitoringResourceController", "not enough information provided, not all functionality is present") + } + + return controllers, errors.NewAggregate(errs) +} + +type staticPodOperatorControllers struct { + revisionController *revision.RevisionController + installerController *installer.InstallerController + staticPodStateController *staticpodstate.StaticPodStateController + pruneController *prune.PruneController + nodeController *node.NodeController + backingResourceController *backingresource.BackingResourceController + monitoringResourceController *monitoring.MonitoringResourceController } func (o *staticPodOperatorControllers) WithInstallerPodMutationFn(installerPodMutationFn installer.InstallerPodMutationFunc) *staticPodOperatorControllers { diff --git a/vendor/github.com/openshift/library-go/pkg/operator/status/status_controller.go b/vendor/github.com/openshift/library-go/pkg/operator/status/status_controller.go index dd2e899b1830..25331dfd8468 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/status/status_controller.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/status/status_controller.go @@ -10,9 +10,6 @@ import ( "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/diff" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" @@ -23,6 +20,7 @@ import ( configv1client "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" configv1helpers "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers" "github.com/openshift/library-go/pkg/operator/events" + "github.com/openshift/library-go/pkg/operator/resource/resourceapply" operatorv1helpers "github.com/openshift/library-go/pkg/operator/v1helpers" ) @@ -163,9 +161,8 @@ func (c StatusSyncer) sync() error { if equality.Semantic.DeepEqual(clusterOperatorObj, originalClusterOperatorObj) { return nil } - originalJSON := runtime.EncodeOrDie(unstructured.UnstructuredJSONScheme, originalClusterOperatorObj) - newJSON := runtime.EncodeOrDie(unstructured.UnstructuredJSONScheme, clusterOperatorObj) - glog.V(2).Infof("clusteroperator/%s diff %v", c.clusterOperatorName, diff.StringDiff(originalJSON, newJSON)) + + glog.V(2).Infof("clusteroperator/%s diff %v", c.clusterOperatorName, resourceapply.JSONPatch(originalClusterOperatorObj, clusterOperatorObj)) if len(clusterOperatorObj.ResourceVersion) != 0 { if _, updateErr := c.clusterOperatorClient.ClusterOperators().UpdateStatus(clusterOperatorObj); err != nil { diff --git a/vendor/github.com/openshift/library-go/pkg/operator/status/version.go b/vendor/github.com/openshift/library-go/pkg/operator/status/version.go index 232be347c9e3..92c61eae813b 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/status/version.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/status/version.go @@ -1,6 +1,14 @@ package status -import "sync" +import ( + "sync" + + corev1client "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/openshift/library-go/pkg/operator/events" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) type versionGetter struct { lock sync.Mutex @@ -48,3 +56,21 @@ func (v *versionGetter) VersionChangedChannel() <-chan struct{} { v.notificationChannels = append(v.notificationChannels, channel) return channel } + +func VersionForOperand(namespace, imagePullSpec string, configMapGetter corev1client.ConfigMapsGetter, eventRecorder events.Recorder) string { + versionMap := map[string]string{} + versionMapping, err := configMapGetter.ConfigMaps(namespace).Get("version-mapping", metav1.GetOptions{}) + if err != nil && !apierrors.IsNotFound(err) { + eventRecorder.Warningf("VersionMappingFailure", "unable to get version mapping: %v", err) + return "" + } + if versionMapping != nil { + for version, image := range versionMapping.Data { + versionMap[image] = version + } + } + + // we have the actual daemonset and we need the pull spec + operandVersion := versionMap[imagePullSpec] + return operandVersion +} diff --git a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/helpers.go b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/helpers.go index c0a0641645cc..2755b640c096 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/helpers.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/v1helpers/helpers.go @@ -133,6 +133,46 @@ func EnsureOperatorConfigExists(client dynamic.Interface, operatorConfigBytes [] } } +// UpdateOperatorSpecFunc is a func that mutates an operator spec. +type UpdateOperatorSpecFunc func(spec *operatorv1.OperatorSpec) error + +// UpdateSpec applies the update funcs to the oldStatus and tries to update via the client. +func UpdateSpec(client OperatorClient, updateFuncs ...UpdateOperatorSpecFunc) (*operatorv1.OperatorSpec, bool, error) { + updated := false + var operatorSpec *operatorv1.OperatorSpec + err := retry.RetryOnConflict(retry.DefaultBackoff, func() error { + oldSpec, _, resourceVersion, err := client.GetOperatorState() + if err != nil { + return err + } + + newSpec := oldSpec.DeepCopy() + for _, update := range updateFuncs { + if err := update(newSpec); err != nil { + return err + } + } + + if equality.Semantic.DeepEqual(oldSpec, newSpec) { + return nil + } + + operatorSpec, _, err = client.UpdateOperatorSpec(resourceVersion, newSpec) + updated = err == nil + return err + }) + + return operatorSpec, updated, err +} + +// UpdateSpecConfigFn returns a func to update the config. +func UpdateObservedConfigFn(config map[string]interface{}) UpdateOperatorSpecFunc { + return func(oldSpec *operatorv1.OperatorSpec) error { + oldSpec.ObservedConfig = runtime.RawExtension{Object: &unstructured.Unstructured{Object: config}} + return nil + } +} + // UpdateStatusFunc is a func that mutates an operator status. type UpdateStatusFunc func(status *operatorv1.OperatorStatus) error @@ -194,6 +234,8 @@ func UpdateStaticPodStatus(client StaticPodOperatorClient, updateFuncs ...Update } if equality.Semantic.DeepEqual(oldStatus, newStatus) { + // We return the newStatus which is a deep copy of oldStatus but with all update funcs applied. + updatedOperatorStatus = newStatus return nil } diff --git a/vendor/k8s.io/component-base/CONTRIBUTING.md b/vendor/k8s.io/component-base/CONTRIBUTING.md index 3b98c63f6b7a..f54b9e7ee3fa 100644 --- a/vendor/k8s.io/component-base/CONTRIBUTING.md +++ b/vendor/k8s.io/component-base/CONTRIBUTING.md @@ -4,4 +4,4 @@ Do not open pull requests directly against this repository, they will be ignored This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/component-base](https://git.k8s.io/kubernetes/staging/src/k8s.io/component-base) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/staging.md) for more information +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information diff --git a/vendor/k8s.io/component-base/Godeps/Godeps.json b/vendor/k8s.io/component-base/Godeps/Godeps.json index 591c923a32ff..a919804ebda8 100644 --- a/vendor/k8s.io/component-base/Godeps/Godeps.json +++ b/vendor/k8s.io/component-base/Godeps/Godeps.json @@ -60,91 +60,91 @@ }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "bf20fabcb82547b660b8acad8292e96710f4e1bb" + "Rev": "f05b8decd79cf55449e1e5b2cc9f14496ba6b942" }, { "ImportPath": "k8s.io/klog",