From 99ec5f7ce1c53beccc5f1d6a1760588fa9e7a56b Mon Sep 17 00:00:00 2001 From: Tobias Schug <4014687+HappyTobi@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:32:54 +0200 Subject: [PATCH 01/24] FIX csi driver update for VMSS Flex (#366) * FIX csi driver update for VMSS Flex * FIX set zoned cluster for test * Update rename test cases --- charts/images.yaml | 2 +- .../templates/_deployment.tpl | 5 +++ pkg/controller/controlplane/valuesprovider.go | 21 +++++++-- .../controlplane/valuesprovider_test.go | 43 ++++++++++++++++++- 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/charts/images.yaml b/charts/images.yaml index f8a805723..2dcca6f4e 100644 --- a/charts/images.yaml +++ b/charts/images.yaml @@ -49,7 +49,7 @@ images: - name: csi-driver-disk sourceRepository: github.com/kubernetes-sigs/azuredisk-csi-driver repository: mcr.microsoft.com/k8s/csi/azuredisk-csi - tag: "v1.2.0" + tag: "v1.6.0" - name: csi-driver-file sourceRepository: github.com/kubernetes-sigs/azurefile-csi-driver repository: mcr.microsoft.com/k8s/csi/azurefile-csi diff --git a/charts/internal/seed-controlplane/charts/csi-driver-controller/templates/_deployment.tpl b/charts/internal/seed-controlplane/charts/csi-driver-controller/templates/_deployment.tpl index ed579fc54..fe2ce0569 100644 --- a/charts/internal/seed-controlplane/charts/csi-driver-controller/templates/_deployment.tpl +++ b/charts/internal/seed-controlplane/charts/csi-driver-controller/templates/_deployment.tpl @@ -44,6 +44,11 @@ spec: - --endpoint=$(CSI_ENDPOINT) {{- if eq .role "disk" }} - --kubeconfig=/var/lib/csi-driver-controller-disk/kubeconfig + {{- if hasKey .Values "vmType" }} + {{- if eq .Values.vmType "vmss" }} + - --disable-avset-nodes=false + {{- end }} + {{- end }} {{- end }} {{- if eq .role "file" }} - --nodeid=dummy diff --git a/pkg/controller/controlplane/valuesprovider.go b/pkg/controller/controlplane/valuesprovider.go index 75f385956..42e9817fa 100644 --- a/pkg/controller/controlplane/valuesprovider.go +++ b/pkg/controller/controlplane/valuesprovider.go @@ -437,7 +437,12 @@ func (vp *valuesProvider) GetControlPlaneChartValues( } checksums[azure.CloudProviderConfigName] = utils.ComputeChecksum(cpConfigSecret.Data) - return getControlPlaneChartValues(cpConfig, cp, cluster, checksums, scaledDown) + infraStatus := &apisazure.InfrastructureStatus{} + if _, _, err := vp.Decoder().Decode(cp.Spec.InfrastructureProviderStatus.Raw, nil, infraStatus); err != nil { + return nil, fmt.Errorf("could not decode infrastructureProviderStatus of controlplane '%s': %w", kutil.ObjectName(cp), err) + } + + return getControlPlaneChartValues(cpConfig, cp, cluster, checksums, scaledDown, infraStatus) } // GetControlPlaneShootChartValues returns the values for the control plane shoot chart applied by the generic actuator. @@ -597,13 +602,14 @@ func getControlPlaneChartValues( cluster *extensionscontroller.Cluster, checksums map[string]string, scaledDown bool, + infraStatus *apisazure.InfrastructureStatus, ) (map[string]interface{}, error) { ccm, err := getCCMChartValues(cpConfig, cp, cluster, checksums, scaledDown) if err != nil { return nil, err } - csi, err := getCSIControllerChartValues(cluster, checksums, scaledDown) + csi, err := getCSIControllerChartValues(cluster, checksums, scaledDown, infraStatus) if err != nil { return nil, err } @@ -663,6 +669,7 @@ func getCSIControllerChartValues( cluster *extensionscontroller.Cluster, checksums map[string]string, scaledDown bool, + infraStatus *apisazure.InfrastructureStatus, ) (map[string]interface{}, error) { k8sVersionLessThan121, err := version.CompareVersions(cluster.Shoot.Spec.Kubernetes.Version, "<", "1.21") if err != nil { @@ -673,7 +680,7 @@ func getCSIControllerChartValues( return map[string]interface{}{"enabled": false}, nil } - return map[string]interface{}{ + values := map[string]interface{}{ "enabled": true, "replicas": extensionscontroller.GetControlPlaneReplicas(cluster, scaledDown, 1), "podAnnotations": map[string]interface{}{ @@ -691,7 +698,13 @@ func getCSIControllerChartValues( "checksum/secret-" + azure.CSISnapshotControllerName: checksums[azure.CSISnapshotControllerName], }, }, - }, nil + } + + if azureapihelper.IsVmoRequired(infraStatus) { + values["vmType"] = "vmss" + } + + return values, nil } // getRemedyControllerChartValues collects and returns the remedy controller chart values. diff --git a/pkg/controller/controlplane/valuesprovider_test.go b/pkg/controller/controlplane/valuesprovider_test.go index 2ec79f02f..7165a9126 100644 --- a/pkg/controller/controlplane/valuesprovider_test.go +++ b/pkg/controller/controlplane/valuesprovider_test.go @@ -378,8 +378,49 @@ var _ = Describe("ValuesProvider", func() { })) }) - It("should return correct control plane chart values (k8s >= 1.21)", func() { + It("should return correct control plane chart values (k8s >= 1.21) without zoned infrastructure", func() { cluster = generateCluster(cidr, k8sVersionHigherEqual121, true, nil) + infrastructureStatus.Zoned = false + cp := generateControlPlane(controlPlaneConfig, infrastructureStatus) + + values, err := vp.GetControlPlaneChartValues(ctx, cp, cluster, checksums, false) + Expect(err).NotTo(HaveOccurred()) + Expect(values).To(Equal(map[string]interface{}{ + azure.CloudControllerManagerName: utils.MergeMaps(ccmChartValues, map[string]interface{}{ + "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version, + }), + azure.CSIControllerName: utils.MergeMaps(enabledTrue, map[string]interface{}{ + "replicas": 1, + "podAnnotations": map[string]interface{}{ + "checksum/secret-" + azure.CSIControllerDiskName: checksums[azure.CSIControllerDiskName], + "checksum/secret-" + azure.CSIControllerFileName: checksums[azure.CSIControllerFileName], + "checksum/secret-" + azure.CSIProvisionerName: checksums[azure.CSIProvisionerName], + "checksum/secret-" + azure.CSIAttacherName: checksums[azure.CSIAttacherName], + "checksum/secret-" + azure.CSISnapshotterName: checksums[azure.CSISnapshotterName], + "checksum/secret-" + azure.CSIResizerName: checksums[azure.CSIResizerName], + "checksum/secret-" + azure.CloudProviderConfigName: checksums[azure.CloudProviderConfigName], + }, + "csiSnapshotController": map[string]interface{}{ + "replicas": 1, + "podAnnotations": map[string]interface{}{ + "checksum/secret-" + azure.CSISnapshotControllerName: checksums[azure.CSISnapshotControllerName], + }, + }, + "vmType": "vmss", + }), + azure.RemedyControllerName: utils.MergeMaps(enabledTrue, map[string]interface{}{ + "replicas": 1, + "podAnnotations": map[string]interface{}{ + "checksum/secret-" + azure.RemedyControllerName: checksums[azure.RemedyControllerName], + "checksum/secret-" + azure.CloudProviderConfigName: checksums[azure.CloudProviderConfigName], + }, + }), + })) + }) + + It("should return correct control plane chart values (k8s >= 1.21) with zoned infrastructure", func() { + cluster = generateCluster(cidr, k8sVersionHigherEqual121, true, nil) + infrastructureStatus.Zoned = true cp := generateControlPlane(controlPlaneConfig, infrastructureStatus) values, err := vp.GetControlPlaneChartValues(ctx, cp, cluster, checksums, false) From b9afdb46128608cff02ad1c7a0fadb797863bced Mon Sep 17 00:00:00 2001 From: Stoyan Rachev Date: Thu, 9 Sep 2021 15:41:29 +0300 Subject: [PATCH 02/24] Vendor gardener/gardener@v1.31.0 (#371) --- go.mod | 2 +- go.sum | 4 +- .../gardener/gardener/charts/images.yaml | 17 +- .../pkg/controller/backupbucket/mapper.go | 13 +- .../pkg/controller/backupentry/controller.go | 4 +- .../pkg/controller/backupentry/mapper.go | 42 +- .../pkg/controller/backupentry/reconciler.go | 10 +- .../controlplane/genericactuator/actuator.go | 9 +- .../pkg/controller/controlplane/reconciler.go | 10 +- .../pkg/controller/dnsrecord/reconciler.go | 10 +- .../controller/infrastructure/reconciler.go | 10 +- .../genericactuator/actuator_restore.go | 5 +- .../pkg/controller/worker/mapper.go | 6 +- .../pkg/controller/worker/reconciler.go | 10 +- .../extensions/pkg/terraformer/state.go | 6 +- .../gardener/gardener/hack/update-codegen.sh | 8 +- .../gardener/pkg/apis/authentication/doc.go | 21 - .../pkg/apis/authentication/register.go | 53 - .../types_adminkubeconfigrequest.go | 54 - .../apis/authentication/v1alpha1/defaults.go | 32 - .../pkg/apis/authentication/v1alpha1/doc.go | 28 - .../authentication/v1alpha1/generated.pb.go | 813 -------- .../authentication/v1alpha1/generated.proto | 62 - .../apis/authentication/v1alpha1/register.go | 53 - .../v1alpha1/types_adminkubeconfigrequest.go | 55 - .../v1alpha1/zz_generated.conversion.go | 148 -- .../v1alpha1/zz_generated.deepcopy.go | 96 - .../v1alpha1/zz_generated.defaults.go | 37 - .../authentication/zz_generated.deepcopy.go | 91 - .../gardener/pkg/apis/core/install/install.go | 9 + .../core/v1beta1/constants/types_constants.go | 2 + .../pkg/apis/core/v1beta1/helper/errors.go | 2 +- .../pkg/apis/core/v1beta1/helper/helper.go | 2 + .../pkg/apis/operations/install/install.go | 39 + .../apis/seedmanagement/install/install.go | 39 + .../apis/seedmanagement/types_managedseed.go | 2 +- .../v1alpha1/defaults_managedseed.go | 2 +- .../seedmanagement/v1alpha1/generated.proto | 2 +- .../v1alpha1/types_managedseed.go | 2 +- .../pkg/apis/settings/install/install.go | 39 + .../core/clientset/versioned/clientset.go | 111 -- .../client/core/clientset/versioned/doc.go | 20 - .../core/clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 58 - .../typed/core/v1alpha1/backupbucket.go | 184 -- .../typed/core/v1alpha1/backupentry.go | 195 -- .../typed/core/v1alpha1/cloudprofile.go | 168 -- .../core/v1alpha1/controllerdeployment.go | 168 -- .../core/v1alpha1/controllerinstallation.go | 184 -- .../core/v1alpha1/controllerregistration.go | 168 -- .../typed/core/v1alpha1/core_client.go | 159 -- .../versioned/typed/core/v1alpha1/doc.go | 20 - .../typed/core/v1alpha1/exposureclass.go | 168 -- .../core/v1alpha1/generated_expansion.go | 49 - .../versioned/typed/core/v1alpha1/plant.go | 195 -- .../versioned/typed/core/v1alpha1/project.go | 184 -- .../versioned/typed/core/v1alpha1/quota.go | 178 -- .../typed/core/v1alpha1/secretbinding.go | 178 -- .../versioned/typed/core/v1alpha1/seed.go | 184 -- .../versioned/typed/core/v1alpha1/shoot.go | 213 -- .../core/v1alpha1/shootextensionstatus.go | 178 -- .../typed/core/v1alpha1/shootstate.go | 178 -- .../typed/core/v1beta1/backupbucket.go | 184 -- .../typed/core/v1beta1/backupentry.go | 195 -- .../typed/core/v1beta1/cloudprofile.go | 168 -- .../core/v1beta1/controllerdeployment.go | 168 -- .../core/v1beta1/controllerinstallation.go | 184 -- .../core/v1beta1/controllerregistration.go | 168 -- .../typed/core/v1beta1/core_client.go | 144 -- .../versioned/typed/core/v1beta1/doc.go | 20 - .../typed/core/v1beta1/generated_expansion.go | 43 - .../versioned/typed/core/v1beta1/plant.go | 195 -- .../versioned/typed/core/v1beta1/project.go | 184 -- .../versioned/typed/core/v1beta1/quota.go | 178 -- .../typed/core/v1beta1/secretbinding.go | 178 -- .../versioned/typed/core/v1beta1/seed.go | 184 -- .../versioned/typed/core/v1beta1/shoot.go | 213 -- .../clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 56 - .../gardener/pkg/client/kubernetes/client.go | 49 +- .../pkg/client/kubernetes/clientset.go | 37 +- .../pkg/client/kubernetes/mock/mocks.go | 90 - .../gardener/pkg/client/kubernetes/pods.go | 11 - .../gardener/pkg/client/kubernetes/types.go | 61 +- .../clientset/versioned/clientset.go | 97 - .../operations/clientset/versioned/doc.go | 20 - .../clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 56 - .../typed/operations/v1alpha1/bastion.go | 195 -- .../typed/operations/v1alpha1/doc.go | 20 - .../v1alpha1/generated_expansion.go | 21 - .../operations/v1alpha1/operations_client.go | 89 - .../clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 56 - .../gardener/pkg/features/features.go | 5 + .../pkg/gardenlet/apis/config/types.go | 2 + .../apis/config/v1alpha1/defaults.go | 2 + .../gardenlet/apis/config/v1alpha1/types.go | 2 + .../v1alpha1/zz_generated.conversion.go | 6 + .../config/v1alpha1/zz_generated.deepcopy.go | 1 + .../apis/config/zz_generated.deepcopy.go | 1 + .../component/kubescheduler/kube_scheduler.go | 3 +- .../pkg/scheduler/apis/config/types.go | 2 + .../scheduler/apis/config/v1alpha1/types.go | 2 + .../v1alpha1/zz_generated.conversion.go | 6 + .../config/v1alpha1/zz_generated.deepcopy.go | 1 + .../apis/config/zz_generated.deepcopy.go | 1 + .../pkg/utils/kubernetes/managedseed.go | 18 + .../test/framework/gardenerframework.go | 4 +- .../test/framework/shootcreationframework.go | 8 +- .../gardener/test/framework/shootframework.go | 21 +- .../test/framework/shootmigrationtest.go | 18 +- .../gardener/test/framework/template.go | 6 +- .../clientset/clientset.go | 111 -- .../clientset_generated/clientset/doc.go | 20 - .../v1/apiregistration_client.go | 89 - .../typed/apiregistration/v1/apiservice.go | 184 -- .../clientset/typed/apiregistration/v1/doc.go | 20 - .../apiregistration/v1/generated_expansion.go | 21 - .../v1beta1/apiregistration_client.go | 89 - .../apiregistration/v1beta1/apiservice.go | 184 -- .../typed/apiregistration/v1beta1/doc.go | 20 - .../v1beta1/generated_expansion.go | 21 - .../metrics/pkg/apis/metrics/v1alpha1/doc.go | 24 - .../pkg/apis/metrics/v1alpha1/generated.pb.go | 1758 ----------------- .../pkg/apis/metrics/v1alpha1/generated.proto | 89 - .../pkg/apis/metrics/v1alpha1/register.go | 53 - .../pkg/apis/metrics/v1alpha1/types.go | 95 - .../v1alpha1/zz_generated.conversion.go | 208 -- .../metrics/v1alpha1/zz_generated.deepcopy.go | 185 -- .../client/clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 58 - vendor/modules.txt | 21 +- 133 files changed, 363 insertions(+), 11349 deletions(-) delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/register.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/types_adminkubeconfigrequest.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/defaults.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.pb.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/register.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/types_adminkubeconfigrequest.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.conversion.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.defaults.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/apis/authentication/zz_generated.deepcopy.go create mode 100644 vendor/github.com/gardener/gardener/pkg/apis/operations/install/install.go create mode 100644 vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/install/install.go create mode 100644 vendor/github.com/gardener/gardener/pkg/apis/settings/install/install.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/clientset.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/register.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupbucket.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupentry.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/cloudprofile.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerdeployment.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerinstallation.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerregistration.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/core_client.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/exposureclass.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/generated_expansion.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/plant.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/project.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/quota.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/secretbinding.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/seed.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shoot.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootextensionstatus.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootstate.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupbucket.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupentry.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/cloudprofile.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerdeployment.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerinstallation.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerregistration.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/core_client.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/generated_expansion.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/plant.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/project.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/quota.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/secretbinding.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/seed.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/shoot.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/register.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/clientset.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/register.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/bastion.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/generated_expansion.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/operations_client.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/doc.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/register.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiregistration_client.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/doc.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/generated_expansion.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go delete mode 100644 vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/register.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go delete mode 100644 vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go delete mode 100644 vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/doc.go delete mode 100644 vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/register.go diff --git a/go.mod b/go.mod index 65a3e51c0..f3a699724 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/coreos/go-systemd/v22 v22.1.0 github.com/frankban/quicktest v1.9.0 // indirect github.com/gardener/etcd-druid v0.5.0 - github.com/gardener/gardener v1.30.1-0.20210831145107-5b4604745d8e + github.com/gardener/gardener v1.31.0 github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a github.com/gardener/machine-controller-manager v0.36.0 github.com/gardener/remedy-controller v0.6.0 diff --git a/go.sum b/go.sum index 8c15795aa..4006f6978 100644 --- a/go.sum +++ b/go.sum @@ -224,8 +224,8 @@ github.com/gardener/gardener v1.6.6/go.mod h1:w5IHIQDccvSxZJFOtBa8YConyyFgt07DBH github.com/gardener/gardener v1.11.3/go.mod h1:5DzqfOm+G8UftKu5zUbYJ+9Cnfd4XrvRNDabkM9AIp4= github.com/gardener/gardener v1.17.1/go.mod h1:uucRHq0xV46xd9MpJJjRswx/Slq3+ipbbJg09FVUtvM= github.com/gardener/gardener v1.27.1/go.mod h1:g+3Vx1Q8HSwcSkRwxn4G54WealBh4pcZSNOSkE6ygdQ= -github.com/gardener/gardener v1.30.1-0.20210831145107-5b4604745d8e h1:40KFDNiIhXzNSPpfnCB+5PSs9AOuEPp8GnJbHDGc+bs= -github.com/gardener/gardener v1.30.1-0.20210831145107-5b4604745d8e/go.mod h1:3VK2HoMK33jZmS4+PeVfHSBXI06t9ybvM+rj1QvYtc0= +github.com/gardener/gardener v1.31.0 h1:5im6qQftO48KKsK/+2hJ3zdNHyb2kzbKmH/yj2yrDiY= +github.com/gardener/gardener v1.31.0/go.mod h1:3VK2HoMK33jZmS4+PeVfHSBXI06t9ybvM+rj1QvYtc0= github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a h1:jBvyEhkRzW11Nz2y9IIQAo9HUaCvCqxEko5Nf9NRYUI= github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a/go.mod h1:bmD89OLvEBbXLlznsHe90ZlgTU+OrKErwHb6NWlSTvY= github.com/gardener/gardener-resource-manager v0.10.0/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ= diff --git a/vendor/github.com/gardener/gardener/charts/images.yaml b/vendor/github.com/gardener/gardener/charts/images.yaml index 8ebdbf350..923fd14bb 100644 --- a/vendor/github.com/gardener/gardener/charts/images.yaml +++ b/vendor/github.com/gardener/gardener/charts/images.yaml @@ -190,12 +190,23 @@ images: - name: nginx-ingress-controller sourceRepository: github.com/kubernetes/ingress-nginx repository: k8s.gcr.io/ingress-nginx/controller - tag: "v0.41.2" - targetVersion: ">= 1.20" + tag: "v0.49.0" + targetVersion: ">= 1.20, < 1.22" +- name: nginx-ingress-controller + sourceRepository: github.com/kubernetes/ingress-nginx + repository: k8s.gcr.io/ingress-nginx/controller + tag: "v1.0.0" + targetVersion: ">= 1.22" +- name: nginx-ingress-controller-seed + sourceRepository: github.com/kubernetes/ingress-nginx + repository: k8s.gcr.io/ingress-nginx/controller + tag: "v0.49.0" + targetVersion: "< 1.22" - name: nginx-ingress-controller-seed sourceRepository: github.com/kubernetes/ingress-nginx repository: k8s.gcr.io/ingress-nginx/controller - tag: "v0.41.2" + tag: "v1.0.0" + targetVersion: ">= 1.22" - name: ingress-default-backend sourceRepository: github.com/gardener/ingress-default-backend repository: eu.gcr.io/gardener-project/gardener/ingress-default-backend diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupbucket/mapper.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupbucket/mapper.go index 8623a3e92..8895de312 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupbucket/mapper.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupbucket/mapper.go @@ -16,6 +16,7 @@ package backupbucket import ( "context" + "time" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -27,9 +28,11 @@ import ( extensionshandler "github.com/gardener/gardener/extensions/pkg/handler" extensionspredicate "github.com/gardener/gardener/extensions/pkg/predicate" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + ctxutils "github.com/gardener/gardener/pkg/utils/context" ) type secretToBackupBucketMapper struct { + ctx context.Context client client.Client predicates []predicate.Predicate } @@ -39,6 +42,11 @@ func (m *secretToBackupBucketMapper) InjectClient(c client.Client) error { return nil } +func (m *secretToBackupBucketMapper) InjectStopChannel(stopCh <-chan struct{}) error { + m.ctx = ctxutils.FromStopChannel(stopCh) + return nil +} + func (m *secretToBackupBucketMapper) InjectFunc(f inject.Func) error { for _, p := range m.predicates { if err := f(p); err != nil { @@ -49,13 +57,16 @@ func (m *secretToBackupBucketMapper) InjectFunc(f inject.Func) error { } func (m *secretToBackupBucketMapper) Map(obj client.Object) []reconcile.Request { + ctx, cancel := context.WithTimeout(m.ctx, 5*time.Second) + defer cancel() + secret, ok := obj.(*corev1.Secret) if !ok { return nil } backupBucketList := &extensionsv1alpha1.BackupBucketList{} - if err := m.client.List(context.TODO(), backupBucketList); err != nil { + if err := m.client.List(ctx, backupBucketList); err != nil { return nil } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/controller.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/controller.go index 5c794f799..c5d386a5f 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/controller.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/controller.go @@ -88,14 +88,14 @@ func add(mgr manager.Manager, args AddArgs, predicates []predicate.Predicate) er if args.IgnoreOperationAnnotation { if err := ctrl.Watch( &source.Kind{Type: &corev1.Namespace{}}, - extensionshandler.EnqueueRequestsFromMapper(NamespaceToBackupEntryMapper(mgr.GetClient(), predicates), extensionshandler.UpdateWithNew), + extensionshandler.EnqueueRequestsFromMapper(NamespaceToBackupEntryMapper(predicates), extensionshandler.UpdateWithNew), ); err != nil { return err } if err := ctrl.Watch( &source.Kind{Type: &corev1.Secret{}}, - extensionshandler.EnqueueRequestsFromMapper(SecretToBackupEntryMapper(mgr.GetClient(), predicates), extensionshandler.UpdateWithNew), + extensionshandler.EnqueueRequestsFromMapper(SecretToBackupEntryMapper(predicates), extensionshandler.UpdateWithNew), ); err != nil { return err } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/mapper.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/mapper.go index dfe3c311b..dfc55f96b 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/mapper.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/mapper.go @@ -16,6 +16,7 @@ package backupentry import ( "context" + "time" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -27,21 +28,36 @@ import ( extensionspredicate "github.com/gardener/gardener/extensions/pkg/predicate" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + ctxutils "github.com/gardener/gardener/pkg/utils/context" ) type secretToBackupEntryMapper struct { + ctx context.Context client client.Client predicates []predicate.Predicate } +func (m *secretToBackupEntryMapper) InjectClient(c client.Client) error { + m.client = c + return nil +} + +func (m *secretToBackupEntryMapper) InjectStopChannel(stopCh <-chan struct{}) error { + m.ctx = ctxutils.FromStopChannel(stopCh) + return nil +} + func (m *secretToBackupEntryMapper) Map(obj client.Object) []reconcile.Request { + ctx, cancel := context.WithTimeout(m.ctx, 5*time.Second) + defer cancel() + secret, ok := obj.(*corev1.Secret) if !ok { return nil } backupEntryList := &extensionsv1alpha1.BackupEntryList{} - if err := m.client.List(context.TODO(), backupEntryList); err != nil { + if err := m.client.List(ctx, backupEntryList); err != nil { return nil } @@ -63,23 +79,37 @@ func (m *secretToBackupEntryMapper) Map(obj client.Object) []reconcile.Request { // SecretToBackupEntryMapper returns a mapper that returns requests for BackupEntry whose // referenced secrets have been modified. -func SecretToBackupEntryMapper(client client.Client, predicates []predicate.Predicate) extensionshandler.Mapper { - return &secretToBackupEntryMapper{client, predicates} +func SecretToBackupEntryMapper(predicates []predicate.Predicate) extensionshandler.Mapper { + return &secretToBackupEntryMapper{predicates: predicates} } type namespaceToBackupEntryMapper struct { + ctx context.Context client client.Client predicates []predicate.Predicate } +func (m *namespaceToBackupEntryMapper) InjectClient(c client.Client) error { + m.client = c + return nil +} + +func (m *namespaceToBackupEntryMapper) InjectStopChannel(stopCh <-chan struct{}) error { + m.ctx = ctxutils.FromStopChannel(stopCh) + return nil +} + func (m *namespaceToBackupEntryMapper) Map(obj client.Object) []reconcile.Request { + ctx, cancel := context.WithTimeout(m.ctx, 5*time.Second) + defer cancel() + namespace, ok := obj.(*corev1.Namespace) if !ok { return nil } backupEntryList := &extensionsv1alpha1.BackupEntryList{} - if err := m.client.List(context.TODO(), backupEntryList); err != nil { + if err := m.client.List(ctx, backupEntryList); err != nil { return nil } @@ -105,6 +135,6 @@ func (m *namespaceToBackupEntryMapper) Map(obj client.Object) []reconcile.Reques // NamespaceToBackupEntryMapper returns a mapper that returns requests for BackupEntry whose // associated Shoot's seed namespace have been modified. -func NamespaceToBackupEntryMapper(client client.Client, predicates []predicate.Predicate) extensionshandler.Mapper { - return &namespaceToBackupEntryMapper{client, predicates} +func NamespaceToBackupEntryMapper(predicates []predicate.Predicate) extensionshandler.Mapper { + return &namespaceToBackupEntryMapper{predicates: predicates} } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go index ca3a3ad3e..6345ea072 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go @@ -99,13 +99,17 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(be.ObjectMeta, be.Status.LastOperation) switch { - case extensionscontroller.IsMigrated(be): - return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: + if extensionscontroller.IsMigrated(be) { + return reconcile.Result{}, nil + } return r.migrate(ctx, be) case be.DeletionTimestamp != nil: + if extensionscontroller.IsMigrated(be) { + return reconcile.Result{}, nil + } return r.delete(ctx, be) - case be.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, be) default: return r.reconcile(ctx, be, operationType) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator/actuator.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator/actuator.go index 186f4959e..c9b1af15e 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator/actuator.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator/actuator.go @@ -24,6 +24,7 @@ import ( "github.com/gardener/gardener/extensions/pkg/controller/controlplane" "github.com/gardener/gardener/extensions/pkg/webhook" extensionswebhookshoot "github.com/gardener/gardener/extensions/pkg/webhook/shoot" + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" clientkubernetes "github.com/gardener/gardener/pkg/client/kubernetes" @@ -279,18 +280,12 @@ func (a *actuator) reconcileControlPlane( // then we requeue the `ControlPlane` CRD in order to give the provider-specific control plane components time to // properly prepare the cluster for hibernation (whatever needs to be done). If the kube-apiserver is already scaled down // then we allow continuing the reconciliation. - if cluster.Shoot.DeletionTimestamp == nil { + if cluster.Shoot.DeletionTimestamp == nil && (cluster.Shoot.Status.LastOperation == nil || cluster.Shoot.Status.LastOperation.Type != gardencorev1beta1.LastOperationTypeMigrate) { if dep.Spec.Replicas != nil && *dep.Spec.Replicas > 0 { requeue = true } else { scaledDown = true } - // Similarly, if a hibernated shoot is deleted then we might need to wake up all the provider-specific components. We - // wait until the kube-apiserver is woken up again before we wake up the provider-specific components. - } else { - if dep.Spec.Replicas == nil || *dep.Spec.Replicas == 0 { - return true, nil - } } } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go index ca92f6cb4..530aaf67d 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go @@ -100,13 +100,17 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(cp.ObjectMeta, cp.Status.LastOperation) switch { - case extensionscontroller.IsMigrated(cp): - return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: + if extensionscontroller.IsMigrated(cp) { + return reconcile.Result{}, nil + } return r.migrate(ctx, cp, cluster) case cp.DeletionTimestamp != nil: + if extensionscontroller.IsMigrated(cp) { + return reconcile.Result{}, nil + } return r.delete(ctx, cp, cluster) - case cp.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, cp, cluster) default: return r.reconcile(ctx, cp, cluster, operationType) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go index c3a8097e9..1d1e23271 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go @@ -101,13 +101,17 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(dns.ObjectMeta, dns.Status.LastOperation) switch { - case extensionscontroller.IsMigrated(dns): - return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: + if extensionscontroller.IsMigrated(dns) { + return reconcile.Result{}, nil + } return r.migrate(ctx, dns, cluster) case dns.DeletionTimestamp != nil: + if extensionscontroller.IsMigrated(dns) { + return reconcile.Result{}, nil + } return r.delete(ctx, dns, cluster) - case dns.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, dns, cluster) default: return r.reconcile(ctx, dns, cluster, operationType) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go index f2232a511..ecfe14b88 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go @@ -105,13 +105,17 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(infrastructure.ObjectMeta, infrastructure.Status.LastOperation) switch { - case extensionscontroller.IsMigrated(infrastructure): - return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: + if extensionscontroller.IsMigrated(infrastructure) { + return reconcile.Result{}, nil + } return r.migrate(ctx, logger.WithValues("operation", "migrate"), infrastructure, cluster) case infrastructure.DeletionTimestamp != nil: + if extensionscontroller.IsMigrated(infrastructure) { + return reconcile.Result{}, nil + } return r.delete(ctx, logger.WithValues("operation", "delete"), infrastructure, cluster) - case infrastructure.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, logger.WithValues("operation", "restore"), infrastructure, cluster) default: return r.reconcile(ctx, logger.WithValues("operation", "reconcile"), infrastructure, cluster, operationType) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go index e17749762..f73bc9ffc 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go @@ -124,7 +124,7 @@ func (a *genericActuator) deployMachineSetsAndMachines(ctx context.Context, logg for _, machineSet := range machineSets { // Create the MachineSet if not already exists. We do not care about the MachineSet status // because the MCM will update it - if err := a.client.Create(ctx, &machineSet); err != nil && !apierrors.IsAlreadyExists(err) { + if err := a.client.Create(ctx, &machineSet); kutil.IgnoreAlreadyExists(err) != nil { return err } } @@ -132,8 +132,7 @@ func (a *genericActuator) deployMachineSetsAndMachines(ctx context.Context, logg // Deploy each machine owned by the MachineSet which was restored above for _, machine := range wantedMachineDeployment.State.Machines { // Create the machine if it not exists already - err := a.client.Create(ctx, &machine) - if err != nil && !apierrors.IsAlreadyExists(err) { + if err := a.client.Create(ctx, &machine); kutil.IgnoreAlreadyExists(err) != nil { return err } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/mapper.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/mapper.go index b79ea4c82..7ac545a89 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/mapper.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/mapper.go @@ -16,6 +16,7 @@ package worker import ( "context" + "time" machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "k8s.io/apimachinery/pkg/api/meta" @@ -124,13 +125,16 @@ func (m *machineToObjectMapper) InjectFunc(f inject.Func) error { } func (m *machineToObjectMapper) Map(obj client.Object) []reconcile.Request { + ctx, cancel := context.WithTimeout(m.ctx, 5*time.Second) + defer cancel() + machine, ok := obj.(*machinev1alpha1.Machine) if !ok { return nil } objList := m.newObjListFunc() - if err := m.client.List(m.ctx, objList, client.InNamespace(machine.Namespace)); err != nil { + if err := m.client.List(ctx, objList, client.InNamespace(machine.Namespace)); err != nil { return nil } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go index 2a7f4d1d1..cd4f979b2 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go @@ -97,13 +97,17 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(worker.ObjectMeta, worker.Status.LastOperation) switch { - case isWorkerMigrated(worker): - return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: + if extensionscontroller.IsMigrated(worker) { + return reconcile.Result{}, nil + } return r.migrate(ctx, logger.WithValues("operation", "migrate"), worker, cluster) case worker.DeletionTimestamp != nil: + if extensionscontroller.IsMigrated(worker) { + return reconcile.Result{}, nil + } return r.delete(ctx, logger.WithValues("operation", "delete"), worker, cluster) - case worker.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, logger.WithValues("operation", "restore"), worker, cluster) default: return r.reconcile(ctx, logger.WithValues("operation", "reconcile"), worker, cluster, operationType) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/terraformer/state.go b/vendor/github.com/gardener/gardener/extensions/pkg/terraformer/state.go index bf62bd1e7..88ec49f42 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/terraformer/state.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/terraformer/state.go @@ -206,11 +206,7 @@ func CreateState(ctx context.Context, c client.Client, namespace, name string, o configMap.SetOwnerReferences(kutil.MergeOwnerReferences(configMap.OwnerReferences, *ownerRef)) } - if err := c.Create(ctx, configMap); err != nil && !apierrors.IsAlreadyExists(err) { - return err - } - - return nil + return kutil.IgnoreAlreadyExists(c.Create(ctx, configMap)) } // Initialize implements StateConfigMapInitializer diff --git a/vendor/github.com/gardener/gardener/hack/update-codegen.sh b/vendor/github.com/gardener/gardener/hack/update-codegen.sh index 889b14c6d..9c9a26b0e 100755 --- a/vendor/github.com/gardener/gardener/hack/update-codegen.sh +++ b/vendor/github.com/gardener/gardener/hack/update-codegen.sh @@ -53,8 +53,8 @@ extensions_groups() { echo "Generating API groups for pkg/apis/extensions" bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-groups.sh \ - "deepcopy,client,informer,lister" \ - github.com/gardener/gardener/pkg/client/extensions \ + "deepcopy" \ + github.com/gardener/gardener/pkg/apis \ github.com/gardener/gardener/pkg/apis \ "extensions:v1alpha1" \ -h "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt" @@ -111,8 +111,8 @@ operations_groups() { echo "Generating API groups for pkg/apis/operations" bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ - deepcopy,defaulter,client,lister,informer \ - github.com/gardener/gardener/pkg/client/operations \ + deepcopy,defaulter \ + github.com/gardener/gardener/pkg/apis \ github.com/gardener/gardener/pkg/apis \ github.com/gardener/gardener/pkg/apis \ "operations:v1alpha1" \ diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/doc.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/doc.go deleted file mode 100644 index fffc4aab3..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package - -// Package authentication is the internal version of the API. -// +groupName=authentication.gardener.cloud -package authentication diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/register.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/register.go deleted file mode 100644 index c79804ae0..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package authentication - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the name of the authentication API group. -const GroupName = "authentication.gardener.cloud" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind. -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns back a Group qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder is a new Scheme Builder which registers our API. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme is a reference to the Scheme Builder's AddToScheme function. - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &AdminKubeconfigRequest{}, - ) - return nil -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/types_adminkubeconfigrequest.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/types_adminkubeconfigrequest.go deleted file mode 100644 index cb82bf372..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/types_adminkubeconfigrequest.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package authentication - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AdminKubeconfigRequest can be used to request a kubeconfig with admin credentials -// for a Shoot cluster. -type AdminKubeconfigRequest struct { - metav1.TypeMeta - // Standard object metadata. - metav1.ObjectMeta - // Spec is the specification of the AdminKubeconfigRequest. - Spec AdminKubeconfigRequestSpec - // Status is the status of the AdminKubeconfigRequest. - Status AdminKubeconfigRequestStatus -} - -// AdminKubeconfigRequestStatus is the status of the AdminKubeconfigRequest containing -// the kubeconfig and expiration of the credential. -type AdminKubeconfigRequestStatus struct { - // Kubeconfig contains the kubeconfig with cluster-admin privileges for the shoot cluster. - Kubeconfig []byte - // ExpirationTimestamp is the expiration timestamp of of the returned credential. - ExpirationTimestamp metav1.Time -} - -// AdminKubeconfigRequestSpec contains the expiration time of the kubeconfig. -type AdminKubeconfigRequestSpec struct { - // ExpirationSeconds is the requested validity duration of the credential. The - // credential issuer may return a credential with a different validity duration so a - // client needs to check the 'expirationTimestamp' field in a response. - // Defaults to 1 hour. - ExpirationSeconds int64 -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/defaults.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/defaults.go deleted file mode 100644 index 951dc4900..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -func SetDefaults_AdminKubeconfigRequestSpec(obj *AdminKubeconfigRequestSpec) { - if obj.ExpirationSeconds == nil { - hour := int64(60 * 60) - obj.ExpirationSeconds = &hour - } -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/doc.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/doc.go deleted file mode 100644 index 19fbeede3..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 is the v1alpha1 version of the API. -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/gardener/gardener/pkg/apis/authentication -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -// +k8s:protobuf-gen=package - -//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../../hack/api-reference/authentication-config.json -template-dir ../../../../hack/api-reference/template -out-file ../../../../hack/api-reference/authentication.md - -// Package v1alpha1 is a version of the API. -// +groupName=authentication.gardener.cloud -package v1alpha1 diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.pb.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.pb.go deleted file mode 100644 index 607bca3a6..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.pb.go +++ /dev/null @@ -1,813 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto - -package v1alpha1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *AdminKubeconfigRequest) Reset() { *m = AdminKubeconfigRequest{} } -func (*AdminKubeconfigRequest) ProtoMessage() {} -func (*AdminKubeconfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4ad0cb10cdbf25b8, []int{0} -} -func (m *AdminKubeconfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AdminKubeconfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AdminKubeconfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdminKubeconfigRequest.Merge(m, src) -} -func (m *AdminKubeconfigRequest) XXX_Size() int { - return m.Size() -} -func (m *AdminKubeconfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AdminKubeconfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AdminKubeconfigRequest proto.InternalMessageInfo - -func (m *AdminKubeconfigRequestSpec) Reset() { *m = AdminKubeconfigRequestSpec{} } -func (*AdminKubeconfigRequestSpec) ProtoMessage() {} -func (*AdminKubeconfigRequestSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_4ad0cb10cdbf25b8, []int{1} -} -func (m *AdminKubeconfigRequestSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AdminKubeconfigRequestSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AdminKubeconfigRequestSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdminKubeconfigRequestSpec.Merge(m, src) -} -func (m *AdminKubeconfigRequestSpec) XXX_Size() int { - return m.Size() -} -func (m *AdminKubeconfigRequestSpec) XXX_DiscardUnknown() { - xxx_messageInfo_AdminKubeconfigRequestSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_AdminKubeconfigRequestSpec proto.InternalMessageInfo - -func (m *AdminKubeconfigRequestStatus) Reset() { *m = AdminKubeconfigRequestStatus{} } -func (*AdminKubeconfigRequestStatus) ProtoMessage() {} -func (*AdminKubeconfigRequestStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_4ad0cb10cdbf25b8, []int{2} -} -func (m *AdminKubeconfigRequestStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AdminKubeconfigRequestStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *AdminKubeconfigRequestStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdminKubeconfigRequestStatus.Merge(m, src) -} -func (m *AdminKubeconfigRequestStatus) XXX_Size() int { - return m.Size() -} -func (m *AdminKubeconfigRequestStatus) XXX_DiscardUnknown() { - xxx_messageInfo_AdminKubeconfigRequestStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_AdminKubeconfigRequestStatus proto.InternalMessageInfo - -func init() { - proto.RegisterType((*AdminKubeconfigRequest)(nil), "github.com.gardener.gardener.pkg.apis.authentication.v1alpha1.AdminKubeconfigRequest") - proto.RegisterType((*AdminKubeconfigRequestSpec)(nil), "github.com.gardener.gardener.pkg.apis.authentication.v1alpha1.AdminKubeconfigRequestSpec") - proto.RegisterType((*AdminKubeconfigRequestStatus)(nil), "github.com.gardener.gardener.pkg.apis.authentication.v1alpha1.AdminKubeconfigRequestStatus") -} - -func init() { - proto.RegisterFile("github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto", fileDescriptor_4ad0cb10cdbf25b8) -} - -var fileDescriptor_4ad0cb10cdbf25b8 = []byte{ - // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x92, 0x41, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0x33, 0x6d, 0x29, 0x65, 0x2c, 0x85, 0xa6, 0x28, 0xcb, 0x2a, 0xb3, 0xb2, 0x27, 0x11, - 0x9c, 0xb8, 0x22, 0xe2, 0xc5, 0x83, 0x91, 0x9e, 0xa4, 0x08, 0xa9, 0x17, 0xf5, 0xe2, 0xdb, 0xe4, - 0x35, 0x19, 0xd7, 0x64, 0xc6, 0xcc, 0x64, 0xb1, 0x78, 0x11, 0xfc, 0x02, 0x7e, 0xac, 0xf5, 0xd6, - 0x63, 0x4f, 0x8b, 0x1b, 0x3f, 0x87, 0x20, 0x33, 0x9b, 0x6d, 0xd6, 0x6e, 0xab, 0x82, 0xf4, 0xf6, - 0x5e, 0xe6, 0xfd, 0xff, 0xbf, 0x7f, 0xe6, 0x0d, 0x3d, 0x48, 0x85, 0xc9, 0xaa, 0x21, 0x8f, 0x65, - 0x1e, 0xa4, 0x50, 0x26, 0x58, 0x60, 0xd9, 0x16, 0x6a, 0x94, 0x06, 0xa0, 0x84, 0x0e, 0xa0, 0x32, - 0x19, 0x16, 0x46, 0xc4, 0x60, 0x84, 0x2c, 0x82, 0xf1, 0x00, 0xde, 0xab, 0x0c, 0x06, 0x41, 0x6a, - 0xc7, 0xc0, 0x60, 0xc2, 0x55, 0x29, 0x8d, 0xf4, 0x9f, 0xb4, 0x76, 0x7c, 0xe1, 0xd2, 0x16, 0x6a, - 0x94, 0x72, 0x6b, 0xc7, 0x7f, 0xb7, 0xe3, 0x0b, 0xbb, 0xee, 0xbd, 0xe5, 0x34, 0x32, 0x95, 0x81, - 0x73, 0x1d, 0x56, 0x47, 0xae, 0x73, 0x8d, 0xab, 0xe6, 0xb4, 0xee, 0xc3, 0xd1, 0x63, 0xcd, 0x85, - 0xb4, 0x11, 0x73, 0x88, 0x33, 0x51, 0x60, 0x79, 0xdc, 0x66, 0xce, 0xd1, 0x40, 0x30, 0x5e, 0xc9, - 0xd8, 0x0d, 0x2e, 0x53, 0x95, 0x55, 0x61, 0x44, 0x8e, 0x2b, 0x82, 0x47, 0x7f, 0x13, 0xe8, 0x38, - 0xc3, 0x1c, 0xce, 0xeb, 0xfa, 0x3f, 0xd7, 0xe8, 0x8d, 0xa7, 0x49, 0x2e, 0x8a, 0xe7, 0xd5, 0x10, - 0x63, 0x59, 0x1c, 0x89, 0x34, 0xc2, 0x0f, 0x15, 0x6a, 0xe3, 0xbf, 0xa5, 0x5b, 0x36, 0x5e, 0x02, - 0x06, 0x3a, 0xe4, 0x36, 0xb9, 0x73, 0xed, 0xc1, 0x7d, 0x3e, 0xa7, 0xf0, 0x65, 0x4a, 0x7b, 0x63, - 0x76, 0x9a, 0x8f, 0x07, 0xfc, 0xc5, 0xf0, 0x1d, 0xc6, 0xe6, 0x00, 0x0d, 0x84, 0xfe, 0x64, 0xda, - 0xf3, 0xea, 0x69, 0x8f, 0xb6, 0xdf, 0xa2, 0x33, 0x57, 0xff, 0x13, 0xdd, 0xd0, 0x0a, 0xe3, 0xce, - 0x9a, 0x73, 0x7f, 0xc5, 0xff, 0x6b, 0x31, 0xfc, 0xe2, 0xdf, 0x38, 0x54, 0x18, 0x87, 0xdb, 0x4d, - 0x8c, 0x0d, 0xdb, 0x45, 0x0e, 0xea, 0x7f, 0x21, 0x74, 0x53, 0x1b, 0x30, 0x95, 0xee, 0xac, 0x3b, - 0xfe, 0x9b, 0xab, 0xe1, 0x3b, 0x44, 0xb8, 0xd3, 0x24, 0xd8, 0x9c, 0xf7, 0x51, 0x83, 0xee, 0x03, - 0xed, 0x5e, 0x9e, 0xdb, 0x7f, 0x46, 0x77, 0xf1, 0xa3, 0x12, 0xa5, 0x23, 0x1d, 0xda, 0x81, 0x44, - 0xbb, 0x5d, 0xac, 0x87, 0xd7, 0xeb, 0x69, 0x6f, 0x77, 0xff, 0xfc, 0x61, 0xb4, 0x3a, 0xdf, 0xff, - 0x46, 0xe8, 0xad, 0x3f, 0x65, 0xf3, 0x39, 0xa5, 0xa3, 0xb3, 0x23, 0x67, 0xbf, 0x1d, 0xee, 0xd8, - 0xa5, 0x2d, 0x09, 0x96, 0x26, 0xfc, 0x63, 0xba, 0xd7, 0x52, 0x5e, 0x8a, 0x1c, 0xb5, 0x81, 0x5c, - 0x35, 0x5b, 0xbc, 0xfb, 0x6f, 0x6f, 0xc4, 0xca, 0xc2, 0x9b, 0xcd, 0xa5, 0xec, 0xed, 0xaf, 0xda, - 0x45, 0x17, 0x31, 0x42, 0x3e, 0x99, 0x31, 0xef, 0x64, 0xc6, 0xbc, 0xd3, 0x19, 0xf3, 0x3e, 0xd7, - 0x8c, 0x4c, 0x6a, 0x46, 0x4e, 0x6a, 0x46, 0x4e, 0x6b, 0x46, 0xbe, 0xd7, 0x8c, 0x7c, 0xfd, 0xc1, - 0xbc, 0xd7, 0x5b, 0x8b, 0x9d, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x8b, 0x17, 0xae, 0x3b, - 0x04, 0x00, 0x00, -} - -func (m *AdminKubeconfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AdminKubeconfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AdminKubeconfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *AdminKubeconfigRequestSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AdminKubeconfigRequestSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AdminKubeconfigRequestSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExpirationSeconds != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.ExpirationSeconds)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *AdminKubeconfigRequestStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AdminKubeconfigRequestStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AdminKubeconfigRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ExpirationTimestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Kubeconfig != nil { - i -= len(m.Kubeconfig) - copy(dAtA[i:], m.Kubeconfig) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kubeconfig))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AdminKubeconfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *AdminKubeconfigRequestSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExpirationSeconds != nil { - n += 1 + sovGenerated(uint64(*m.ExpirationSeconds)) - } - return n -} - -func (m *AdminKubeconfigRequestStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Kubeconfig != nil { - l = len(m.Kubeconfig) - n += 1 + l + sovGenerated(uint64(l)) - } - l = m.ExpirationTimestamp.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *AdminKubeconfigRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AdminKubeconfigRequest{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "AdminKubeconfigRequestSpec", "AdminKubeconfigRequestSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "AdminKubeconfigRequestStatus", "AdminKubeconfigRequestStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *AdminKubeconfigRequestSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AdminKubeconfigRequestSpec{`, - `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, - `}`, - }, "") - return s -} -func (this *AdminKubeconfigRequestStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AdminKubeconfigRequestStatus{`, - `Kubeconfig:` + valueToStringGenerated(this.Kubeconfig) + `,`, - `ExpirationTimestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExpirationTimestamp), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *AdminKubeconfigRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AdminKubeconfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AdminKubeconfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AdminKubeconfigRequestSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AdminKubeconfigRequestSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AdminKubeconfigRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationSeconds", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ExpirationSeconds = &v - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AdminKubeconfigRequestStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AdminKubeconfigRequestStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AdminKubeconfigRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kubeconfig", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kubeconfig = append(m.Kubeconfig[:0], dAtA[iNdEx:postIndex]...) - if m.Kubeconfig == nil { - m.Kubeconfig = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ExpirationTimestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto deleted file mode 100644 index e0d4340eb..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/generated.proto +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package github.com.gardener.gardener.pkg.apis.authentication.v1alpha1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// AdminKubeconfigRequest can be used to request a kubeconfig with admin credentials -// for a Shoot cluster. -message AdminKubeconfigRequest { - // Standard object metadata. - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec is the specification of the AdminKubeconfigRequest. - optional AdminKubeconfigRequestSpec spec = 2; - - // Status is the status of the AdminKubeconfigRequest. - optional AdminKubeconfigRequestStatus status = 3; -} - -// AdminKubeconfigRequestSpec contains the expiration time of the kubeconfig. -message AdminKubeconfigRequestSpec { - // ExpirationSeconds is the requested validity duration of the credential. The - // credential issuer may return a credential with a different validity duration so a - // client needs to check the 'expirationTimestamp' field in a response. - // Defaults to 1 hour. - // +optional - optional int64 expirationSeconds = 1; -} - -// AdminKubeconfigRequestStatus is the status of the AdminKubeconfigRequest containing -// the kubeconfig and expiration of the credential. -message AdminKubeconfigRequestStatus { - // Kubeconfig contains the kubeconfig with cluster-admin privileges for the shoot cluster. - optional bytes kubeconfig = 1; - - // ExpirationTimestamp is the expiration timestamp of the returned credential. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2; -} - diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/register.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/register.go deleted file mode 100644 index 03b826e0b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the name of the authentication API group. -const GroupName = "authentication.gardener.cloud" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind. -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder is a new Scheme Builder which registers our API. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs) - localSchemeBuilder = &SchemeBuilder - // AddToScheme is a reference to the Scheme Builder's AddToScheme function. - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &AdminKubeconfigRequest{}, - ) - return nil -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/types_adminkubeconfigrequest.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/types_adminkubeconfigrequest.go deleted file mode 100644 index a8432778b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/types_adminkubeconfigrequest.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AdminKubeconfigRequest can be used to request a kubeconfig with admin credentials -// for a Shoot cluster. -type AdminKubeconfigRequest struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata. - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec is the specification of the AdminKubeconfigRequest. - Spec AdminKubeconfigRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is the status of the AdminKubeconfigRequest. - Status AdminKubeconfigRequestStatus `json:"status" protobuf:"bytes,3,opt,name=status"` -} - -// AdminKubeconfigRequestStatus is the status of the AdminKubeconfigRequest containing -// the kubeconfig and expiration of the credential. -type AdminKubeconfigRequestStatus struct { - // Kubeconfig contains the kubeconfig with cluster-admin privileges for the shoot cluster. - Kubeconfig []byte `json:"kubeconfig" protobuf:"bytes,1,name=kubeconfig"` - // ExpirationTimestamp is the expiration timestamp of the returned credential. - ExpirationTimestamp metav1.Time `json:"expirationTimestamp" protobuf:"bytes,2,name=expirationTimestamp"` -} - -// AdminKubeconfigRequestSpec contains the expiration time of the kubeconfig. -type AdminKubeconfigRequestSpec struct { - // ExpirationSeconds is the requested validity duration of the credential. The - // credential issuer may return a credential with a different validity duration so a - // client needs to check the 'expirationTimestamp' field in a response. - // Defaults to 1 hour. - // +optional - ExpirationSeconds *int64 `json:"expirationSeconds,omitempty" protobuf:"varint,1,opt,name=expirationSeconds"` -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index c6fb10c45..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,148 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - authentication "github.com/gardener/gardener/pkg/apis/authentication" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AdminKubeconfigRequest)(nil), (*authentication.AdminKubeconfigRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AdminKubeconfigRequest_To_authentication_AdminKubeconfigRequest(a.(*AdminKubeconfigRequest), b.(*authentication.AdminKubeconfigRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*authentication.AdminKubeconfigRequest)(nil), (*AdminKubeconfigRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_authentication_AdminKubeconfigRequest_To_v1alpha1_AdminKubeconfigRequest(a.(*authentication.AdminKubeconfigRequest), b.(*AdminKubeconfigRequest), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AdminKubeconfigRequestSpec)(nil), (*authentication.AdminKubeconfigRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec(a.(*AdminKubeconfigRequestSpec), b.(*authentication.AdminKubeconfigRequestSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*authentication.AdminKubeconfigRequestSpec)(nil), (*AdminKubeconfigRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec(a.(*authentication.AdminKubeconfigRequestSpec), b.(*AdminKubeconfigRequestSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AdminKubeconfigRequestStatus)(nil), (*authentication.AdminKubeconfigRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus(a.(*AdminKubeconfigRequestStatus), b.(*authentication.AdminKubeconfigRequestStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*authentication.AdminKubeconfigRequestStatus)(nil), (*AdminKubeconfigRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus(a.(*authentication.AdminKubeconfigRequestStatus), b.(*AdminKubeconfigRequestStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_AdminKubeconfigRequest_To_authentication_AdminKubeconfigRequest(in *AdminKubeconfigRequest, out *authentication.AdminKubeconfigRequest, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AdminKubeconfigRequest_To_authentication_AdminKubeconfigRequest is an autogenerated conversion function. -func Convert_v1alpha1_AdminKubeconfigRequest_To_authentication_AdminKubeconfigRequest(in *AdminKubeconfigRequest, out *authentication.AdminKubeconfigRequest, s conversion.Scope) error { - return autoConvert_v1alpha1_AdminKubeconfigRequest_To_authentication_AdminKubeconfigRequest(in, out, s) -} - -func autoConvert_authentication_AdminKubeconfigRequest_To_v1alpha1_AdminKubeconfigRequest(in *authentication.AdminKubeconfigRequest, out *AdminKubeconfigRequest, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_authentication_AdminKubeconfigRequest_To_v1alpha1_AdminKubeconfigRequest is an autogenerated conversion function. -func Convert_authentication_AdminKubeconfigRequest_To_v1alpha1_AdminKubeconfigRequest(in *authentication.AdminKubeconfigRequest, out *AdminKubeconfigRequest, s conversion.Scope) error { - return autoConvert_authentication_AdminKubeconfigRequest_To_v1alpha1_AdminKubeconfigRequest(in, out, s) -} - -func autoConvert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec(in *AdminKubeconfigRequestSpec, out *authentication.AdminKubeconfigRequestSpec, s conversion.Scope) error { - if err := v1.Convert_Pointer_int64_To_int64(&in.ExpirationSeconds, &out.ExpirationSeconds, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec is an autogenerated conversion function. -func Convert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec(in *AdminKubeconfigRequestSpec, out *authentication.AdminKubeconfigRequestSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AdminKubeconfigRequestSpec_To_authentication_AdminKubeconfigRequestSpec(in, out, s) -} - -func autoConvert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec(in *authentication.AdminKubeconfigRequestSpec, out *AdminKubeconfigRequestSpec, s conversion.Scope) error { - if err := v1.Convert_int64_To_Pointer_int64(&in.ExpirationSeconds, &out.ExpirationSeconds, s); err != nil { - return err - } - return nil -} - -// Convert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec is an autogenerated conversion function. -func Convert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec(in *authentication.AdminKubeconfigRequestSpec, out *AdminKubeconfigRequestSpec, s conversion.Scope) error { - return autoConvert_authentication_AdminKubeconfigRequestSpec_To_v1alpha1_AdminKubeconfigRequestSpec(in, out, s) -} - -func autoConvert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus(in *AdminKubeconfigRequestStatus, out *authentication.AdminKubeconfigRequestStatus, s conversion.Scope) error { - out.Kubeconfig = *(*[]byte)(unsafe.Pointer(&in.Kubeconfig)) - out.ExpirationTimestamp = in.ExpirationTimestamp - return nil -} - -// Convert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus is an autogenerated conversion function. -func Convert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus(in *AdminKubeconfigRequestStatus, out *authentication.AdminKubeconfigRequestStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_AdminKubeconfigRequestStatus_To_authentication_AdminKubeconfigRequestStatus(in, out, s) -} - -func autoConvert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus(in *authentication.AdminKubeconfigRequestStatus, out *AdminKubeconfigRequestStatus, s conversion.Scope) error { - out.Kubeconfig = *(*[]byte)(unsafe.Pointer(&in.Kubeconfig)) - out.ExpirationTimestamp = in.ExpirationTimestamp - return nil -} - -// Convert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus is an autogenerated conversion function. -func Convert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus(in *authentication.AdminKubeconfigRequestStatus, out *AdminKubeconfigRequestStatus, s conversion.Scope) error { - return autoConvert_authentication_AdminKubeconfigRequestStatus_To_v1alpha1_AdminKubeconfigRequestStatus(in, out, s) -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index c1f4c0e9f..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,96 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdminKubeconfigRequest) DeepCopyInto(out *AdminKubeconfigRequest) { - *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 AdminKubeconfigRequest. -func (in *AdminKubeconfigRequest) DeepCopy() *AdminKubeconfigRequest { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdminKubeconfigRequest) 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 *AdminKubeconfigRequestSpec) DeepCopyInto(out *AdminKubeconfigRequestSpec) { - *out = *in - if in.ExpirationSeconds != nil { - in, out := &in.ExpirationSeconds, &out.ExpirationSeconds - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminKubeconfigRequestSpec. -func (in *AdminKubeconfigRequestSpec) DeepCopy() *AdminKubeconfigRequestSpec { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdminKubeconfigRequestStatus) DeepCopyInto(out *AdminKubeconfigRequestStatus) { - *out = *in - if in.Kubeconfig != nil { - in, out := &in.Kubeconfig, &out.Kubeconfig - *out = make([]byte, len(*in)) - copy(*out, *in) - } - in.ExpirationTimestamp.DeepCopyInto(&out.ExpirationTimestamp) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminKubeconfigRequestStatus. -func (in *AdminKubeconfigRequestStatus) DeepCopy() *AdminKubeconfigRequestStatus { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequestStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.defaults.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.defaults.go deleted file mode 100644 index 1f0f9c46e..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/v1alpha1/zz_generated.defaults.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&AdminKubeconfigRequest{}, func(obj interface{}) { SetObjectDefaults_AdminKubeconfigRequest(obj.(*AdminKubeconfigRequest)) }) - return nil -} - -func SetObjectDefaults_AdminKubeconfigRequest(in *AdminKubeconfigRequest) { - SetDefaults_AdminKubeconfigRequestSpec(&in.Spec) -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/authentication/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/apis/authentication/zz_generated.deepcopy.go deleted file mode 100644 index a6eddc4f9..000000000 --- a/vendor/github.com/gardener/gardener/pkg/apis/authentication/zz_generated.deepcopy.go +++ /dev/null @@ -1,91 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package authentication - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdminKubeconfigRequest) DeepCopyInto(out *AdminKubeconfigRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminKubeconfigRequest. -func (in *AdminKubeconfigRequest) DeepCopy() *AdminKubeconfigRequest { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AdminKubeconfigRequest) 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 *AdminKubeconfigRequestSpec) DeepCopyInto(out *AdminKubeconfigRequestSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminKubeconfigRequestSpec. -func (in *AdminKubeconfigRequestSpec) DeepCopy() *AdminKubeconfigRequestSpec { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AdminKubeconfigRequestStatus) DeepCopyInto(out *AdminKubeconfigRequestStatus) { - *out = *in - if in.Kubeconfig != nil { - in, out := &in.Kubeconfig, &out.Kubeconfig - *out = make([]byte, len(*in)) - copy(*out, *in) - } - in.ExpirationTimestamp.DeepCopyInto(&out.ExpirationTimestamp) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdminKubeconfigRequestStatus. -func (in *AdminKubeconfigRequestStatus) DeepCopy() *AdminKubeconfigRequestStatus { - if in == nil { - return nil - } - out := new(AdminKubeconfigRequestStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/install/install.go b/vendor/github.com/gardener/gardener/pkg/apis/core/install/install.go index 6b7215442..36b903170 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/install/install.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/install/install.go @@ -23,6 +23,15 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) +var ( + localSchemeBuilder = runtime.SchemeBuilder{ + v1alpha1.AddToScheme, + v1beta1.AddToScheme, + } + // AddToScheme adds all versioned API types to the given scheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + // Install registers the API group and adds types to a scheme. func Install(scheme *runtime.Scheme) { utilruntime.Must(core.AddToScheme(scheme)) diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go index 193666dbd..9fd324859 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go @@ -448,6 +448,8 @@ const ( // SeedNginxIngressClass defines the ingress class for the seed nginx ingress controller SeedNginxIngressClass = "nginx-gardener" + // SeedNginxIngressClass122 defines the ingress class for the seed nginx ingress controller for K8s >= 1.22 + SeedNginxIngressClass122 = "nginx-ingress-gardener" // IngressKindNginx defines nginx as kind as managed Seed ingress IngressKindNginx = "nginx" // ShootNginxIngressClass defines the ingress class for the seed nginx ingress controller diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/errors.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/errors.go index 90b088f50..b1ae03577 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/errors.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/errors.go @@ -53,7 +53,7 @@ func (e *ErrorWithCodes) Error() string { var ( unauthorizedRegexp = regexp.MustCompile(`(?i)(Unauthorized|InvalidClientTokenId|InvalidAuthenticationTokenTenant|SignatureDoesNotMatch|Authentication failed|AuthFailure|AuthorizationFailed|invalid character|invalid_grant|invalid_client|Authorization Profile was not found|cannot fetch token|no active subscriptions|InvalidAccessKeyId|InvalidSecretAccessKey|query returned no results|UnauthorizedOperation|not authorized|InvalidSubscriptionId)`) - quotaExceededRegexp = regexp.MustCompile(`(?i)((?:^|[^t]|(?:[^s]|^)t|(?:[^e]|^)st|(?:[^u]|^)est|(?:[^q]|^)uest|(?:[^e]|^)quest|(?:[^r]|^)equest)LimitExceeded|Quotas|Quota exceeded|exceeded quota|Quota has been met|QUOTA_EXCEEDED)`) + quotaExceededRegexp = regexp.MustCompile(`(?i)((?:^|[^t]|(?:[^s]|^)t|(?:[^e]|^)st|(?:[^u]|^)est|(?:[^q]|^)uest|(?:[^e]|^)quest|(?:[^r]|^)equest)LimitExceeded|Quotas|Quota exceeded|exceeded quota|Quota has been met|QUOTA_EXCEEDED|Maximum number of ports exceeded)`) rateLimitsExceededRegexp = regexp.MustCompile(`(?i)(RequestLimitExceeded|Throttling|Too many requests)`) insufficientPrivilegesRegexp = regexp.MustCompile(`(?i)(AccessDenied|OperationNotAllowed|Error 403)`) dependenciesRegexp = regexp.MustCompile(`(?i)(PendingVerification|Access Not Configured|accessNotConfigured|DependencyViolation|OptInRequired|DeleteConflict|Conflict|inactive billing state|ReadOnlyDisabledSubscription|is already being used|InUseSubnetCannotBeDeleted|VnetInUse|InUseRouteTableCannotBeDeleted|timeout while waiting for state to become|InvalidCidrBlock|already busy for|InsufficientFreeAddressesInSubnet|InternalServerError|internalerror|internal server error|A resource with the ID|VnetAddressSpaceCannotChangeDueToPeerings|InternalBillingError)`) diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go index 05e6eb22b..f77fe945c 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go @@ -187,6 +187,8 @@ func ComputeOperationType(meta metav1.ObjectMeta, lastOperation *gardencorev1bet return gardencorev1beta1.LastOperationTypeMigrate case meta.DeletionTimestamp != nil: return gardencorev1beta1.LastOperationTypeDelete + case meta.Annotations[v1beta1constants.GardenerOperation] == v1beta1constants.GardenerOperationRestore: + return gardencorev1beta1.LastOperationTypeRestore case lastOperation == nil: return gardencorev1beta1.LastOperationTypeCreate case lastOperation.Type == gardencorev1beta1.LastOperationTypeCreate && lastOperation.State != gardencorev1beta1.LastOperationStateSucceeded: diff --git a/vendor/github.com/gardener/gardener/pkg/apis/operations/install/install.go b/vendor/github.com/gardener/gardener/pkg/apis/operations/install/install.go new file mode 100644 index 000000000..89f602f7c --- /dev/null +++ b/vendor/github.com/gardener/gardener/pkg/apis/operations/install/install.go @@ -0,0 +1,39 @@ +// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package install + +import ( + "github.com/gardener/gardener/pkg/apis/operations" + "github.com/gardener/gardener/pkg/apis/operations/v1alpha1" + + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + localSchemeBuilder = runtime.SchemeBuilder{ + v1alpha1.AddToScheme, + } + // AddToScheme adds all versioned API types to the given scheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Install registers the API group and adds types to a scheme. +func Install(scheme *runtime.Scheme) { + utilruntime.Must(operations.AddToScheme(scheme)) + utilruntime.Must(v1alpha1.AddToScheme(scheme)) + + utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) +} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/install/install.go b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/install/install.go new file mode 100644 index 000000000..f3555ec8f --- /dev/null +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/install/install.go @@ -0,0 +1,39 @@ +// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package install + +import ( + "github.com/gardener/gardener/pkg/apis/seedmanagement" + "github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1" + + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + localSchemeBuilder = runtime.SchemeBuilder{ + v1alpha1.AddToScheme, + } + // AddToScheme adds all versioned API types to the given scheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Install registers the API group and adds types to a scheme. +func Install(scheme *runtime.Scheme) { + utilruntime.Must(seedmanagement.AddToScheme(scheme)) + utilruntime.Must(v1alpha1.AddToScheme(scheme)) + + utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) +} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/types_managedseed.go b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/types_managedseed.go index 2c3902950..21f0247f4 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/types_managedseed.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/types_managedseed.go @@ -95,7 +95,7 @@ type Gardenlet struct { type GardenletDeployment struct { // ReplicaCount is the number of gardenlet replicas. Defaults to 1. ReplicaCount *int32 - // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 1. + // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 10. RevisionHistoryLimit *int32 // ServiceAccountName is the name of the ServiceAccount to use to run gardenlet pods. ServiceAccountName *string diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/defaults_managedseed.go b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/defaults_managedseed.go index d3b5831dc..b5fdf3724 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/defaults_managedseed.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/defaults_managedseed.go @@ -51,7 +51,7 @@ func SetDefaults_GardenletDeployment(obj *GardenletDeployment) { // Set default revision history limit if obj.RevisionHistoryLimit == nil { - obj.RevisionHistoryLimit = pointer.Int32(1) + obj.RevisionHistoryLimit = pointer.Int32(10) } // Set default image diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/generated.proto b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/generated.proto index 17da9c75b..b3491ba38 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/generated.proto +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/generated.proto @@ -59,7 +59,7 @@ message GardenletDeployment { // +optional optional int32 replicaCount = 1; - // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 1. + // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 10. // +optional optional int32 revisionHistoryLimit = 2; diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/types_managedseed.go b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/types_managedseed.go index d1e75cda1..e7ce30b03 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/types_managedseed.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/types_managedseed.go @@ -109,7 +109,7 @@ type GardenletDeployment struct { // ReplicaCount is the number of gardenlet replicas. Defaults to 1. // +optional ReplicaCount *int32 `json:"replicaCount,omitempty" protobuf:"varint,1,opt,name=replicaCount"` - // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 1. + // RevisionHistoryLimit is the number of old gardenlet ReplicaSets to retain to allow rollback. Defaults to 10. // +optional RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,2,opt,name=revisionHistoryLimit"` // ServiceAccountName is the name of the ServiceAccount to use to run gardenlet pods. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/settings/install/install.go b/vendor/github.com/gardener/gardener/pkg/apis/settings/install/install.go new file mode 100644 index 000000000..328086047 --- /dev/null +++ b/vendor/github.com/gardener/gardener/pkg/apis/settings/install/install.go @@ -0,0 +1,39 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package install + +import ( + "github.com/gardener/gardener/pkg/apis/settings" + "github.com/gardener/gardener/pkg/apis/settings/v1alpha1" + + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + localSchemeBuilder = runtime.SchemeBuilder{ + v1alpha1.AddToScheme, + } + // AddToScheme adds all versioned API types to the given scheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Install registers the API group and adds types to a scheme. +func Install(scheme *runtime.Scheme) { + utilruntime.Must(settings.AddToScheme(scheme)) + utilruntime.Must(v1alpha1.AddToScheme(scheme)) + + utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) +} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/clientset.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/clientset.go deleted file mode 100644 index d6ec68662..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/clientset.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - - corev1alpha1 "github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1" - corev1beta1 "github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - CoreV1alpha1() corev1alpha1.CoreV1alpha1Interface - CoreV1beta1() corev1beta1.CoreV1beta1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - coreV1alpha1 *corev1alpha1.CoreV1alpha1Client - coreV1beta1 *corev1beta1.CoreV1beta1Client -} - -// CoreV1alpha1 retrieves the CoreV1alpha1Client -func (c *Clientset) CoreV1alpha1() corev1alpha1.CoreV1alpha1Interface { - return c.coreV1alpha1 -} - -// CoreV1beta1 retrieves the CoreV1beta1Client -func (c *Clientset) CoreV1beta1() corev1beta1.CoreV1beta1Interface { - return c.coreV1beta1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.coreV1alpha1, err = corev1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.coreV1beta1, err = corev1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.coreV1alpha1 = corev1alpha1.NewForConfigOrDie(c) - cs.coreV1beta1 = corev1beta1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.coreV1alpha1 = corev1alpha1.New(c) - cs.coreV1beta1 = corev1beta1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/doc.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/doc.go deleted file mode 100644 index 32d852285..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/doc.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7d4fb776b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/register.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/register.go deleted file mode 100644 index aee592da4..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - corev1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - corev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - corev1alpha1.AddToScheme, - corev1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupbucket.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupbucket.go deleted file mode 100644 index 8e168d589..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupbucket.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// BackupBucketsGetter has a method to return a BackupBucketInterface. -// A group's client should implement this interface. -type BackupBucketsGetter interface { - BackupBuckets() BackupBucketInterface -} - -// BackupBucketInterface has methods to work with BackupBucket resources. -type BackupBucketInterface interface { - Create(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.CreateOptions) (*v1alpha1.BackupBucket, error) - Update(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.UpdateOptions) (*v1alpha1.BackupBucket, error) - UpdateStatus(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.UpdateOptions) (*v1alpha1.BackupBucket, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BackupBucket, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BackupBucketList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackupBucket, err error) - BackupBucketExpansion -} - -// backupBuckets implements BackupBucketInterface -type backupBuckets struct { - client rest.Interface -} - -// newBackupBuckets returns a BackupBuckets -func newBackupBuckets(c *CoreV1alpha1Client) *backupBuckets { - return &backupBuckets{ - client: c.RESTClient(), - } -} - -// Get takes name of the backupBucket, and returns the corresponding backupBucket object, and an error if there is any. -func (c *backupBuckets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackupBucket, err error) { - result = &v1alpha1.BackupBucket{} - err = c.client.Get(). - Resource("backupbuckets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackupBuckets that match those selectors. -func (c *backupBuckets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackupBucketList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BackupBucketList{} - err = c.client.Get(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backupBuckets. -func (c *backupBuckets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backupBucket and creates it. Returns the server's representation of the backupBucket, and an error, if there is any. -func (c *backupBuckets) Create(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.CreateOptions) (result *v1alpha1.BackupBucket, err error) { - result = &v1alpha1.BackupBucket{} - err = c.client.Post(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backupBucket and updates it. Returns the server's representation of the backupBucket, and an error, if there is any. -func (c *backupBuckets) Update(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.UpdateOptions) (result *v1alpha1.BackupBucket, err error) { - result = &v1alpha1.BackupBucket{} - err = c.client.Put(). - Resource("backupbuckets"). - Name(backupBucket.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - 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 *backupBuckets) UpdateStatus(ctx context.Context, backupBucket *v1alpha1.BackupBucket, opts v1.UpdateOptions) (result *v1alpha1.BackupBucket, err error) { - result = &v1alpha1.BackupBucket{} - err = c.client.Put(). - Resource("backupbuckets"). - Name(backupBucket.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backupBucket and deletes it. Returns an error if one occurs. -func (c *backupBuckets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("backupbuckets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backupBuckets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("backupbuckets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backupBucket. -func (c *backupBuckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackupBucket, err error) { - result = &v1alpha1.BackupBucket{} - err = c.client.Patch(pt). - Resource("backupbuckets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupentry.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupentry.go deleted file mode 100644 index cf367142c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/backupentry.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// BackupEntriesGetter has a method to return a BackupEntryInterface. -// A group's client should implement this interface. -type BackupEntriesGetter interface { - BackupEntries(namespace string) BackupEntryInterface -} - -// BackupEntryInterface has methods to work with BackupEntry resources. -type BackupEntryInterface interface { - Create(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.CreateOptions) (*v1alpha1.BackupEntry, error) - Update(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.UpdateOptions) (*v1alpha1.BackupEntry, error) - UpdateStatus(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.UpdateOptions) (*v1alpha1.BackupEntry, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BackupEntry, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BackupEntryList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackupEntry, err error) - BackupEntryExpansion -} - -// backupEntries implements BackupEntryInterface -type backupEntries struct { - client rest.Interface - ns string -} - -// newBackupEntries returns a BackupEntries -func newBackupEntries(c *CoreV1alpha1Client, namespace string) *backupEntries { - return &backupEntries{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the backupEntry, and returns the corresponding backupEntry object, and an error if there is any. -func (c *backupEntries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackupEntry, err error) { - result = &v1alpha1.BackupEntry{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackupEntries that match those selectors. -func (c *backupEntries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackupEntryList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BackupEntryList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backupEntries. -func (c *backupEntries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backupEntry and creates it. Returns the server's representation of the backupEntry, and an error, if there is any. -func (c *backupEntries) Create(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.CreateOptions) (result *v1alpha1.BackupEntry, err error) { - result = &v1alpha1.BackupEntry{} - err = c.client.Post(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backupEntry and updates it. Returns the server's representation of the backupEntry, and an error, if there is any. -func (c *backupEntries) Update(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.UpdateOptions) (result *v1alpha1.BackupEntry, err error) { - result = &v1alpha1.BackupEntry{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backupentries"). - Name(backupEntry.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - 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 *backupEntries) UpdateStatus(ctx context.Context, backupEntry *v1alpha1.BackupEntry, opts v1.UpdateOptions) (result *v1alpha1.BackupEntry, err error) { - result = &v1alpha1.BackupEntry{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backupentries"). - Name(backupEntry.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backupEntry and deletes it. Returns an error if one occurs. -func (c *backupEntries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backupEntries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backupEntry. -func (c *backupEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackupEntry, err error) { - result = &v1alpha1.BackupEntry{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/cloudprofile.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/cloudprofile.go deleted file mode 100644 index 064d00471..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/cloudprofile.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// CloudProfilesGetter has a method to return a CloudProfileInterface. -// A group's client should implement this interface. -type CloudProfilesGetter interface { - CloudProfiles() CloudProfileInterface -} - -// CloudProfileInterface has methods to work with CloudProfile resources. -type CloudProfileInterface interface { - Create(ctx context.Context, cloudProfile *v1alpha1.CloudProfile, opts v1.CreateOptions) (*v1alpha1.CloudProfile, error) - Update(ctx context.Context, cloudProfile *v1alpha1.CloudProfile, opts v1.UpdateOptions) (*v1alpha1.CloudProfile, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.CloudProfile, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CloudProfileList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CloudProfile, err error) - CloudProfileExpansion -} - -// cloudProfiles implements CloudProfileInterface -type cloudProfiles struct { - client rest.Interface -} - -// newCloudProfiles returns a CloudProfiles -func newCloudProfiles(c *CoreV1alpha1Client) *cloudProfiles { - return &cloudProfiles{ - client: c.RESTClient(), - } -} - -// Get takes name of the cloudProfile, and returns the corresponding cloudProfile object, and an error if there is any. -func (c *cloudProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CloudProfile, err error) { - result = &v1alpha1.CloudProfile{} - err = c.client.Get(). - Resource("cloudprofiles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CloudProfiles that match those selectors. -func (c *cloudProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CloudProfileList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.CloudProfileList{} - err = c.client.Get(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cloudProfiles. -func (c *cloudProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cloudProfile and creates it. Returns the server's representation of the cloudProfile, and an error, if there is any. -func (c *cloudProfiles) Create(ctx context.Context, cloudProfile *v1alpha1.CloudProfile, opts v1.CreateOptions) (result *v1alpha1.CloudProfile, err error) { - result = &v1alpha1.CloudProfile{} - err = c.client.Post(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cloudProfile). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cloudProfile and updates it. Returns the server's representation of the cloudProfile, and an error, if there is any. -func (c *cloudProfiles) Update(ctx context.Context, cloudProfile *v1alpha1.CloudProfile, opts v1.UpdateOptions) (result *v1alpha1.CloudProfile, err error) { - result = &v1alpha1.CloudProfile{} - err = c.client.Put(). - Resource("cloudprofiles"). - Name(cloudProfile.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cloudProfile). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cloudProfile and deletes it. Returns an error if one occurs. -func (c *cloudProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("cloudprofiles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cloudProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("cloudprofiles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cloudProfile. -func (c *cloudProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CloudProfile, err error) { - result = &v1alpha1.CloudProfile{} - err = c.client.Patch(pt). - Resource("cloudprofiles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerdeployment.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerdeployment.go deleted file mode 100644 index 8ecd643fe..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerdeployment.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerDeploymentsGetter has a method to return a ControllerDeploymentInterface. -// A group's client should implement this interface. -type ControllerDeploymentsGetter interface { - ControllerDeployments() ControllerDeploymentInterface -} - -// ControllerDeploymentInterface has methods to work with ControllerDeployment resources. -type ControllerDeploymentInterface interface { - Create(ctx context.Context, controllerDeployment *v1alpha1.ControllerDeployment, opts v1.CreateOptions) (*v1alpha1.ControllerDeployment, error) - Update(ctx context.Context, controllerDeployment *v1alpha1.ControllerDeployment, opts v1.UpdateOptions) (*v1alpha1.ControllerDeployment, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ControllerDeployment, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ControllerDeploymentList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerDeployment, err error) - ControllerDeploymentExpansion -} - -// controllerDeployments implements ControllerDeploymentInterface -type controllerDeployments struct { - client rest.Interface -} - -// newControllerDeployments returns a ControllerDeployments -func newControllerDeployments(c *CoreV1alpha1Client) *controllerDeployments { - return &controllerDeployments{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerDeployment, and returns the corresponding controllerDeployment object, and an error if there is any. -func (c *controllerDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ControllerDeployment, err error) { - result = &v1alpha1.ControllerDeployment{} - err = c.client.Get(). - Resource("controllerdeployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerDeployments that match those selectors. -func (c *controllerDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ControllerDeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ControllerDeploymentList{} - err = c.client.Get(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerDeployments. -func (c *controllerDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerDeployment and creates it. Returns the server's representation of the controllerDeployment, and an error, if there is any. -func (c *controllerDeployments) Create(ctx context.Context, controllerDeployment *v1alpha1.ControllerDeployment, opts v1.CreateOptions) (result *v1alpha1.ControllerDeployment, err error) { - result = &v1alpha1.ControllerDeployment{} - err = c.client.Post(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerDeployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerDeployment and updates it. Returns the server's representation of the controllerDeployment, and an error, if there is any. -func (c *controllerDeployments) Update(ctx context.Context, controllerDeployment *v1alpha1.ControllerDeployment, opts v1.UpdateOptions) (result *v1alpha1.ControllerDeployment, err error) { - result = &v1alpha1.ControllerDeployment{} - err = c.client.Put(). - Resource("controllerdeployments"). - Name(controllerDeployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerDeployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerDeployment and deletes it. Returns an error if one occurs. -func (c *controllerDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerdeployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerdeployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerDeployment. -func (c *controllerDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerDeployment, err error) { - result = &v1alpha1.ControllerDeployment{} - err = c.client.Patch(pt). - Resource("controllerdeployments"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerinstallation.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerinstallation.go deleted file mode 100644 index 219170efe..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerinstallation.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerInstallationsGetter has a method to return a ControllerInstallationInterface. -// A group's client should implement this interface. -type ControllerInstallationsGetter interface { - ControllerInstallations() ControllerInstallationInterface -} - -// ControllerInstallationInterface has methods to work with ControllerInstallation resources. -type ControllerInstallationInterface interface { - Create(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.CreateOptions) (*v1alpha1.ControllerInstallation, error) - Update(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.UpdateOptions) (*v1alpha1.ControllerInstallation, error) - UpdateStatus(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.UpdateOptions) (*v1alpha1.ControllerInstallation, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ControllerInstallation, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ControllerInstallationList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerInstallation, err error) - ControllerInstallationExpansion -} - -// controllerInstallations implements ControllerInstallationInterface -type controllerInstallations struct { - client rest.Interface -} - -// newControllerInstallations returns a ControllerInstallations -func newControllerInstallations(c *CoreV1alpha1Client) *controllerInstallations { - return &controllerInstallations{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerInstallation, and returns the corresponding controllerInstallation object, and an error if there is any. -func (c *controllerInstallations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ControllerInstallation, err error) { - result = &v1alpha1.ControllerInstallation{} - err = c.client.Get(). - Resource("controllerinstallations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerInstallations that match those selectors. -func (c *controllerInstallations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ControllerInstallationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ControllerInstallationList{} - err = c.client.Get(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerInstallations. -func (c *controllerInstallations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerInstallation and creates it. Returns the server's representation of the controllerInstallation, and an error, if there is any. -func (c *controllerInstallations) Create(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.CreateOptions) (result *v1alpha1.ControllerInstallation, err error) { - result = &v1alpha1.ControllerInstallation{} - err = c.client.Post(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerInstallation and updates it. Returns the server's representation of the controllerInstallation, and an error, if there is any. -func (c *controllerInstallations) Update(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.UpdateOptions) (result *v1alpha1.ControllerInstallation, err error) { - result = &v1alpha1.ControllerInstallation{} - err = c.client.Put(). - Resource("controllerinstallations"). - Name(controllerInstallation.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - 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 *controllerInstallations) UpdateStatus(ctx context.Context, controllerInstallation *v1alpha1.ControllerInstallation, opts v1.UpdateOptions) (result *v1alpha1.ControllerInstallation, err error) { - result = &v1alpha1.ControllerInstallation{} - err = c.client.Put(). - Resource("controllerinstallations"). - Name(controllerInstallation.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerInstallation and deletes it. Returns an error if one occurs. -func (c *controllerInstallations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerinstallations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerInstallations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerinstallations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerInstallation. -func (c *controllerInstallations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerInstallation, err error) { - result = &v1alpha1.ControllerInstallation{} - err = c.client.Patch(pt). - Resource("controllerinstallations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerregistration.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerregistration.go deleted file mode 100644 index 67890f524..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/controllerregistration.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerRegistrationsGetter has a method to return a ControllerRegistrationInterface. -// A group's client should implement this interface. -type ControllerRegistrationsGetter interface { - ControllerRegistrations() ControllerRegistrationInterface -} - -// ControllerRegistrationInterface has methods to work with ControllerRegistration resources. -type ControllerRegistrationInterface interface { - Create(ctx context.Context, controllerRegistration *v1alpha1.ControllerRegistration, opts v1.CreateOptions) (*v1alpha1.ControllerRegistration, error) - Update(ctx context.Context, controllerRegistration *v1alpha1.ControllerRegistration, opts v1.UpdateOptions) (*v1alpha1.ControllerRegistration, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ControllerRegistration, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ControllerRegistrationList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerRegistration, err error) - ControllerRegistrationExpansion -} - -// controllerRegistrations implements ControllerRegistrationInterface -type controllerRegistrations struct { - client rest.Interface -} - -// newControllerRegistrations returns a ControllerRegistrations -func newControllerRegistrations(c *CoreV1alpha1Client) *controllerRegistrations { - return &controllerRegistrations{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerRegistration, and returns the corresponding controllerRegistration object, and an error if there is any. -func (c *controllerRegistrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ControllerRegistration, err error) { - result = &v1alpha1.ControllerRegistration{} - err = c.client.Get(). - Resource("controllerregistrations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerRegistrations that match those selectors. -func (c *controllerRegistrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ControllerRegistrationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ControllerRegistrationList{} - err = c.client.Get(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerRegistrations. -func (c *controllerRegistrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerRegistration and creates it. Returns the server's representation of the controllerRegistration, and an error, if there is any. -func (c *controllerRegistrations) Create(ctx context.Context, controllerRegistration *v1alpha1.ControllerRegistration, opts v1.CreateOptions) (result *v1alpha1.ControllerRegistration, err error) { - result = &v1alpha1.ControllerRegistration{} - err = c.client.Post(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRegistration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerRegistration and updates it. Returns the server's representation of the controllerRegistration, and an error, if there is any. -func (c *controllerRegistrations) Update(ctx context.Context, controllerRegistration *v1alpha1.ControllerRegistration, opts v1.UpdateOptions) (result *v1alpha1.ControllerRegistration, err error) { - result = &v1alpha1.ControllerRegistration{} - err = c.client.Put(). - Resource("controllerregistrations"). - Name(controllerRegistration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRegistration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerRegistration and deletes it. Returns an error if one occurs. -func (c *controllerRegistrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerregistrations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerRegistrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerregistrations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerRegistration. -func (c *controllerRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ControllerRegistration, err error) { - result = &v1alpha1.ControllerRegistration{} - err = c.client.Patch(pt). - Resource("controllerregistrations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/core_client.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/core_client.go deleted file mode 100644 index 617ef417e..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/core_client.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type CoreV1alpha1Interface interface { - RESTClient() rest.Interface - BackupBucketsGetter - BackupEntriesGetter - CloudProfilesGetter - ControllerDeploymentsGetter - ControllerInstallationsGetter - ControllerRegistrationsGetter - ExposureClassesGetter - PlantsGetter - ProjectsGetter - QuotasGetter - SecretBindingsGetter - SeedsGetter - ShootsGetter - ShootExtensionStatusesGetter - ShootStatesGetter -} - -// CoreV1alpha1Client is used to interact with features provided by the core.gardener.cloud group. -type CoreV1alpha1Client struct { - restClient rest.Interface -} - -func (c *CoreV1alpha1Client) BackupBuckets() BackupBucketInterface { - return newBackupBuckets(c) -} - -func (c *CoreV1alpha1Client) BackupEntries(namespace string) BackupEntryInterface { - return newBackupEntries(c, namespace) -} - -func (c *CoreV1alpha1Client) CloudProfiles() CloudProfileInterface { - return newCloudProfiles(c) -} - -func (c *CoreV1alpha1Client) ControllerDeployments() ControllerDeploymentInterface { - return newControllerDeployments(c) -} - -func (c *CoreV1alpha1Client) ControllerInstallations() ControllerInstallationInterface { - return newControllerInstallations(c) -} - -func (c *CoreV1alpha1Client) ControllerRegistrations() ControllerRegistrationInterface { - return newControllerRegistrations(c) -} - -func (c *CoreV1alpha1Client) ExposureClasses() ExposureClassInterface { - return newExposureClasses(c) -} - -func (c *CoreV1alpha1Client) Plants(namespace string) PlantInterface { - return newPlants(c, namespace) -} - -func (c *CoreV1alpha1Client) Projects() ProjectInterface { - return newProjects(c) -} - -func (c *CoreV1alpha1Client) Quotas(namespace string) QuotaInterface { - return newQuotas(c, namespace) -} - -func (c *CoreV1alpha1Client) SecretBindings(namespace string) SecretBindingInterface { - return newSecretBindings(c, namespace) -} - -func (c *CoreV1alpha1Client) Seeds() SeedInterface { - return newSeeds(c) -} - -func (c *CoreV1alpha1Client) Shoots(namespace string) ShootInterface { - return newShoots(c, namespace) -} - -func (c *CoreV1alpha1Client) ShootExtensionStatuses(namespace string) ShootExtensionStatusInterface { - return newShootExtensionStatuses(c, namespace) -} - -func (c *CoreV1alpha1Client) ShootStates(namespace string) ShootStateInterface { - return newShootStates(c, namespace) -} - -// NewForConfig creates a new CoreV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*CoreV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &CoreV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new CoreV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CoreV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CoreV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *CoreV1alpha1Client { - return &CoreV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *CoreV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/doc.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/doc.go deleted file mode 100644 index 828c8ebe1..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/exposureclass.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/exposureclass.go deleted file mode 100644 index bab70b1b5..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/exposureclass.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ExposureClassesGetter has a method to return a ExposureClassInterface. -// A group's client should implement this interface. -type ExposureClassesGetter interface { - ExposureClasses() ExposureClassInterface -} - -// ExposureClassInterface has methods to work with ExposureClass resources. -type ExposureClassInterface interface { - Create(ctx context.Context, exposureClass *v1alpha1.ExposureClass, opts v1.CreateOptions) (*v1alpha1.ExposureClass, error) - Update(ctx context.Context, exposureClass *v1alpha1.ExposureClass, opts v1.UpdateOptions) (*v1alpha1.ExposureClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ExposureClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ExposureClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ExposureClass, err error) - ExposureClassExpansion -} - -// exposureClasses implements ExposureClassInterface -type exposureClasses struct { - client rest.Interface -} - -// newExposureClasses returns a ExposureClasses -func newExposureClasses(c *CoreV1alpha1Client) *exposureClasses { - return &exposureClasses{ - client: c.RESTClient(), - } -} - -// Get takes name of the exposureClass, and returns the corresponding exposureClass object, and an error if there is any. -func (c *exposureClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ExposureClass, err error) { - result = &v1alpha1.ExposureClass{} - err = c.client.Get(). - Resource("exposureclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ExposureClasses that match those selectors. -func (c *exposureClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ExposureClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ExposureClassList{} - err = c.client.Get(). - Resource("exposureclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested exposureClasses. -func (c *exposureClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("exposureclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a exposureClass and creates it. Returns the server's representation of the exposureClass, and an error, if there is any. -func (c *exposureClasses) Create(ctx context.Context, exposureClass *v1alpha1.ExposureClass, opts v1.CreateOptions) (result *v1alpha1.ExposureClass, err error) { - result = &v1alpha1.ExposureClass{} - err = c.client.Post(). - Resource("exposureclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(exposureClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a exposureClass and updates it. Returns the server's representation of the exposureClass, and an error, if there is any. -func (c *exposureClasses) Update(ctx context.Context, exposureClass *v1alpha1.ExposureClass, opts v1.UpdateOptions) (result *v1alpha1.ExposureClass, err error) { - result = &v1alpha1.ExposureClass{} - err = c.client.Put(). - Resource("exposureclasses"). - Name(exposureClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(exposureClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the exposureClass and deletes it. Returns an error if one occurs. -func (c *exposureClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("exposureclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *exposureClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("exposureclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched exposureClass. -func (c *exposureClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ExposureClass, err error) { - result = &v1alpha1.ExposureClass{} - err = c.client.Patch(pt). - Resource("exposureclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/generated_expansion.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/generated_expansion.go deleted file mode 100644 index eaba1f41c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type BackupBucketExpansion interface{} - -type BackupEntryExpansion interface{} - -type CloudProfileExpansion interface{} - -type ControllerDeploymentExpansion interface{} - -type ControllerInstallationExpansion interface{} - -type ControllerRegistrationExpansion interface{} - -type ExposureClassExpansion interface{} - -type PlantExpansion interface{} - -type ProjectExpansion interface{} - -type QuotaExpansion interface{} - -type SecretBindingExpansion interface{} - -type SeedExpansion interface{} - -type ShootExpansion interface{} - -type ShootExtensionStatusExpansion interface{} - -type ShootStateExpansion interface{} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/plant.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/plant.go deleted file mode 100644 index 2c5fb0c7f..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/plant.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// PlantsGetter has a method to return a PlantInterface. -// A group's client should implement this interface. -type PlantsGetter interface { - Plants(namespace string) PlantInterface -} - -// PlantInterface has methods to work with Plant resources. -type PlantInterface interface { - Create(ctx context.Context, plant *v1alpha1.Plant, opts v1.CreateOptions) (*v1alpha1.Plant, error) - Update(ctx context.Context, plant *v1alpha1.Plant, opts v1.UpdateOptions) (*v1alpha1.Plant, error) - UpdateStatus(ctx context.Context, plant *v1alpha1.Plant, opts v1.UpdateOptions) (*v1alpha1.Plant, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Plant, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PlantList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Plant, err error) - PlantExpansion -} - -// plants implements PlantInterface -type plants struct { - client rest.Interface - ns string -} - -// newPlants returns a Plants -func newPlants(c *CoreV1alpha1Client, namespace string) *plants { - return &plants{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the plant, and returns the corresponding plant object, and an error if there is any. -func (c *plants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Plant, err error) { - result = &v1alpha1.Plant{} - err = c.client.Get(). - Namespace(c.ns). - Resource("plants"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Plants that match those selectors. -func (c *plants) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PlantList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PlantList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested plants. -func (c *plants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a plant and creates it. Returns the server's representation of the plant, and an error, if there is any. -func (c *plants) Create(ctx context.Context, plant *v1alpha1.Plant, opts v1.CreateOptions) (result *v1alpha1.Plant, err error) { - result = &v1alpha1.Plant{} - err = c.client.Post(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a plant and updates it. Returns the server's representation of the plant, and an error, if there is any. -func (c *plants) Update(ctx context.Context, plant *v1alpha1.Plant, opts v1.UpdateOptions) (result *v1alpha1.Plant, err error) { - result = &v1alpha1.Plant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("plants"). - Name(plant.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - 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 *plants) UpdateStatus(ctx context.Context, plant *v1alpha1.Plant, opts v1.UpdateOptions) (result *v1alpha1.Plant, err error) { - result = &v1alpha1.Plant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("plants"). - Name(plant.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the plant and deletes it. Returns an error if one occurs. -func (c *plants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("plants"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *plants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched plant. -func (c *plants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Plant, err error) { - result = &v1alpha1.Plant{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("plants"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/project.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/project.go deleted file mode 100644 index a42bf152e..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/project.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ProjectsGetter has a method to return a ProjectInterface. -// A group's client should implement this interface. -type ProjectsGetter interface { - Projects() ProjectInterface -} - -// ProjectInterface has methods to work with Project resources. -type ProjectInterface interface { - Create(ctx context.Context, project *v1alpha1.Project, opts v1.CreateOptions) (*v1alpha1.Project, error) - Update(ctx context.Context, project *v1alpha1.Project, opts v1.UpdateOptions) (*v1alpha1.Project, error) - UpdateStatus(ctx context.Context, project *v1alpha1.Project, opts v1.UpdateOptions) (*v1alpha1.Project, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Project, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ProjectList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Project, err error) - ProjectExpansion -} - -// projects implements ProjectInterface -type projects struct { - client rest.Interface -} - -// newProjects returns a Projects -func newProjects(c *CoreV1alpha1Client) *projects { - return &projects{ - client: c.RESTClient(), - } -} - -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *projects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Get(). - Resource("projects"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *projects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ProjectList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ProjectList{} - err = c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projects. -func (c *projects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Create(ctx context.Context, project *v1alpha1.Project, opts v1.CreateOptions) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Post(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Update(ctx context.Context, project *v1alpha1.Project, opts v1.UpdateOptions) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - 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 *projects) UpdateStatus(ctx context.Context, project *v1alpha1.Project, opts v1.UpdateOptions) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the project and deletes it. Returns an error if one occurs. -func (c *projects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("projects"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("projects"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched project. -func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Patch(pt). - Resource("projects"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/quota.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/quota.go deleted file mode 100644 index 1bd530ef1..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/quota.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// QuotasGetter has a method to return a QuotaInterface. -// A group's client should implement this interface. -type QuotasGetter interface { - Quotas(namespace string) QuotaInterface -} - -// QuotaInterface has methods to work with Quota resources. -type QuotaInterface interface { - Create(ctx context.Context, quota *v1alpha1.Quota, opts v1.CreateOptions) (*v1alpha1.Quota, error) - Update(ctx context.Context, quota *v1alpha1.Quota, opts v1.UpdateOptions) (*v1alpha1.Quota, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Quota, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.QuotaList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Quota, err error) - QuotaExpansion -} - -// quotas implements QuotaInterface -type quotas struct { - client rest.Interface - ns string -} - -// newQuotas returns a Quotas -func newQuotas(c *CoreV1alpha1Client, namespace string) *quotas { - return "as{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the quota, and returns the corresponding quota object, and an error if there is any. -func (c *quotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Quota, err error) { - result = &v1alpha1.Quota{} - err = c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Quotas that match those selectors. -func (c *quotas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.QuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.QuotaList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested quotas. -func (c *quotas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a quota and creates it. Returns the server's representation of the quota, and an error, if there is any. -func (c *quotas) Create(ctx context.Context, quota *v1alpha1.Quota, opts v1.CreateOptions) (result *v1alpha1.Quota, err error) { - result = &v1alpha1.Quota{} - err = c.client.Post(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(quota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a quota and updates it. Returns the server's representation of the quota, and an error, if there is any. -func (c *quotas) Update(ctx context.Context, quota *v1alpha1.Quota, opts v1.UpdateOptions) (result *v1alpha1.Quota, err error) { - result = &v1alpha1.Quota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("quotas"). - Name(quota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(quota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the quota and deletes it. Returns an error if one occurs. -func (c *quotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("quotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *quotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched quota. -func (c *quotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Quota, err error) { - result = &v1alpha1.Quota{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("quotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/secretbinding.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/secretbinding.go deleted file mode 100644 index 0798e053b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/secretbinding.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// SecretBindingsGetter has a method to return a SecretBindingInterface. -// A group's client should implement this interface. -type SecretBindingsGetter interface { - SecretBindings(namespace string) SecretBindingInterface -} - -// SecretBindingInterface has methods to work with SecretBinding resources. -type SecretBindingInterface interface { - Create(ctx context.Context, secretBinding *v1alpha1.SecretBinding, opts v1.CreateOptions) (*v1alpha1.SecretBinding, error) - Update(ctx context.Context, secretBinding *v1alpha1.SecretBinding, opts v1.UpdateOptions) (*v1alpha1.SecretBinding, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.SecretBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.SecretBindingList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.SecretBinding, err error) - SecretBindingExpansion -} - -// secretBindings implements SecretBindingInterface -type secretBindings struct { - client rest.Interface - ns string -} - -// newSecretBindings returns a SecretBindings -func newSecretBindings(c *CoreV1alpha1Client, namespace string) *secretBindings { - return &secretBindings{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the secretBinding, and returns the corresponding secretBinding object, and an error if there is any. -func (c *secretBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.SecretBinding, err error) { - result = &v1alpha1.SecretBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SecretBindings that match those selectors. -func (c *secretBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.SecretBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.SecretBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested secretBindings. -func (c *secretBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a secretBinding and creates it. Returns the server's representation of the secretBinding, and an error, if there is any. -func (c *secretBindings) Create(ctx context.Context, secretBinding *v1alpha1.SecretBinding, opts v1.CreateOptions) (result *v1alpha1.SecretBinding, err error) { - result = &v1alpha1.SecretBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secretBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a secretBinding and updates it. Returns the server's representation of the secretBinding, and an error, if there is any. -func (c *secretBindings) Update(ctx context.Context, secretBinding *v1alpha1.SecretBinding, opts v1.UpdateOptions) (result *v1alpha1.SecretBinding, err error) { - result = &v1alpha1.SecretBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("secretbindings"). - Name(secretBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secretBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the secretBinding and deletes it. Returns an error if one occurs. -func (c *secretBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *secretBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched secretBinding. -func (c *secretBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.SecretBinding, err error) { - result = &v1alpha1.SecretBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/seed.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/seed.go deleted file mode 100644 index 97dee9344..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/seed.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// SeedsGetter has a method to return a SeedInterface. -// A group's client should implement this interface. -type SeedsGetter interface { - Seeds() SeedInterface -} - -// SeedInterface has methods to work with Seed resources. -type SeedInterface interface { - Create(ctx context.Context, seed *v1alpha1.Seed, opts v1.CreateOptions) (*v1alpha1.Seed, error) - Update(ctx context.Context, seed *v1alpha1.Seed, opts v1.UpdateOptions) (*v1alpha1.Seed, error) - UpdateStatus(ctx context.Context, seed *v1alpha1.Seed, opts v1.UpdateOptions) (*v1alpha1.Seed, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Seed, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.SeedList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Seed, err error) - SeedExpansion -} - -// seeds implements SeedInterface -type seeds struct { - client rest.Interface -} - -// newSeeds returns a Seeds -func newSeeds(c *CoreV1alpha1Client) *seeds { - return &seeds{ - client: c.RESTClient(), - } -} - -// Get takes name of the seed, and returns the corresponding seed object, and an error if there is any. -func (c *seeds) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Seed, err error) { - result = &v1alpha1.Seed{} - err = c.client.Get(). - Resource("seeds"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Seeds that match those selectors. -func (c *seeds) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.SeedList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.SeedList{} - err = c.client.Get(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested seeds. -func (c *seeds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a seed and creates it. Returns the server's representation of the seed, and an error, if there is any. -func (c *seeds) Create(ctx context.Context, seed *v1alpha1.Seed, opts v1.CreateOptions) (result *v1alpha1.Seed, err error) { - result = &v1alpha1.Seed{} - err = c.client.Post(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a seed and updates it. Returns the server's representation of the seed, and an error, if there is any. -func (c *seeds) Update(ctx context.Context, seed *v1alpha1.Seed, opts v1.UpdateOptions) (result *v1alpha1.Seed, err error) { - result = &v1alpha1.Seed{} - err = c.client.Put(). - Resource("seeds"). - Name(seed.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - 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 *seeds) UpdateStatus(ctx context.Context, seed *v1alpha1.Seed, opts v1.UpdateOptions) (result *v1alpha1.Seed, err error) { - result = &v1alpha1.Seed{} - err = c.client.Put(). - Resource("seeds"). - Name(seed.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the seed and deletes it. Returns an error if one occurs. -func (c *seeds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("seeds"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *seeds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("seeds"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched seed. -func (c *seeds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Seed, err error) { - result = &v1alpha1.Seed{} - err = c.client.Patch(pt). - Resource("seeds"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shoot.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shoot.go deleted file mode 100644 index 8a217cfa9..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shoot.go +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - authenticationv1alpha1 "github.com/gardener/gardener/pkg/apis/authentication/v1alpha1" - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ShootsGetter has a method to return a ShootInterface. -// A group's client should implement this interface. -type ShootsGetter interface { - Shoots(namespace string) ShootInterface -} - -// ShootInterface has methods to work with Shoot resources. -type ShootInterface interface { - Create(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.CreateOptions) (*v1alpha1.Shoot, error) - Update(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.UpdateOptions) (*v1alpha1.Shoot, error) - UpdateStatus(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.UpdateOptions) (*v1alpha1.Shoot, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Shoot, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ShootList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Shoot, err error) - CreateAdminKubeconfigRequest(ctx context.Context, shootName string, adminKubeconfigRequest *authenticationv1alpha1.AdminKubeconfigRequest, opts v1.CreateOptions) (*authenticationv1alpha1.AdminKubeconfigRequest, error) - - ShootExpansion -} - -// shoots implements ShootInterface -type shoots struct { - client rest.Interface - ns string -} - -// newShoots returns a Shoots -func newShoots(c *CoreV1alpha1Client, namespace string) *shoots { - return &shoots{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the shoot, and returns the corresponding shoot object, and an error if there is any. -func (c *shoots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Shoot, err error) { - result = &v1alpha1.Shoot{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Shoots that match those selectors. -func (c *shoots) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ShootList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ShootList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested shoots. -func (c *shoots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a shoot and creates it. Returns the server's representation of the shoot, and an error, if there is any. -func (c *shoots) Create(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.CreateOptions) (result *v1alpha1.Shoot, err error) { - result = &v1alpha1.Shoot{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a shoot and updates it. Returns the server's representation of the shoot, and an error, if there is any. -func (c *shoots) Update(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.UpdateOptions) (result *v1alpha1.Shoot, err error) { - result = &v1alpha1.Shoot{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shoots"). - Name(shoot.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - 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 *shoots) UpdateStatus(ctx context.Context, shoot *v1alpha1.Shoot, opts v1.UpdateOptions) (result *v1alpha1.Shoot, err error) { - result = &v1alpha1.Shoot{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shoots"). - Name(shoot.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the shoot and deletes it. Returns an error if one occurs. -func (c *shoots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("shoots"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *shoots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched shoot. -func (c *shoots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Shoot, err error) { - result = &v1alpha1.Shoot{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("shoots"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// CreateAdminKubeconfigRequest takes the representation of a adminKubeconfigRequest and creates it. Returns the server's representation of the adminKubeconfigRequest, and an error, if there is any. -func (c *shoots) CreateAdminKubeconfigRequest(ctx context.Context, shootName string, adminKubeconfigRequest *authenticationv1alpha1.AdminKubeconfigRequest, opts v1.CreateOptions) (result *authenticationv1alpha1.AdminKubeconfigRequest, err error) { - result = &authenticationv1alpha1.AdminKubeconfigRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shoots"). - Name(shootName). - SubResource("adminkubeconfig"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(adminKubeconfigRequest). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootextensionstatus.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootextensionstatus.go deleted file mode 100644 index 90ee4528c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootextensionstatus.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ShootExtensionStatusesGetter has a method to return a ShootExtensionStatusInterface. -// A group's client should implement this interface. -type ShootExtensionStatusesGetter interface { - ShootExtensionStatuses(namespace string) ShootExtensionStatusInterface -} - -// ShootExtensionStatusInterface has methods to work with ShootExtensionStatus resources. -type ShootExtensionStatusInterface interface { - Create(ctx context.Context, shootExtensionStatus *v1alpha1.ShootExtensionStatus, opts v1.CreateOptions) (*v1alpha1.ShootExtensionStatus, error) - Update(ctx context.Context, shootExtensionStatus *v1alpha1.ShootExtensionStatus, opts v1.UpdateOptions) (*v1alpha1.ShootExtensionStatus, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ShootExtensionStatus, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ShootExtensionStatusList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ShootExtensionStatus, err error) - ShootExtensionStatusExpansion -} - -// shootExtensionStatuses implements ShootExtensionStatusInterface -type shootExtensionStatuses struct { - client rest.Interface - ns string -} - -// newShootExtensionStatuses returns a ShootExtensionStatuses -func newShootExtensionStatuses(c *CoreV1alpha1Client, namespace string) *shootExtensionStatuses { - return &shootExtensionStatuses{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the shootExtensionStatus, and returns the corresponding shootExtensionStatus object, and an error if there is any. -func (c *shootExtensionStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ShootExtensionStatus, err error) { - result = &v1alpha1.ShootExtensionStatus{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ShootExtensionStatuses that match those selectors. -func (c *shootExtensionStatuses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ShootExtensionStatusList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ShootExtensionStatusList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested shootExtensionStatuses. -func (c *shootExtensionStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a shootExtensionStatus and creates it. Returns the server's representation of the shootExtensionStatus, and an error, if there is any. -func (c *shootExtensionStatuses) Create(ctx context.Context, shootExtensionStatus *v1alpha1.ShootExtensionStatus, opts v1.CreateOptions) (result *v1alpha1.ShootExtensionStatus, err error) { - result = &v1alpha1.ShootExtensionStatus{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shootExtensionStatus). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a shootExtensionStatus and updates it. Returns the server's representation of the shootExtensionStatus, and an error, if there is any. -func (c *shootExtensionStatuses) Update(ctx context.Context, shootExtensionStatus *v1alpha1.ShootExtensionStatus, opts v1.UpdateOptions) (result *v1alpha1.ShootExtensionStatus, err error) { - result = &v1alpha1.ShootExtensionStatus{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - Name(shootExtensionStatus.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shootExtensionStatus). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the shootExtensionStatus and deletes it. Returns an error if one occurs. -func (c *shootExtensionStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *shootExtensionStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("shootextensionstatuses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched shootExtensionStatus. -func (c *shootExtensionStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ShootExtensionStatus, err error) { - result = &v1alpha1.ShootExtensionStatus{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("shootextensionstatuses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootstate.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootstate.go deleted file mode 100644 index 2a28e0a19..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1/shootstate.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/core/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ShootStatesGetter has a method to return a ShootStateInterface. -// A group's client should implement this interface. -type ShootStatesGetter interface { - ShootStates(namespace string) ShootStateInterface -} - -// ShootStateInterface has methods to work with ShootState resources. -type ShootStateInterface interface { - Create(ctx context.Context, shootState *v1alpha1.ShootState, opts v1.CreateOptions) (*v1alpha1.ShootState, error) - Update(ctx context.Context, shootState *v1alpha1.ShootState, opts v1.UpdateOptions) (*v1alpha1.ShootState, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ShootState, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ShootStateList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ShootState, err error) - ShootStateExpansion -} - -// shootStates implements ShootStateInterface -type shootStates struct { - client rest.Interface - ns string -} - -// newShootStates returns a ShootStates -func newShootStates(c *CoreV1alpha1Client, namespace string) *shootStates { - return &shootStates{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the shootState, and returns the corresponding shootState object, and an error if there is any. -func (c *shootStates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ShootState, err error) { - result = &v1alpha1.ShootState{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shootstates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ShootStates that match those selectors. -func (c *shootStates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ShootStateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ShootStateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shootstates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested shootStates. -func (c *shootStates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("shootstates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a shootState and creates it. Returns the server's representation of the shootState, and an error, if there is any. -func (c *shootStates) Create(ctx context.Context, shootState *v1alpha1.ShootState, opts v1.CreateOptions) (result *v1alpha1.ShootState, err error) { - result = &v1alpha1.ShootState{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shootstates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shootState). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a shootState and updates it. Returns the server's representation of the shootState, and an error, if there is any. -func (c *shootStates) Update(ctx context.Context, shootState *v1alpha1.ShootState, opts v1.UpdateOptions) (result *v1alpha1.ShootState, err error) { - result = &v1alpha1.ShootState{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shootstates"). - Name(shootState.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shootState). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the shootState and deletes it. Returns an error if one occurs. -func (c *shootStates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("shootstates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *shootStates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("shootstates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched shootState. -func (c *shootStates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ShootState, err error) { - result = &v1alpha1.ShootState{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("shootstates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupbucket.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupbucket.go deleted file mode 100644 index a7238c9a6..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupbucket.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// BackupBucketsGetter has a method to return a BackupBucketInterface. -// A group's client should implement this interface. -type BackupBucketsGetter interface { - BackupBuckets() BackupBucketInterface -} - -// BackupBucketInterface has methods to work with BackupBucket resources. -type BackupBucketInterface interface { - Create(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.CreateOptions) (*v1beta1.BackupBucket, error) - Update(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.UpdateOptions) (*v1beta1.BackupBucket, error) - UpdateStatus(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.UpdateOptions) (*v1beta1.BackupBucket, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackupBucket, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackupBucketList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupBucket, err error) - BackupBucketExpansion -} - -// backupBuckets implements BackupBucketInterface -type backupBuckets struct { - client rest.Interface -} - -// newBackupBuckets returns a BackupBuckets -func newBackupBuckets(c *CoreV1beta1Client) *backupBuckets { - return &backupBuckets{ - client: c.RESTClient(), - } -} - -// Get takes name of the backupBucket, and returns the corresponding backupBucket object, and an error if there is any. -func (c *backupBuckets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupBucket, err error) { - result = &v1beta1.BackupBucket{} - err = c.client.Get(). - Resource("backupbuckets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackupBuckets that match those selectors. -func (c *backupBuckets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupBucketList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.BackupBucketList{} - err = c.client.Get(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backupBuckets. -func (c *backupBuckets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backupBucket and creates it. Returns the server's representation of the backupBucket, and an error, if there is any. -func (c *backupBuckets) Create(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.CreateOptions) (result *v1beta1.BackupBucket, err error) { - result = &v1beta1.BackupBucket{} - err = c.client.Post(). - Resource("backupbuckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backupBucket and updates it. Returns the server's representation of the backupBucket, and an error, if there is any. -func (c *backupBuckets) Update(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.UpdateOptions) (result *v1beta1.BackupBucket, err error) { - result = &v1beta1.BackupBucket{} - err = c.client.Put(). - Resource("backupbuckets"). - Name(backupBucket.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - 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 *backupBuckets) UpdateStatus(ctx context.Context, backupBucket *v1beta1.BackupBucket, opts v1.UpdateOptions) (result *v1beta1.BackupBucket, err error) { - result = &v1beta1.BackupBucket{} - err = c.client.Put(). - Resource("backupbuckets"). - Name(backupBucket.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupBucket). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backupBucket and deletes it. Returns an error if one occurs. -func (c *backupBuckets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("backupbuckets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backupBuckets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("backupbuckets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backupBucket. -func (c *backupBuckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupBucket, err error) { - result = &v1beta1.BackupBucket{} - err = c.client.Patch(pt). - Resource("backupbuckets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupentry.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupentry.go deleted file mode 100644 index 13880f074..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/backupentry.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// BackupEntriesGetter has a method to return a BackupEntryInterface. -// A group's client should implement this interface. -type BackupEntriesGetter interface { - BackupEntries(namespace string) BackupEntryInterface -} - -// BackupEntryInterface has methods to work with BackupEntry resources. -type BackupEntryInterface interface { - Create(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.CreateOptions) (*v1beta1.BackupEntry, error) - Update(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.UpdateOptions) (*v1beta1.BackupEntry, error) - UpdateStatus(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.UpdateOptions) (*v1beta1.BackupEntry, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackupEntry, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackupEntryList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupEntry, err error) - BackupEntryExpansion -} - -// backupEntries implements BackupEntryInterface -type backupEntries struct { - client rest.Interface - ns string -} - -// newBackupEntries returns a BackupEntries -func newBackupEntries(c *CoreV1beta1Client, namespace string) *backupEntries { - return &backupEntries{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the backupEntry, and returns the corresponding backupEntry object, and an error if there is any. -func (c *backupEntries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupEntry, err error) { - result = &v1beta1.BackupEntry{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackupEntries that match those selectors. -func (c *backupEntries) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupEntryList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.BackupEntryList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backupEntries. -func (c *backupEntries) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backupEntry and creates it. Returns the server's representation of the backupEntry, and an error, if there is any. -func (c *backupEntries) Create(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.CreateOptions) (result *v1beta1.BackupEntry, err error) { - result = &v1beta1.BackupEntry{} - err = c.client.Post(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backupEntry and updates it. Returns the server's representation of the backupEntry, and an error, if there is any. -func (c *backupEntries) Update(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.UpdateOptions) (result *v1beta1.BackupEntry, err error) { - result = &v1beta1.BackupEntry{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backupentries"). - Name(backupEntry.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - 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 *backupEntries) UpdateStatus(ctx context.Context, backupEntry *v1beta1.BackupEntry, opts v1.UpdateOptions) (result *v1beta1.BackupEntry, err error) { - result = &v1beta1.BackupEntry{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backupentries"). - Name(backupEntry.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backupEntry). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backupEntry and deletes it. Returns an error if one occurs. -func (c *backupEntries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backupEntries) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("backupentries"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backupEntry. -func (c *backupEntries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupEntry, err error) { - result = &v1beta1.BackupEntry{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("backupentries"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/cloudprofile.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/cloudprofile.go deleted file mode 100644 index 37b7cab27..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/cloudprofile.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// CloudProfilesGetter has a method to return a CloudProfileInterface. -// A group's client should implement this interface. -type CloudProfilesGetter interface { - CloudProfiles() CloudProfileInterface -} - -// CloudProfileInterface has methods to work with CloudProfile resources. -type CloudProfileInterface interface { - Create(ctx context.Context, cloudProfile *v1beta1.CloudProfile, opts v1.CreateOptions) (*v1beta1.CloudProfile, error) - Update(ctx context.Context, cloudProfile *v1beta1.CloudProfile, opts v1.UpdateOptions) (*v1beta1.CloudProfile, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CloudProfile, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CloudProfileList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CloudProfile, err error) - CloudProfileExpansion -} - -// cloudProfiles implements CloudProfileInterface -type cloudProfiles struct { - client rest.Interface -} - -// newCloudProfiles returns a CloudProfiles -func newCloudProfiles(c *CoreV1beta1Client) *cloudProfiles { - return &cloudProfiles{ - client: c.RESTClient(), - } -} - -// Get takes name of the cloudProfile, and returns the corresponding cloudProfile object, and an error if there is any. -func (c *cloudProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CloudProfile, err error) { - result = &v1beta1.CloudProfile{} - err = c.client.Get(). - Resource("cloudprofiles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CloudProfiles that match those selectors. -func (c *cloudProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CloudProfileList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CloudProfileList{} - err = c.client.Get(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cloudProfiles. -func (c *cloudProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cloudProfile and creates it. Returns the server's representation of the cloudProfile, and an error, if there is any. -func (c *cloudProfiles) Create(ctx context.Context, cloudProfile *v1beta1.CloudProfile, opts v1.CreateOptions) (result *v1beta1.CloudProfile, err error) { - result = &v1beta1.CloudProfile{} - err = c.client.Post(). - Resource("cloudprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cloudProfile). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cloudProfile and updates it. Returns the server's representation of the cloudProfile, and an error, if there is any. -func (c *cloudProfiles) Update(ctx context.Context, cloudProfile *v1beta1.CloudProfile, opts v1.UpdateOptions) (result *v1beta1.CloudProfile, err error) { - result = &v1beta1.CloudProfile{} - err = c.client.Put(). - Resource("cloudprofiles"). - Name(cloudProfile.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cloudProfile). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cloudProfile and deletes it. Returns an error if one occurs. -func (c *cloudProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("cloudprofiles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cloudProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("cloudprofiles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cloudProfile. -func (c *cloudProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CloudProfile, err error) { - result = &v1beta1.CloudProfile{} - err = c.client.Patch(pt). - Resource("cloudprofiles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerdeployment.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerdeployment.go deleted file mode 100644 index 4fb08989e..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerdeployment.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerDeploymentsGetter has a method to return a ControllerDeploymentInterface. -// A group's client should implement this interface. -type ControllerDeploymentsGetter interface { - ControllerDeployments() ControllerDeploymentInterface -} - -// ControllerDeploymentInterface has methods to work with ControllerDeployment resources. -type ControllerDeploymentInterface interface { - Create(ctx context.Context, controllerDeployment *v1beta1.ControllerDeployment, opts v1.CreateOptions) (*v1beta1.ControllerDeployment, error) - Update(ctx context.Context, controllerDeployment *v1beta1.ControllerDeployment, opts v1.UpdateOptions) (*v1beta1.ControllerDeployment, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerDeployment, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerDeploymentList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerDeployment, err error) - ControllerDeploymentExpansion -} - -// controllerDeployments implements ControllerDeploymentInterface -type controllerDeployments struct { - client rest.Interface -} - -// newControllerDeployments returns a ControllerDeployments -func newControllerDeployments(c *CoreV1beta1Client) *controllerDeployments { - return &controllerDeployments{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerDeployment, and returns the corresponding controllerDeployment object, and an error if there is any. -func (c *controllerDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerDeployment, err error) { - result = &v1beta1.ControllerDeployment{} - err = c.client.Get(). - Resource("controllerdeployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerDeployments that match those selectors. -func (c *controllerDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerDeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ControllerDeploymentList{} - err = c.client.Get(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerDeployments. -func (c *controllerDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerDeployment and creates it. Returns the server's representation of the controllerDeployment, and an error, if there is any. -func (c *controllerDeployments) Create(ctx context.Context, controllerDeployment *v1beta1.ControllerDeployment, opts v1.CreateOptions) (result *v1beta1.ControllerDeployment, err error) { - result = &v1beta1.ControllerDeployment{} - err = c.client.Post(). - Resource("controllerdeployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerDeployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerDeployment and updates it. Returns the server's representation of the controllerDeployment, and an error, if there is any. -func (c *controllerDeployments) Update(ctx context.Context, controllerDeployment *v1beta1.ControllerDeployment, opts v1.UpdateOptions) (result *v1beta1.ControllerDeployment, err error) { - result = &v1beta1.ControllerDeployment{} - err = c.client.Put(). - Resource("controllerdeployments"). - Name(controllerDeployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerDeployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerDeployment and deletes it. Returns an error if one occurs. -func (c *controllerDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerdeployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerdeployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerDeployment. -func (c *controllerDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerDeployment, err error) { - result = &v1beta1.ControllerDeployment{} - err = c.client.Patch(pt). - Resource("controllerdeployments"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerinstallation.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerinstallation.go deleted file mode 100644 index 5756e8467..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerinstallation.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerInstallationsGetter has a method to return a ControllerInstallationInterface. -// A group's client should implement this interface. -type ControllerInstallationsGetter interface { - ControllerInstallations() ControllerInstallationInterface -} - -// ControllerInstallationInterface has methods to work with ControllerInstallation resources. -type ControllerInstallationInterface interface { - Create(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.CreateOptions) (*v1beta1.ControllerInstallation, error) - Update(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.UpdateOptions) (*v1beta1.ControllerInstallation, error) - UpdateStatus(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.UpdateOptions) (*v1beta1.ControllerInstallation, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerInstallation, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerInstallationList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerInstallation, err error) - ControllerInstallationExpansion -} - -// controllerInstallations implements ControllerInstallationInterface -type controllerInstallations struct { - client rest.Interface -} - -// newControllerInstallations returns a ControllerInstallations -func newControllerInstallations(c *CoreV1beta1Client) *controllerInstallations { - return &controllerInstallations{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerInstallation, and returns the corresponding controllerInstallation object, and an error if there is any. -func (c *controllerInstallations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerInstallation, err error) { - result = &v1beta1.ControllerInstallation{} - err = c.client.Get(). - Resource("controllerinstallations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerInstallations that match those selectors. -func (c *controllerInstallations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerInstallationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ControllerInstallationList{} - err = c.client.Get(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerInstallations. -func (c *controllerInstallations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerInstallation and creates it. Returns the server's representation of the controllerInstallation, and an error, if there is any. -func (c *controllerInstallations) Create(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.CreateOptions) (result *v1beta1.ControllerInstallation, err error) { - result = &v1beta1.ControllerInstallation{} - err = c.client.Post(). - Resource("controllerinstallations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerInstallation and updates it. Returns the server's representation of the controllerInstallation, and an error, if there is any. -func (c *controllerInstallations) Update(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.UpdateOptions) (result *v1beta1.ControllerInstallation, err error) { - result = &v1beta1.ControllerInstallation{} - err = c.client.Put(). - Resource("controllerinstallations"). - Name(controllerInstallation.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - 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 *controllerInstallations) UpdateStatus(ctx context.Context, controllerInstallation *v1beta1.ControllerInstallation, opts v1.UpdateOptions) (result *v1beta1.ControllerInstallation, err error) { - result = &v1beta1.ControllerInstallation{} - err = c.client.Put(). - Resource("controllerinstallations"). - Name(controllerInstallation.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerInstallation). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerInstallation and deletes it. Returns an error if one occurs. -func (c *controllerInstallations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerinstallations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerInstallations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerinstallations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerInstallation. -func (c *controllerInstallations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerInstallation, err error) { - result = &v1beta1.ControllerInstallation{} - err = c.client.Patch(pt). - Resource("controllerinstallations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerregistration.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerregistration.go deleted file mode 100644 index c7f66b209..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/controllerregistration.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ControllerRegistrationsGetter has a method to return a ControllerRegistrationInterface. -// A group's client should implement this interface. -type ControllerRegistrationsGetter interface { - ControllerRegistrations() ControllerRegistrationInterface -} - -// ControllerRegistrationInterface has methods to work with ControllerRegistration resources. -type ControllerRegistrationInterface interface { - Create(ctx context.Context, controllerRegistration *v1beta1.ControllerRegistration, opts v1.CreateOptions) (*v1beta1.ControllerRegistration, error) - Update(ctx context.Context, controllerRegistration *v1beta1.ControllerRegistration, opts v1.UpdateOptions) (*v1beta1.ControllerRegistration, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerRegistration, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRegistrationList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRegistration, err error) - ControllerRegistrationExpansion -} - -// controllerRegistrations implements ControllerRegistrationInterface -type controllerRegistrations struct { - client rest.Interface -} - -// newControllerRegistrations returns a ControllerRegistrations -func newControllerRegistrations(c *CoreV1beta1Client) *controllerRegistrations { - return &controllerRegistrations{ - client: c.RESTClient(), - } -} - -// Get takes name of the controllerRegistration, and returns the corresponding controllerRegistration object, and an error if there is any. -func (c *controllerRegistrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRegistration, err error) { - result = &v1beta1.ControllerRegistration{} - err = c.client.Get(). - Resource("controllerregistrations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerRegistrations that match those selectors. -func (c *controllerRegistrations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRegistrationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ControllerRegistrationList{} - err = c.client.Get(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerRegistrations. -func (c *controllerRegistrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerRegistration and creates it. Returns the server's representation of the controllerRegistration, and an error, if there is any. -func (c *controllerRegistrations) Create(ctx context.Context, controllerRegistration *v1beta1.ControllerRegistration, opts v1.CreateOptions) (result *v1beta1.ControllerRegistration, err error) { - result = &v1beta1.ControllerRegistration{} - err = c.client.Post(). - Resource("controllerregistrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRegistration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerRegistration and updates it. Returns the server's representation of the controllerRegistration, and an error, if there is any. -func (c *controllerRegistrations) Update(ctx context.Context, controllerRegistration *v1beta1.ControllerRegistration, opts v1.UpdateOptions) (result *v1beta1.ControllerRegistration, err error) { - result = &v1beta1.ControllerRegistration{} - err = c.client.Put(). - Resource("controllerregistrations"). - Name(controllerRegistration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRegistration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerRegistration and deletes it. Returns an error if one occurs. -func (c *controllerRegistrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("controllerregistrations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerRegistrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("controllerregistrations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerRegistration. -func (c *controllerRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRegistration, err error) { - result = &v1beta1.ControllerRegistration{} - err = c.client.Patch(pt). - Resource("controllerregistrations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/core_client.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/core_client.go deleted file mode 100644 index 79dedf09a..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/core_client.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type CoreV1beta1Interface interface { - RESTClient() rest.Interface - BackupBucketsGetter - BackupEntriesGetter - CloudProfilesGetter - ControllerDeploymentsGetter - ControllerInstallationsGetter - ControllerRegistrationsGetter - PlantsGetter - ProjectsGetter - QuotasGetter - SecretBindingsGetter - SeedsGetter - ShootsGetter -} - -// CoreV1beta1Client is used to interact with features provided by the core.gardener.cloud group. -type CoreV1beta1Client struct { - restClient rest.Interface -} - -func (c *CoreV1beta1Client) BackupBuckets() BackupBucketInterface { - return newBackupBuckets(c) -} - -func (c *CoreV1beta1Client) BackupEntries(namespace string) BackupEntryInterface { - return newBackupEntries(c, namespace) -} - -func (c *CoreV1beta1Client) CloudProfiles() CloudProfileInterface { - return newCloudProfiles(c) -} - -func (c *CoreV1beta1Client) ControllerDeployments() ControllerDeploymentInterface { - return newControllerDeployments(c) -} - -func (c *CoreV1beta1Client) ControllerInstallations() ControllerInstallationInterface { - return newControllerInstallations(c) -} - -func (c *CoreV1beta1Client) ControllerRegistrations() ControllerRegistrationInterface { - return newControllerRegistrations(c) -} - -func (c *CoreV1beta1Client) Plants(namespace string) PlantInterface { - return newPlants(c, namespace) -} - -func (c *CoreV1beta1Client) Projects() ProjectInterface { - return newProjects(c) -} - -func (c *CoreV1beta1Client) Quotas(namespace string) QuotaInterface { - return newQuotas(c, namespace) -} - -func (c *CoreV1beta1Client) SecretBindings(namespace string) SecretBindingInterface { - return newSecretBindings(c, namespace) -} - -func (c *CoreV1beta1Client) Seeds() SeedInterface { - return newSeeds(c) -} - -func (c *CoreV1beta1Client) Shoots(namespace string) ShootInterface { - return newShoots(c, namespace) -} - -// NewForConfig creates a new CoreV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*CoreV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &CoreV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new CoreV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CoreV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CoreV1beta1Client for the given RESTClient. -func New(c rest.Interface) *CoreV1beta1Client { - return &CoreV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *CoreV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/doc.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/doc.go deleted file mode 100644 index 11866df3c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/generated_expansion.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/generated_expansion.go deleted file mode 100644 index f1d02d42c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/generated_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type BackupBucketExpansion interface{} - -type BackupEntryExpansion interface{} - -type CloudProfileExpansion interface{} - -type ControllerDeploymentExpansion interface{} - -type ControllerInstallationExpansion interface{} - -type ControllerRegistrationExpansion interface{} - -type PlantExpansion interface{} - -type ProjectExpansion interface{} - -type QuotaExpansion interface{} - -type SecretBindingExpansion interface{} - -type SeedExpansion interface{} - -type ShootExpansion interface{} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/plant.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/plant.go deleted file mode 100644 index 1beb236a0..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/plant.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// PlantsGetter has a method to return a PlantInterface. -// A group's client should implement this interface. -type PlantsGetter interface { - Plants(namespace string) PlantInterface -} - -// PlantInterface has methods to work with Plant resources. -type PlantInterface interface { - Create(ctx context.Context, plant *v1beta1.Plant, opts v1.CreateOptions) (*v1beta1.Plant, error) - Update(ctx context.Context, plant *v1beta1.Plant, opts v1.UpdateOptions) (*v1beta1.Plant, error) - UpdateStatus(ctx context.Context, plant *v1beta1.Plant, opts v1.UpdateOptions) (*v1beta1.Plant, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Plant, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PlantList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Plant, err error) - PlantExpansion -} - -// plants implements PlantInterface -type plants struct { - client rest.Interface - ns string -} - -// newPlants returns a Plants -func newPlants(c *CoreV1beta1Client, namespace string) *plants { - return &plants{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the plant, and returns the corresponding plant object, and an error if there is any. -func (c *plants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Plant, err error) { - result = &v1beta1.Plant{} - err = c.client.Get(). - Namespace(c.ns). - Resource("plants"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Plants that match those selectors. -func (c *plants) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PlantList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PlantList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested plants. -func (c *plants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a plant and creates it. Returns the server's representation of the plant, and an error, if there is any. -func (c *plants) Create(ctx context.Context, plant *v1beta1.Plant, opts v1.CreateOptions) (result *v1beta1.Plant, err error) { - result = &v1beta1.Plant{} - err = c.client.Post(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a plant and updates it. Returns the server's representation of the plant, and an error, if there is any. -func (c *plants) Update(ctx context.Context, plant *v1beta1.Plant, opts v1.UpdateOptions) (result *v1beta1.Plant, err error) { - result = &v1beta1.Plant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("plants"). - Name(plant.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - 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 *plants) UpdateStatus(ctx context.Context, plant *v1beta1.Plant, opts v1.UpdateOptions) (result *v1beta1.Plant, err error) { - result = &v1beta1.Plant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("plants"). - Name(plant.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(plant). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the plant and deletes it. Returns an error if one occurs. -func (c *plants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("plants"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *plants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("plants"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched plant. -func (c *plants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Plant, err error) { - result = &v1beta1.Plant{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("plants"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/project.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/project.go deleted file mode 100644 index b0d08d49c..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/project.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ProjectsGetter has a method to return a ProjectInterface. -// A group's client should implement this interface. -type ProjectsGetter interface { - Projects() ProjectInterface -} - -// ProjectInterface has methods to work with Project resources. -type ProjectInterface interface { - Create(ctx context.Context, project *v1beta1.Project, opts v1.CreateOptions) (*v1beta1.Project, error) - Update(ctx context.Context, project *v1beta1.Project, opts v1.UpdateOptions) (*v1beta1.Project, error) - UpdateStatus(ctx context.Context, project *v1beta1.Project, opts v1.UpdateOptions) (*v1beta1.Project, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Project, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ProjectList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Project, err error) - ProjectExpansion -} - -// projects implements ProjectInterface -type projects struct { - client rest.Interface -} - -// newProjects returns a Projects -func newProjects(c *CoreV1beta1Client) *projects { - return &projects{ - client: c.RESTClient(), - } -} - -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *projects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Project, err error) { - result = &v1beta1.Project{} - err = c.client.Get(). - Resource("projects"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *projects) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ProjectList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ProjectList{} - err = c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projects. -func (c *projects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Create(ctx context.Context, project *v1beta1.Project, opts v1.CreateOptions) (result *v1beta1.Project, err error) { - result = &v1beta1.Project{} - err = c.client.Post(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Update(ctx context.Context, project *v1beta1.Project, opts v1.UpdateOptions) (result *v1beta1.Project, err error) { - result = &v1beta1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - 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 *projects) UpdateStatus(ctx context.Context, project *v1beta1.Project, opts v1.UpdateOptions) (result *v1beta1.Project, err error) { - result = &v1beta1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the project and deletes it. Returns an error if one occurs. -func (c *projects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("projects"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("projects"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched project. -func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Project, err error) { - result = &v1beta1.Project{} - err = c.client.Patch(pt). - Resource("projects"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/quota.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/quota.go deleted file mode 100644 index 73aef2bea..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/quota.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// QuotasGetter has a method to return a QuotaInterface. -// A group's client should implement this interface. -type QuotasGetter interface { - Quotas(namespace string) QuotaInterface -} - -// QuotaInterface has methods to work with Quota resources. -type QuotaInterface interface { - Create(ctx context.Context, quota *v1beta1.Quota, opts v1.CreateOptions) (*v1beta1.Quota, error) - Update(ctx context.Context, quota *v1beta1.Quota, opts v1.UpdateOptions) (*v1beta1.Quota, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Quota, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.QuotaList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Quota, err error) - QuotaExpansion -} - -// quotas implements QuotaInterface -type quotas struct { - client rest.Interface - ns string -} - -// newQuotas returns a Quotas -func newQuotas(c *CoreV1beta1Client, namespace string) *quotas { - return "as{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the quota, and returns the corresponding quota object, and an error if there is any. -func (c *quotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Quota, err error) { - result = &v1beta1.Quota{} - err = c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Quotas that match those selectors. -func (c *quotas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.QuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.QuotaList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested quotas. -func (c *quotas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a quota and creates it. Returns the server's representation of the quota, and an error, if there is any. -func (c *quotas) Create(ctx context.Context, quota *v1beta1.Quota, opts v1.CreateOptions) (result *v1beta1.Quota, err error) { - result = &v1beta1.Quota{} - err = c.client.Post(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(quota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a quota and updates it. Returns the server's representation of the quota, and an error, if there is any. -func (c *quotas) Update(ctx context.Context, quota *v1beta1.Quota, opts v1.UpdateOptions) (result *v1beta1.Quota, err error) { - result = &v1beta1.Quota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("quotas"). - Name(quota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(quota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the quota and deletes it. Returns an error if one occurs. -func (c *quotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("quotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *quotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("quotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched quota. -func (c *quotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Quota, err error) { - result = &v1beta1.Quota{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("quotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/secretbinding.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/secretbinding.go deleted file mode 100644 index 953846e93..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/secretbinding.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// SecretBindingsGetter has a method to return a SecretBindingInterface. -// A group's client should implement this interface. -type SecretBindingsGetter interface { - SecretBindings(namespace string) SecretBindingInterface -} - -// SecretBindingInterface has methods to work with SecretBinding resources. -type SecretBindingInterface interface { - Create(ctx context.Context, secretBinding *v1beta1.SecretBinding, opts v1.CreateOptions) (*v1beta1.SecretBinding, error) - Update(ctx context.Context, secretBinding *v1beta1.SecretBinding, opts v1.UpdateOptions) (*v1beta1.SecretBinding, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.SecretBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SecretBindingList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SecretBinding, err error) - SecretBindingExpansion -} - -// secretBindings implements SecretBindingInterface -type secretBindings struct { - client rest.Interface - ns string -} - -// newSecretBindings returns a SecretBindings -func newSecretBindings(c *CoreV1beta1Client, namespace string) *secretBindings { - return &secretBindings{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the secretBinding, and returns the corresponding secretBinding object, and an error if there is any. -func (c *secretBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SecretBinding, err error) { - result = &v1beta1.SecretBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SecretBindings that match those selectors. -func (c *secretBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SecretBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.SecretBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested secretBindings. -func (c *secretBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a secretBinding and creates it. Returns the server's representation of the secretBinding, and an error, if there is any. -func (c *secretBindings) Create(ctx context.Context, secretBinding *v1beta1.SecretBinding, opts v1.CreateOptions) (result *v1beta1.SecretBinding, err error) { - result = &v1beta1.SecretBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secretBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a secretBinding and updates it. Returns the server's representation of the secretBinding, and an error, if there is any. -func (c *secretBindings) Update(ctx context.Context, secretBinding *v1beta1.SecretBinding, opts v1.UpdateOptions) (result *v1beta1.SecretBinding, err error) { - result = &v1beta1.SecretBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("secretbindings"). - Name(secretBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secretBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the secretBinding and deletes it. Returns an error if one occurs. -func (c *secretBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *secretBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("secretbindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched secretBinding. -func (c *secretBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SecretBinding, err error) { - result = &v1beta1.SecretBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("secretbindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/seed.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/seed.go deleted file mode 100644 index 05b1df257..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/seed.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// SeedsGetter has a method to return a SeedInterface. -// A group's client should implement this interface. -type SeedsGetter interface { - Seeds() SeedInterface -} - -// SeedInterface has methods to work with Seed resources. -type SeedInterface interface { - Create(ctx context.Context, seed *v1beta1.Seed, opts v1.CreateOptions) (*v1beta1.Seed, error) - Update(ctx context.Context, seed *v1beta1.Seed, opts v1.UpdateOptions) (*v1beta1.Seed, error) - UpdateStatus(ctx context.Context, seed *v1beta1.Seed, opts v1.UpdateOptions) (*v1beta1.Seed, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Seed, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SeedList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Seed, err error) - SeedExpansion -} - -// seeds implements SeedInterface -type seeds struct { - client rest.Interface -} - -// newSeeds returns a Seeds -func newSeeds(c *CoreV1beta1Client) *seeds { - return &seeds{ - client: c.RESTClient(), - } -} - -// Get takes name of the seed, and returns the corresponding seed object, and an error if there is any. -func (c *seeds) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Seed, err error) { - result = &v1beta1.Seed{} - err = c.client.Get(). - Resource("seeds"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Seeds that match those selectors. -func (c *seeds) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SeedList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.SeedList{} - err = c.client.Get(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested seeds. -func (c *seeds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a seed and creates it. Returns the server's representation of the seed, and an error, if there is any. -func (c *seeds) Create(ctx context.Context, seed *v1beta1.Seed, opts v1.CreateOptions) (result *v1beta1.Seed, err error) { - result = &v1beta1.Seed{} - err = c.client.Post(). - Resource("seeds"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a seed and updates it. Returns the server's representation of the seed, and an error, if there is any. -func (c *seeds) Update(ctx context.Context, seed *v1beta1.Seed, opts v1.UpdateOptions) (result *v1beta1.Seed, err error) { - result = &v1beta1.Seed{} - err = c.client.Put(). - Resource("seeds"). - Name(seed.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - 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 *seeds) UpdateStatus(ctx context.Context, seed *v1beta1.Seed, opts v1.UpdateOptions) (result *v1beta1.Seed, err error) { - result = &v1beta1.Seed{} - err = c.client.Put(). - Resource("seeds"). - Name(seed.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(seed). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the seed and deletes it. Returns an error if one occurs. -func (c *seeds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("seeds"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *seeds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("seeds"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched seed. -func (c *seeds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Seed, err error) { - result = &v1beta1.Seed{} - err = c.client.Patch(pt). - Resource("seeds"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/shoot.go b/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/shoot.go deleted file mode 100644 index d76e0ea8d..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1/shoot.go +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/authentication/v1alpha1" - v1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - scheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - 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" -) - -// ShootsGetter has a method to return a ShootInterface. -// A group's client should implement this interface. -type ShootsGetter interface { - Shoots(namespace string) ShootInterface -} - -// ShootInterface has methods to work with Shoot resources. -type ShootInterface interface { - Create(ctx context.Context, shoot *v1beta1.Shoot, opts v1.CreateOptions) (*v1beta1.Shoot, error) - Update(ctx context.Context, shoot *v1beta1.Shoot, opts v1.UpdateOptions) (*v1beta1.Shoot, error) - UpdateStatus(ctx context.Context, shoot *v1beta1.Shoot, opts v1.UpdateOptions) (*v1beta1.Shoot, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Shoot, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ShootList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Shoot, err error) - CreateAdminKubeconfigRequest(ctx context.Context, shootName string, adminKubeconfigRequest *v1alpha1.AdminKubeconfigRequest, opts v1.CreateOptions) (*v1alpha1.AdminKubeconfigRequest, error) - - ShootExpansion -} - -// shoots implements ShootInterface -type shoots struct { - client rest.Interface - ns string -} - -// newShoots returns a Shoots -func newShoots(c *CoreV1beta1Client, namespace string) *shoots { - return &shoots{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the shoot, and returns the corresponding shoot object, and an error if there is any. -func (c *shoots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Shoot, err error) { - result = &v1beta1.Shoot{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Shoots that match those selectors. -func (c *shoots) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ShootList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ShootList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested shoots. -func (c *shoots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a shoot and creates it. Returns the server's representation of the shoot, and an error, if there is any. -func (c *shoots) Create(ctx context.Context, shoot *v1beta1.Shoot, opts v1.CreateOptions) (result *v1beta1.Shoot, err error) { - result = &v1beta1.Shoot{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a shoot and updates it. Returns the server's representation of the shoot, and an error, if there is any. -func (c *shoots) Update(ctx context.Context, shoot *v1beta1.Shoot, opts v1.UpdateOptions) (result *v1beta1.Shoot, err error) { - result = &v1beta1.Shoot{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shoots"). - Name(shoot.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - 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 *shoots) UpdateStatus(ctx context.Context, shoot *v1beta1.Shoot, opts v1.UpdateOptions) (result *v1beta1.Shoot, err error) { - result = &v1beta1.Shoot{} - err = c.client.Put(). - Namespace(c.ns). - Resource("shoots"). - Name(shoot.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(shoot). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the shoot and deletes it. Returns an error if one occurs. -func (c *shoots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("shoots"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *shoots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("shoots"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched shoot. -func (c *shoots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Shoot, err error) { - result = &v1beta1.Shoot{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("shoots"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// CreateAdminKubeconfigRequest takes the representation of a adminKubeconfigRequest and creates it. Returns the server's representation of the adminKubeconfigRequest, and an error, if there is any. -func (c *shoots) CreateAdminKubeconfigRequest(ctx context.Context, shootName string, adminKubeconfigRequest *v1alpha1.AdminKubeconfigRequest, opts v1.CreateOptions) (result *v1alpha1.AdminKubeconfigRequest, err error) { - result = &v1alpha1.AdminKubeconfigRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("shoots"). - Name(shootName). - SubResource("adminkubeconfig"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(adminKubeconfigRequest). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/doc.go b/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7d4fb776b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/register.go b/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/register.go deleted file mode 100644 index 22a1acecf..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - extensionsv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/client.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/client.go index 869faa808..934f2629b 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/client.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/client.go @@ -20,7 +20,6 @@ import ( "fmt" corev1 "k8s.io/api/core/v1" - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" kubernetesclientset "k8s.io/client-go/kubernetes" @@ -28,18 +27,14 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" componentbaseconfig "k8s.io/component-base/config" - apiserviceclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - gardencoreclientset "github.com/gardener/gardener/pkg/client/core/clientset/versioned" - gardenercorescheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" + gardenercoreinstall "github.com/gardener/gardener/pkg/apis/core/install" + seedmanagementinstall "github.com/gardener/gardener/pkg/apis/seedmanagement/install" + settingsinstall "github.com/gardener/gardener/pkg/apis/settings/install" kcache "github.com/gardener/gardener/pkg/client/kubernetes/cache" - gardenoperationsclientset "github.com/gardener/gardener/pkg/client/operations/clientset/versioned" - gardenseedmanagementclientset "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned" - seedmanagementscheme "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned/scheme" - settingsscheme "github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme" "github.com/gardener/gardener/pkg/logger" versionutils "github.com/gardener/gardener/pkg/utils/version" ) @@ -57,9 +52,9 @@ const KubeConfig = "kubeconfig" func init() { // enable protobuf for Gardener API for controller-runtime clients protobufSchemeBuilder := runtime.NewSchemeBuilder( - gardenercorescheme.AddToScheme, - seedmanagementscheme.AddToScheme, - settingsscheme.AddToScheme, + gardenercoreinstall.AddToScheme, + seedmanagementinstall.AddToScheme, + settingsinstall.AddToScheme, ) utilruntime.Must(apiutil.AddToProtobufScheme(protobufSchemeBuilder.AddToScheme)) @@ -306,31 +301,6 @@ func newClientSet(conf *Config) (Interface, error) { return nil, err } - gardenCore, err := gardencoreclientset.NewForConfig(cfg) - if err != nil { - return nil, err - } - - gardenSeedManagement, err := gardenseedmanagementclientset.NewForConfig(cfg) - if err != nil { - return nil, err - } - - gardenOperations, err := gardenoperationsclientset.NewForConfig(cfg) - if err != nil { - return nil, err - } - - apiRegistration, err := apiserviceclientset.NewForConfig(cfg) - if err != nil { - return nil, err - } - - apiExtension, err := apiextensionsclientset.NewForConfig(cfg) - if err != nil { - return nil, err - } - cs := &clientSet{ config: conf.restConfig, restClient: kubernetes.Discovery().RESTClient(), @@ -341,12 +311,7 @@ func newClientSet(conf *Config) (Interface, error) { apiReader: c, cache: runtimeCache, - kubernetes: kubernetes, - gardenCore: gardenCore, - gardenSeedManagement: gardenSeedManagement, - gardenOperations: gardenOperations, - apiregistration: apiRegistration, - apiextension: apiExtension, + kubernetes: kubernetes, } if _, err := cs.DiscoverVersion(); err != nil { diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/clientset.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/clientset.go index e7cb96328..369d95498 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/clientset.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/clientset.go @@ -19,16 +19,11 @@ import ( "sync" "github.com/gardener/gardener/pkg/chartrenderer" - gardencoreclientset "github.com/gardener/gardener/pkg/client/core/clientset/versioned" - gardenoperationsclientset "github.com/gardener/gardener/pkg/client/operations/clientset/versioned" - gardenseedmanagementclientset "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned" "github.com/gardener/gardener/pkg/logger" - apiextensionclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - apiregistrationclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -59,12 +54,7 @@ type clientSet struct { // startOnce guards starting the cache only once startOnce sync.Once - kubernetes kubernetes.Interface - gardenCore gardencoreclientset.Interface - gardenSeedManagement gardenseedmanagementclientset.Interface - gardenOperations gardenoperationsclientset.Interface - apiextension apiextensionclientset.Interface - apiregistration apiregistrationclientset.Interface + kubernetes kubernetes.Interface version string } @@ -109,31 +99,6 @@ func (c *clientSet) Kubernetes() kubernetes.Interface { return c.kubernetes } -// GardenCore will return the gardenCore attribute of the Client object. -func (c *clientSet) GardenCore() gardencoreclientset.Interface { - return c.gardenCore -} - -// GardenSeedManagement will return the gardenSeedManagement attribute of the Client object. -func (c *clientSet) GardenSeedManagement() gardenseedmanagementclientset.Interface { - return c.gardenSeedManagement -} - -// GardenOperations will return the gardenOperations attribute of the Client object. -func (c *clientSet) GardenOperations() gardenoperationsclientset.Interface { - return c.gardenOperations -} - -// APIExtension will return the apiextensions attribute of the Client object. -func (c *clientSet) APIExtension() apiextensionclientset.Interface { - return c.apiextension -} - -// APIRegistration will return the apiregistration attribute of the Client object. -func (c *clientSet) APIRegistration() apiregistrationclientset.Interface { - return c.apiregistration -} - // RESTClient will return the restClient attribute of the Client object. func (c *clientSet) RESTClient() rest.Interface { return c.restClient diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go index 405a71345..80ec022c9 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go @@ -9,16 +9,11 @@ import ( reflect "reflect" chartrenderer "github.com/gardener/gardener/pkg/chartrenderer" - versioned "github.com/gardener/gardener/pkg/client/core/clientset/versioned" kubernetes "github.com/gardener/gardener/pkg/client/kubernetes" - versioned0 "github.com/gardener/gardener/pkg/client/operations/clientset/versioned" - versioned1 "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned" gomock "github.com/golang/mock/gomock" - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" version "k8s.io/apimachinery/pkg/version" kubernetes0 "k8s.io/client-go/kubernetes" rest "k8s.io/client-go/rest" - clientset0 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" cache "sigs.k8s.io/controller-runtime/pkg/cache" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -46,20 +41,6 @@ func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder { return m.recorder } -// APIExtension mocks base method. -func (m *MockInterface) APIExtension() clientset.Interface { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "APIExtension") - ret0, _ := ret[0].(clientset.Interface) - return ret0 -} - -// APIExtension indicates an expected call of APIExtension. -func (mr *MockInterfaceMockRecorder) APIExtension() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIExtension", reflect.TypeOf((*MockInterface)(nil).APIExtension)) -} - // APIReader mocks base method. func (m *MockInterface) APIReader() client.Reader { m.ctrl.T.Helper() @@ -74,20 +55,6 @@ func (mr *MockInterfaceMockRecorder) APIReader() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIReader", reflect.TypeOf((*MockInterface)(nil).APIReader)) } -// APIRegistration mocks base method. -func (m *MockInterface) APIRegistration() clientset0.Interface { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "APIRegistration") - ret0, _ := ret[0].(clientset0.Interface) - return ret0 -} - -// APIRegistration indicates an expected call of APIRegistration. -func (mr *MockInterfaceMockRecorder) APIRegistration() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "APIRegistration", reflect.TypeOf((*MockInterface)(nil).APIRegistration)) -} - // Applier mocks base method. func (m *MockInterface) Applier() kubernetes.Applier { m.ctrl.T.Helper() @@ -187,63 +154,6 @@ func (mr *MockInterfaceMockRecorder) DiscoverVersion() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DiscoverVersion", reflect.TypeOf((*MockInterface)(nil).DiscoverVersion)) } -// ForwardPodPort mocks base method. -func (m *MockInterface) ForwardPodPort(arg0, arg1 string, arg2, arg3 int) (chan struct{}, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ForwardPodPort", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(chan struct{}) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ForwardPodPort indicates an expected call of ForwardPodPort. -func (mr *MockInterfaceMockRecorder) ForwardPodPort(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ForwardPodPort", reflect.TypeOf((*MockInterface)(nil).ForwardPodPort), arg0, arg1, arg2, arg3) -} - -// GardenCore mocks base method. -func (m *MockInterface) GardenCore() versioned.Interface { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GardenCore") - ret0, _ := ret[0].(versioned.Interface) - return ret0 -} - -// GardenCore indicates an expected call of GardenCore. -func (mr *MockInterfaceMockRecorder) GardenCore() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GardenCore", reflect.TypeOf((*MockInterface)(nil).GardenCore)) -} - -// GardenOperations mocks base method. -func (m *MockInterface) GardenOperations() versioned0.Interface { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GardenOperations") - ret0, _ := ret[0].(versioned0.Interface) - return ret0 -} - -// GardenOperations indicates an expected call of GardenOperations. -func (mr *MockInterfaceMockRecorder) GardenOperations() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GardenOperations", reflect.TypeOf((*MockInterface)(nil).GardenOperations)) -} - -// GardenSeedManagement mocks base method. -func (m *MockInterface) GardenSeedManagement() versioned1.Interface { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GardenSeedManagement") - ret0, _ := ret[0].(versioned1.Interface) - return ret0 -} - -// GardenSeedManagement indicates an expected call of GardenSeedManagement. -func (mr *MockInterfaceMockRecorder) GardenSeedManagement() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GardenSeedManagement", reflect.TypeOf((*MockInterface)(nil).GardenSeedManagement)) -} - // Kubernetes mocks base method. func (m *MockInterface) Kubernetes() kubernetes0.Interface { m.ctrl.T.Helper() diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go index 277f68a22..a08c23667 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go @@ -103,17 +103,6 @@ func GetPodLogs(ctx context.Context, podInterface corev1client.PodInterface, nam return io.ReadAll(stream) } -// ForwardPodPort tries to forward the port of the pod with name in namespace to -// the port. If equals zero, a free port will be chosen randomly. -// It returns the stop channel which must be closed when the port forward connection should be terminated. -func (c *clientSet) ForwardPodPort(namespace, name string, local, remote int) (chan struct{}, error) { - fw, stopChan, err := c.setupForwardPodPort(namespace, name, local, remote) - if err != nil { - return nil, err - } - return stopChan, fw.ForwardPorts() -} - // CheckForwardPodPort tries to forward the port of the pod with name in namespace to // the port. If equals zero, a free port will be chosen randomly. // It returns true if the port forward connection has been established successfully or false otherwise. diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go index d95b7f21f..9007753ff 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go @@ -17,23 +17,12 @@ package kubernetes import ( "context" - "github.com/gardener/gardener/pkg/chartrenderer" - gardencoreclientset "github.com/gardener/gardener/pkg/client/core/clientset/versioned" - gardencorescheme "github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme" - gardenextensionsscheme "github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme" - gardenoperationsclientset "github.com/gardener/gardener/pkg/client/operations/clientset/versioned" - gardenoperationsscheme "github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme" - gardenseedmanagementclientset "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned" - gardenseedmanagementscheme "github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned/scheme" - gardensettingsscheme "github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme" - druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1" dnsv1alpha1 "github.com/gardener/external-dns-management/pkg/apis/dns/v1alpha1" - resourcesscheme "github.com/gardener/gardener-resource-manager/api/resources/v1alpha1" + resourcesv1alpha1 "github.com/gardener/gardener-resource-manager/api/resources/v1alpha1" hvpav1alpha1 "github.com/gardener/hvpa-controller/api/v1alpha1" istionetworkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" istionetworkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" - apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -42,14 +31,21 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/json" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/version" - autoscalingscheme "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2" + autoscalingv1beta2 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2" kubernetesclientset "k8s.io/client-go/kubernetes" - corescheme "k8s.io/client-go/kubernetes/scheme" + kubernetesscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - apiregistrationclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" apiregistrationscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" + metricsv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + + gardenercoreinstall "github.com/gardener/gardener/pkg/apis/core/install" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + gardenoperationsinstall "github.com/gardener/gardener/pkg/apis/operations/install" + gardenseedmanagementinstall "github.com/gardener/gardener/pkg/apis/seedmanagement/install" + gardensettingsinstall "github.com/gardener/gardener/pkg/apis/settings/install" + "github.com/gardener/gardener/pkg/chartrenderer" ) var ( @@ -95,21 +91,21 @@ func DefaultUpdateOptions() metav1.UpdateOptions { return metav1.UpdateOptions{} func init() { gardenSchemeBuilder := runtime.NewSchemeBuilder( - corescheme.AddToScheme, - gardencorescheme.AddToScheme, - gardenseedmanagementscheme.AddToScheme, - gardensettingsscheme.AddToScheme, - gardenoperationsscheme.AddToScheme, + kubernetesscheme.AddToScheme, + gardenercoreinstall.AddToScheme, + gardenseedmanagementinstall.AddToScheme, + gardensettingsinstall.AddToScheme, + gardenoperationsinstall.AddToScheme, apiregistrationscheme.AddToScheme, ) utilruntime.Must(gardenSchemeBuilder.AddToScheme(GardenScheme)) seedSchemeBuilder := runtime.NewSchemeBuilder( - corescheme.AddToScheme, + kubernetesscheme.AddToScheme, dnsv1alpha1.AddToScheme, - gardenextensionsscheme.AddToScheme, - resourcesscheme.AddToScheme, - autoscalingscheme.AddToScheme, + extensionsv1alpha1.AddToScheme, + resourcesv1alpha1.AddToScheme, + autoscalingv1beta2.AddToScheme, hvpav1alpha1.AddToScheme, druidv1alpha1.AddToScheme, apiextensionsscheme.AddToScheme, @@ -119,16 +115,16 @@ func init() { utilruntime.Must(seedSchemeBuilder.AddToScheme(SeedScheme)) shootSchemeBuilder := runtime.NewSchemeBuilder( - corescheme.AddToScheme, + kubernetesscheme.AddToScheme, apiextensionsscheme.AddToScheme, apiregistrationscheme.AddToScheme, - autoscalingscheme.AddToScheme, + autoscalingv1beta2.AddToScheme, + metricsv1beta1.AddToScheme, ) utilruntime.Must(shootSchemeBuilder.AddToScheme(ShootScheme)) plantSchemeBuilder := runtime.NewSchemeBuilder( - corescheme.AddToScheme, - gardencorescheme.AddToScheme, + kubernetesscheme.AddToScheme, ) utilruntime.Must(plantSchemeBuilder.AddToScheme(PlantScheme)) } @@ -171,14 +167,7 @@ type Interface interface { ChartApplier() ChartApplier Kubernetes() kubernetesclientset.Interface - GardenCore() gardencoreclientset.Interface - GardenSeedManagement() gardenseedmanagementclientset.Interface - GardenOperations() gardenoperationsclientset.Interface - APIExtension() apiextensionsclientset.Interface - APIRegistration() apiregistrationclientset.Interface - - // Deprecated: Use `Client()` and utils instead. - ForwardPodPort(string, string, int, int) (chan struct{}, error) + CheckForwardPodPort(string, string, int, int) error // Version returns the server version of the targeted Kubernetes cluster. diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/clientset.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/clientset.go deleted file mode 100644 index 66d7990ea..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/clientset.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - - operationsv1alpha1 "github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - OperationsV1alpha1() operationsv1alpha1.OperationsV1alpha1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - operationsV1alpha1 *operationsv1alpha1.OperationsV1alpha1Client -} - -// OperationsV1alpha1 retrieves the OperationsV1alpha1Client -func (c *Clientset) OperationsV1alpha1() operationsv1alpha1.OperationsV1alpha1Interface { - return c.operationsV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.operationsV1alpha1, err = operationsv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.operationsV1alpha1 = operationsv1alpha1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.operationsV1alpha1 = operationsv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/doc.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/doc.go deleted file mode 100644 index 32d852285..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/doc.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7d4fb776b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/register.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/register.go deleted file mode 100644 index 46f939c63..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - operationsv1alpha1 "github.com/gardener/gardener/pkg/apis/operations/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - operationsv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/bastion.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/bastion.go deleted file mode 100644 index 882c15a20..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/bastion.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - "time" - - v1alpha1 "github.com/gardener/gardener/pkg/apis/operations/v1alpha1" - scheme "github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme" - 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" -) - -// BastionsGetter has a method to return a BastionInterface. -// A group's client should implement this interface. -type BastionsGetter interface { - Bastions(namespace string) BastionInterface -} - -// BastionInterface has methods to work with Bastion resources. -type BastionInterface interface { - Create(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.CreateOptions) (*v1alpha1.Bastion, error) - Update(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.UpdateOptions) (*v1alpha1.Bastion, error) - UpdateStatus(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.UpdateOptions) (*v1alpha1.Bastion, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Bastion, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BastionList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bastion, err error) - BastionExpansion -} - -// bastions implements BastionInterface -type bastions struct { - client rest.Interface - ns string -} - -// newBastions returns a Bastions -func newBastions(c *OperationsV1alpha1Client, namespace string) *bastions { - return &bastions{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the bastion, and returns the corresponding bastion object, and an error if there is any. -func (c *bastions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Bastion, err error) { - result = &v1alpha1.Bastion{} - err = c.client.Get(). - Namespace(c.ns). - Resource("bastions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Bastions that match those selectors. -func (c *bastions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BastionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BastionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("bastions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested bastions. -func (c *bastions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("bastions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a bastion and creates it. Returns the server's representation of the bastion, and an error, if there is any. -func (c *bastions) Create(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.CreateOptions) (result *v1alpha1.Bastion, err error) { - result = &v1alpha1.Bastion{} - err = c.client.Post(). - Namespace(c.ns). - Resource("bastions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bastion). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a bastion and updates it. Returns the server's representation of the bastion, and an error, if there is any. -func (c *bastions) Update(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.UpdateOptions) (result *v1alpha1.Bastion, err error) { - result = &v1alpha1.Bastion{} - err = c.client.Put(). - Namespace(c.ns). - Resource("bastions"). - Name(bastion.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bastion). - Do(ctx). - 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 *bastions) UpdateStatus(ctx context.Context, bastion *v1alpha1.Bastion, opts v1.UpdateOptions) (result *v1alpha1.Bastion, err error) { - result = &v1alpha1.Bastion{} - err = c.client.Put(). - Namespace(c.ns). - Resource("bastions"). - Name(bastion.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bastion). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the bastion and deletes it. Returns an error if one occurs. -func (c *bastions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("bastions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *bastions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("bastions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched bastion. -func (c *bastions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bastion, err error) { - result = &v1alpha1.Bastion{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("bastions"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/doc.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/doc.go deleted file mode 100644 index 828c8ebe1..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/generated_expansion.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/generated_expansion.go deleted file mode 100644 index 16689683b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type BastionExpansion interface{} diff --git a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/operations_client.go b/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/operations_client.go deleted file mode 100644 index 27568bca3..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1/operations_client.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/gardener/gardener/pkg/apis/operations/v1alpha1" - "github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type OperationsV1alpha1Interface interface { - RESTClient() rest.Interface - BastionsGetter -} - -// OperationsV1alpha1Client is used to interact with features provided by the operations.gardener.cloud group. -type OperationsV1alpha1Client struct { - restClient rest.Interface -} - -func (c *OperationsV1alpha1Client) Bastions(namespace string) BastionInterface { - return newBastions(c, namespace) -} - -// NewForConfig creates a new OperationsV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*OperationsV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &OperationsV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new OperationsV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *OperationsV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new OperationsV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *OperationsV1alpha1Client { - return &OperationsV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *OperationsV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/doc.go b/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7d4fb776b..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/register.go b/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/register.go deleted file mode 100644 index 89313a4d1..000000000 --- a/vendor/github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - settingsv1alpha1 "github.com/gardener/gardener/pkg/apis/settings/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - settingsv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/github.com/gardener/gardener/pkg/features/features.go b/vendor/github.com/gardener/gardener/pkg/features/features.go index e0ed47a4b..8a5938065 100644 --- a/vendor/github.com/gardener/gardener/pkg/features/features.go +++ b/vendor/github.com/gardener/gardener/pkg/features/features.go @@ -101,4 +101,9 @@ const ( // owner: @petersutter @xrstf // alpha: v1.28.0 RotateSSHKeypairOnMaintenance featuregate.Feature = "RotateSSHKeypairOnMaintenance" + + // DenyInvalidExtensionResources causes the seed-admission-controller to deny invalid extension resources (instead of just logging validation errors). + // owner: @vanjiii + // alpha: v1.31.0 + DenyInvalidExtensionResources featuregate.Feature = "DenyInvalidExtensionResources" ) diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go index 28cf4fa00..fba24b9b2 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go @@ -52,6 +52,8 @@ type GardenletConfiguration struct { KubernetesLogLevel *klog.Level // Server defines the configuration of the HTTP server. Server *ServerConfiguration + // Debugging holds configuration for Debugging related features. + Debugging componentbaseconfig.DebuggingConfiguration // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental // features. This field modifies piecemeal the built-in default values from // "github.com/gardener/gardener/pkg/gardenlet/features/features.go". diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/defaults.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/defaults.go index e3b628c23..0f1fa70a1 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/defaults.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/defaults.go @@ -117,6 +117,8 @@ func SetDefaults_GardenletConfiguration(obj *GardenletConfiguration) { obj.Server.HTTPS.Port = 2720 } + // TODO: consider enabling profiling by default (like in k8s components) + if obj.SNI == nil { obj.SNI = &SNI{} } diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go index e52eb55bd..242889495 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go @@ -63,6 +63,8 @@ type GardenletConfiguration struct { // Server defines the configuration of the HTTP server. // +optional Server *ServerConfiguration `json:"server,omitempty"` + // Debugging holds configuration for Debugging related features. + Debugging componentbaseconfigv1alpha1.DebuggingConfiguration `json:"debugging"` // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental // features. This field modifies piecemeal the built-in default values from // "github.com/gardener/gardener/pkg/gardenlet/features/features.go". diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go index 7a0f439b7..851cdaa18 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go @@ -711,6 +711,9 @@ func autoConvert_v1alpha1_GardenletConfiguration_To_config_GardenletConfiguratio out.LogFormat = (*string)(unsafe.Pointer(in.LogFormat)) out.KubernetesLogLevel = (*klog.Level)(unsafe.Pointer(in.KubernetesLogLevel)) out.Server = (*config.ServerConfiguration)(unsafe.Pointer(in.Server)) + if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + return err + } out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if in.SeedConfig != nil { in, out := &in.SeedConfig, &out.SeedConfig @@ -783,6 +786,9 @@ func autoConvert_config_GardenletConfiguration_To_v1alpha1_GardenletConfiguratio out.LogFormat = (*string)(unsafe.Pointer(in.LogFormat)) out.KubernetesLogLevel = (*klog.Level)(unsafe.Pointer(in.KubernetesLogLevel)) out.Server = (*ServerConfiguration)(unsafe.Pointer(in.Server)) + if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + return err + } out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if in.SeedConfig != nil { in, out := &in.SeedConfig, &out.SeedConfig diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go index d5b9f2c98..101fb6104 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -351,6 +351,7 @@ func (in *GardenletConfiguration) DeepCopyInto(out *GardenletConfiguration) { *out = new(ServerConfiguration) (*in).DeepCopyInto(*out) } + in.Debugging.DeepCopyInto(&out.Debugging) if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates *out = make(map[string]bool, len(*in)) diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go index 7752908c6..72d68ff3e 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go @@ -351,6 +351,7 @@ func (in *GardenletConfiguration) DeepCopyInto(out *GardenletConfiguration) { *out = new(ServerConfiguration) (*in).DeepCopyInto(*out) } + out.Debugging = in.Debugging if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates *out = make(map[string]bool, len(*in)) diff --git a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/kube_scheduler.go b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/kube_scheduler.go index 80b07cda0..6726df7db 100644 --- a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/kube_scheduler.go +++ b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/kube_scheduler.go @@ -36,7 +36,6 @@ import ( appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -148,7 +147,7 @@ func (k *kubeScheduler) Deploy(ctx context.Context) error { command = k.computeCommand(port) ) - if err := k.client.Create(ctx, configMap); err != nil && !apierrors.IsAlreadyExists(err) { + if err := k.client.Create(ctx, configMap); kutil.IgnoreAlreadyExists(err) != nil { return err } diff --git a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/types.go b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/types.go index 4a096825e..fcecdeffe 100644 --- a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/types.go +++ b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/types.go @@ -64,6 +64,8 @@ type SchedulerConfiguration struct { // Server defines the configuration of the HTTP server. This is deprecated in favor of // HealthServer. Server ServerConfiguration + // Debugging holds configuration for Debugging related features. + Debugging componentbaseconfig.DebuggingConfiguration // Scheduler defines the configuration of the schedulers. Schedulers SchedulerControllerConfiguration // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental diff --git a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/types.go b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/types.go index a721c8883..198440b85 100644 --- a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/types.go +++ b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/types.go @@ -63,6 +63,8 @@ type SchedulerConfiguration struct { // Server defines the configuration of the HTTP server. This is deprecated in favor of // HealthServer. Server ServerConfiguration `json:"server,omitempty"` + // Debugging holds configuration for Debugging related features. + Debugging componentbaseconfigv1alpha1.DebuggingConfiguration `json:"debugging"` // Scheduler defines the configuration of the schedulers. Schedulers SchedulerControllerConfiguration `json:"schedulers"` // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental diff --git a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go index be36431cf..94de6f130 100644 --- a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go +++ b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.conversion.go @@ -131,6 +131,9 @@ func autoConvert_v1alpha1_SchedulerConfiguration_To_config_SchedulerConfiguratio if err := Convert_v1alpha1_ServerConfiguration_To_config_ServerConfiguration(&in.Server, &out.Server, s); err != nil { return err } + if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + return err + } if err := Convert_v1alpha1_SchedulerControllerConfiguration_To_config_SchedulerControllerConfiguration(&in.Schedulers, &out.Schedulers, s); err != nil { return err } @@ -155,6 +158,9 @@ func autoConvert_config_SchedulerConfiguration_To_v1alpha1_SchedulerConfiguratio if err := Convert_config_ServerConfiguration_To_v1alpha1_ServerConfiguration(&in.Server, &out.Server, s); err != nil { return err } + if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { + return err + } if err := Convert_config_SchedulerControllerConfiguration_To_v1alpha1_SchedulerControllerConfiguration(&in.Schedulers, &out.Schedulers, s); err != nil { return err } diff --git a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.deepcopy.go index 2c385e743..42a7d77d5 100644 --- a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -47,6 +47,7 @@ func (in *SchedulerConfiguration) DeepCopyInto(out *SchedulerConfiguration) { out.ClientConnection = in.ClientConnection in.LeaderElection.DeepCopyInto(&out.LeaderElection) in.Server.DeepCopyInto(&out.Server) + in.Debugging.DeepCopyInto(&out.Debugging) in.Schedulers.DeepCopyInto(&out.Schedulers) if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates diff --git a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/zz_generated.deepcopy.go index 289fb75e3..018786779 100644 --- a/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/scheduler/apis/config/zz_generated.deepcopy.go @@ -64,6 +64,7 @@ func (in *SchedulerConfiguration) DeepCopyInto(out *SchedulerConfiguration) { out.ClientConnection = in.ClientConnection out.LeaderElection = in.LeaderElection in.Server.DeepCopyInto(&out.Server) + out.Debugging = in.Debugging in.Schedulers.DeepCopyInto(&out.Schedulers) if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates diff --git a/vendor/github.com/gardener/gardener/pkg/utils/kubernetes/managedseed.go b/vendor/github.com/gardener/gardener/pkg/utils/kubernetes/managedseed.go index 4a9181708..34de71247 100644 --- a/vendor/github.com/gardener/gardener/pkg/utils/kubernetes/managedseed.go +++ b/vendor/github.com/gardener/gardener/pkg/utils/kubernetes/managedseed.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" + "sigs.k8s.io/controller-runtime/pkg/client" ) // GetManagedSeed gets the ManagedSeed resource for the given shoot namespace and name, @@ -44,3 +45,20 @@ func GetManagedSeed(ctx context.Context, seedManagementClient gardenseedmanageme } return &managedSeedList.Items[0], nil } + +// GetManagedSeedWithReader gets the ManagedSeed resource for the given shoot namespace and name, +// by searching for all ManagedSeeds in the shoot namespace that have spec.shoot.name set to the shoot name. +// If no such ManagedSeeds are found, nil is returned. +func GetManagedSeedWithReader(ctx context.Context, r client.Reader, shootNamespace, shootName string) (*seedmanagementv1alpha1.ManagedSeed, error) { + managedSeedList := &seedmanagementv1alpha1.ManagedSeedList{} + if err := r.List(ctx, managedSeedList, client.InNamespace(shootNamespace), client.MatchingFields{seedmanagement.ManagedSeedShootName: shootName}); err != nil { + return nil, err + } + if len(managedSeedList.Items) == 0 { + return nil, nil + } + if len(managedSeedList.Items) > 1 { + return nil, fmt.Errorf("found more than one ManagedSeed objects for shoot %s/%s", shootNamespace, shootName) + } + return &managedSeedList.Items[0], nil +} diff --git a/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go b/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go index d4a22cb48..5735028a4 100644 --- a/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go +++ b/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go @@ -147,14 +147,14 @@ func RegisterGardenerFrameworkFlags() *GardenerConfig { // NewShootFramework creates a new shoot framework with the current gardener framework // and a shoot -func (f *GardenerFramework) NewShootFramework(shoot *gardencorev1beta1.Shoot) (*ShootFramework, error) { +func (f *GardenerFramework) NewShootFramework(ctx context.Context, shoot *gardencorev1beta1.Shoot) (*ShootFramework, error) { shootFramework := &ShootFramework{ GardenerFramework: f, Config: &ShootConfig{ GardenerConfig: f.GardenerFrameworkConfig, }, } - if err := shootFramework.AddShoot(context.TODO(), shoot.GetName(), shoot.GetNamespace()); err != nil { + if err := shootFramework.AddShoot(ctx, shoot.GetName(), shoot.GetNamespace()); err != nil { return nil, err } return shootFramework, nil diff --git a/vendor/github.com/gardener/gardener/test/framework/shootcreationframework.go b/vendor/github.com/gardener/gardener/test/framework/shootcreationframework.go index a10ec5146..708194839 100644 --- a/vendor/github.com/gardener/gardener/test/framework/shootcreationframework.go +++ b/vendor/github.com/gardener/gardener/test/framework/shootcreationframework.go @@ -367,7 +367,7 @@ func (f *ShootCreationFramework) CreateShoot(ctx context.Context, initializeShoo if err := f.GardenerFramework.CreateShoot(ctx, f.Shoot); err != nil { f.Logger.Fatalf("Cannot create shoot %s: %s", f.Shoot.GetName(), err.Error()) - shootFramework, err2 := f.newShootFramework() + shootFramework, err2 := f.newShootFramework(ctx) if err2 != nil { f.Logger.Fatalf("Cannot dump shoot state %s: %s", f.Shoot.GetName(), err.Error()) } else { @@ -377,7 +377,7 @@ func (f *ShootCreationFramework) CreateShoot(ctx context.Context, initializeShoo } f.Logger.Infof("Successfully created shoot %s", f.Shoot.GetName()) - shootFramework, err := f.newShootFramework() + shootFramework, err := f.newShootFramework(ctx) if err != nil { return nil, err } @@ -435,8 +435,8 @@ func (f *ShootCreationFramework) InitializeShootWithFlags(ctx context.Context) e } // newShootFramework creates a new ShootFramework with the Shoot created by the ShootCreationFramework -func (f *ShootCreationFramework) newShootFramework() (*ShootFramework, error) { - shootFramework, err := f.GardenerFramework.NewShootFramework(f.Shoot) +func (f *ShootCreationFramework) newShootFramework(ctx context.Context) (*ShootFramework, error) { + shootFramework, err := f.GardenerFramework.NewShootFramework(ctx, f.Shoot) if err != nil { return nil, err } diff --git a/vendor/github.com/gardener/gardener/test/framework/shootframework.go b/vendor/github.com/gardener/gardener/test/framework/shootframework.go index 31fcbd609..247df300e 100644 --- a/vendor/github.com/gardener/gardener/test/framework/shootframework.go +++ b/vendor/github.com/gardener/gardener/test/framework/shootframework.go @@ -24,7 +24,7 @@ import ( gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" - gardenextensionsscheme "github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme" + "github.com/gardener/gardener/pkg/client/kubernetes" kutil "github.com/gardener/gardener/pkg/utils/kubernetes" "github.com/gardener/gardener/pkg/utils/retry" @@ -32,13 +32,10 @@ import ( "github.com/onsi/ginkgo" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - corescheme "k8s.io/client-go/kubernetes/scheme" - apiregistrationscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" - metricsscheme "k8s.io/metrics/pkg/client/clientset/versioned/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -211,21 +208,9 @@ func (f *ShootFramework) AddShoot(ctx context.Context, shootName, shootNamespace return nil } - shootScheme := runtime.NewScheme() - shootSchemeBuilder := runtime.NewSchemeBuilder( - corescheme.AddToScheme, - apiextensionsscheme.AddToScheme, - apiregistrationscheme.AddToScheme, - metricsscheme.AddToScheme, - gardenextensionsscheme.AddToScheme, - ) - err = shootSchemeBuilder.AddToScheme(shootScheme) - if err != nil { - return fmt.Errorf("could not add schemes to shoot scheme: %w", err) - } if err := retry.UntilTimeout(ctx, k8sClientInitPollInterval, k8sClientInitTimeout, func(ctx context.Context) (bool, error) { shootClient, err = kubernetes.NewClientFromSecret(ctx, f.SeedClient.Client(), ComputeTechnicalID(f.Project.Name, shoot), gardencorev1beta1.GardenerName, kubernetes.WithClientOptions(client.Options{ - Scheme: shootScheme, + Scheme: kubernetes.ShootScheme, })) if err != nil { return retry.MinorError(fmt.Errorf("could not construct Shoot client: %w", err)) diff --git a/vendor/github.com/gardener/gardener/test/framework/shootmigrationtest.go b/vendor/github.com/gardener/gardener/test/framework/shootmigrationtest.go index cd065471b..159da05f0 100644 --- a/vendor/github.com/gardener/gardener/test/framework/shootmigrationtest.go +++ b/vendor/github.com/gardener/gardener/test/framework/shootmigrationtest.go @@ -87,7 +87,7 @@ func NewShootMigrationTest(f *GardenerFramework, cfg *ShootMigrationConfig) *Sho func (t *ShootMigrationTest) MigrateShoot(ctx context.Context) error { // Dump gardener state if delete shoot is in exit handler if os.Getenv("TM_PHASE") == "Exit" { - if shootFramework, err := t.GardenerFramework.NewShootFramework(&t.Shoot); err == nil { + if shootFramework, err := t.GardenerFramework.NewShootFramework(ctx, &t.Shoot); err == nil { shootFramework.DumpState(ctx) } else { t.GardenerFramework.DumpState(ctx) @@ -203,7 +203,7 @@ func (t *ShootMigrationTest) CompareElementsAfterMigration() error { // Check the timestamp of all objects that the resource-manager creates in the Shoot cluster. // The timestamp should not be after the ShootMigrationTest.MigrationTime -func (t *ShootMigrationTest) CheckObjectsTimestamp(ctx context.Context, mrExcludeList []string) error { +func (t *ShootMigrationTest) CheckObjectsTimestamp(ctx context.Context, mrExcludeList, resourcesWithGeneratedName []string) error { mrList := &resourcesv1alpha1.ManagedResourceList{} if err := t.TargetSeedClient.Client().List( ctx, @@ -218,6 +218,10 @@ func (t *ShootMigrationTest) CheckObjectsTimestamp(ctx context.Context, mrExclud if !utils.ValueExists(mr.GetName(), mrExcludeList) { t.GardenerFramework.Logger.Infof("=== Managed Resource: %s/%s ===", mr.Namespace, mr.Name) for _, r := range mr.Status.Resources { + if len(r.Name) > 9 && utils.ValueExists(r.Name[:len(r.Name)-9], resourcesWithGeneratedName) { + continue + } + obj := &unstructured.Unstructured{} obj.SetAPIVersion(r.APIVersion) obj.SetKind(r.Kind) @@ -226,11 +230,11 @@ func (t *ShootMigrationTest) CheckObjectsTimestamp(ctx context.Context, mrExclud return err } - createionTimestamp := obj.GetCreationTimestamp() - t.GardenerFramework.Logger.Infof("Object: %s %s/%s Created At: %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), createionTimestamp) - if t.MigrationTime.Before(&createionTimestamp) { - t.GardenerFramework.Logger.Errorf("object: %s %s/%s Created At: %s is created after the Shoot migration %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), createionTimestamp, t.MigrationTime) - return fmt.Errorf("object: %s %s/%s Created At: %s is created after the Shoot migration %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), createionTimestamp, t.MigrationTime) + creationTimestamp := obj.GetCreationTimestamp() + t.GardenerFramework.Logger.Infof("Object: %s %s/%s Created At: %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), creationTimestamp) + if t.MigrationTime.Before(&creationTimestamp) { + t.GardenerFramework.Logger.Errorf("object: %s %s/%s Created At: %s is created after the Shoot migration %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), creationTimestamp, t.MigrationTime) + return fmt.Errorf("object: %s %s/%s Created At: %s is created after the Shoot migration %s", obj.GetKind(), obj.GetNamespace(), obj.GetName(), creationTimestamp, t.MigrationTime) } } } diff --git a/vendor/github.com/gardener/gardener/test/framework/template.go b/vendor/github.com/gardener/gardener/test/framework/template.go index 466c3889c..e52d2cdac 100644 --- a/vendor/github.com/gardener/gardener/test/framework/template.go +++ b/vendor/github.com/gardener/gardener/test/framework/template.go @@ -22,6 +22,7 @@ import ( "os" "path/filepath" + "github.com/Masterminds/sprig" "github.com/gardener/gardener/pkg/client/kubernetes" ) @@ -32,7 +33,10 @@ func (f *CommonFramework) RenderAndDeployTemplate(ctx context.Context, k8sClient return fmt.Errorf("could not find template in %q", templateFilepath) } - tpl, err := template.ParseFiles(templateFilepath) + tpl, err := template. + New(templateName). + Funcs(sprig.HtmlFuncMap()). + ParseFiles(templateFilepath) if err != nil { return fmt.Errorf("unable to parse template in %s: %w", templateFilepath, err) } diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go deleted file mode 100644 index 0680b9de0..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package clientset - -import ( - "fmt" - - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - apiregistrationv1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1" - apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ApiregistrationV1beta1() apiregistrationv1beta1.ApiregistrationV1beta1Interface - ApiregistrationV1() apiregistrationv1.ApiregistrationV1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - apiregistrationV1beta1 *apiregistrationv1beta1.ApiregistrationV1beta1Client - apiregistrationV1 *apiregistrationv1.ApiregistrationV1Client -} - -// ApiregistrationV1beta1 retrieves the ApiregistrationV1beta1Client -func (c *Clientset) ApiregistrationV1beta1() apiregistrationv1beta1.ApiregistrationV1beta1Interface { - return c.apiregistrationV1beta1 -} - -// ApiregistrationV1 retrieves the ApiregistrationV1Client -func (c *Clientset) ApiregistrationV1() apiregistrationv1.ApiregistrationV1Interface { - return c.apiregistrationV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.apiregistrationV1beta1, err = apiregistrationv1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.apiregistrationV1, err = apiregistrationv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.apiregistrationV1beta1 = apiregistrationv1beta1.NewForConfigOrDie(c) - cs.apiregistrationV1 = apiregistrationv1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.apiregistrationV1beta1 = apiregistrationv1beta1.New(c) - cs.apiregistrationV1 = apiregistrationv1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go deleted file mode 100644 index ee865e56d..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package clientset diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiregistration_client.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiregistration_client.go deleted file mode 100644 index 77767f646..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiregistration_client.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - rest "k8s.io/client-go/rest" - v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" - "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -type ApiregistrationV1Interface interface { - RESTClient() rest.Interface - APIServicesGetter -} - -// ApiregistrationV1Client is used to interact with features provided by the apiregistration.k8s.io group. -type ApiregistrationV1Client struct { - restClient rest.Interface -} - -func (c *ApiregistrationV1Client) APIServices() APIServiceInterface { - return newAPIServices(c) -} - -// NewForConfig creates a new ApiregistrationV1Client for the given config. -func NewForConfig(c *rest.Config) (*ApiregistrationV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ApiregistrationV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ApiregistrationV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ApiregistrationV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ApiregistrationV1Client for the given RESTClient. -func New(c rest.Interface) *ApiregistrationV1Client { - return &ApiregistrationV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ApiregistrationV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go deleted file mode 100644 index 25bf6ea44..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/apiservice.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - metav1 "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" - v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" - scheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -// APIServicesGetter has a method to return a APIServiceInterface. -// A group's client should implement this interface. -type APIServicesGetter interface { - APIServices() APIServiceInterface -} - -// APIServiceInterface has methods to work with APIService resources. -type APIServiceInterface interface { - Create(ctx context.Context, aPIService *v1.APIService, opts metav1.CreateOptions) (*v1.APIService, error) - Update(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (*v1.APIService, error) - UpdateStatus(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (*v1.APIService, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.APIService, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.APIServiceList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIService, err error) - APIServiceExpansion -} - -// aPIServices implements APIServiceInterface -type aPIServices struct { - client rest.Interface -} - -// newAPIServices returns a APIServices -func newAPIServices(c *ApiregistrationV1Client) *aPIServices { - return &aPIServices{ - client: c.RESTClient(), - } -} - -// Get takes name of the aPIService, and returns the corresponding aPIService object, and an error if there is any. -func (c *aPIServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.APIService, err error) { - result = &v1.APIService{} - err = c.client.Get(). - Resource("apiservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of APIServices that match those selectors. -func (c *aPIServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.APIServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.APIServiceList{} - err = c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested aPIServices. -func (c *aPIServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a aPIService and creates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Create(ctx context.Context, aPIService *v1.APIService, opts metav1.CreateOptions) (result *v1.APIService, err error) { - result = &v1.APIService{} - err = c.client.Post(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Update(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (result *v1.APIService, err error) { - result = &v1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - 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 *aPIServices) UpdateStatus(ctx context.Context, aPIService *v1.APIService, opts metav1.UpdateOptions) (result *v1.APIService, err error) { - result = &v1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *aPIServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("apiservices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *aPIServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("apiservices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched aPIService. -func (c *aPIServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIService, err error) { - result = &v1.APIService{} - err = c.client.Patch(pt). - Resource("apiservices"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/doc.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/doc.go deleted file mode 100644 index 3af5d054f..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/generated_expansion.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/generated_expansion.go deleted file mode 100644 index 87aa18716..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type APIServiceExpansion interface{} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go deleted file mode 100644 index e7a9aa507..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - rest "k8s.io/client-go/rest" - v1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" - "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -type ApiregistrationV1beta1Interface interface { - RESTClient() rest.Interface - APIServicesGetter -} - -// ApiregistrationV1beta1Client is used to interact with features provided by the apiregistration.k8s.io group. -type ApiregistrationV1beta1Client struct { - restClient rest.Interface -} - -func (c *ApiregistrationV1beta1Client) APIServices() APIServiceInterface { - return newAPIServices(c) -} - -// NewForConfig creates a new ApiregistrationV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*ApiregistrationV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ApiregistrationV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new ApiregistrationV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ApiregistrationV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ApiregistrationV1beta1Client for the given RESTClient. -func New(c rest.Interface) *ApiregistrationV1beta1Client { - return &ApiregistrationV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ApiregistrationV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go deleted file mode 100644 index a5e76412e..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - "time" - - 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" - v1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" - scheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -// APIServicesGetter has a method to return a APIServiceInterface. -// A group's client should implement this interface. -type APIServicesGetter interface { - APIServices() APIServiceInterface -} - -// APIServiceInterface has methods to work with APIService resources. -type APIServiceInterface interface { - Create(ctx context.Context, aPIService *v1beta1.APIService, opts v1.CreateOptions) (*v1beta1.APIService, error) - Update(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (*v1beta1.APIService, error) - UpdateStatus(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (*v1beta1.APIService, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.APIService, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.APIServiceList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.APIService, err error) - APIServiceExpansion -} - -// aPIServices implements APIServiceInterface -type aPIServices struct { - client rest.Interface -} - -// newAPIServices returns a APIServices -func newAPIServices(c *ApiregistrationV1beta1Client) *aPIServices { - return &aPIServices{ - client: c.RESTClient(), - } -} - -// Get takes name of the aPIService, and returns the corresponding aPIService object, and an error if there is any. -func (c *aPIServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Get(). - Resource("apiservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of APIServices that match those selectors. -func (c *aPIServices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.APIServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.APIServiceList{} - err = c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested aPIServices. -func (c *aPIServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a aPIService and creates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Create(ctx context.Context, aPIService *v1beta1.APIService, opts v1.CreateOptions) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Post(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Update(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - 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 *aPIServices) UpdateStatus(ctx context.Context, aPIService *v1beta1.APIService, opts v1.UpdateOptions) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(aPIService). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *aPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("apiservices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *aPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("apiservices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched aPIService. -func (c *aPIServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Patch(pt). - Resource("apiservices"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go deleted file mode 100644 index 771101956..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go deleted file mode 100644 index e9108c5c8..000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type APIServiceExpansion interface{} diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go deleted file mode 100644 index 8e06b2205..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:protobuf-gen=package -// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/metrics -// +k8s:openapi-gen=true -// +groupName=metrics.k8s.io - -// Package v1alpha1 is the v1alpha1 version of the metrics API. -package v1alpha1 // import "k8s.io/metrics/pkg/apis/metrics/v1alpha1" diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go deleted file mode 100644 index 19355d77f..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go +++ /dev/null @@ -1,1758 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto - -package v1alpha1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - - k8s_io_api_core_v1 "k8s.io/api/core/v1" - k8s_io_apimachinery_pkg_api_resource "k8s.io/apimachinery/pkg/api/resource" - resource "k8s.io/apimachinery/pkg/api/resource" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *ContainerMetrics) Reset() { *m = ContainerMetrics{} } -func (*ContainerMetrics) ProtoMessage() {} -func (*ContainerMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_4bcbecebae081ea6, []int{0} -} -func (m *ContainerMetrics) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ContainerMetrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ContainerMetrics) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerMetrics.Merge(m, src) -} -func (m *ContainerMetrics) XXX_Size() int { - return m.Size() -} -func (m *ContainerMetrics) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerMetrics.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerMetrics proto.InternalMessageInfo - -func (m *NodeMetrics) Reset() { *m = NodeMetrics{} } -func (*NodeMetrics) ProtoMessage() {} -func (*NodeMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_4bcbecebae081ea6, []int{1} -} -func (m *NodeMetrics) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeMetrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *NodeMetrics) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeMetrics.Merge(m, src) -} -func (m *NodeMetrics) XXX_Size() int { - return m.Size() -} -func (m *NodeMetrics) XXX_DiscardUnknown() { - xxx_messageInfo_NodeMetrics.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeMetrics proto.InternalMessageInfo - -func (m *NodeMetricsList) Reset() { *m = NodeMetricsList{} } -func (*NodeMetricsList) ProtoMessage() {} -func (*NodeMetricsList) Descriptor() ([]byte, []int) { - return fileDescriptor_4bcbecebae081ea6, []int{2} -} -func (m *NodeMetricsList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeMetricsList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *NodeMetricsList) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeMetricsList.Merge(m, src) -} -func (m *NodeMetricsList) XXX_Size() int { - return m.Size() -} -func (m *NodeMetricsList) XXX_DiscardUnknown() { - xxx_messageInfo_NodeMetricsList.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeMetricsList proto.InternalMessageInfo - -func (m *PodMetrics) Reset() { *m = PodMetrics{} } -func (*PodMetrics) ProtoMessage() {} -func (*PodMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_4bcbecebae081ea6, []int{3} -} -func (m *PodMetrics) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PodMetrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PodMetrics) XXX_Merge(src proto.Message) { - xxx_messageInfo_PodMetrics.Merge(m, src) -} -func (m *PodMetrics) XXX_Size() int { - return m.Size() -} -func (m *PodMetrics) XXX_DiscardUnknown() { - xxx_messageInfo_PodMetrics.DiscardUnknown(m) -} - -var xxx_messageInfo_PodMetrics proto.InternalMessageInfo - -func (m *PodMetricsList) Reset() { *m = PodMetricsList{} } -func (*PodMetricsList) ProtoMessage() {} -func (*PodMetricsList) Descriptor() ([]byte, []int) { - return fileDescriptor_4bcbecebae081ea6, []int{4} -} -func (m *PodMetricsList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PodMetricsList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PodMetricsList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PodMetricsList.Merge(m, src) -} -func (m *PodMetricsList) XXX_Size() int { - return m.Size() -} -func (m *PodMetricsList) XXX_DiscardUnknown() { - xxx_messageInfo_PodMetricsList.DiscardUnknown(m) -} - -var xxx_messageInfo_PodMetricsList proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ContainerMetrics)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.ContainerMetrics") - proto.RegisterMapType((k8s_io_api_core_v1.ResourceList)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.ContainerMetrics.UsageEntry") - proto.RegisterType((*NodeMetrics)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.NodeMetrics") - proto.RegisterMapType((k8s_io_api_core_v1.ResourceList)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.NodeMetrics.UsageEntry") - proto.RegisterType((*NodeMetricsList)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.NodeMetricsList") - proto.RegisterType((*PodMetrics)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.PodMetrics") - proto.RegisterType((*PodMetricsList)(nil), "k8s.io.metrics.pkg.apis.metrics.v1alpha1.PodMetricsList") -} - -func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto", fileDescriptor_4bcbecebae081ea6) -} - -var fileDescriptor_4bcbecebae081ea6 = []byte{ - // 658 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x54, 0x41, 0x4f, 0x13, 0x41, - 0x18, 0xed, 0xd0, 0x96, 0xc0, 0x54, 0x11, 0xf7, 0x44, 0x7a, 0xd8, 0x92, 0x9e, 0x1a, 0x13, 0x66, - 0x85, 0xa0, 0x21, 0x9c, 0xcc, 0x0a, 0x07, 0x13, 0x41, 0xd9, 0xa0, 0x46, 0xf4, 0xe0, 0x74, 0x3b, - 0x6e, 0xc7, 0xb2, 0x33, 0x9b, 0x99, 0xd9, 0x92, 0xde, 0x8c, 0x7a, 0xf2, 0x64, 0xe2, 0x9f, 0xc2, - 0x78, 0xe1, 0xc8, 0x45, 0x90, 0xf5, 0xee, 0x0f, 0xf0, 0x64, 0x76, 0x3a, 0xdb, 0xad, 0x14, 0xa1, - 0x72, 0xf0, 0xc4, 0x6d, 0xf7, 0x9b, 0x79, 0xef, 0x7d, 0xf3, 0xbe, 0x37, 0x03, 0xb7, 0x3a, 0x2b, - 0x12, 0x51, 0xee, 0x74, 0xe2, 0x26, 0x11, 0x8c, 0x28, 0x22, 0x9d, 0x2e, 0x61, 0x2d, 0x2e, 0x1c, - 0xb3, 0x10, 0x12, 0x25, 0xa8, 0x2f, 0x9d, 0xa8, 0x13, 0x38, 0x38, 0xa2, 0x72, 0x50, 0xe8, 0x2e, - 0xe2, 0xdd, 0xa8, 0x8d, 0x17, 0x9d, 0x80, 0x30, 0x22, 0xb0, 0x22, 0x2d, 0x14, 0x09, 0xae, 0xb8, - 0xd5, 0xe8, 0x23, 0x91, 0xd9, 0x88, 0xa2, 0x4e, 0x80, 0x52, 0xe4, 0xa0, 0x90, 0x21, 0xab, 0x0b, - 0x01, 0x55, 0xed, 0xb8, 0x89, 0x7c, 0x1e, 0x3a, 0x01, 0x0f, 0xb8, 0xa3, 0x09, 0x9a, 0xf1, 0x6b, - 0xfd, 0xa7, 0x7f, 0xf4, 0x57, 0x9f, 0xb8, 0x5a, 0x37, 0x2d, 0xe1, 0x88, 0x3a, 0x3e, 0x17, 0xc4, - 0xe9, 0x8e, 0x88, 0x57, 0x97, 0xf3, 0x3d, 0x21, 0xf6, 0xdb, 0x94, 0x11, 0xd1, 0xcb, 0x7a, 0x77, - 0x04, 0x91, 0x3c, 0x16, 0x3e, 0xf9, 0x27, 0x94, 0x3e, 0x31, 0x3e, 0x4b, 0xcb, 0xf9, 0x1b, 0x4a, - 0xc4, 0x4c, 0xd1, 0x70, 0x54, 0xe6, 0xee, 0x45, 0x00, 0xe9, 0xb7, 0x49, 0x88, 0x4f, 0xe3, 0xea, - 0xef, 0x8b, 0x70, 0xf6, 0x3e, 0x67, 0x0a, 0xa7, 0x88, 0x8d, 0xbe, 0x8b, 0xd6, 0x3c, 0x2c, 0x31, - 0x1c, 0x92, 0x39, 0x30, 0x0f, 0x1a, 0xd3, 0xee, 0xb5, 0xfd, 0xa3, 0x5a, 0x21, 0x39, 0xaa, 0x95, - 0x36, 0x71, 0x48, 0x3c, 0xbd, 0x62, 0x25, 0x00, 0x96, 0x63, 0x89, 0x03, 0x32, 0x37, 0x31, 0x5f, - 0x6c, 0x54, 0x96, 0xd6, 0xd1, 0xb8, 0x93, 0x41, 0xa7, 0xd5, 0xd0, 0x93, 0x94, 0x67, 0x9d, 0x29, - 0xd1, 0x73, 0x3f, 0x00, 0xa3, 0x55, 0xd6, 0xc5, 0x5f, 0x47, 0xb5, 0xda, 0xe8, 0x60, 0x90, 0x67, - 0xbc, 0x7e, 0x48, 0xa5, 0x7a, 0x77, 0x7c, 0xee, 0x96, 0xb4, 0xe5, 0x8f, 0xc7, 0xb5, 0x85, 0x71, - 0x46, 0x87, 0xb6, 0x62, 0xcc, 0x14, 0x55, 0x3d, 0xaf, 0x7f, 0xb4, 0x6a, 0x1b, 0xc2, 0xbc, 0x37, - 0x6b, 0x16, 0x16, 0x3b, 0xa4, 0xd7, 0xf7, 0xc4, 0x4b, 0x3f, 0xad, 0x35, 0x58, 0xee, 0xe2, 0xdd, - 0x38, 0xf5, 0x00, 0x34, 0x2a, 0x4b, 0x28, 0xf3, 0x60, 0x58, 0x25, 0x33, 0x02, 0x9d, 0xa1, 0xa2, - 0xc1, 0xab, 0x13, 0x2b, 0xa0, 0xfe, 0xb3, 0x04, 0x2b, 0x9b, 0xbc, 0x45, 0xb2, 0x01, 0xbc, 0x82, - 0x53, 0x69, 0x32, 0x5a, 0x58, 0x61, 0x2d, 0x58, 0x59, 0xba, 0x7d, 0x1e, 0xb9, 0x76, 0x19, 0xa3, - 0xee, 0x22, 0x7a, 0xd4, 0x7c, 0x43, 0x7c, 0xb5, 0x41, 0x14, 0x76, 0x2d, 0x63, 0x25, 0xcc, 0x6b, - 0xde, 0x80, 0xd5, 0x7a, 0x01, 0xa7, 0xd3, 0x58, 0x48, 0x85, 0xc3, 0xc8, 0xf4, 0x7f, 0x6b, 0x3c, - 0x89, 0x6d, 0x1a, 0x12, 0xf7, 0xa6, 0x21, 0x9f, 0xde, 0xce, 0x48, 0xbc, 0x9c, 0xcf, 0x7a, 0x0a, - 0x27, 0xf7, 0x28, 0x6b, 0xf1, 0xbd, 0xb9, 0xe2, 0xc5, 0xce, 0xe4, 0xcc, 0x6b, 0xb1, 0xc0, 0x8a, - 0x72, 0xe6, 0xce, 0x18, 0xf6, 0xc9, 0x67, 0x9a, 0xc5, 0x33, 0x6c, 0xd6, 0xb7, 0x41, 0xea, 0x4a, - 0x3a, 0x75, 0xf7, 0xc6, 0x4f, 0xdd, 0x90, 0xbb, 0x57, 0x81, 0x03, 0xf5, 0xaf, 0x00, 0xde, 0x18, - 0xb2, 0x24, 0x3d, 0x98, 0xf5, 0x72, 0x24, 0x74, 0x63, 0xce, 0x2d, 0x45, 0xeb, 0xc8, 0xcd, 0x1a, - 0x33, 0xa7, 0xb2, 0xca, 0x50, 0xe0, 0x76, 0x60, 0x99, 0x2a, 0x12, 0x4a, 0xf3, 0x60, 0xdc, 0xb9, - 0xd4, 0xe8, 0xdc, 0xeb, 0xd9, 0xb8, 0x1e, 0xa4, 0x5c, 0x5e, 0x9f, 0xb2, 0xfe, 0xb9, 0x08, 0xe1, - 0x63, 0xde, 0xba, 0xba, 0x3d, 0xe7, 0xde, 0x1e, 0x06, 0xa1, 0x9f, 0xbd, 0xbd, 0xd2, 0xdc, 0xa0, - 0xd5, 0xcb, 0xbf, 0xdb, 0xb9, 0x45, 0x83, 0x15, 0xe9, 0x0d, 0x29, 0xd4, 0xbf, 0x00, 0x38, 0x93, - 0x4f, 0xe5, 0x3f, 0x44, 0xec, 0xf9, 0x9f, 0x11, 0x5b, 0x1e, 0xff, 0x6c, 0x79, 0x9b, 0x67, 0x27, - 0xcc, 0x45, 0xfb, 0x27, 0x76, 0xe1, 0xe0, 0xc4, 0x2e, 0x1c, 0x9e, 0xd8, 0x85, 0xb7, 0x89, 0x0d, - 0xf6, 0x13, 0x1b, 0x1c, 0x24, 0x36, 0x38, 0x4c, 0x6c, 0xf0, 0x3d, 0xb1, 0xc1, 0xa7, 0x1f, 0x76, - 0x61, 0x67, 0x2a, 0x23, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xe6, 0x48, 0x8b, 0xfc, 0x08, - 0x00, 0x00, -} - -func (m *ContainerMetrics) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerMetrics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Usage) > 0 { - keysForUsage := make([]string, 0, len(m.Usage)) - for k := range m.Usage { - keysForUsage = append(keysForUsage, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForUsage) - for iNdEx := len(keysForUsage) - 1; iNdEx >= 0; iNdEx-- { - v := m.Usage[k8s_io_api_core_v1.ResourceName(keysForUsage[iNdEx])] - baseI := i - { - size, err := ((*resource.Quantity)(&v)).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(keysForUsage[iNdEx]) - copy(dAtA[i:], keysForUsage[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForUsage[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NodeMetrics) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeMetrics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Usage) > 0 { - keysForUsage := make([]string, 0, len(m.Usage)) - for k := range m.Usage { - keysForUsage = append(keysForUsage, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForUsage) - for iNdEx := len(keysForUsage) - 1; iNdEx >= 0; iNdEx-- { - v := m.Usage[k8s_io_api_core_v1.ResourceName(keysForUsage[iNdEx])] - baseI := i - { - size, err := ((*resource.Quantity)(&v)).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(keysForUsage[iNdEx]) - copy(dAtA[i:], keysForUsage[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForUsage[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.Window.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *NodeMetricsList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NodeMetricsList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeMetricsList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PodMetrics) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PodMetrics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PodMetrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Containers) > 0 { - for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.Window.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PodMetricsList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PodMetricsList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PodMetricsList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ContainerMetrics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Usage) > 0 { - for k, v := range m.Usage { - _ = k - _ = v - l = ((*resource.Quantity)(&v)).Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - return n -} - -func (m *NodeMetrics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Timestamp.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Window.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Usage) > 0 { - for k, v := range m.Usage { - _ = k - _ = v - l = ((*resource.Quantity)(&v)).Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - return n -} - -func (m *NodeMetricsList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *PodMetrics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Timestamp.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Window.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Containers) > 0 { - for _, e := range m.Containers { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *PodMetricsList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ContainerMetrics) String() string { - if this == nil { - return "nil" - } - keysForUsage := make([]string, 0, len(this.Usage)) - for k := range this.Usage { - keysForUsage = append(keysForUsage, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForUsage) - mapStringForUsage := "k8s_io_api_core_v1.ResourceList{" - for _, k := range keysForUsage { - mapStringForUsage += fmt.Sprintf("%v: %v,", k, this.Usage[k8s_io_api_core_v1.ResourceName(k)]) - } - mapStringForUsage += "}" - s := strings.Join([]string{`&ContainerMetrics{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Usage:` + mapStringForUsage + `,`, - `}`, - }, "") - return s -} -func (this *NodeMetrics) String() string { - if this == nil { - return "nil" - } - keysForUsage := make([]string, 0, len(this.Usage)) - for k := range this.Usage { - keysForUsage = append(keysForUsage, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForUsage) - mapStringForUsage := "k8s_io_api_core_v1.ResourceList{" - for _, k := range keysForUsage { - mapStringForUsage += fmt.Sprintf("%v: %v,", k, this.Usage[k8s_io_api_core_v1.ResourceName(k)]) - } - mapStringForUsage += "}" - s := strings.Join([]string{`&NodeMetrics{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `Window:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Window), "Duration", "v1.Duration", 1), `&`, ``, 1) + `,`, - `Usage:` + mapStringForUsage + `,`, - `}`, - }, "") - return s -} -func (this *NodeMetricsList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]NodeMetrics{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "NodeMetrics", "NodeMetrics", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&NodeMetricsList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *PodMetrics) String() string { - if this == nil { - return "nil" - } - repeatedStringForContainers := "[]ContainerMetrics{" - for _, f := range this.Containers { - repeatedStringForContainers += strings.Replace(strings.Replace(f.String(), "ContainerMetrics", "ContainerMetrics", 1), `&`, ``, 1) + "," - } - repeatedStringForContainers += "}" - s := strings.Join([]string{`&PodMetrics{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `Window:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Window), "Duration", "v1.Duration", 1), `&`, ``, 1) + `,`, - `Containers:` + repeatedStringForContainers + `,`, - `}`, - }, "") - return s -} -func (this *PodMetricsList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]PodMetrics{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodMetrics", "PodMetrics", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&PodMetricsList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ContainerMetrics) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ContainerMetrics: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ContainerMetrics: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Usage == nil { - m.Usage = make(k8s_io_api_core_v1.ResourceList) - } - var mapkey k8s_io_api_core_v1.ResourceName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Usage[k8s_io_api_core_v1.ResourceName(mapkey)] = ((k8s_io_apimachinery_pkg_api_resource.Quantity)(*mapvalue)) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeMetrics) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NodeMetrics: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeMetrics: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Window.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Usage == nil { - m.Usage = make(k8s_io_api_core_v1.ResourceList) - } - var mapkey k8s_io_api_core_v1.ResourceName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Usage[k8s_io_api_core_v1.ResourceName(mapkey)] = ((k8s_io_apimachinery_pkg_api_resource.Quantity)(*mapvalue)) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeMetricsList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NodeMetricsList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeMetricsList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, NodeMetrics{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodMetrics) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodMetrics: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodMetrics: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Window.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Containers = append(m.Containers, ContainerMetrics{}) - if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodMetricsList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodMetricsList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodMetricsList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, PodMetrics{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto deleted file mode 100644 index dbce364f0..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.proto +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.metrics.pkg.apis.metrics.v1alpha1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1alpha1"; - -// ContainerMetrics sets resource usage metrics of a container. -message ContainerMetrics { - // Container name corresponding to the one from pod.spec.containers. - optional string name = 1; - - // The memory usage is the memory working set. - map usage = 2; -} - -// NodeMetrics sets resource usage metrics of a node. -message NodeMetrics { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The following fields define time interval from which metrics were - // collected from the interval [Timestamp-Window, Timestamp]. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time timestamp = 2; - - optional k8s.io.apimachinery.pkg.apis.meta.v1.Duration window = 3; - - // The memory usage is the memory working set. - map usage = 4; -} - -// NodeMetricsList is a list of NodeMetrics. -message NodeMetricsList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of node metrics. - repeated NodeMetrics items = 2; -} - -// PodMetrics sets resource usage metrics of a pod. -message PodMetrics { - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // The following fields define time interval from which metrics were - // collected from the interval [Timestamp-Window, Timestamp]. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time timestamp = 2; - - optional k8s.io.apimachinery.pkg.apis.meta.v1.Duration window = 3; - - // Metrics for all containers are collected within the same time window. - repeated ContainerMetrics containers = 4; -} - -// PodMetricsList is a list of PodMetrics. -message PodMetricsList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of pod metrics. - repeated PodMetrics items = 2; -} - diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/register.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/register.go deleted file mode 100644 index 3e5359a8e..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "metrics.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder points to a list of functions added to Scheme. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - // AddToScheme applies all the stored functions to the scheme. - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &NodeMetrics{}, - &NodeMetricsList{}, - &PodMetrics{}, - &PodMetricsList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go deleted file mode 100644 index 10d6cd865..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +resourceName=nodes -// +genclient:readonly -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeMetrics sets resource usage metrics of a node. -type NodeMetrics struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // The following fields define time interval from which metrics were - // collected from the interval [Timestamp-Window, Timestamp]. - Timestamp metav1.Time `json:"timestamp" protobuf:"bytes,2,opt,name=timestamp"` - Window metav1.Duration `json:"window" protobuf:"bytes,3,opt,name=window"` - - // The memory usage is the memory working set. - Usage v1.ResourceList `json:"usage" protobuf:"bytes,4,rep,name=usage,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeMetricsList is a list of NodeMetrics. -type NodeMetricsList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // List of node metrics. - Items []NodeMetrics `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +genclient -// +resourceName=pods -// +genclient:readonly -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PodMetrics sets resource usage metrics of a pod. -type PodMetrics struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // The following fields define time interval from which metrics were - // collected from the interval [Timestamp-Window, Timestamp]. - Timestamp metav1.Time `json:"timestamp" protobuf:"bytes,2,opt,name=timestamp"` - Window metav1.Duration `json:"window" protobuf:"bytes,3,opt,name=window"` - - // Metrics for all containers are collected within the same time window. - Containers []ContainerMetrics `json:"containers" protobuf:"bytes,4,rep,name=containers"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PodMetricsList is a list of PodMetrics. -type PodMetricsList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // List of pod metrics. - Items []PodMetrics `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// ContainerMetrics sets resource usage metrics of a container. -type ContainerMetrics struct { - // Container name corresponding to the one from pod.spec.containers. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - // The memory usage is the memory working set. - Usage v1.ResourceList `json:"usage" protobuf:"bytes,2,rep,name=usage,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` -} diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 532bbec41..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,208 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - metrics "k8s.io/metrics/pkg/apis/metrics" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ContainerMetrics)(nil), (*metrics.ContainerMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ContainerMetrics_To_metrics_ContainerMetrics(a.(*ContainerMetrics), b.(*metrics.ContainerMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*metrics.ContainerMetrics)(nil), (*ContainerMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_metrics_ContainerMetrics_To_v1alpha1_ContainerMetrics(a.(*metrics.ContainerMetrics), b.(*ContainerMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeMetrics)(nil), (*metrics.NodeMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NodeMetrics_To_metrics_NodeMetrics(a.(*NodeMetrics), b.(*metrics.NodeMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*metrics.NodeMetrics)(nil), (*NodeMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_metrics_NodeMetrics_To_v1alpha1_NodeMetrics(a.(*metrics.NodeMetrics), b.(*NodeMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeMetricsList)(nil), (*metrics.NodeMetricsList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NodeMetricsList_To_metrics_NodeMetricsList(a.(*NodeMetricsList), b.(*metrics.NodeMetricsList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*metrics.NodeMetricsList)(nil), (*NodeMetricsList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_metrics_NodeMetricsList_To_v1alpha1_NodeMetricsList(a.(*metrics.NodeMetricsList), b.(*NodeMetricsList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PodMetrics)(nil), (*metrics.PodMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PodMetrics_To_metrics_PodMetrics(a.(*PodMetrics), b.(*metrics.PodMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*metrics.PodMetrics)(nil), (*PodMetrics)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_metrics_PodMetrics_To_v1alpha1_PodMetrics(a.(*metrics.PodMetrics), b.(*PodMetrics), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PodMetricsList)(nil), (*metrics.PodMetricsList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PodMetricsList_To_metrics_PodMetricsList(a.(*PodMetricsList), b.(*metrics.PodMetricsList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*metrics.PodMetricsList)(nil), (*PodMetricsList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_metrics_PodMetricsList_To_v1alpha1_PodMetricsList(a.(*metrics.PodMetricsList), b.(*PodMetricsList), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_ContainerMetrics_To_metrics_ContainerMetrics(in *ContainerMetrics, out *metrics.ContainerMetrics, s conversion.Scope) error { - out.Name = in.Name - out.Usage = *(*v1.ResourceList)(unsafe.Pointer(&in.Usage)) - return nil -} - -// Convert_v1alpha1_ContainerMetrics_To_metrics_ContainerMetrics is an autogenerated conversion function. -func Convert_v1alpha1_ContainerMetrics_To_metrics_ContainerMetrics(in *ContainerMetrics, out *metrics.ContainerMetrics, s conversion.Scope) error { - return autoConvert_v1alpha1_ContainerMetrics_To_metrics_ContainerMetrics(in, out, s) -} - -func autoConvert_metrics_ContainerMetrics_To_v1alpha1_ContainerMetrics(in *metrics.ContainerMetrics, out *ContainerMetrics, s conversion.Scope) error { - out.Name = in.Name - out.Usage = *(*v1.ResourceList)(unsafe.Pointer(&in.Usage)) - return nil -} - -// Convert_metrics_ContainerMetrics_To_v1alpha1_ContainerMetrics is an autogenerated conversion function. -func Convert_metrics_ContainerMetrics_To_v1alpha1_ContainerMetrics(in *metrics.ContainerMetrics, out *ContainerMetrics, s conversion.Scope) error { - return autoConvert_metrics_ContainerMetrics_To_v1alpha1_ContainerMetrics(in, out, s) -} - -func autoConvert_v1alpha1_NodeMetrics_To_metrics_NodeMetrics(in *NodeMetrics, out *metrics.NodeMetrics, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Timestamp = in.Timestamp - out.Window = in.Window - out.Usage = *(*v1.ResourceList)(unsafe.Pointer(&in.Usage)) - return nil -} - -// Convert_v1alpha1_NodeMetrics_To_metrics_NodeMetrics is an autogenerated conversion function. -func Convert_v1alpha1_NodeMetrics_To_metrics_NodeMetrics(in *NodeMetrics, out *metrics.NodeMetrics, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeMetrics_To_metrics_NodeMetrics(in, out, s) -} - -func autoConvert_metrics_NodeMetrics_To_v1alpha1_NodeMetrics(in *metrics.NodeMetrics, out *NodeMetrics, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Timestamp = in.Timestamp - out.Window = in.Window - out.Usage = *(*v1.ResourceList)(unsafe.Pointer(&in.Usage)) - return nil -} - -// Convert_metrics_NodeMetrics_To_v1alpha1_NodeMetrics is an autogenerated conversion function. -func Convert_metrics_NodeMetrics_To_v1alpha1_NodeMetrics(in *metrics.NodeMetrics, out *NodeMetrics, s conversion.Scope) error { - return autoConvert_metrics_NodeMetrics_To_v1alpha1_NodeMetrics(in, out, s) -} - -func autoConvert_v1alpha1_NodeMetricsList_To_metrics_NodeMetricsList(in *NodeMetricsList, out *metrics.NodeMetricsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]metrics.NodeMetrics)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_NodeMetricsList_To_metrics_NodeMetricsList is an autogenerated conversion function. -func Convert_v1alpha1_NodeMetricsList_To_metrics_NodeMetricsList(in *NodeMetricsList, out *metrics.NodeMetricsList, s conversion.Scope) error { - return autoConvert_v1alpha1_NodeMetricsList_To_metrics_NodeMetricsList(in, out, s) -} - -func autoConvert_metrics_NodeMetricsList_To_v1alpha1_NodeMetricsList(in *metrics.NodeMetricsList, out *NodeMetricsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]NodeMetrics)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_metrics_NodeMetricsList_To_v1alpha1_NodeMetricsList is an autogenerated conversion function. -func Convert_metrics_NodeMetricsList_To_v1alpha1_NodeMetricsList(in *metrics.NodeMetricsList, out *NodeMetricsList, s conversion.Scope) error { - return autoConvert_metrics_NodeMetricsList_To_v1alpha1_NodeMetricsList(in, out, s) -} - -func autoConvert_v1alpha1_PodMetrics_To_metrics_PodMetrics(in *PodMetrics, out *metrics.PodMetrics, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Timestamp = in.Timestamp - out.Window = in.Window - out.Containers = *(*[]metrics.ContainerMetrics)(unsafe.Pointer(&in.Containers)) - return nil -} - -// Convert_v1alpha1_PodMetrics_To_metrics_PodMetrics is an autogenerated conversion function. -func Convert_v1alpha1_PodMetrics_To_metrics_PodMetrics(in *PodMetrics, out *metrics.PodMetrics, s conversion.Scope) error { - return autoConvert_v1alpha1_PodMetrics_To_metrics_PodMetrics(in, out, s) -} - -func autoConvert_metrics_PodMetrics_To_v1alpha1_PodMetrics(in *metrics.PodMetrics, out *PodMetrics, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Timestamp = in.Timestamp - out.Window = in.Window - out.Containers = *(*[]ContainerMetrics)(unsafe.Pointer(&in.Containers)) - return nil -} - -// Convert_metrics_PodMetrics_To_v1alpha1_PodMetrics is an autogenerated conversion function. -func Convert_metrics_PodMetrics_To_v1alpha1_PodMetrics(in *metrics.PodMetrics, out *PodMetrics, s conversion.Scope) error { - return autoConvert_metrics_PodMetrics_To_v1alpha1_PodMetrics(in, out, s) -} - -func autoConvert_v1alpha1_PodMetricsList_To_metrics_PodMetricsList(in *PodMetricsList, out *metrics.PodMetricsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]metrics.PodMetrics)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_PodMetricsList_To_metrics_PodMetricsList is an autogenerated conversion function. -func Convert_v1alpha1_PodMetricsList_To_metrics_PodMetricsList(in *PodMetricsList, out *metrics.PodMetricsList, s conversion.Scope) error { - return autoConvert_v1alpha1_PodMetricsList_To_metrics_PodMetricsList(in, out, s) -} - -func autoConvert_metrics_PodMetricsList_To_v1alpha1_PodMetricsList(in *metrics.PodMetricsList, out *PodMetricsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]PodMetrics)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_metrics_PodMetricsList_To_v1alpha1_PodMetricsList is an autogenerated conversion function. -func Convert_metrics_PodMetricsList_To_v1alpha1_PodMetricsList(in *metrics.PodMetricsList, out *PodMetricsList, s conversion.Scope) error { - return autoConvert_metrics_PodMetricsList_To_v1alpha1_PodMetricsList(in, out, s) -} diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 28001c397..000000000 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,185 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ContainerMetrics) DeepCopyInto(out *ContainerMetrics) { - *out = *in - if in.Usage != nil { - in, out := &in.Usage, &out.Usage - *out = make(v1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerMetrics. -func (in *ContainerMetrics) DeepCopy() *ContainerMetrics { - if in == nil { - return nil - } - out := new(ContainerMetrics) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeMetrics) DeepCopyInto(out *NodeMetrics) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Timestamp.DeepCopyInto(&out.Timestamp) - out.Window = in.Window - if in.Usage != nil { - in, out := &in.Usage, &out.Usage - *out = make(v1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeMetrics. -func (in *NodeMetrics) DeepCopy() *NodeMetrics { - if in == nil { - return nil - } - out := new(NodeMetrics) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeMetrics) 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 *NodeMetricsList) DeepCopyInto(out *NodeMetricsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeMetrics, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeMetricsList. -func (in *NodeMetricsList) DeepCopy() *NodeMetricsList { - if in == nil { - return nil - } - out := new(NodeMetricsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeMetricsList) 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 *PodMetrics) DeepCopyInto(out *PodMetrics) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Timestamp.DeepCopyInto(&out.Timestamp) - out.Window = in.Window - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]ContainerMetrics, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMetrics. -func (in *PodMetrics) DeepCopy() *PodMetrics { - if in == nil { - return nil - } - out := new(PodMetrics) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodMetrics) 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 *PodMetricsList) DeepCopyInto(out *PodMetricsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodMetrics, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodMetricsList. -func (in *PodMetricsList) DeepCopy() *PodMetricsList { - if in == nil { - return nil - } - out := new(PodMetricsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodMetricsList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/doc.go b/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc375616..000000000 --- a/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/register.go b/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/register.go deleted file mode 100644 index 361fe99e1..000000000 --- a/vendor/k8s.io/metrics/pkg/client/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - metricsv1alpha1 "k8s.io/metrics/pkg/apis/metrics/v1alpha1" - metricsv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - metricsv1alpha1.AddToScheme, - metricsv1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2bf1be126..6e9ac945d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -95,7 +95,7 @@ github.com/gardener/etcd-druid/api/v1alpha1 # github.com/gardener/external-dns-management v0.7.18 github.com/gardener/external-dns-management/pkg/apis/dns github.com/gardener/external-dns-management/pkg/apis/dns/v1alpha1 -# github.com/gardener/gardener v1.30.1-0.20210831145107-5b4604745d8e +# github.com/gardener/gardener v1.31.0 ## explicit github.com/gardener/gardener/.github github.com/gardener/gardener/.github/ISSUE_TEMPLATE @@ -149,8 +149,6 @@ github.com/gardener/gardener/hack/.ci github.com/gardener/gardener/hack/api-reference/template github.com/gardener/gardener/pkg/api/core github.com/gardener/gardener/pkg/api/extensions -github.com/gardener/gardener/pkg/apis/authentication -github.com/gardener/gardener/pkg/apis/authentication/v1alpha1 github.com/gardener/gardener/pkg/apis/core github.com/gardener/gardener/pkg/apis/core/helper github.com/gardener/gardener/pkg/apis/core/install @@ -165,29 +163,23 @@ github.com/gardener/gardener/pkg/apis/extensions github.com/gardener/gardener/pkg/apis/extensions/v1alpha1 github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper github.com/gardener/gardener/pkg/apis/operations +github.com/gardener/gardener/pkg/apis/operations/install github.com/gardener/gardener/pkg/apis/operations/v1alpha1 github.com/gardener/gardener/pkg/apis/seedmanagement github.com/gardener/gardener/pkg/apis/seedmanagement/encoding +github.com/gardener/gardener/pkg/apis/seedmanagement/install github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1 github.com/gardener/gardener/pkg/apis/settings +github.com/gardener/gardener/pkg/apis/settings/install github.com/gardener/gardener/pkg/apis/settings/v1alpha1 github.com/gardener/gardener/pkg/chartrenderer -github.com/gardener/gardener/pkg/client/core/clientset/versioned -github.com/gardener/gardener/pkg/client/core/clientset/versioned/scheme -github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1alpha1 -github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1 github.com/gardener/gardener/pkg/client/core/listers/core/internalversion -github.com/gardener/gardener/pkg/client/extensions/clientset/versioned/scheme github.com/gardener/gardener/pkg/client/kubernetes github.com/gardener/gardener/pkg/client/kubernetes/cache github.com/gardener/gardener/pkg/client/kubernetes/mock -github.com/gardener/gardener/pkg/client/operations/clientset/versioned -github.com/gardener/gardener/pkg/client/operations/clientset/versioned/scheme -github.com/gardener/gardener/pkg/client/operations/clientset/versioned/typed/operations/v1alpha1 github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned/scheme github.com/gardener/gardener/pkg/client/seedmanagement/clientset/versioned/typed/seedmanagement/v1alpha1 -github.com/gardener/gardener/pkg/client/settings/clientset/versioned/scheme github.com/gardener/gardener/pkg/controllerutils github.com/gardener/gardener/pkg/extensions github.com/gardener/gardener/pkg/features @@ -1022,10 +1014,7 @@ k8s.io/klog/v2 k8s.io/kube-aggregator/pkg/apis/apiregistration k8s.io/kube-aggregator/pkg/apis/apiregistration/v1 k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1 -k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme -k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1 -k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1 # k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 k8s.io/kube-openapi/cmd/openapi-gen k8s.io/kube-openapi/cmd/openapi-gen/args @@ -1039,9 +1028,7 @@ k8s.io/kube-openapi/pkg/util/sets k8s.io/kubelet/config/v1beta1 # k8s.io/metrics v0.21.2 k8s.io/metrics/pkg/apis/metrics -k8s.io/metrics/pkg/apis/metrics/v1alpha1 k8s.io/metrics/pkg/apis/metrics/v1beta1 -k8s.io/metrics/pkg/client/clientset/versioned/scheme # k8s.io/utils v0.0.0-20210527160623-6fdb442a123b ## explicit k8s.io/utils/buffer From d6cd84f1e9456f648c3ca02751ce7e45db71c6b8 Mon Sep 17 00:00:00 2001 From: Stoyan Rachev Date: Fri, 10 Sep 2021 16:48:02 +0300 Subject: [PATCH 03/24] Make the linter fail on missing or wrong doc comments (#372) --- .golangci.yaml | 12 ++++++++++++ pkg/admission/validator/webhook.go | 1 + pkg/apis/config/loader/loader.go | 16 ++++++++-------- pkg/controller/backupbucket/actuator.go | 5 +---- pkg/controller/dnsrecord/actuator.go | 1 + test/integration/infrastructure/matchers.go | 1 + test/tm/generator.go | 6 +++--- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index d54e53588..70faa5aba 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -5,3 +5,15 @@ run: linters: disable: - unused + enable: + - revive + +issues: + exclude-use-default: false + exclude: + # revive + - var-naming # ((var|const|struct field|func) .* should be .* + - dot-imports # should not use dot imports + - package-comments # package comment should be of the form + - indent-error-flow # if block ends with a return statement, so drop this else and outdent its block + - "exported: (type|func) name will be used as .* by other packages, and that stutters;" diff --git a/pkg/admission/validator/webhook.go b/pkg/admission/validator/webhook.go index fe2d5e131..72ecbff94 100644 --- a/pkg/admission/validator/webhook.go +++ b/pkg/admission/validator/webhook.go @@ -27,6 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// SecretsValidatorName is the name of the secrets validator. const SecretsValidatorName = "secrets." + extensionswebhook.ValidatorName var logger = log.Log.WithName("azure-validator-webhook") diff --git a/pkg/apis/config/loader/loader.go b/pkg/apis/config/loader/loader.go index 435b41904..65b2ce20f 100644 --- a/pkg/apis/config/loader/loader.go +++ b/pkg/apis/config/loader/loader.go @@ -27,16 +27,16 @@ import ( ) var ( - Codec runtime.Codec - Scheme *runtime.Scheme + codec runtime.Codec + scheme *runtime.Scheme ) func init() { - Scheme = runtime.NewScheme() - install.Install(Scheme) - yamlSerializer := json.NewYAMLSerializer(json.DefaultMetaFactory, Scheme, Scheme) - Codec = versioning.NewDefaultingCodecForScheme( - Scheme, + scheme = runtime.NewScheme() + install.Install(scheme) + yamlSerializer := json.NewYAMLSerializer(json.DefaultMetaFactory, scheme, scheme) + codec = versioning.NewDefaultingCodecForScheme( + scheme, yamlSerializer, yamlSerializer, schema.GroupVersion{Version: "v1alpha1"}, @@ -63,7 +63,7 @@ func Load(data []byte) (*config.ControllerConfiguration, error) { return cfg, nil } - decoded, _, err := Codec.Decode(data, &schema.GroupVersionKind{Version: "v1alpha1", Kind: "Config"}, cfg) + decoded, _, err := codec.Decode(data, &schema.GroupVersionKind{Version: "v1alpha1", Kind: "Config"}, cfg) if err != nil { return nil, err } diff --git a/pkg/controller/backupbucket/actuator.go b/pkg/controller/backupbucket/actuator.go index ec725232a..1a20aabcf 100644 --- a/pkg/controller/backupbucket/actuator.go +++ b/pkg/controller/backupbucket/actuator.go @@ -94,8 +94,5 @@ func (a *actuator) Delete(ctx context.Context, backupBucket *extensionsv1alpha1. } // Delete the generated backup secret in the garden namespace. - if err := a.deleteBackupBucketGeneratedSecret(ctx, backupBucket); err != nil { - return err - } - return nil + return a.deleteBackupBucketGeneratedSecret(ctx, backupBucket) } diff --git a/pkg/controller/dnsrecord/actuator.go b/pkg/controller/dnsrecord/actuator.go index d381c43ce..916d67016 100644 --- a/pkg/controller/dnsrecord/actuator.go +++ b/pkg/controller/dnsrecord/actuator.go @@ -46,6 +46,7 @@ type actuator struct { logger logr.Logger } +// NewActuator creates a new dnsrecord.Actuator. func NewActuator(client client.Client, azureClientFactory azureclient.Factory, logger logr.Logger) dnsrecord.Actuator { return &actuator{ client: client, diff --git a/test/integration/infrastructure/matchers.go b/test/integration/infrastructure/matchers.go index f05ccd6d2..bd3885831 100644 --- a/test/integration/infrastructure/matchers.go +++ b/test/integration/infrastructure/matchers.go @@ -43,6 +43,7 @@ func (a *azureNotFoundErrorMatcher) Match(actual interface{}) (success bool, err return false, nil } +// IsNotFound returns true if the given error is a autorest.DetailedError with status code http.StatusNotFound. func IsNotFound(err error) bool { if err == nil { return false diff --git a/test/tm/generator.go b/test/tm/generator.go index 01757c622..d48526c11 100644 --- a/test/tm/generator.go +++ b/test/tm/generator.go @@ -36,7 +36,7 @@ const ( defaultNetworkWorkerCidr = "10.250.0.0/19" ) -type GeneratorConfig struct { +type generatorConfig struct { networkWorkerCidr string networkVnetCidr string infrastructureProviderConfigPath string @@ -46,12 +46,12 @@ type GeneratorConfig struct { } var ( - cfg *GeneratorConfig + cfg *generatorConfig logger logr.Logger ) func addFlags() { - cfg = &GeneratorConfig{} + cfg = &generatorConfig{} flag.StringVar(&cfg.infrastructureProviderConfigPath, "infrastructure-provider-config-filepath", "", "filepath to the provider specific infrastructure config") flag.StringVar(&cfg.controlplaneProviderConfigPath, "controlplane-provider-config-filepath", "", "filepath to the provider specific controlplane config") From d9c9d7aa7021c2ef1d3847a6845d7e5a17ba9a21 Mon Sep 17 00:00:00 2001 From: Rafael Franzke Date: Wed, 22 Sep 2021 18:16:25 +0200 Subject: [PATCH 04/24] Vendor gardener/gardener@v1.32.0 (#375) Vendor gardener/gardener@v1.32.0 --- Makefile | 2 +- .../app/app.go | 2 +- go.mod | 4 +- go.sum | 11 +- test/e2e/doc.go | 18 - test/e2e/netpol-gen/app/azure.go | 99 -- test/e2e/netpol-gen/netpol-gen.go | 39 - test/e2e/networkpolicies/doc.go | 20 - .../networkpolicies_suite_test.go | 31 - .../e2e/networkpolicies/networkpolicy_test.go | 1182 ----------------- .../pkg/restarter/api/encoding.go | 28 - .../pkg/restarter/api/types.go | 27 - .../pkg/controller/backupentry/reconciler.go | 8 +- .../pkg/controller/common/context.go | 2 +- .../pkg/controller/controlplane/reconciler.go | 8 +- .../pkg/controller/dnsrecord/reconciler.go | 8 +- .../pkg/controller/healthcheck/actuator.go | 2 +- .../controller/healthcheck/config/types.go | 1 + .../healthcheck/config/v1alpha1/types.go | 1 + .../pkg/controller/healthcheck/controller.go | 1 + .../healthcheck/general/daemonset.go | 10 +- .../healthcheck/general/deployment.go | 10 +- .../healthcheck/general/statefulsets.go | 10 +- .../healthcheck/healtcheck_actuator.go | 3 + .../pkg/controller/healthcheck/inject.go | 2 +- .../controller/infrastructure/reconciler.go | 8 +- .../extensions/pkg/controller/utils.go | 5 + .../genericactuator/actuator_restore.go | 36 +- .../pkg/controller/worker/reconciler.go | 8 +- .../extensions/pkg/webhook/cmd/options.go | 4 +- .../controlplane/genericmutator/mutator.go | 7 +- .../extensions/pkg/webhook/network/mutator.go | 1 + .../extensions/pkg/webhook/registration.go | 2 +- .../extensions/pkg/webhook/shoot/shoot.go | 2 +- .../extensions/pkg/webhook/webhook.go | 1 + .../test/e2e/framework/executor/executor.go | 116 -- .../e2e/framework/networkpolicies/agnostic.go | 290 ---- .../generators/networkpolicies.go | 739 ----------- .../generators/pretty_print.go | 31 - .../framework/networkpolicies/rule_builder.go | 107 -- .../networkpolicies/shared_resources.go | 28 - .../e2e/framework/networkpolicies/types.go | 218 --- .../healthcheck/healthcheck_operation.go | 32 +- .../integration/operation/shoot_operation.go | 15 +- .../gardener/gardener/hack/update-codegen.sh | 28 +- .../gardener/pkg/apis/core/helper/helpers.go | 23 + .../gardener/pkg/apis/core/types_quota.go | 1 + .../pkg/apis/core/types_secretbinding.go | 1 + .../gardener/pkg/apis/core/types_shoot.go | 10 +- .../pkg/apis/core/v1alpha1/conversions.go | 1 + .../pkg/apis/core/v1alpha1/generated.proto | 9 +- .../pkg/apis/core/v1alpha1/helper/helper.go | 3 + .../pkg/apis/core/v1alpha1/types_plant.go | 1 + .../pkg/apis/core/v1alpha1/types_quota.go | 1 + .../apis/core/v1alpha1/types_secretbinding.go | 1 + .../pkg/apis/core/v1alpha1/types_shoot.go | 10 +- .../core/v1beta1/constants/types_constants.go | 2 + .../pkg/apis/core/v1beta1/conversions.go | 1 + .../pkg/apis/core/v1beta1/generated.proto | 9 +- .../pkg/apis/core/v1beta1/helper/helper.go | 27 + .../pkg/apis/core/v1beta1/types_plant.go | 1 + .../pkg/apis/core/v1beta1/types_quota.go | 1 + .../apis/core/v1beta1/types_secretbinding.go | 1 + .../pkg/apis/core/v1beta1/types_shoot.go | 10 +- .../pkg/apis/core/validation/cloudprofile.go | 12 +- .../pkg/apis/core/validation/quota.go | 6 +- .../gardener/pkg/apis/core/validation/seed.go | 2 +- .../pkg/apis/core/validation/shoot.go | 20 +- .../gardener/pkg/apis/extensions/register.go | 1 + .../apis/extensions/v1alpha1/helper/helper.go | 3 +- .../pkg/apis/extensions/v1alpha1/register.go | 4 +- .../v1alpha1/types_containerruntime.go | 1 + .../v1alpha1/types_operatingsystemconfig.go | 6 +- .../apis/operations/v1alpha1/conversions.go | 1 + .../seedmanagement/v1alpha1/conversions.go | 1 + .../pkg/client/kubernetes/cache/cache.go | 5 + .../pkg/client/kubernetes/chartoptions.go | 2 + .../pkg/client/kubernetes/manifestoptions.go | 4 +- .../pkg/client/kubernetes/mock/mocks.go | 14 - .../gardener/pkg/client/kubernetes/pods.go | 64 +- .../gardener/pkg/client/kubernetes/types.go | 2 - .../gardener/pkg/controllerutils/worker.go | 2 +- .../pkg/extensions/customresources.go | 64 +- .../gardener/pkg/features/features.go | 3 +- .../pkg/gardenlet/apis/config/types.go | 4 +- .../apis/config/v1alpha1/conversions.go | 1 + .../gardenlet/apis/config/v1alpha1/types.go | 5 +- .../v1alpha1/zz_generated.conversion.go | 21 +- .../config/v1alpha1/zz_generated.deepcopy.go | 7 +- .../apis/config/zz_generated.deepcopy.go | 7 +- .../botanist/component/etcd/bootstrap.go | 785 ----------- .../component/etcd/dependency_watchdog.go | 50 - .../operation/botanist/component/etcd/etcd.go | 696 ---------- .../botanist/component/etcd/logging.go | 58 - .../botanist/component/etcd/monitoring.go | 372 ------ .../botanist/component/etcd/waiter.go | 91 -- .../kube_controller_manager.go | 606 --------- .../kubecontrollermanager/logging.go | 43 - .../kubecontrollermanager/monitoring.go | 109 -- .../kubecontrollermanager/shoot_resources.go | 30 - .../component/kubecontrollermanager/waiter.go | 96 -- .../component/kubescheduler/kube_scheduler.go | 428 ------ .../component/kubescheduler/logging.go | 43 - .../component/kubescheduler/monitoring.go | 154 --- .../component/monitoring/blackbox_exporter.go | 18 - .../component/monitoring/prometheus.go | 28 - .../pkg/operation/botanist/component/phase.go | 2 +- .../gardener/pkg/operation/common/types.go | 3 - .../pkg/scheduler/apis/config/types.go | 2 +- .../scheduler/apis/config/v1alpha1/types.go | 3 +- .../v1alpha1/zz_generated.conversion.go | 21 +- .../config/v1alpha1/zz_generated.deepcopy.go | 7 +- .../apis/config/zz_generated.deepcopy.go | 7 +- .../scheduler/controller/shoot/reconciler.go | 18 +- .../gardener/pkg/utils/errors/unwrap.go | 2 +- .../gardener/gardener/pkg/utils/flow/flow.go | 8 +- .../gardener/pkg/utils/flow/taskfn.go | 9 +- .../gardener/pkg/utils/gardener/dns.go | 12 +- .../gardener/pkg/utils/gardener/seed.go | 17 +- .../pkg/utils/kubernetes/kubernetes.go | 11 + .../pkg/utils/secrets/certificates.go | 13 +- .../gardener/gardener/pkg/utils/values.go | 5 +- .../gardener/test/framework/common.go | 2 +- .../gardener/gardener/test/framework/dump.go | 2 + .../gardener/test/framework/gardener_utils.go | 16 +- .../gardener/test/framework/k8s_utils.go | 11 +- .../test/framework/shootcreationframework.go | 8 +- .../gardener/test/framework/shootframework.go | 2 +- .../test/framework/shootmigrationtest.go | 6 +- .../gardener/test/framework/test_options.go | 2 +- .../gardener/test/framework/worker_utils.go | 5 +- vendor/golang.org/x/lint/README.md | 4 + .../x/tools/go/ast/astutil/rewrite.go | 8 +- .../x/tools/internal/gocommand/version.go | 2 +- .../x/tools/internal/typeparams/doc.go | 11 + .../tools/internal/typeparams/notypeparams.go | 90 ++ .../x/tools/internal/typeparams/typeparams.go | 105 ++ vendor/modules.txt | 18 +- 138 files changed, 671 insertions(+), 6950 deletions(-) delete mode 100644 test/e2e/doc.go delete mode 100644 test/e2e/netpol-gen/app/azure.go delete mode 100644 test/e2e/netpol-gen/netpol-gen.go delete mode 100644 test/e2e/networkpolicies/doc.go delete mode 100644 test/e2e/networkpolicies/networkpolicies_suite_test.go delete mode 100644 test/e2e/networkpolicies/networkpolicy_test.go delete mode 100644 vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/encoding.go delete mode 100644 vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/types.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/executor/executor.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/agnostic.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/networkpolicies.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/pretty_print.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/rule_builder.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/shared_resources.go delete mode 100644 vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/types.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/bootstrap.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/dependency_watchdog.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/etcd.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/logging.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/monitoring.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/waiter.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager/kube_controller_manager.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager/logging.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager/monitoring.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager/shoot_resources.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager/waiter.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/kube_scheduler.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/logging.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler/monitoring.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/monitoring/blackbox_exporter.go delete mode 100644 vendor/github.com/gardener/gardener/pkg/operation/botanist/component/monitoring/prometheus.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/doc.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/notypeparams.go create mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeparams.go diff --git a/Makefile b/Makefile index 78786739d..9c3997117 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ check: .PHONY: generate generate: - @$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./charts/... ./cmd/... ./pkg/... ./test/... + @$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./charts/... ./cmd/... ./pkg/... .PHONY: format format: diff --git a/cmd/gardener-extension-provider-azure/app/app.go b/cmd/gardener-extension-provider-azure/app/app.go index 93b4863a5..a52a7a09e 100644 --- a/cmd/gardener-extension-provider-azure/app/app.go +++ b/cmd/gardener-extension-provider-azure/app/app.go @@ -191,7 +191,7 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command { reconcileOpts.Completed().Apply(&azureworker.DefaultAddOptions.IgnoreOperationAnnotation) workerCtrlOpts.Completed().Apply(&azureworker.DefaultAddOptions.Controller) - if _, _, err := webhookOptions.Completed().AddToManager(mgr); err != nil { + if _, _, err := webhookOptions.Completed().AddToManager(ctx, mgr); err != nil { controllercmd.LogErrAndExit(err, "Could not add webhooks to manager") } diff --git a/go.mod b/go.mod index f3a699724..32b3d5275 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/coreos/go-systemd/v22 v22.1.0 github.com/frankban/quicktest v1.9.0 // indirect github.com/gardener/etcd-druid v0.5.0 - github.com/gardener/gardener v1.31.0 + github.com/gardener/gardener v1.32.0 github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a github.com/gardener/machine-controller-manager v0.36.0 github.com/gardener/remedy-controller v0.6.0 @@ -38,8 +38,6 @@ require ( k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible k8s.io/code-generator v0.21.2 k8s.io/component-base v0.21.2 - k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 - k8s.io/klog v1.0.0 k8s.io/kubelet v0.21.2 k8s.io/utils v0.0.0-20210527160623-6fdb442a123b sigs.k8s.io/controller-runtime v0.9.1 diff --git a/go.sum b/go.sum index 4006f6978..6bc084736 100644 --- a/go.sum +++ b/go.sum @@ -205,7 +205,6 @@ github.com/gardener/component-spec/bindings-go v0.0.33/go.mod h1:53EIwICsuMgbY/M github.com/gardener/controller-manager-library v0.1.1-0.20191212112146-917449ad760c/go.mod h1:v6cbldxmpL2fYBEB2lSnq3LSEPwIHus9En6iIhwNE1k= github.com/gardener/controller-manager-library v0.1.1-0.20200204110458-c263b9bb97ad/go.mod h1:v6cbldxmpL2fYBEB2lSnq3LSEPwIHus9En6iIhwNE1k= github.com/gardener/controller-manager-library v0.2.1-0.20200810091329-d980dbe10959/go.mod h1:XMp1tPcX3SP/dMd+3id418f5Cqu44vydeTkBRbW8EvQ= -github.com/gardener/dependency-watchdog v0.6.1-0.20210623112844-96f73d5dc311 h1:UaBOYSCJkISXUlKiSwHSiHAM+4yotKvkd6GQMkC4ke4= github.com/gardener/dependency-watchdog v0.6.1-0.20210623112844-96f73d5dc311/go.mod h1:h4miVhg/rGUl8jZsmRrunKDX56I6gHvr2HtC7gBepIY= github.com/gardener/etcd-druid v0.1.12/go.mod h1:yZrUQY9clD8/ZXK+MmEq8OS1TaKJeipV0u4kHHrwWeY= github.com/gardener/etcd-druid v0.1.15/go.mod h1:BHXG8N04Dl4On7Ie6cErwmpvzncNrmeb+HO7Sqrhf+A= @@ -224,8 +223,8 @@ github.com/gardener/gardener v1.6.6/go.mod h1:w5IHIQDccvSxZJFOtBa8YConyyFgt07DBH github.com/gardener/gardener v1.11.3/go.mod h1:5DzqfOm+G8UftKu5zUbYJ+9Cnfd4XrvRNDabkM9AIp4= github.com/gardener/gardener v1.17.1/go.mod h1:uucRHq0xV46xd9MpJJjRswx/Slq3+ipbbJg09FVUtvM= github.com/gardener/gardener v1.27.1/go.mod h1:g+3Vx1Q8HSwcSkRwxn4G54WealBh4pcZSNOSkE6ygdQ= -github.com/gardener/gardener v1.31.0 h1:5im6qQftO48KKsK/+2hJ3zdNHyb2kzbKmH/yj2yrDiY= -github.com/gardener/gardener v1.31.0/go.mod h1:3VK2HoMK33jZmS4+PeVfHSBXI06t9ybvM+rj1QvYtc0= +github.com/gardener/gardener v1.32.0 h1:/a7vUkG10fDW5mtpeKjSp6BJRo+2tfKG92MhTyGKN/o= +github.com/gardener/gardener v1.32.0/go.mod h1:tmclsznh8ZMNaqDKf7QLvEeMkplYXFWNOCNRynWrcHU= github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a h1:jBvyEhkRzW11Nz2y9IIQAo9HUaCvCqxEko5Nf9NRYUI= github.com/gardener/gardener-extension-networking-calico v1.7.1-0.20200522070525-f9aa28d3c83a/go.mod h1:bmD89OLvEBbXLlznsHe90ZlgTU+OrKErwHb6NWlSTvY= github.com/gardener/gardener-resource-manager v0.10.0/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ= @@ -817,8 +816,9 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1028,8 +1028,9 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/test/e2e/doc.go b/test/e2e/doc.go deleted file mode 100644 index c9eeda80a..000000000 --- a/test/e2e/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:generate go run netpol-gen/netpol-gen.go --go-header-file ../../vendor/github.com/gardener/gardener/hack/LICENSE_BOILERPLATE.txt --input-dirs ./netpol-gen/app --output-base networkpolicies - -// Package e2e contain all network policies for Azure. -package e2e diff --git a/test/e2e/netpol-gen/app/azure.go b/test/e2e/netpol-gen/app/azure.go deleted file mode 100644 index eb3327f74..000000000 --- a/test/e2e/netpol-gen/app/azure.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - np "github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies" -) - -// azureNetworkPolicy holds Azure-specific network policy settings. -type azureNetworkPolicy struct { - np.Agnostic - - // metadata points to Azure-specific Metadata service. - metadata *np.Host -} - -// NewCloudAware returns Azure-specific policies. -func NewCloudAware() np.CloudAware { - return &azureNetworkPolicy{ - metadata: &np.Host{ - Description: "Metadata service", - HostName: "169.254.169.254", - Port: 80, - }, - } -} - -// Sources returns list of all Azure-specific sources and targets. -func (a *azureNetworkPolicy) Rules() []np.Rule { - ag := a.Agnostic - return []np.Rule{ - a.newSource(ag.KubeAPIServer()).AllowPod(ag.EtcdMain(), ag.EtcdEvents()).AllowHost(ag.SeedKubeAPIServer(), ag.External()).Build(), - a.newSource(ag.EtcdMain()).AllowHost(ag.External()).Build(), - a.newSource(ag.EtcdEvents()).AllowHost(ag.External()).Build(), - a.newSource(ag.CloudControllerManagerSecured()).AllowPod(ag.KubeAPIServer()).AllowHost(ag.External()).Build(), - a.newSource(ag.Loki()).Build(), - a.newSource(ag.Grafana()).AllowPod(ag.Prometheus(), ag.Loki()).Build(), - a.newSource(ag.AddonManager()).AllowPod(ag.KubeAPIServer()).AllowHost(ag.SeedKubeAPIServer(), ag.External()).Build(), - a.newSource(ag.KubeControllerManagerSecured()).AllowPod(ag.KubeAPIServer()).AllowHost(a.metadata, ag.External()).Build(), - a.newSource(ag.KubeSchedulerSecured()).AllowPod(ag.KubeAPIServer()).Build(), - a.newSource(ag.KubeStateMetricsShoot()).AllowPod(ag.KubeAPIServer()).Build(), - a.newSource(ag.MachineControllerManager()).AllowPod(ag.KubeAPIServer()).AllowHost(ag.SeedKubeAPIServer(), ag.External()).Build(), - a.newSource(ag.Prometheus()).AllowPod( - ag.CloudControllerManagerSecured(), - ag.EtcdEvents(), - ag.EtcdMain(), - ag.KubeAPIServer(), - ag.KubeControllerManagerSecured(), - ag.KubeSchedulerSecured(), - ag.KubeStateMetricsShoot(), - ag.MachineControllerManager(), - ).AllowTargetPod(ag.Loki().FromPort("metrics")).AllowHost(ag.SeedKubeAPIServer(), ag.External(), ag.GardenPrometheus()).Build(), - } -} - -// EgressFromOtherNamespaces returns list of all azure-specific sources and targets. -func (a *azureNetworkPolicy) EgressFromOtherNamespaces(sourcePod *np.SourcePod) np.Rule { - return np.NewSource(sourcePod).DenyPod(a.Sources()...).AllowPod(a.Agnostic.KubeAPIServer()).Build() -} - -func (a *azureNetworkPolicy) newSource(sourcePod *np.SourcePod) *np.RuleBuilder { - return np.NewSource(sourcePod).DenyPod(a.Sources()...).DenyHost(a.metadata, a.Agnostic.External(), a.Agnostic.GardenPrometheus()) -} - -// Sources returns a list of SourcePods of Azure. -func (a *azureNetworkPolicy) Sources() []*np.SourcePod { - ag := a.Agnostic - return []*np.SourcePod{ - ag.AddonManager(), - ag.CloudControllerManagerSecured(), - ag.Loki(), - ag.EtcdEvents(), - ag.EtcdMain(), - ag.Grafana(), - ag.KubeAPIServer(), - ag.KubeControllerManagerSecured(), - ag.KubeSchedulerSecured(), - ag.KubeStateMetricsShoot(), - ag.MachineControllerManager(), - ag.Prometheus(), - } -} - -// Provider returns Azure cloud provider. -func (a *azureNetworkPolicy) Provider() string { - return "azure" -} diff --git a/test/e2e/netpol-gen/netpol-gen.go b/test/e2e/netpol-gen/netpol-gen.go deleted file mode 100644 index b1ae734c8..000000000 --- a/test/e2e/netpol-gen/netpol-gen.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "os" - - "github.com/gardener/gardener-extension-provider-azure/test/e2e/netpol-gen/app" - - "github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators" - "k8s.io/gengo/args" - "k8s.io/klog" -) - -func main() { - klog.InitFlags(nil) - arguments := args.Default() - if err := arguments.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.NewPackages(app.NewCloudAware()), - ); err != nil { - klog.Errorf("Error: %v", err) - os.Exit(1) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/test/e2e/networkpolicies/doc.go b/test/e2e/networkpolicies/doc.go deleted file mode 100644 index f60b531e9..000000000 --- a/test/e2e/networkpolicies/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by netpol-gen. DO NOT EDIT. - -// Package has auto-generated cloud-specific network policy tests. -package networkpolies diff --git a/test/e2e/networkpolicies/networkpolicies_suite_test.go b/test/e2e/networkpolicies/networkpolicies_suite_test.go deleted file mode 100644 index 9e26956de..000000000 --- a/test/e2e/networkpolicies/networkpolicies_suite_test.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by netpol-gen. DO NOT EDIT. - -package networkpolies - -import ( - "testing" - - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" -) - -func TestNetworkPolicies(t *testing.T) { - gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "Network Policies e2e Test Suite") -} diff --git a/test/e2e/networkpolicies/networkpolicy_test.go b/test/e2e/networkpolicies/networkpolicy_test.go deleted file mode 100644 index 7b0ebeb7c..000000000 --- a/test/e2e/networkpolicies/networkpolicy_test.go +++ /dev/null @@ -1,1182 +0,0 @@ -/* -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by netpol-gen. DO NOT EDIT. - -package networkpolies - -import ( - "context" - "encoding/json" - "flag" - "fmt" - "strings" - "sync" - "time" - - "github.com/gardener/gardener/extensions/test/e2e/framework/executor" - networkpolicies "github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies" - "github.com/gardener/gardener/pkg/client/kubernetes" - "github.com/gardener/gardener/test/framework" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - corev1 "k8s.io/api/core/v1" - networkingv1 "k8s.io/api/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -var ( - cleanup = flag.Bool("cleanup", false, "deletes all created e2e resources after the test suite is done") -) - -const ( - InitializationTimeout = 10 * time.Minute - FinalizationTimeout = time.Minute - DefaultTestTimeout = 10 * time.Second -) - -func init() { - framework.RegisterShootFrameworkFlags() -} - -var _ = Describe("Network Policy Testing", func() { - - var ( - f = framework.NewShootFramework(nil) - sharedResources networkpolicies.SharedResources - - agnostic = &networkpolicies.Agnostic{} - DefaultCIt = func(text string, body func(ctx context.Context)) { - f.Default().CIt(text, body, DefaultTestTimeout) - } - - getTargetPod = func(ctx context.Context, targetPod *networkpolicies.NamespacedTargetPod) *corev1.Pod { - if !targetPod.Pod.CheckVersion(f.Shoot) { - Skip("Target pod doesn't match Shoot version constraints. Skipping.") - } - if !targetPod.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - By(fmt.Sprintf("Checking that target Pod: %s is running", targetPod.Pod.Name)) - err := f.WaitUntilPodIsRunningWithLabels(ctx, targetPod.Pod.Selector(), targetPod.Namespace, f.SeedClient) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - By(fmt.Sprintf("Get target pod: %s", targetPod.Pod.Name)) - trgPod, err := framework.GetFirstRunningPodWithLabels(ctx, targetPod.Pod.Selector(), targetPod.Namespace, f.SeedClient) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - return trgPod - } - - establishConnectionToHost = func(ctx context.Context, nsp *networkpolicies.NamespacedSourcePod, host string, port int32) (stdout, stderr string, err error) { - if !nsp.Pod.CheckVersion(f.Shoot) { - Skip("Source pod doesn't match Shoot version constraints. Skipping.") - } - if !nsp.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - By(fmt.Sprintf("Checking for source Pod: %s is running", nsp.Pod.Name)) - ExpectWithOffset(1, f.WaitUntilPodIsRunningWithLabels(ctx, nsp.Pod.Selector(), nsp.Namespace, f.SeedClient)).NotTo(HaveOccurred()) - - command := []string{"nc", "-vznw", "3", host, fmt.Sprint(port)} - By(fmt.Sprintf("Executing connectivity command in %s/%s to %s", nsp.Namespace, nsp.Pod.Name, strings.Join(command, " "))) - - return executor.NewExecutor(f.SeedClient). - ExecCommandInContainerWithFullOutput(ctx, nsp.Namespace, nsp.Pod.Name, "busybox-0", command...) - } - - assertCannotConnectToHost = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, host string, port int32) { - _, stderr, err := establishConnectionToHost(ctx, sourcePod, host, port) - ExpectWithOffset(1, err).To(HaveOccurred()) - By("Connection message is timed out\n") - ExpectWithOffset(1, stderr).To(SatisfyAny(ContainSubstring("Connection timed out"), ContainSubstring("nc: bad address"))) - } - - assertConnectToHost = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetHost *networkpolicies.Host, allowed bool) { - _, stderr, err := establishConnectionToHost(ctx, sourcePod, targetHost.HostName, targetHost.Port) - if allowed { - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - } else { - ExpectWithOffset(1, err).To(HaveOccurred()) - ExpectWithOffset(1, stderr).To(SatisfyAny(BeEmpty(), ContainSubstring("Connection timed out"), ContainSubstring("nc: bad address")), "stderr has correct message") - } - } - - assertCannotConnectToPod = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetPod *networkpolicies.NamespacedTargetPod) { - pod := getTargetPod(ctx, targetPod) - assertCannotConnectToHost(ctx, sourcePod, pod.Status.PodIP, targetPod.Port.Port) - } - - assertConnectToPod = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetPod *networkpolicies.NamespacedTargetPod, allowed bool) { - pod := getTargetPod(ctx, targetPod) - assertConnectToHost(ctx, sourcePod, &networkpolicies.Host{ - HostName: pod.Status.PodIP, - Port: targetPod.Port.Port, - }, allowed) - } - - // generated targets - CloudControllerManagerHttps = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "cloud-controller-manager-https", - Labels: labels.Set{ - "app": "kubernetes", - "role": "cloud-controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 10258, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - CloudControllerManagerHttps10258 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "cloud-controller-manager-https", - Labels: labels.Set{ - "app": "kubernetes", - "role": "cloud-controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 10258, - Name: ""}} - EtcdEvents = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "etcd-events", - Labels: labels.Set{ - "app": "etcd-statefulset", - "garden.sapcloud.io/role": "controlplane", - "role": "events"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 2379, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-etcd": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-private-networks": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "deny-all": sets.Empty{}}} - EtcdEvents2379 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "etcd-events", - Labels: labels.Set{ - "app": "etcd-statefulset", - "garden.sapcloud.io/role": "controlplane", - "role": "events"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 2379, - Name: ""}} - EtcdMain = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "etcd-main", - Labels: labels.Set{ - "app": "etcd-statefulset", - "garden.sapcloud.io/role": "controlplane", - "role": "main"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 2379, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-etcd": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-private-networks": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "deny-all": sets.Empty{}}} - EtcdMain2379 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "etcd-main", - Labels: labels.Set{ - "app": "etcd-statefulset", - "garden.sapcloud.io/role": "controlplane", - "role": "main"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 2379, - Name: ""}} - ExternalhostPort53 = &networkpolicies.Host{ - Description: "External host", - HostName: "8.8.8.8", - Port: 53} - GardenPrometheusPort80 = &networkpolicies.Host{ - Description: "Garden Prometheus", - HostName: "prometheus-web.garden", - Port: 80} - GardenerResourceManager = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "gardener-resource-manager", - Labels: labels.Set{ - "app": "gardener-resource-manager", - "gardener.cloud/role": "controlplane"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port(nil), - ExpectedPolicies: sets.String{ - "allow-to-dns": sets.Empty{}, - "allow-to-seed-apiserver": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - GardenerResourceManager8080 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "gardener-resource-manager", - Labels: labels.Set{ - "app": "gardener-resource-manager", - "gardener.cloud/role": "controlplane"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 8080, - Name: "dummy"}} - Grafana = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "grafana", - Labels: labels.Set{ - "component": "grafana", - "gardener.cloud/role": "monitoring"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 3000, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-grafana": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "deny-all": sets.Empty{}}} - Grafana3000 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "grafana", - Labels: labels.Set{ - "component": "grafana", - "gardener.cloud/role": "monitoring"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 3000, - Name: ""}} - KubeApiserver = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "kube-apiserver", - Labels: labels.Set{ - "app": "kubernetes", - "role": "apiserver"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 443, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-kube-apiserver": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-private-networks": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "allow-to-shoot-networks": sets.Empty{}, - "deny-all": sets.Empty{}}} - KubeApiserver443 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "kube-apiserver", - Labels: labels.Set{ - "app": "kubernetes", - "role": "apiserver"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 443, - Name: ""}} - KubeControllerManagerHttps = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "kube-controller-manager-https", - Labels: labels.Set{ - "app": "kubernetes", - "gardener.cloud/role": "controlplane", - "role": "controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 10257, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-to-blocked-cidrs": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-private-networks": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - KubeControllerManagerHttps10257 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "kube-controller-manager-https", - Labels: labels.Set{ - "app": "kubernetes", - "gardener.cloud/role": "controlplane", - "role": "controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 10257, - Name: ""}} - KubeSchedulerHttps = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "kube-scheduler-https", - Labels: labels.Set{ - "app": "kubernetes", - "gardener.cloud/role": "controlplane", - "role": "scheduler"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 10259, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - KubeSchedulerHttps10259 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "kube-scheduler-https", - Labels: labels.Set{ - "app": "kubernetes", - "gardener.cloud/role": "controlplane", - "role": "scheduler"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 10259, - Name: ""}} - KubeStateMetricsShoot = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "kube-state-metrics-shoot", - Labels: labels.Set{ - "component": "kube-state-metrics", - "gardener.cloud/role": "monitoring", - "type": "shoot"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 8080, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - KubeStateMetricsShoot8080 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "kube-state-metrics-shoot", - Labels: labels.Set{ - "component": "kube-state-metrics", - "gardener.cloud/role": "monitoring", - "type": "shoot"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 8080, - Name: ""}} - Loki = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "loki", - Labels: labels.Set{ - "app": "loki", - "gardener.cloud/role": "logging", - "role": "logging"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 3100, - Name: "metrics"}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-loki": sets.Empty{}, - "deny-all": sets.Empty{}}} - Loki3100 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "loki", - Labels: labels.Set{ - "app": "loki", - "gardener.cloud/role": "logging", - "role": "logging"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 3100, - Name: "metrics"}} - MachineControllerManager = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "machine-controller-manager", - Labels: labels.Set{ - "app": "kubernetes", - "role": "machine-controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 10258, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-from-prometheus": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-private-networks": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "allow-to-seed-apiserver": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "deny-all": sets.Empty{}}} - MachineControllerManager10258 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "machine-controller-manager", - Labels: labels.Set{ - "app": "kubernetes", - "role": "machine-controller-manager"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 10258, - Name: ""}} - MetadataservicePort80 = &networkpolicies.Host{ - Description: "Metadata service", - HostName: "169.254.169.254", - Port: 80} - Prometheus = &networkpolicies.SourcePod{ - Pod: networkpolicies.Pod{ - Name: "prometheus", - Labels: labels.Set{ - "app": "prometheus", - "gardener.cloud/role": "monitoring", - "role": "monitoring"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Ports: []networkpolicies.Port{ - networkpolicies.Port{ - Port: 9090, - Name: ""}}, - ExpectedPolicies: sets.String{ - "allow-prometheus": sets.Empty{}, - "allow-to-dns": sets.Empty{}, - "allow-to-public-networks": sets.Empty{}, - "allow-to-seed-apiserver": sets.Empty{}, - "allow-to-shoot-apiserver": sets.Empty{}, - "allow-to-shoot-networks": sets.Empty{}, - "deny-all": sets.Empty{}}} - Prometheus9090 = &networkpolicies.TargetPod{ - Pod: networkpolicies.Pod{ - Name: "prometheus", - Labels: labels.Set{ - "app": "prometheus", - "gardener.cloud/role": "monitoring", - "role": "monitoring"}, - ShootVersionConstraint: "", - SeedClusterConstraints: sets.String(nil)}, - Port: networkpolicies.Port{ - Port: 9090, - Name: ""}} - SeedKubeAPIServerPort443 = &networkpolicies.Host{ - Description: "Seed Kube APIServer", - HostName: "kubernetes.default", - Port: 443} - ) - - SynchronizedBeforeSuite(func() []byte { - ctx, cancel := context.WithTimeout(context.TODO(), InitializationTimeout) - defer cancel() - - var err error - - // The framework has to be manually initialized as BeforeEach is not allowed to be called inside a SynchronizedBeforeSuite - f = &framework.ShootFramework{ - GardenerFramework: framework.NewGardenerFrameworkFromConfig(nil), - TestDescription: framework.NewTestDescription("SHOOT"), - Config: nil, - } - f.CommonFramework.BeforeEach() - f.GardenerFramework.BeforeEach() - f.BeforeEach(ctx) - - By("Getting Seed Cloud Provider") - sharedResources.SeedCloudProvider = f.Seed.Spec.Provider.Type - - By("Creating namespace for Ingress testing") - ns := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "gardener-e2e-network-policies-", - Labels: map[string]string{ - "gardener-e2e-test": "networkpolicies", - }, - }, - } - err = f.SeedClient.Client().Create(ctx, ns) - Expect(err).NotTo(HaveOccurred()) - - sharedResources.External = ns.GetName() - - By("Creating mirror namespace for pod2pod network testing") - mirrorNamespace := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "gardener-e2e-mirror-network-policies-", - Labels: map[string]string{ - "gardener-e2e-test": "networkpolicies", - }, - }, - } - err = f.SeedClient.Client().Create(ctx, mirrorNamespace) - Expect(err).NotTo(HaveOccurred()) - - sharedResources.Mirror = mirrorNamespace.GetName() - - By(fmt.Sprintf("Getting all network policies in namespace %q", f.ShootSeedNamespace())) - list := &networkingv1.NetworkPolicyList{} - err = f.SeedClient.Client().List(ctx, list, client.InNamespace(f.ShootSeedNamespace())) - Expect(err).ToNot(HaveOccurred()) - - sharedResources.Policies = list.Items - - for _, netPol := range sharedResources.Policies { - cpy := &networkingv1.NetworkPolicy{} - cpy.Name = netPol.Name - cpy.Namespace = sharedResources.Mirror - cpy.Spec = *netPol.Spec.DeepCopy() - By(fmt.Sprintf("Copying network policy %s in namespace %q", netPol.Name, sharedResources.Mirror)) - err = f.SeedClient.Client().Create(ctx, cpy) - Expect(err).NotTo(HaveOccurred()) - } - - By("Getting the current CloudProvider") - currentProvider := f.Shoot.Spec.Provider.Type - - getFirstNodeInternalIP := func(ctx context.Context, cl kubernetes.Interface) (string, error) { - nodes := &corev1.NodeList{} - err := cl.Client().List(ctx, nodes, client.Limit(1)) - if err != nil { - return "", err - } - - if len(nodes.Items) > 0 { - firstNode := nodes.Items[0] - for _, address := range firstNode.Status.Addresses { - if address.Type == corev1.NodeInternalIP { - return address.Address, nil - } - } - } - - return "", framework.ErrNoInternalIPsForNodeWasFound - } - - By("Getting fist running node") - sharedResources.SeedNodeIP, err = getFirstNodeInternalIP(ctx, f.SeedClient) - Expect(err).NotTo(HaveOccurred()) - - if currentProvider != "azure" { - Fail(fmt.Sprintf("Not supported cloud provider %s", currentProvider)) - } - - createBusyBox := func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, ports ...corev1.ContainerPort) { - if len(ports) == 0 { - Fail(fmt.Sprintf("No ports found for SourcePod %+v", *sourcePod.SourcePod)) - } - containers := []corev1.Container{} - for i, port := range ports { - containers = append(containers, corev1.Container{ - Args: []string{"nc", "-lk", "-p", fmt.Sprint(port.ContainerPort), "-e", "/bin/echo", "-s", "0.0.0.0"}, - Image: "busybox", - Name: fmt.Sprintf("busybox-%d", i), - Ports: []corev1.ContainerPort{port}, - }) - } - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: sourcePod.Pod.Name, - Namespace: sourcePod.Namespace, - Labels: sourcePod.Pod.Labels, - }, - Spec: corev1.PodSpec{ - Containers: containers, - }, - } - - By(fmt.Sprintf("Creating Pod %s/%s", sourcePod.Namespace, sourcePod.Name)) - err := f.SeedClient.Client().Create(ctx, pod) - Expect(err).NotTo(HaveOccurred()) - - By(fmt.Sprintf("Waiting foo Pod %s/%s to be running", sourcePod.Namespace, sourcePod.Name)) - err = framework.WaitUntilPodIsRunning(ctx, f.Logger, pod.GetName(), sourcePod.Namespace, f.SeedClient) - if err != nil { - Fail(fmt.Sprintf("Couldn't find running busybox %s/%s", sourcePod.Namespace, pod.GetName())) - } - } - - sources := []*networkpolicies.SourcePod{ - GardenerResourceManager, - CloudControllerManagerHttps, - Loki, - EtcdEvents, - EtcdMain, - Grafana, - KubeApiserver, - KubeControllerManagerHttps, - KubeSchedulerHttps, - KubeStateMetricsShoot, - MachineControllerManager, - Prometheus, - } - - var wg sync.WaitGroup - // one extra for the busybox Pod bellow. - wg.Add(len(sources) + 1) - - for _, s := range sources { - go func(pi *networkpolicies.SourcePod) { - defer GinkgoRecover() - defer wg.Done() - if !pi.Pod.CheckVersion(f.Shoot) || !pi.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - return - } - pod, err := framework.GetFirstRunningPodWithLabels(ctx, pi.Pod.Selector(), f.ShootSeedNamespace(), f.SeedClient) - if err != nil { - Fail(fmt.Sprintf("Couldn't find running Pod %s/%s with labels: %+v", f.ShootSeedNamespace(), pi.Pod.Name, pi.Pod.Labels)) - } - cpy := *pi - - targetLabels := make(map[string]string) - - for k, v := range pod.Labels { - targetLabels[k] = v - } - - cpy.Pod.Labels = targetLabels - By(fmt.Sprintf("Mirroring Pod %s to namespace %s", cpy.Pod.Labels.String(), sharedResources.Mirror)) - - expectedPorts := sets.Int64{} - actualPorts := sets.Int64{} - for _, p := range pi.Ports { - expectedPorts.Insert(int64(p.Port)) - } - containerPorts := []corev1.ContainerPort{} - for _, container := range pod.Spec.Containers { - if len(container.Ports) > 0 { - for _, p := range container.Ports { - actualPorts.Insert(int64(p.ContainerPort)) - } - containerPorts = append(containerPorts, container.Ports...) - } - } - - if !actualPorts.HasAll(expectedPorts.List()...) { - Fail(fmt.Sprintf("Pod %s doesn't have all ports. Expected %+v, actual %+v", pi.Pod.Name, expectedPorts.List(), actualPorts.List())) - } - if len(containerPorts) == 0 { - // Dummy port for containers which don't have any ports. - containerPorts = append(containerPorts, corev1.ContainerPort{ContainerPort: 8080}) - } - createBusyBox(ctx, networkpolicies.NewNamespacedSourcePod(&cpy, sharedResources.Mirror), containerPorts...) - }(s) - } - go func() { - defer GinkgoRecover() - defer wg.Done() - createBusyBox(ctx, networkpolicies.NewNamespacedSourcePod(agnostic.Busybox(), ns.GetName()), corev1.ContainerPort{ContainerPort: 8080}) - }() - - wg.Wait() - - b, err := json.Marshal(sharedResources) - Expect(err).NotTo(HaveOccurred()) - - return b - }, func(data []byte) { - sr := &networkpolicies.SharedResources{} - err := json.Unmarshal(data, sr) - Expect(err).NotTo(HaveOccurred()) - - sharedResources = *sr - }) - - SynchronizedAfterSuite(func() { - if !*cleanup { - return - } - - ctx, cancel := context.WithTimeout(context.TODO(), FinalizationTimeout) - defer cancel() - - namespaces := &corev1.NamespaceList{} - selector := labels.SelectorFromSet(labels.Set{ - "gardener-e2e-test": "networkpolicies", - }) - err := f.SeedClient.Client().List(ctx, namespaces, client.MatchingLabelsSelector{Selector: selector}) - Expect(err).NotTo(HaveOccurred()) - - for _, ns := range namespaces.Items { - err = f.SeedClient.Client().Delete(ctx, &ns) - if err != nil && !errors.IsConflict(err) { - Expect(err).NotTo(HaveOccurred()) - } - } - }, func() {}) - - Context("Deprecated old policies are removed", func() { - - const ( - deprecatedKubeAPIServerPolicy = "kube-apiserver-default" - deprecatedMetadataAppPolicy = "cloud-metadata-service-deny-blacklist-app" - deprecatedMetadataRolePolicy = "cloud-metadata-service-deny-blacklist-role" - ) - - var ( - assertPolicyIsGone = func(policyName string) func(ctx context.Context) { - return func(ctx context.Context) { - By(fmt.Sprintf("Getting network policy %q in namespace %q", policyName, f.ShootSeedNamespace())) - getErr := f.SeedClient.Client().Get(ctx, types.NamespacedName{Name: policyName, Namespace: f.ShootSeedNamespace()}, &networkingv1.NetworkPolicy{}) - Expect(getErr).To(HaveOccurred()) - By("error is NotFound") - Expect(errors.IsNotFound(getErr)).To(BeTrue()) - } - } - ) - - DefaultCIt(deprecatedKubeAPIServerPolicy, assertPolicyIsGone(deprecatedKubeAPIServerPolicy)) - DefaultCIt(deprecatedMetadataAppPolicy, assertPolicyIsGone(deprecatedMetadataAppPolicy)) - DefaultCIt(deprecatedMetadataRolePolicy, assertPolicyIsGone(deprecatedMetadataRolePolicy)) - }) - - Context("components are selected by correct policies", func() { - var ( - assertHasNetworkPolicy = func(sourcePod *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - if !sourcePod.Pod.CheckVersion(f.Shoot) { - Skip("Component doesn't match Shoot version constraints. Skipping.") - } - if !sourcePod.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - - matched := sets.NewString() - var podLabelSet labels.Set - - By(fmt.Sprintf("Getting first running pod with selectors %q in namespace %q", sourcePod.Pod.Labels, f.ShootSeedNamespace())) - pod, err := framework.GetFirstRunningPodWithLabels(ctx, sourcePod.Pod.Selector(), f.ShootSeedNamespace(), f.SeedClient) - podLabelSet = pod.GetLabels() - Expect(err).NotTo(HaveOccurred()) - - for _, netPol := range sharedResources.Policies { - netPolSelector, err := metav1.LabelSelectorAsSelector(&netPol.Spec.PodSelector) - Expect(err).NotTo(HaveOccurred()) - - if netPolSelector.Matches(podLabelSet) { - matched.Insert(netPol.GetName()) - } - } - By(fmt.Sprintf("Matching actual network policies against expected %s", sourcePod.ExpectedPolicies.List())) - Expect(matched.List()).Should(ConsistOf(sourcePod.ExpectedPolicies.List())) - } - } - ) - DefaultCIt(`kube-apiserver`, assertHasNetworkPolicy(KubeApiserver)) - DefaultCIt(`etcd-main`, assertHasNetworkPolicy(EtcdMain)) - DefaultCIt(`etcd-events`, assertHasNetworkPolicy(EtcdEvents)) - DefaultCIt(`cloud-controller-manager-https`, assertHasNetworkPolicy(CloudControllerManagerHttps)) - DefaultCIt(`loki`, assertHasNetworkPolicy(Loki)) - DefaultCIt(`grafana`, assertHasNetworkPolicy(Grafana)) - DefaultCIt(`gardener-resource-manager`, assertHasNetworkPolicy(GardenerResourceManager)) - DefaultCIt(`kube-controller-manager-https`, assertHasNetworkPolicy(KubeControllerManagerHttps)) - DefaultCIt(`kube-scheduler-https`, assertHasNetworkPolicy(KubeSchedulerHttps)) - DefaultCIt(`kube-state-metrics-shoot`, assertHasNetworkPolicy(KubeStateMetricsShoot)) - DefaultCIt(`machine-controller-manager`, assertHasNetworkPolicy(MachineControllerManager)) - DefaultCIt(`prometheus`, assertHasNetworkPolicy(Prometheus)) - }) - - Context("ingress from other namespaces", func() { - - var ( - assertBlockIngress = func(to *networkpolicies.TargetPod, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToPod(ctx, networkpolicies.NewNamespacedSourcePod(agnostic.Busybox(), sharedResources.External), networkpolicies.NewNamespacedTargetPod(to, f.ShootSeedNamespace()), allowed) - } - } - ) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertBlockIngress(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertBlockIngress(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertBlockIngress(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertBlockIngress(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertBlockIngress(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertBlockIngress(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertBlockIngress(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertBlockIngress(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertBlockIngress(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertBlockIngress(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertBlockIngress(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertBlockIngress(Prometheus9090, false)) - }) - - Context("egress to other namespaces", func() { - - var ( - assertBlockEgresss = func(from *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - assertCannotConnectToPod(ctx, networkpolicies.NewNamespacedSourcePod(from, sharedResources.Mirror), networkpolicies.NewNamespacedTargetPod(agnostic.Busybox().DummyPort(), sharedResources.External)) - } - } - ) - - DefaultCIt(`should block connectivity from kube-apiserver to busybox`, assertBlockEgresss(KubeApiserver)) - DefaultCIt(`should block connectivity from etcd-main to busybox`, assertBlockEgresss(EtcdMain)) - DefaultCIt(`should block connectivity from etcd-events to busybox`, assertBlockEgresss(EtcdEvents)) - DefaultCIt(`should block connectivity from cloud-controller-manager-https to busybox`, assertBlockEgresss(CloudControllerManagerHttps)) - DefaultCIt(`should block connectivity from loki to busybox`, assertBlockEgresss(Loki)) - DefaultCIt(`should block connectivity from grafana to busybox`, assertBlockEgresss(Grafana)) - DefaultCIt(`should block connectivity from gardener-resource-manager to busybox`, assertBlockEgresss(GardenerResourceManager)) - DefaultCIt(`should block connectivity from kube-controller-manager-https to busybox`, assertBlockEgresss(KubeControllerManagerHttps)) - DefaultCIt(`should block connectivity from kube-scheduler-https to busybox`, assertBlockEgresss(KubeSchedulerHttps)) - DefaultCIt(`should block connectivity from kube-state-metrics-shoot to busybox`, assertBlockEgresss(KubeStateMetricsShoot)) - DefaultCIt(`should block connectivity from machine-controller-manager to busybox`, assertBlockEgresss(MachineControllerManager)) - DefaultCIt(`should block connectivity from prometheus to busybox`, assertBlockEgresss(Prometheus)) - }) - - Context("egress to Seed nodes", func() { - - var ( - assertBlockToSeedNodes = func(from *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - assertCannotConnectToHost(ctx, networkpolicies.NewNamespacedSourcePod(from, sharedResources.Mirror), sharedResources.SeedNodeIP, 10250) - } - } - ) - - DefaultCIt(`should block connectivity from kube-apiserver`, assertBlockToSeedNodes(KubeApiserver)) - DefaultCIt(`should block connectivity from etcd-main`, assertBlockToSeedNodes(EtcdMain)) - DefaultCIt(`should block connectivity from etcd-events`, assertBlockToSeedNodes(EtcdEvents)) - DefaultCIt(`should block connectivity from cloud-controller-manager-https`, assertBlockToSeedNodes(CloudControllerManagerHttps)) - DefaultCIt(`should block connectivity from loki`, assertBlockToSeedNodes(Loki)) - DefaultCIt(`should block connectivity from grafana`, assertBlockToSeedNodes(Grafana)) - DefaultCIt(`should block connectivity from gardener-resource-manager`, assertBlockToSeedNodes(GardenerResourceManager)) - DefaultCIt(`should block connectivity from kube-controller-manager-https`, assertBlockToSeedNodes(KubeControllerManagerHttps)) - DefaultCIt(`should block connectivity from kube-scheduler-https`, assertBlockToSeedNodes(KubeSchedulerHttps)) - DefaultCIt(`should block connectivity from kube-state-metrics-shoot`, assertBlockToSeedNodes(KubeStateMetricsShoot)) - DefaultCIt(`should block connectivity from machine-controller-manager`, assertBlockToSeedNodes(MachineControllerManager)) - DefaultCIt(`should block connectivity from prometheus`, assertBlockToSeedNodes(Prometheus)) - }) - - Context("egress for mirrored pods", func() { - - var ( - from *networkpolicies.NamespacedSourcePod - - assertEgresssToMirroredPod = func(to *networkpolicies.TargetPod, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToPod(ctx, from, networkpolicies.NewNamespacedTargetPod(to, sharedResources.Mirror), allowed) - } - } - - assertEgresssToHost = func(to *networkpolicies.Host, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToHost(ctx, from, to, allowed) - } - } - ) - - Context("kube-apiserver", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(KubeApiserver, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should allow connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, true)) - DefaultCIt(`should allow connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, true)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - DefaultCIt(`should allow connection to "Seed Kube APIServer" kubernetes.default:443`, assertEgresssToHost(SeedKubeAPIServerPort443, true)) - }) - - Context("etcd-main", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(EtcdMain, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should block connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, false)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("etcd-events", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(EtcdEvents, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should block connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, false)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("cloud-controller-manager-https", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(CloudControllerManagerHttps, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("loki", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(Loki, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should block connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, false)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should block connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, false)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("grafana", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(Grafana, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should allow connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, true)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, false)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should allow connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, true)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should block connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, false)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("gardener-resource-manager", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(GardenerResourceManager, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - DefaultCIt(`should allow connection to "Seed Kube APIServer" kubernetes.default:443`, assertEgresssToHost(SeedKubeAPIServerPort443, true)) - }) - - Context("kube-controller-manager-https", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(KubeControllerManagerHttps, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should allow connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, true)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("kube-scheduler-https", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(KubeSchedulerHttps, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should block connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, false)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("kube-state-metrics-shoot", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(KubeStateMetricsShoot, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should block connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, false)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - }) - - Context("machine-controller-manager", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(MachineControllerManager, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should block connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, false)) - DefaultCIt(`should block connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, false)) - DefaultCIt(`should block connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, false)) - DefaultCIt(`should block connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, false)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should block connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, false)) - DefaultCIt(`should block connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, false)) - DefaultCIt(`should block connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, false)) - DefaultCIt(`should block connection to Pod "prometheus" at port 9090`, assertEgresssToMirroredPod(Prometheus9090, false)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should block connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, false)) - DefaultCIt(`should allow connection to "Seed Kube APIServer" kubernetes.default:443`, assertEgresssToHost(SeedKubeAPIServerPort443, true)) - }) - - Context("prometheus", func() { - - BeforeEach(func() { - from = networkpolicies.NewNamespacedSourcePod(Prometheus, sharedResources.Mirror) - }) - - DefaultCIt(`should block connection to Pod "gardener-resource-manager" at port 8080`, assertEgresssToMirroredPod(GardenerResourceManager8080, false)) - DefaultCIt(`should allow connection to Pod "cloud-controller-manager-https" at port 10258`, assertEgresssToMirroredPod(CloudControllerManagerHttps10258, true)) - DefaultCIt(`should allow connection to Pod "loki" at port 3100`, assertEgresssToMirroredPod(Loki3100, true)) - DefaultCIt(`should allow connection to Pod "etcd-events" at port 2379`, assertEgresssToMirroredPod(EtcdEvents2379, true)) - DefaultCIt(`should allow connection to Pod "etcd-main" at port 2379`, assertEgresssToMirroredPod(EtcdMain2379, true)) - DefaultCIt(`should block connection to Pod "grafana" at port 3000`, assertEgresssToMirroredPod(Grafana3000, false)) - DefaultCIt(`should allow connection to Pod "kube-apiserver" at port 443`, assertEgresssToMirroredPod(KubeApiserver443, true)) - DefaultCIt(`should allow connection to Pod "kube-controller-manager-https" at port 10257`, assertEgresssToMirroredPod(KubeControllerManagerHttps10257, true)) - DefaultCIt(`should allow connection to Pod "kube-scheduler-https" at port 10259`, assertEgresssToMirroredPod(KubeSchedulerHttps10259, true)) - DefaultCIt(`should allow connection to Pod "kube-state-metrics-shoot" at port 8080`, assertEgresssToMirroredPod(KubeStateMetricsShoot8080, true)) - DefaultCIt(`should allow connection to Pod "machine-controller-manager" at port 10258`, assertEgresssToMirroredPod(MachineControllerManager10258, true)) - DefaultCIt(`should block connection to "Metadata service" 169.254.169.254:80`, assertEgresssToHost(MetadataservicePort80, false)) - DefaultCIt(`should allow connection to "External host" 8.8.8.8:53`, assertEgresssToHost(ExternalhostPort53, true)) - DefaultCIt(`should allow connection to "Garden Prometheus" prometheus-web.garden:80`, assertEgresssToHost(GardenPrometheusPort80, true)) - DefaultCIt(`should allow connection to "Seed Kube APIServer" kubernetes.default:443`, assertEgresssToHost(SeedKubeAPIServerPort443, true)) - }) - }) -}) diff --git a/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/encoding.go b/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/encoding.go deleted file mode 100644 index 288f14020..000000000 --- a/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/encoding.go +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors. -// -// SPDX-License-Identifier: Apache-2.0 - -package api - -import ( - "github.com/ghodss/yaml" -) - -// Encode encodes the ServiceDependants objects into a string. -func Encode(dependants *ServiceDependants) (string, error) { - data, err := yaml.Marshal(dependants) - if err != nil { - return "", err - } - return string(data), nil -} - -// Decode decodes the byte stream to ServiceDependants objects. -func Decode(data []byte) (*ServiceDependants, error) { - dependants := new(ServiceDependants) - err := yaml.Unmarshal(data, dependants) - if err != nil { - return nil, err - } - return dependants, nil -} diff --git a/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/types.go b/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/types.go deleted file mode 100644 index ec3281617..000000000 --- a/vendor/github.com/gardener/dependency-watchdog/pkg/restarter/api/types.go +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors. -// -// SPDX-License-Identifier: Apache-2.0 - -package api - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ServiceDependants holds the service and the label selectors of the pods which has to be restarted when -// the service becomes ready and the pods are in CrashloopBackoff. -type ServiceDependants struct { - Services map[string]Service `json:"services"` - Namespace string `json:"namespace"` -} - -// Service struct defines the dependent pods of a service. -type Service struct { - Dependants []DependantPods `json:"dependantPods"` -} - -// DependantPods struct captures the details needed to identify dependant pods. -type DependantPods struct { - Name string `json:"name,omitempty"` - Selector *metav1.LabelSelector `json:"selector"` -} diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go index 6345ea072..2075eeb6c 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/backupentry/reconciler.go @@ -99,15 +99,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(be.ObjectMeta, be.Status.LastOperation) switch { + case extensionscontroller.ShouldSkipOperation(operationType, be): + return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: - if extensionscontroller.IsMigrated(be) { - return reconcile.Result{}, nil - } return r.migrate(ctx, be) case be.DeletionTimestamp != nil: - if extensionscontroller.IsMigrated(be) { - return reconcile.Result{}, nil - } return r.delete(ctx, be) case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, be) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/common/context.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/common/context.go index 904f15aba..39d4e272b 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/common/context.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/common/context.go @@ -34,7 +34,7 @@ type ClientContext struct { client client.Client } -// NewClientConntext offers the possibility to create a ClientContext without injection. +// NewClientContext offers the possibility to create a ClientContext without injection. func NewClientContext(client client.Client, scheme *runtime.Scheme, decoder runtime.Decoder) ClientContext { if decoder == nil && scheme != nil { decoder = serializer.NewCodecFactory(scheme, serializer.EnableStrict).UniversalDecoder() diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go index 530aaf67d..eb2a49bab 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/controlplane/reconciler.go @@ -100,15 +100,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(cp.ObjectMeta, cp.Status.LastOperation) switch { + case extensionscontroller.ShouldSkipOperation(operationType, cp): + return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: - if extensionscontroller.IsMigrated(cp) { - return reconcile.Result{}, nil - } return r.migrate(ctx, cp, cluster) case cp.DeletionTimestamp != nil: - if extensionscontroller.IsMigrated(cp) { - return reconcile.Result{}, nil - } return r.delete(ctx, cp, cluster) case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, cp, cluster) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go index 1d1e23271..aca9bdde0 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/dnsrecord/reconciler.go @@ -101,15 +101,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(dns.ObjectMeta, dns.Status.LastOperation) switch { + case extensionscontroller.ShouldSkipOperation(operationType, dns): + return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: - if extensionscontroller.IsMigrated(dns) { - return reconcile.Result{}, nil - } return r.migrate(ctx, dns, cluster) case dns.DeletionTimestamp != nil: - if extensionscontroller.IsMigrated(dns) { - return reconcile.Result{}, nil - } return r.delete(ctx, dns, cluster) case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, dns, cluster) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/actuator.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/actuator.go index 25f13184d..6c9463f18 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/actuator.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/actuator.go @@ -50,7 +50,7 @@ import ( // For example: func() extensionsv1alpha1.Object {return &extensionsv1alpha1.Worker{}} type GetExtensionObjectFunc = func() extensionsv1alpha1.Object -// GetExtensionObjectFunc returns the extension object that should be registered with the health check controller. Has to be a List. +// GetExtensionObjectListFunc returns the extension object list that should be registered with the health check controller. // For example: func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} } type GetExtensionObjectListFunc = func() client.ObjectList diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/types.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/types.go index a0d225bcf..3139bea0e 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/types.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/types.go @@ -16,6 +16,7 @@ package config import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// HealthCheckConfig contains the health check controller configuration. type HealthCheckConfig struct { // SyncPeriod is the duration how often the existing resources are reconciled (how // often the health check of Shoot clusters is performed (only if no operation is diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/v1alpha1/types.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/v1alpha1/types.go index 3868cc09f..4011513e2 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/v1alpha1/types.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/v1alpha1/types.go @@ -16,6 +16,7 @@ package v1alpha1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// HealthCheckConfig contains the health check controller configuration. type HealthCheckConfig struct { // SyncPeriod is the duration how often the existing resources are reconciled (how // often the health check of Shoot clusters is performed (only if no operation is diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/controller.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/controller.go index 9478a5c2d..c6ce1cd56 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/controller.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/controller.go @@ -131,6 +131,7 @@ func (a *AddArgs) RegisterExtension(getExtensionObjFunc GetExtensionObjectFunc, return nil } +// GetExtensionGroupVersionKind returns the schema.GroupVersionKind of the registered extension of this AddArgs. func (a *AddArgs) GetExtensionGroupVersionKind() schema.GroupVersionKind { return a.registeredExtension.groupVersionKind } diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/daemonset.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/daemonset.go index d07fe3de0..4e007c49e 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/daemonset.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/daemonset.go @@ -43,15 +43,15 @@ type DaemonSetHealthChecker struct { type DaemonSetCheckType string const ( - DaemonSetCheckTypeSeed DaemonSetCheckType = "Seed" - DaemonSetCheckTypeShoot DaemonSetCheckType = "Shoot" + daemonSetCheckTypeSeed DaemonSetCheckType = "Seed" + daemonSetCheckTypeShoot DaemonSetCheckType = "Shoot" ) // NewSeedDaemonSetHealthChecker is a healthCheck function to check DaemonSets func NewSeedDaemonSetHealthChecker(name string) healthcheck.HealthCheck { return &DaemonSetHealthChecker{ name: name, - checkType: DaemonSetCheckTypeSeed, + checkType: daemonSetCheckTypeSeed, } } @@ -59,7 +59,7 @@ func NewSeedDaemonSetHealthChecker(name string) healthcheck.HealthCheck { func NewShootDaemonSetHealthChecker(name string) healthcheck.HealthCheck { return &DaemonSetHealthChecker{ name: name, - checkType: DaemonSetCheckTypeShoot, + checkType: daemonSetCheckTypeShoot, } } @@ -88,7 +88,7 @@ func (healthChecker *DaemonSetHealthChecker) DeepCopy() healthcheck.HealthCheck func (healthChecker *DaemonSetHealthChecker) Check(ctx context.Context, request types.NamespacedName) (*healthcheck.SingleCheckResult, error) { daemonSet := &appsv1.DaemonSet{} var err error - if healthChecker.checkType == DaemonSetCheckTypeSeed { + if healthChecker.checkType == daemonSetCheckTypeSeed { err = healthChecker.seedClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, daemonSet) } else { err = healthChecker.shootClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, daemonSet) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/deployment.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/deployment.go index d84412d76..8751b9782 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/deployment.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/deployment.go @@ -43,15 +43,15 @@ type DeploymentHealthChecker struct { type DeploymentCheckType string const ( - DeploymentCheckTypeSeed DeploymentCheckType = "Seed" - DeploymentCheckTypeShoot DeploymentCheckType = "Shoot" + deploymentCheckTypeSeed DeploymentCheckType = "Seed" + deploymentCheckTypeShoot DeploymentCheckType = "Shoot" ) // NewSeedDeploymentHealthChecker is a healthCheck function to check Deployments in the Seed cluster func NewSeedDeploymentHealthChecker(deploymentName string) healthcheck.HealthCheck { return &DeploymentHealthChecker{ name: deploymentName, - checkType: DeploymentCheckTypeSeed, + checkType: deploymentCheckTypeSeed, } } @@ -59,7 +59,7 @@ func NewSeedDeploymentHealthChecker(deploymentName string) healthcheck.HealthChe func NewShootDeploymentHealthChecker(deploymentName string) healthcheck.HealthCheck { return &DeploymentHealthChecker{ name: deploymentName, - checkType: DeploymentCheckTypeShoot, + checkType: deploymentCheckTypeShoot, } } @@ -89,7 +89,7 @@ func (healthChecker *DeploymentHealthChecker) Check(ctx context.Context, request deployment := &appsv1.Deployment{} var err error - if healthChecker.checkType == DeploymentCheckTypeSeed { + if healthChecker.checkType == deploymentCheckTypeSeed { err = healthChecker.seedClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, deployment) } else { err = healthChecker.shootClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, deployment) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/statefulsets.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/statefulsets.go index 1ec87ad43..6ebeeb6ea 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/statefulsets.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/general/statefulsets.go @@ -43,15 +43,15 @@ type StatefulSetHealthChecker struct { type StatefulSetCheckType string const ( - StatefulSetCheckTypeSeed StatefulSetCheckType = "Seed" - StatefulSetCheckTypeShoot StatefulSetCheckType = "Shoot" + statefulSetCheckTypeSeed StatefulSetCheckType = "Seed" + statefulSetCheckTypeShoot StatefulSetCheckType = "Shoot" ) // NewSeedStatefulSetChecker is a healthCheck function to check StatefulSets func NewSeedStatefulSetChecker(name string) healthcheck.HealthCheck { return &StatefulSetHealthChecker{ name: name, - checkType: StatefulSetCheckTypeSeed, + checkType: statefulSetCheckTypeSeed, } } @@ -59,7 +59,7 @@ func NewSeedStatefulSetChecker(name string) healthcheck.HealthCheck { func NewShootStatefulSetChecker(name string) healthcheck.HealthCheck { return &StatefulSetHealthChecker{ name: name, - checkType: StatefulSetCheckTypeShoot, + checkType: statefulSetCheckTypeShoot, } } @@ -89,7 +89,7 @@ func (healthChecker *StatefulSetHealthChecker) Check(ctx context.Context, reques statefulSet := &appsv1.StatefulSet{} var err error - if healthChecker.checkType == StatefulSetCheckTypeSeed { + if healthChecker.checkType == statefulSetCheckTypeSeed { err = healthChecker.seedClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, statefulSet) } else { err = healthChecker.shootClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: healthChecker.name}, statefulSet) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/healtcheck_actuator.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/healtcheck_actuator.go index 563f84cfa..56c1a8b10 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/healtcheck_actuator.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/healtcheck_actuator.go @@ -61,17 +61,20 @@ func NewActuator(provider, extensionKind string, getExtensionObjFunc GetExtensio } } +// InjectScheme injects the given runtime.Scheme into this Actuator. func (a *Actuator) InjectScheme(scheme *runtime.Scheme) error { a.scheme = scheme a.decoder = serializer.NewCodecFactory(a.scheme).UniversalDecoder() return nil } +// InjectClient injects the given client.Client into this Actuator. func (a *Actuator) InjectClient(client client.Client) error { a.seedClient = client return nil } +// InjectConfig injects the given rest.Config into this Actuator. func (a *Actuator) InjectConfig(config *rest.Config) error { a.restConfig = config return nil diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/inject.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/inject.go index 9b99a583b..a81fc6ff3 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/inject.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/healthcheck/inject.go @@ -24,7 +24,7 @@ type ShootClient interface { InjectShootClient(client.Client) } -// ShootClient is an interface to be used to receive a seed client. +// SeedClient is an interface to be used to receive a seed client. type SeedClient interface { // InjectSeedClient injects the seed client InjectSeedClient(client.Client) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go index ecfe14b88..321d2214d 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/infrastructure/reconciler.go @@ -105,15 +105,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(infrastructure.ObjectMeta, infrastructure.Status.LastOperation) switch { + case extensionscontroller.ShouldSkipOperation(operationType, infrastructure): + return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: - if extensionscontroller.IsMigrated(infrastructure) { - return reconcile.Result{}, nil - } return r.migrate(ctx, logger.WithValues("operation", "migrate"), infrastructure, cluster) case infrastructure.DeletionTimestamp != nil: - if extensionscontroller.IsMigrated(infrastructure) { - return reconcile.Result{}, nil - } return r.delete(ctx, logger.WithValues("operation", "delete"), infrastructure, cluster) case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, logger.WithValues("operation", "restore"), infrastructure, cluster) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/utils.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/utils.go index 1bbb5390f..64c015f90 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/utils.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/utils.go @@ -185,6 +185,11 @@ func IsMigrated(obj extensionsv1alpha1.Object) bool { lastOp.State == gardencorev1beta1.LastOperationStateSucceeded } +// ShouldSkipOperation checks if the current operation should be skipped depending on the lastOperation of the extension object. +func ShouldSkipOperation(operationType gardencorev1beta1.LastOperationType, obj extensionsv1alpha1.Object) bool { + return operationType != gardencorev1beta1.LastOperationTypeMigrate && operationType != gardencorev1beta1.LastOperationTypeRestore && IsMigrated(obj) +} + // GetObjectByReference gets an object by the given reference, in the given namespace. // If the object kind doesn't match the given reference kind this will result in an error. func GetObjectByReference(ctx context.Context, c client.Client, ref *autoscalingv1.CrossVersionObjectReference, namespace string, obj client.Object) error { diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go index f73bc9ffc..6a4091182 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator/actuator_restore.go @@ -18,7 +18,6 @@ import ( "context" "encoding/json" "fmt" - "time" machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/go-logr/logr" @@ -31,7 +30,6 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/client/kubernetes" kutil "github.com/gardener/gardener/pkg/utils/kubernetes" - gardeneretry "github.com/gardener/gardener/pkg/utils/retry" ) // Restore uses the Worker's spec to figure out the wanted MachineDeployments. Then it parses the Worker's state. @@ -82,7 +80,7 @@ func (a *genericActuator) Restore(ctx context.Context, worker *extensionsv1alpha } // Do the actual restoration - if err := a.deployMachineSetsAndMachines(ctx, logger, wantedMachineDeployments); err != nil { + if err := a.restoreMachineSetsAndMachines(ctx, logger, wantedMachineDeployments); err != nil { return fmt.Errorf("failed restoration of the machineSet and the machines: %w", err) } @@ -116,30 +114,24 @@ func (a *genericActuator) addStateToMachineDeployment(worker *extensionsv1alpha1 return nil } -func (a *genericActuator) deployMachineSetsAndMachines(ctx context.Context, logger logr.Logger, wantedMachineDeployments workercontroller.MachineDeployments) error { +func (a *genericActuator) restoreMachineSetsAndMachines(ctx context.Context, logger logr.Logger, wantedMachineDeployments workercontroller.MachineDeployments) error { logger.Info("Deploying Machines and MachineSets") for _, wantedMachineDeployment := range wantedMachineDeployments { - machineSets := wantedMachineDeployment.State.MachineSets - - for _, machineSet := range machineSets { - // Create the MachineSet if not already exists. We do not care about the MachineSet status - // because the MCM will update it + for _, machineSet := range wantedMachineDeployment.State.MachineSets { if err := a.client.Create(ctx, &machineSet); kutil.IgnoreAlreadyExists(err) != nil { return err } } - // Deploy each machine owned by the MachineSet which was restored above for _, machine := range wantedMachineDeployment.State.Machines { - // Create the machine if it not exists already - if err := a.client.Create(ctx, &machine); kutil.IgnoreAlreadyExists(err) != nil { + newMachine := (&machine).DeepCopy() + newMachine.Status = machinev1alpha1.MachineStatus{} + if err := a.client.Create(ctx, newMachine); kutil.IgnoreAlreadyExists(err) != nil { return err } - // Attach the Shoot node to the Machine status - node := machine.Status.Node - if err := a.waitUntilStatusIsUpdates(ctx, &machine, func() error { - machine.Status.Node = node + if err := extensionscontroller.TryPatchStatus(ctx, retry.DefaultBackoff, a.client, newMachine, func() error { + newMachine.Status = machine.Status return nil }); err != nil { return err @@ -150,18 +142,6 @@ func (a *genericActuator) deployMachineSetsAndMachines(ctx context.Context, logg return nil } -func (a *genericActuator) waitUntilStatusIsUpdates(ctx context.Context, obj client.Object, transform func() error) error { - return gardeneretry.Until(ctx, 5*time.Second, func(ctx context.Context) (done bool, err error) { - if err := extensionscontroller.TryUpdateStatus(ctx, retry.DefaultBackoff, a.client, obj, transform); err != nil { - if apierrors.IsNotFound(err) { - return gardeneretry.NotOk() - } - return gardeneretry.SevereError(err) - } - return gardeneretry.Ok() - }) -} - func removeWantedDeploymentWithoutState(wantedMachineDeployments workercontroller.MachineDeployments) workercontroller.MachineDeployments { if wantedMachineDeployments == nil { return nil diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go index cd4f979b2..57bcf026d 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/controller/worker/reconciler.go @@ -97,15 +97,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( operationType := gardencorev1beta1helper.ComputeOperationType(worker.ObjectMeta, worker.Status.LastOperation) switch { + case extensionscontroller.ShouldSkipOperation(operationType, worker): + return reconcile.Result{}, nil case operationType == gardencorev1beta1.LastOperationTypeMigrate: - if extensionscontroller.IsMigrated(worker) { - return reconcile.Result{}, nil - } return r.migrate(ctx, logger.WithValues("operation", "migrate"), worker, cluster) case worker.DeletionTimestamp != nil: - if extensionscontroller.IsMigrated(worker) { - return reconcile.Result{}, nil - } return r.delete(ctx, logger.WithValues("operation", "delete"), worker, cluster) case operationType == gardencorev1beta1.LastOperationTypeRestore: return r.restore(ctx, logger.WithValues("operation", "restore"), worker, cluster) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/cmd/options.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/cmd/options.go index c40dd5182..b8e41cc9f 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/cmd/options.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/cmd/options.go @@ -216,9 +216,7 @@ type AddToManagerConfig struct { // AddToManager instantiates all webhooks of this configuration. If there are any webhooks, it creates a // webhook server, registers the webhooks and adds the server to the manager. Otherwise, it is a no-op. // It generates and registers the seed targeted webhooks via a Mutatingwebhookconfiguration. -func (c *AddToManagerConfig) AddToManager(mgr manager.Manager) ([]admissionregistrationv1.MutatingWebhook, []admissionregistrationv1.MutatingWebhook, error) { - ctx := context.Background() - +func (c *AddToManagerConfig) AddToManager(ctx context.Context, mgr manager.Manager) ([]admissionregistrationv1.MutatingWebhook, []admissionregistrationv1.MutatingWebhook, error) { webhooks, err := c.Switch.WebhooksFactory(mgr) if err != nil { return nil, nil, fmt.Errorf("could not create webhooks: %w", err) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/controlplane/genericmutator/mutator.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/controlplane/genericmutator/mutator.go index d8b3a0978..f7dc3f26a 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/controlplane/genericmutator/mutator.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/controlplane/genericmutator/mutator.go @@ -270,11 +270,7 @@ func (m *mutator) mutateOperatingSystemConfig(ctx context.Context, gctx gcontext return err } - if err := m.ensurer.EnsureAdditionalUnits(ctx, gctx, &osc.Spec.Units, oldUnits); err != nil { - return err - } - - return nil + return m.ensurer.EnsureAdditionalUnits(ctx, gctx, &osc.Spec.Units, oldUnits) } func (m *mutator) ensureKubeletServiceUnitContent(ctx context.Context, gctx gcontext.GardenContext, content, oldContent *string) error { @@ -373,6 +369,7 @@ func (m *mutator) ensureKubernetesGeneralConfiguration(ctx context.Context, gctx return nil } +// CloudProviderConfigPath is the path to the cloudprovider.conf kubelet configuration file. const CloudProviderConfigPath = "/var/lib/kubelet/cloudprovider.conf" func (m *mutator) ensureKubeletCloudProviderConfig(ctx context.Context, gctx gcontext.GardenContext, osc *extensionsv1alpha1.OperatingSystemConfig) error { diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/network/mutator.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/network/mutator.go index 3e5471796..44ace0945 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/network/mutator.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/network/mutator.go @@ -25,6 +25,7 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" ) +// MutateFn is a function that validates and if needed mutates the given extensionsv1alpha1.Network. type MutateFn func(new, old *extensionsv1alpha1.Network) error // NewMutator creates a new network mutator. diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/registration.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/registration.go index 52ee2d9b1..653d11c53 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/registration.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/registration.go @@ -35,7 +35,7 @@ import ( const ( // NamePrefix is the prefix used for {Valida,Muta}tingWebhookConfigurations of extensions. NamePrefix = "gardener-extension-" - // NameSuffixShoots is the suffix used for {Valida,Muta}tingWebhookConfigurations of extensions targeting a shoot. + // NameSuffixShoot is the suffix used for {Valida,Muta}tingWebhookConfigurations of extensions targeting a shoot. NameSuffixShoot = "-shoot" ) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/shoot/shoot.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/shoot/shoot.go index 6934ffc67..4e2e17fed 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/shoot/shoot.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/shoot/shoot.go @@ -46,7 +46,7 @@ type Args struct { MutatorWithShootClient extensionswebhook.MutatorWithShootClient } -// Add creates a new webhook with the shoot as target cluster. +// New creates a new webhook with the shoot as target cluster. func New(mgr manager.Manager, args Args) (*extensionswebhook.Webhook, error) { logger.Info("Creating webhook", "name", WebhookName) diff --git a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/webhook.go b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/webhook.go index 491192a36..d0575a94c 100644 --- a/vendor/github.com/gardener/gardener/extensions/pkg/webhook/webhook.go +++ b/vendor/github.com/gardener/gardener/extensions/pkg/webhook/webhook.go @@ -50,6 +50,7 @@ type Webhook struct { Selector *metav1.LabelSelector } +// Args contains Webhook creation arguments. type Args struct { Provider string Name string diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/executor/executor.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/executor/executor.go deleted file mode 100644 index 4bc496682..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/executor/executor.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package executor - -import ( - "bytes" - "context" - "io" - "net/url" - "strings" - - "github.com/gardener/gardener/pkg/client/kubernetes" - corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/remotecommand" -) - -// Executor allows for execution of commands in containers. -type Executor interface { - ExecCommandInContainerWithFullOutput(ctx context.Context, namespace, podName, containerName string, cmd ...string) (stdout, stderr string, err error) -} - -// execOptions passed to ExecWithOptions -type execOptions struct { - client kubernetes.Interface - command []string - namespace string - podName string - containerName string - stdin io.Reader - captureStdout bool - captureStderr bool - // If false, whitespace in std{err,out} will be removed. - preserveWhitespace bool -} - -type defaultExecutor struct { - client kubernetes.Interface -} - -// NewExecutor creates a new instance of Executor for a specific -// Kubernetes client. -func NewExecutor(client kubernetes.Interface) Executor { - return &defaultExecutor{client: client} -} - -// ExecCommandInContainerWithFullOutput executes a command in the -// specified container and return stdout, stderr and error -func (e *defaultExecutor) ExecCommandInContainerWithFullOutput(ctx context.Context, namespace, podName, containerName string, cmd ...string) (stdout, stderr string, err error) { - return execWithOptions(execOptions{ - client: e.client, - command: cmd, - namespace: namespace, - podName: podName, - containerName: containerName, - stdin: nil, - captureStdout: true, - captureStderr: true, - preserveWhitespace: false, - }) -} - -// execWithOptions executes a command in the specified container, -// returning stdout, stderr and error. `options` allowed for -// additional parameters to be passed. -func execWithOptions(options execOptions) (stdout, stderr string, err error) { - const tty = false - req := options.client.Kubernetes().CoreV1().RESTClient().Post(). - Resource("pods"). - Name(options.podName). - Namespace(options.namespace). - SubResource("exec"). - Param("container", options.containerName) - req.VersionedParams(&corev1.PodExecOptions{ - Container: options.containerName, - Command: options.command, - Stdin: options.stdin != nil, - Stdout: options.captureStdout, - Stderr: options.captureStderr, - TTY: tty, - }, scheme.ParameterCodec) - - var stdoutBuff, stderrBuff bytes.Buffer - err = execute("POST", req.URL(), options.client.RESTConfig(), options.stdin, &stdoutBuff, &stderrBuff, tty) - - if options.preserveWhitespace { - return stdoutBuff.String(), stderrBuff.String(), err - } - return strings.TrimSpace(stdoutBuff.String()), strings.TrimSpace(stderrBuff.String()), err -} - -func execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, stdout, stderr io.Writer, tty bool) error { - exec, err := remotecommand.NewSPDYExecutor(config, method, url) - if err != nil { - return err - } - return exec.Stream(remotecommand.StreamOptions{ - Stdin: stdin, - Stdout: stdout, - Stderr: stderr, - Tty: tty, - }) -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/agnostic.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/agnostic.go deleted file mode 100644 index c56b92212..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/agnostic.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package networkpolicies - -import ( - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - "github.com/gardener/gardener/pkg/operation/botanist/component/etcd" - "github.com/gardener/gardener/pkg/operation/botanist/component/kubecontrollermanager" - "github.com/gardener/gardener/pkg/operation/botanist/component/kubescheduler" - - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/sets" -) - -// Agnostic contains cloud agnostic settings. -type Agnostic struct{} - -// KubeAPIServer points to cloud-agnostic kube-apiserver. -func (a *Agnostic) KubeAPIServer() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(443), - Pod: NewPod("kube-apiserver", labels.Set{ - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.LabelRole: "apiserver", - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-kube-apiserver", - "allow-to-dns", - "allow-to-public-networks", - "allow-to-private-networks", - "allow-to-shoot-networks", - "deny-all", - ), - } -} - -// KubeControllerManagerSecured points to cloud-agnostic kube-controller-manager running on HTTPS port. -func (a *Agnostic) KubeControllerManagerSecured() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(10257), - Pod: NewPod("kube-controller-manager-https", labels.Set{ - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelRole: kubecontrollermanager.LabelRole, - }), - ExpectedPolicies: sets.NewString( - "allow-to-public-networks", - "allow-to-private-networks", - "allow-from-prometheus", - "allow-to-dns", - "allow-to-blocked-cidrs", - "allow-to-shoot-apiserver", - "deny-all", - ), - } -} - -// KubeSchedulerSecured points to cloud-agnostic kube-scheduler running on HTTPS port. -func (a *Agnostic) KubeSchedulerSecured() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(10259), - Pod: NewPod("kube-scheduler-https", labels.Set{ - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelRole: kubescheduler.LabelRole, - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-to-shoot-apiserver", - "allow-to-dns", - "deny-all", - ), - } -} - -// EtcdMain points to cloud-agnostic etcd-main instance. -func (a *Agnostic) EtcdMain() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(2379), - Pod: NewPod("etcd-main", labels.Set{ - v1beta1constants.LabelApp: etcd.LabelAppValue, - v1beta1constants.DeprecatedGardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelRole: v1beta1constants.ETCDRoleMain, - }), - ExpectedPolicies: sets.NewString( - etcd.NetworkPolicyName, - "allow-to-dns", - "allow-to-public-networks", - "allow-to-private-networks", - "deny-all", - ), - } -} - -// EtcdEvents points to cloud-agnostic etcd-main instance. -func (a *Agnostic) EtcdEvents() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(2379), - Pod: NewPod("etcd-events", labels.Set{ - v1beta1constants.LabelApp: etcd.LabelAppValue, - v1beta1constants.DeprecatedGardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelRole: v1beta1constants.ETCDRoleEvents, - }), - ExpectedPolicies: sets.NewString( - etcd.NetworkPolicyName, - "allow-to-dns", - "allow-to-public-networks", - "allow-to-private-networks", - "deny-all", - ), - } -} - -// CloudControllerManagerSecured points to cloud-agnostic cloud-controller-manager running on HTTPS port. -func (a *Agnostic) CloudControllerManagerSecured() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(10258), - Pod: NewPod("cloud-controller-manager-https", labels.Set{ - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.LabelRole: "cloud-controller-manager", - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-to-shoot-apiserver", - "allow-to-dns", - "allow-to-public-networks", - "deny-all", - ), - } -} - -// Loki points to cloud-agnostic loki instance. -func (a *Agnostic) Loki() *SourcePod { - return &SourcePod{ - Ports: []Port{ - {Name: "metrics", Port: 3100}, - }, - Pod: NewPod("loki", labels.Set{ - v1beta1constants.LabelApp: "loki", - v1beta1constants.GardenRole: "logging", - v1beta1constants.LabelRole: "logging", - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-loki", - "deny-all", - ), - } -} - -// Grafana points to cloud-agnostic grafana instance. -func (a *Agnostic) Grafana() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(3000), - Pod: NewPod("grafana", labels.Set{ - "component": "grafana", - v1beta1constants.GardenRole: "monitoring", - }), - ExpectedPolicies: sets.NewString( - "allow-grafana", - "allow-to-dns", - "deny-all", - ), - } -} - -// KubeStateMetricsShoot points to cloud-agnostic kube-state-metrics-shoot instance. -func (a *Agnostic) KubeStateMetricsShoot() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(8080), - Pod: NewPod("kube-state-metrics-shoot", labels.Set{ - "component": "kube-state-metrics", - v1beta1constants.GardenRole: "monitoring", - "type": "shoot", - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-to-dns", - "allow-to-shoot-apiserver", - "deny-all", - ), - } -} - -// MachineControllerManager points to cloud-agnostic machine-controller-manager instance. -func (a *Agnostic) MachineControllerManager() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(10258), - Pod: NewPod("machine-controller-manager", labels.Set{ - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.LabelRole: "machine-controller-manager", - }), - ExpectedPolicies: sets.NewString( - "allow-from-prometheus", - "allow-to-dns", - "allow-to-public-networks", - "allow-to-private-networks", - "allow-to-seed-apiserver", - "allow-to-shoot-apiserver", - "deny-all", - ), - } -} - -// Prometheus points to cloud-agnostic prometheus instance. -func (a *Agnostic) Prometheus() *SourcePod { - return &SourcePod{ - Ports: NewSinglePort(9090), - Pod: NewPod("prometheus", labels.Set{ - v1beta1constants.LabelApp: "prometheus", - v1beta1constants.GardenRole: "monitoring", - v1beta1constants.LabelRole: "monitoring", - }), - ExpectedPolicies: sets.NewString( - "allow-prometheus", - "allow-to-dns", - "allow-to-public-networks", - "allow-to-seed-apiserver", - "allow-to-shoot-apiserver", - "allow-to-shoot-networks", - "deny-all", - ), - } -} - -// AddonManager points to gardener-resource-manager instance. -func (a *Agnostic) AddonManager() *SourcePod { - return &SourcePod{ - Pod: NewPod("gardener-resource-manager", labels.Set{ - v1beta1constants.LabelApp: "gardener-resource-manager", - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - }), - ExpectedPolicies: sets.NewString( - "allow-to-dns", - "allow-to-seed-apiserver", - "allow-to-shoot-apiserver", - "deny-all", - ), - } -} - -// Busybox points to busybox instance. -func (a *Agnostic) Busybox() *SourcePod { - return &SourcePod{ - Pod: NewPod("busybox", labels.Set{ - v1beta1constants.LabelApp: "busybox", - v1beta1constants.LabelRole: "testing", - }), - } -} - -// External points external host. -func (a *Agnostic) External() *Host { - return &Host{ - Description: "External host", - HostName: "8.8.8.8", - Port: 53, - } -} - -// SeedKubeAPIServer points the Seed Kube APIServer. -func (a *Agnostic) SeedKubeAPIServer() *Host { - return &Host{ - Description: "Seed Kube APIServer", - HostName: "kubernetes.default", - Port: 443, - } -} - -// GardenPrometheus points the Gardener Prometheus running in the seed cluster. -func (a *Agnostic) GardenPrometheus() *Host { - return &Host{ - Description: "Garden Prometheus", - HostName: "prometheus-web.garden", - Port: 80, - } -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/networkpolicies.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/networkpolicies.go deleted file mode 100644 index 4bdc76bf3..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/networkpolicies.go +++ /dev/null @@ -1,739 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package generators - -import ( - "fmt" - "io" - "sort" - "strings" - - "github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies" - - "github.com/huandu/xstrings" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/klog" -) - -const ( - outPkgName = "networkpolies" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -type cloudAwarePackage struct { - cloud networkpolicies.CloudAware -} - -func NewPackages(cloud networkpolicies.CloudAware) func(p *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - return (&cloudAwarePackage{cloud: cloud}).Packages -} - -// Packages makes the sets package definition. -func (a *cloudAwarePackage) Packages(p *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - pkg := &generator.DefaultPackage{ - PackageName: outPkgName, - PackagePath: arguments.OutputPackagePath, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// Package has auto-generated cloud-specific network policy tests. - `), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - generator.DefaultGen{ - OptionalName: "networkpolicies_suite_test", - OptionalBody: []byte(suiteBody), - }, - &genTest{ - DefaultGen: generator.DefaultGen{ - OptionalName: "networkpolicy_test", - }, - outputPackage: outPkgName, - imports: generator.NewImportTracker(), - provider: a.cloud, - }, - } - - return generators - }, - } - - return generator.Packages{pkg} -} - -// genTest produces a file with a set for a single type. -type genTest struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - provider networkpolicies.CloudAware -} - -func (g *genTest) Imports(c *generator.Context) (imports []string) { - return append(g.imports.ImportLines(), - `context`, - `encoding/json`, - `flag`, - `fmt`, - `strings`, - `sync`, - `time`, - - `"github.com/gardener/gardener/test/framework"`, - `. "github.com/onsi/ginkgo"`, - `. "github.com/onsi/gomega"`, - `corev1 "k8s.io/api/core/v1"`, - `github.com/gardener/gardener/pkg/apis/core/v1beta1`, - `github.com/gardener/gardener/pkg/client/kubernetes`, - `github.com/gardener/gardener/pkg/logger`, - `github.com/gardener/gardener/extensions/test/e2e/framework/executor`, - `github.com/sirupsen/logrus`, - `k8s.io/apimachinery/pkg/api/errors`, - `k8s.io/apimachinery/pkg/labels`, - `k8s.io/apimachinery/pkg/types`, - `k8s.io/apimachinery/pkg/util/sets`, - `metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"`, - `networkingv1 "k8s.io/api/networking/v1"`, - `networkpolicies "github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies"`, - `sigs.k8s.io/controller-runtime/pkg/client`, - ) -} - -func (g *genTest) simpleArgs(kv ...interface{}) interface{} { - m := map[interface{}]interface{}{} - for i := 0; i < len(kv)/2; i++ { - m[kv[i*2]] = kv[i*2+1] - } - return m -} - -// GenerateType makes the body of a file implementing a set for type t. -func (g *genTest) Init(c *generator.Context, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do(setHeader, nil) - g.generateValues(sw) - sw.Do(setBody, g.simpleArgs("providerName", g.provider.Provider(), "sourceVarName", g.sources())) - g.correctPolicies(sw) - g.ingressFromOtherNamespaces(sw) - g.egressToOtherNamespaces(sw) - g.egressToSeedNodes(sw) - g.egressForMirroredPods(sw) - sw.Do("})\n", nil) - return nil -} - -func (g *genTest) sources() string { - sourceNames := g.provider.Sources() - names := []string{} - for _, source := range sourceNames { - names = append(names, podToVariableName(&source.Pod)) - } - return strings.Join(names, ",\n") -} - -func (g *genTest) correctPolicies(sw *generator.SnippetWriter) { - sw.Do(` -Context("components are selected by correct policies", func() { - var ( - assertHasNetworkPolicy = func(sourcePod *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - if !sourcePod.Pod.CheckVersion(f.Shoot) { - Skip("Component doesn't match Shoot version constraints. Skipping.") - } - if !sourcePod.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - - matched := sets.NewString() - var podLabelSet labels.Set - - By(fmt.Sprintf("Getting first running pod with selectors %q in namespace %q", sourcePod.Pod.Labels, f.ShootSeedNamespace())) - pod, err := framework.GetFirstRunningPodWithLabels(ctx, sourcePod.Pod.Selector(), f.ShootSeedNamespace(), f.SeedClient) - podLabelSet = pod.GetLabels() - Expect(err).NotTo(HaveOccurred()) - - for _, netPol := range sharedResources.Policies { - netPolSelector, err := metav1.LabelSelectorAsSelector(&netPol.Spec.PodSelector) - Expect(err).NotTo(HaveOccurred()) - - if netPolSelector.Matches(podLabelSet) { - matched.Insert(netPol.GetName()) - } - } - By(fmt.Sprintf("Matching actual network policies against expected %s", sourcePod.ExpectedPolicies.List())) - Expect(matched.List()).Should(ConsistOf(sourcePod.ExpectedPolicies.List())) - } - } - ) -`, nil) - - for _, s := range g.provider.Rules() { - sw.Do("DefaultCIt(`$.sourcePodName$`, assertHasNetworkPolicy($.sourceVarName$))", g.simpleArgs("sourcePodName", s.SourcePod.Pod.Name, "sourceVarName", podToVariableName(&s.SourcePod.Pod))) - sw.Do("\n", nil) - } - - sw.Do("})\n", nil) -} - -func (g *genTest) generateValues(sw *generator.SnippetWriter) { - sw.Do("// generated targets\n", nil) - for _, t := range g.flattenPods() { - sw.Do("$.targetName$ = &$.targetPod$\n", g.simpleArgs("targetName", t.name, "targetPod", t.value)) - } -} - -func (g *genTest) egressForMirroredPods(sw *generator.SnippetWriter) { - sw.Do(` -Context("egress for mirrored pods", func() { - - var ( - from *networkpolicies.NamespacedSourcePod - - assertEgresssToMirroredPod = func(to *networkpolicies.TargetPod, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToPod(ctx, from, networkpolicies.NewNamespacedTargetPod(to, sharedResources.Mirror), allowed) - } - } - - assertEgresssToHost = func(to *networkpolicies.Host, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToHost(ctx, from, to, allowed) - } - } - ) -`, nil) - - for _, s := range g.provider.Rules() { - - sw.Do(` -Context("$.podName$", func() { - - BeforeEach(func(){ - from = networkpolicies.NewNamespacedSourcePod($.sourcePod$, sharedResources.Mirror) - }) - - `, g.simpleArgs("podName", s.SourcePod.Pod.Name, "sourcePod", podToVariableName(&s.SourcePod.Pod))) - for _, t := range s.TargetPods { - if s.Pod.Name != t.Pod.Name { - sw.Do("DefaultCIt(`$.description$`, assertEgresssToMirroredPod($.targetVarName$, $.allowed$))", g.simpleArgs("description", t.ToString(), "targetVarName", targetPodToVariableName(&t.TargetPod), "allowed", t.Allowed)) - sw.Do("\n", nil) - } - } - for _, h := range s.TargetHosts { - sw.Do("DefaultCIt(`$.description$`, assertEgresssToHost($.targetVarName$, $.allowed$))", g.simpleArgs("description", h.ToString(), "targetVarName", hostToVariableName(&h.Host), "allowed", h.Allowed)) - sw.Do("\n", nil) - } - - sw.Do("})\n", nil) - - } - sw.Do("})\n", nil) -} - -func (g *genTest) egressToSeedNodes(sw *generator.SnippetWriter) { - sw.Do(` -Context("egress to Seed nodes", func() { - - var ( - assertBlockToSeedNodes = func(from *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - assertCannotConnectToHost(ctx, networkpolicies.NewNamespacedSourcePod(from, sharedResources.Mirror), sharedResources.SeedNodeIP, 10250) - } - } - ) - - `, nil) - for _, s := range g.provider.Rules() { - sw.Do("DefaultCIt(`should block connectivity from $.podName$`, assertBlockToSeedNodes($.targetVarName$))", g.simpleArgs("podName", s.SourcePod.Pod.Name, "targetVarName", podToVariableName(&s.SourcePod.Pod))) - sw.Do("\n", nil) - } - sw.Do("})\n", nil) -} - -func (g *genTest) egressToOtherNamespaces(sw *generator.SnippetWriter) { - sw.Do(` -Context("egress to other namespaces", func() { - - var ( - assertBlockEgresss = func(from *networkpolicies.SourcePod) func(context.Context) { - return func(ctx context.Context) { - assertCannotConnectToPod(ctx, networkpolicies.NewNamespacedSourcePod(from, sharedResources.Mirror), networkpolicies.NewNamespacedTargetPod(agnostic.Busybox().DummyPort(), sharedResources.External)) - } - } - ) - - `, nil) - - for _, s := range g.provider.Rules() { - sw.Do("DefaultCIt(`should block connectivity from $.sourcePodName$ to busybox`, assertBlockEgresss($.sourceVarName$))", g.simpleArgs("sourcePodName", s.SourcePod.Pod.Name, "sourceVarName", podToVariableName(&s.SourcePod.Pod))) - sw.Do("\n", nil) - } - sw.Do("})\n", nil) -} - -func (g *genTest) ingressFromOtherNamespaces(sw *generator.SnippetWriter) { - sw.Do(` -Context("ingress from other namespaces", func() { - - var ( - assertBlockIngress = func(to *networkpolicies.TargetPod, allowed bool) func(context.Context) { - return func(ctx context.Context) { - assertConnectToPod(ctx, networkpolicies.NewNamespacedSourcePod(agnostic.Busybox(), sharedResources.External), networkpolicies.NewNamespacedTargetPod(to, f.ShootSeedNamespace()), allowed) - } - } - ) - - `, nil) - for _, tp := range g.provider.EgressFromOtherNamespaces((&networkpolicies.Agnostic{}).Busybox()).TargetPods { - sw.Do("DefaultCIt(`$.description$`, assertBlockIngress($.targetVarName$, $.allowed$))", g.simpleArgs("description", tp.ToString(), "targetVarName", targetPodToVariableName(&tp.TargetPod), "allowed", tp.Allowed)) - sw.Do("\n", nil) - } - sw.Do("})\n", nil) - -} - -type target struct { - name string - value string -} - -func (g *genTest) flattenPods() []target { - fPods := map[string]string{} - targets := []target{} - for _, s := range g.provider.Rules() { - - targets = append(targets, target{name: podToVariableName(&s.SourcePod.Pod), value: prettyPrint(*s.SourcePod)}) - - for _, p := range s.TargetPods { - fPodName := targetPodToVariableName(&p.TargetPod) - if _, exists := fPods[fPodName]; !exists { - v := prettyPrint(p.TargetPod) - fPods[fPodName] = v - targets = append(targets, target{name: fPodName, value: v}) - } - } - for _, h := range s.TargetHosts { - fHostName := hostToVariableName(&h.Host) - if _, exists := fPods[fHostName]; !exists { - v := prettyPrint(h.Host) - fPods[fHostName] = v - targets = append(targets, target{name: fHostName, value: v}) - } - } - } - sort.Slice(targets, func(i, j int) bool { return targets[i].name < targets[j].name }) - - return targets -} - -func podToVariableName(p *networkpolicies.Pod) string { - return xstrings.ToCamelCase(strings.ReplaceAll(p.Name, "-", "_")) -} - -func targetPodToVariableName(p *networkpolicies.TargetPod) string { - return xstrings.ToCamelCase(strings.ReplaceAll(fmt.Sprintf("%s%d", p.Pod.Name, p.Port.Port), "-", "_")) -} - -func hostToVariableName(p *networkpolicies.Host) string { - return xstrings.FirstRuneToUpper(strings.ReplaceAll(fmt.Sprintf("%sPort%d", p.Description, p.Port), " ", "")) -} - -var suiteBody = ` -import ( - "testing" - - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" -) - -func TestNetworkPolicies(t *testing.T) { - gomega.RegisterFailHandler(ginkgo.Fail) - ginkgo.RunSpecs(t, "Network Policies e2e Test Suite") -} -` - -var setHeader = ` -var ( - cleanup = flag.Bool("cleanup", false, "deletes all created e2e resources after the test suite is done") -) - -const ( - InitializationTimeout = 10 * time.Minute - FinalizationTimeout = time.Minute - DefaultTestTimeout = 10 * time.Second -) - -func init() { - framework.RegisterShootFrameworkFlags() -} - -var _ = Describe("Network Policy Testing", func() { - - var ( - f = framework.NewShootFramework(nil) - sharedResources networkpolicies.SharedResources - - agnostic = &networkpolicies.Agnostic{} - DefaultCIt = func(text string, body func(ctx context.Context)) { - f.Default().CIt(text, body, DefaultTestTimeout) - } - - getTargetPod = func(ctx context.Context, targetPod *networkpolicies.NamespacedTargetPod) *corev1.Pod { - if !targetPod.Pod.CheckVersion(f.Shoot) { - Skip("Target pod doesn't match Shoot version constraints. Skipping.") - } - if !targetPod.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - By(fmt.Sprintf("Checking that target Pod: %s is running", targetPod.Pod.Name)) - err := f.WaitUntilPodIsRunningWithLabels(ctx, targetPod.Pod.Selector(), targetPod.Namespace, f.SeedClient) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - By(fmt.Sprintf("Get target pod: %s", targetPod.Pod.Name)) - trgPod, err := framework.GetFirstRunningPodWithLabels(ctx, targetPod.Pod.Selector(), targetPod.Namespace, f.SeedClient) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - return trgPod - } - - - establishConnectionToHost = func(ctx context.Context, nsp *networkpolicies.NamespacedSourcePod, host string, port int32) (stdout, stderr string, err error) { - if !nsp.Pod.CheckVersion(f.Shoot) { - Skip("Source pod doesn't match Shoot version constraints. Skipping.") - } - if !nsp.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - Skip("Component doesn't match Seed Provider constraints. Skipping.") - } - By(fmt.Sprintf("Checking for source Pod: %s is running", nsp.Pod.Name)) - ExpectWithOffset(1, f.WaitUntilPodIsRunningWithLabels(ctx, nsp.Pod.Selector(), nsp.Namespace, f.SeedClient)).NotTo(HaveOccurred()) - - command := []string{"nc", "-vznw", "3", host, fmt.Sprint(port)} - By(fmt.Sprintf("Executing connectivity command in %s/%s to %s", nsp.Namespace, nsp.Pod.Name, strings.Join(command, " "))) - - return executor.NewExecutor(f.SeedClient). - ExecCommandInContainerWithFullOutput(ctx, nsp.Namespace, nsp.Pod.Name, "busybox-0", command...) - } - - assertCannotConnectToHost = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, host string, port int32) { - _, stderr, err := establishConnectionToHost(ctx, sourcePod, host, port) - ExpectWithOffset(1, err).To(HaveOccurred()) - By("Connection message is timed out\n") - ExpectWithOffset(1, stderr).To(SatisfyAny(ContainSubstring("Connection timed out"), ContainSubstring("nc: bad address"))) - } - - assertConnectToHost = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetHost *networkpolicies.Host, allowed bool) { - _, stderr, err := establishConnectionToHost(ctx, sourcePod, targetHost.HostName, targetHost.Port) - if allowed { - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - } else { - ExpectWithOffset(1, err).To(HaveOccurred()) - ExpectWithOffset(1, stderr).To(SatisfyAny(BeEmpty(), ContainSubstring("Connection timed out"), ContainSubstring("nc: bad address")), "stderr has correct message") - } - } - - assertCannotConnectToPod = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetPod *networkpolicies.NamespacedTargetPod) { - pod := getTargetPod(ctx, targetPod) - assertCannotConnectToHost(ctx, sourcePod, pod.Status.PodIP, targetPod.Port.Port) - } - - assertConnectToPod = func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, targetPod *networkpolicies.NamespacedTargetPod, allowed bool) { - pod := getTargetPod(ctx, targetPod) - assertConnectToHost(ctx, sourcePod, &networkpolicies.Host{ - HostName: pod.Status.PodIP, - Port: targetPod.Port.Port, - }, allowed) - } - -` - -var setBody = ` - ) - - SynchronizedBeforeSuite(func() []byte { - ctx, cancel := context.WithTimeout(context.TODO(), InitializationTimeout) - defer cancel() - - var err error - - // The framework has to be manually initialized as BeforeEach is not allowed to be called inside a SynchronizedBeforeSuite - f = &framework.ShootFramework{ - GardenerFramework: framework.NewGardenerFrameworkFromConfig(nil), - TestDescription: framework.NewTestDescription("SHOOT"), - Config: nil, - } - f.CommonFramework.BeforeEach() - f.GardenerFramework.BeforeEach() - f.BeforeEach(ctx) - - By("Getting Seed Cloud Provider") - sharedResources.SeedCloudProvider = f.Seed.Spec.Provider.Type - - By("Creating namespace for Ingress testing") - ns := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "gardener-e2e-network-policies-", - Labels: map[string]string{ - "gardener-e2e-test": "networkpolicies", - }, - }, - } - err = f.SeedClient.Client().Create(ctx, ns) - Expect(err).NotTo(HaveOccurred()) - - sharedResources.External = ns.GetName() - - By("Creating mirror namespace for pod2pod network testing") - mirrorNamespace := &corev1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "gardener-e2e-mirror-network-policies-", - Labels: map[string]string{ - "gardener-e2e-test": "networkpolicies", - }, - }, - } - err = f.SeedClient.Client().Create(ctx, mirrorNamespace) - Expect(err).NotTo(HaveOccurred()) - - sharedResources.Mirror = mirrorNamespace.GetName() - - By(fmt.Sprintf("Getting all network policies in namespace %q", f.ShootSeedNamespace())) - list := &networkingv1.NetworkPolicyList{} - err = f.SeedClient.Client().List(ctx, list, client.InNamespace(f.ShootSeedNamespace())) - Expect(err).ToNot(HaveOccurred()) - - sharedResources.Policies = list.Items - - for _, netPol := range sharedResources.Policies { - cpy := &networkingv1.NetworkPolicy{} - cpy.Name = netPol.Name - cpy.Namespace = sharedResources.Mirror - cpy.Spec = *netPol.Spec.DeepCopy() - By(fmt.Sprintf("Copying network policy %s in namespace %q", netPol.Name, sharedResources.Mirror)) - err = f.SeedClient.Client().Create(ctx, cpy) - Expect(err).NotTo(HaveOccurred()) - } - - By("Getting the current CloudProvider") - currentProvider := f.Shoot.Spec.Provider.Type - - getFirstNodeInternalIP := func(ctx context.Context, cl kubernetes.Interface) (string, error) { - nodes := &corev1.NodeList{} - err := cl.Client().List(ctx, nodes, client.Limit(1)) - if err != nil { - return "", err - } - - if len(nodes.Items) > 0 { - firstNode := nodes.Items[0] - for _, address := range firstNode.Status.Addresses { - if address.Type == corev1.NodeInternalIP { - return address.Address, nil - } - } - } - - return "", framework.ErrNoInternalIPsForNodeWasFound - } - - By("Getting fist running node") - sharedResources.SeedNodeIP, err = getFirstNodeInternalIP(ctx, f.SeedClient) - Expect(err).NotTo(HaveOccurred()) - - if currentProvider != "$.providerName$" { - Fail(fmt.Sprintf("Not supported cloud provider %s", currentProvider)) - } - - createBusyBox := func(ctx context.Context, sourcePod *networkpolicies.NamespacedSourcePod, ports ...corev1.ContainerPort) { - if len(ports) == 0 { - Fail(fmt.Sprintf("No ports found for SourcePod %+v", *sourcePod.SourcePod)) - } - containers := []corev1.Container{} - for i, port := range ports { - containers = append(containers, corev1.Container{ - Args: []string{"nc", "-lk", "-p", fmt.Sprint(port.ContainerPort), "-e", "/bin/echo", "-s", "0.0.0.0"}, - Image: "busybox", - Name: fmt.Sprintf("busybox-%d", i), - Ports: []corev1.ContainerPort{port}, - }) - } - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: sourcePod.Pod.Name, - Namespace: sourcePod.Namespace, - Labels: sourcePod.Pod.Labels, - }, - Spec: corev1.PodSpec{ - Containers: containers, - }, - } - - By(fmt.Sprintf("Creating Pod %s/%s", sourcePod.Namespace, sourcePod.Name)) - err := f.SeedClient.Client().Create(ctx, pod) - Expect(err).NotTo(HaveOccurred()) - - By(fmt.Sprintf("Waiting foo Pod %s/%s to be running", sourcePod.Namespace, sourcePod.Name)) - err = framework.WaitUntilPodIsRunning(ctx, f.Logger, pod.GetName(), sourcePod.Namespace, f.SeedClient) - if err != nil { - Fail(fmt.Sprintf("Couldn't find running busybox %s/%s", sourcePod.Namespace, pod.GetName())) - } - } - - sources := []*networkpolicies.SourcePod{ - $.sourceVarName$, - } - - var wg sync.WaitGroup - // one extra for the busybox Pod bellow. - wg.Add(len(sources) + 1) - - for _, s := range sources { - go func(pi *networkpolicies.SourcePod) { - defer GinkgoRecover() - defer wg.Done() - if !pi.Pod.CheckVersion(f.Shoot) || !pi.Pod.CheckSeedCluster(sharedResources.SeedCloudProvider) { - return - } - pod, err := framework.GetFirstRunningPodWithLabels(ctx, pi.Pod.Selector(), f.ShootSeedNamespace(), f.SeedClient) - if err != nil { - Fail(fmt.Sprintf("Couldn't find running Pod %s/%s with labels: %+v", f.ShootSeedNamespace(), pi.Pod.Name, pi.Pod.Labels)) - } - cpy := *pi - - targetLabels := make(map[string]string) - - for k, v := range pod.Labels { - targetLabels[k] = v - } - - cpy.Pod.Labels = targetLabels - By(fmt.Sprintf("Mirroring Pod %s to namespace %s", cpy.Pod.Labels.String(), sharedResources.Mirror)) - - expectedPorts := sets.Int64{} - actualPorts := sets.Int64{} - for _, p := range pi.Ports { - expectedPorts.Insert(int64(p.Port)) - } - containerPorts := []corev1.ContainerPort{} - for _, container := range pod.Spec.Containers { - if len(container.Ports) > 0 { - for _, p := range container.Ports { - actualPorts.Insert(int64(p.ContainerPort)) - } - containerPorts = append(containerPorts, container.Ports...) - } - } - - if !actualPorts.HasAll(expectedPorts.List()...) { - Fail(fmt.Sprintf("Pod %s doesn't have all ports. Expected %+v, actual %+v", pi.Pod.Name, expectedPorts.List(), actualPorts.List())) - } - if len(containerPorts) == 0 { - // Dummy port for containers which don't have any ports. - containerPorts = append(containerPorts, corev1.ContainerPort{ContainerPort: 8080}) - } - createBusyBox(ctx, networkpolicies.NewNamespacedSourcePod(&cpy, sharedResources.Mirror), containerPorts...) - }(s) - } - go func() { - defer GinkgoRecover() - defer wg.Done() - createBusyBox(ctx, networkpolicies.NewNamespacedSourcePod(agnostic.Busybox(), ns.GetName()), corev1.ContainerPort{ContainerPort: 8080}) - }() - - wg.Wait() - - b, err := json.Marshal(sharedResources) - Expect(err).NotTo(HaveOccurred()) - - return b - }, func(data []byte) { - sr := &networkpolicies.SharedResources{} - err := json.Unmarshal(data, sr) - Expect(err).NotTo(HaveOccurred()) - - sharedResources = *sr - }) - - SynchronizedAfterSuite(func() { - if !*cleanup { - return - } - - ctx, cancel := context.WithTimeout(context.TODO(), FinalizationTimeout) - defer cancel() - - namespaces := &corev1.NamespaceList{} - selector := labels.SelectorFromSet(labels.Set{ - "gardener-e2e-test": "networkpolicies", - }) - err := f.SeedClient.Client().List(ctx, namespaces, client.MatchingLabelsSelector{Selector: selector}) - Expect(err).NotTo(HaveOccurred()) - - for _, ns := range namespaces.Items { - err = f.SeedClient.Client().Delete(ctx, &ns) - if err != nil && !errors.IsConflict(err) { - Expect(err).NotTo(HaveOccurred()) - } - } - }, func() {}) - - Context("Deprecated old policies are removed", func() { - - const ( - deprecatedKubeAPIServerPolicy = "kube-apiserver-default" - deprecatedMetadataAppPolicy = "cloud-metadata-service-deny-blacklist-app" - deprecatedMetadataRolePolicy = "cloud-metadata-service-deny-blacklist-role" - ) - - var ( - assertPolicyIsGone = func(policyName string) func(ctx context.Context) { - return func(ctx context.Context) { - By(fmt.Sprintf("Getting network policy %q in namespace %q", policyName, f.ShootSeedNamespace())) - getErr := f.SeedClient.Client().Get(ctx, types.NamespacedName{Name: policyName, Namespace: f.ShootSeedNamespace()}, &networkingv1.NetworkPolicy{}) - Expect(getErr).To(HaveOccurred()) - By("error is NotFound") - Expect(errors.IsNotFound(getErr)).To(BeTrue()) - } - } - ) - - DefaultCIt(deprecatedKubeAPIServerPolicy, assertPolicyIsGone(deprecatedKubeAPIServerPolicy)) - DefaultCIt(deprecatedMetadataAppPolicy, assertPolicyIsGone(deprecatedMetadataAppPolicy)) - DefaultCIt(deprecatedMetadataRolePolicy, assertPolicyIsGone(deprecatedMetadataRolePolicy)) - }) -` diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/pretty_print.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/pretty_print.go deleted file mode 100644 index cec2b836c..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/generators/pretty_print.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package generators - -import ( - "fmt" - "strings" -) - -// Poor-man's pretty struct printer. -func prettyPrint(i interface{}) string { - s1 := strings.ReplaceAll(fmt.Sprintf("%#v", i), ", ", ",\n") - s2 := strings.ReplaceAll(s1, "{", "{\n") - s3 := strings.ReplaceAll(s2, "} ", "}\n") - s4 := strings.ReplaceAll(s3, "[", "[\n") - s5 := strings.ReplaceAll(s4, "] ", "]\n") - - return s5 -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/rule_builder.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/rule_builder.go deleted file mode 100644 index 9007400da..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/rule_builder.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package networkpolicies - -// RuleBuilder is a builder for easy construction of Source. -type RuleBuilder struct { - rule Rule -} - -// NewSource creates a new instance of RuleBuilder. -func NewSource(pi *SourcePod) *RuleBuilder { - return &RuleBuilder{rule: Rule{SourcePod: pi}} -} - -// AllowHost adds `allowedHosts` as allowed Targets. -func (s *RuleBuilder) AllowHost(allowedHosts ...*Host) *RuleBuilder { - return s.conditionalHost(true, allowedHosts...) -} - -// AllowPod adds `allowedSources` as allowed Targets. -func (s *RuleBuilder) AllowPod(allowedSources ...*SourcePod) *RuleBuilder { - allowedTargets := []*TargetPod{} - for _, ap := range allowedSources { - allowedTargets = append(allowedTargets, ap.AsTargetPods()...) - } - return s.conditionalPod(true, allowedTargets...) -} - -// AllowTargetPod adds `allowTargetPods` as allowed Targets. -func (s *RuleBuilder) AllowTargetPod(allowTargetPods ...*TargetPod) *RuleBuilder { - return s.conditionalPod(true, allowTargetPods...) -} - -// DenyHost adds `deniedHosts` as denied Targets. -func (s *RuleBuilder) DenyHost(deniedHosts ...*Host) *RuleBuilder { - return s.conditionalHost(false, deniedHosts...) -} - -// DenyPod adds `deniedPods` as denied Targets. -func (s *RuleBuilder) DenyPod(deniedPods ...*SourcePod) *RuleBuilder { - deniedTargets := []*TargetPod{} - for _, ap := range deniedPods { - deniedTargets = append(deniedTargets, ap.AsTargetPods()...) - } - return s.conditionalPod(false, deniedTargets...) -} - -// DenyTargetPod adds `deniedTargets` as denied Targets. -func (s *RuleBuilder) DenyTargetPod(deniedTargets ...*TargetPod) *RuleBuilder { - return s.conditionalPod(false, deniedTargets...) -} - -// Build returns the completed Source instance. -func (s *RuleBuilder) Build() Rule { - return s.rule -} - -func (s *RuleBuilder) conditionalPod(allowed bool, pods ...*TargetPod) *RuleBuilder { - for _, pod := range pods { - if s.rule.SourcePod.Name == pod.Pod.Name { - // same target and source pods are alwayds allowed to talk to eachother. - continue - } - found := false - for i, existingTarget := range s.rule.TargetPods { - if pod.Pod.Name == existingTarget.TargetPod.Pod.Name && pod.Port.Port == existingTarget.TargetPod.Port.Port { - s.rule.TargetPods[i].Allowed = allowed - found = true - break - } - } - if !found { - s.rule.TargetPods = append(s.rule.TargetPods, PodRule{TargetPod: *pod, Allowed: allowed}) - } - } - return s -} - -func (s *RuleBuilder) conditionalHost(allowed bool, hosts ...*Host) *RuleBuilder { - for _, host := range hosts { - found := false - for i, existingTarget := range s.rule.TargetHosts { - - if host.HostName == existingTarget.Host.HostName && host.Port == existingTarget.Host.Port { - s.rule.TargetHosts[i].Allowed = allowed - found = true - break - } - } - if !found { - s.rule.TargetHosts = append(s.rule.TargetHosts, HostRule{Host: *host, Allowed: allowed}) - } - } - return s -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/shared_resources.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/shared_resources.go deleted file mode 100644 index 188fcc48d..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/shared_resources.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package networkpolicies - -import ( - networkingv1 "k8s.io/api/networking/v1" -) - -// SharedResources are shared between Ginkgo Nodes. -type SharedResources struct { - Mirror string `json:"mirror"` - External string `json:"external"` - SeedNodeIP string `json:"seedNodeIP"` - Policies []networkingv1.NetworkPolicy `json:"policies"` - SeedCloudProvider string `json:"seedCloudProvider"` -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/types.go b/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/types.go deleted file mode 100644 index 78b1deb18..000000000 --- a/vendor/github.com/gardener/gardener/extensions/test/e2e/framework/networkpolicies/types.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package networkpolicies - -import ( - "fmt" - - "github.com/Masterminds/semver" - "github.com/gardener/gardener/pkg/apis/core/v1beta1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/sets" -) - -// SourcePod holds the data about pods in the shoot namespace and their services. -type SourcePod struct { - Pod - Ports []Port - ExpectedPolicies sets.String -} - -// TargetPod contains data about a Pod listening on a specific port. -type TargetPod struct { - Pod - Port -} - -// Pod contains the barebone detals about a Pod. -type Pod struct { - Name string - Labels labels.Set - ShootVersionConstraint string - // For which seed clusters this pod is active. - SeedClusterConstraints sets.String -} - -// Port holds the data about a single port. -type Port struct { - Port int32 - Name string -} - -// HostRule contains a target Host and decision if it's visible to the source Pod. -type HostRule struct { - Host - Allowed bool -} - -// PodRule contains a rule which allows/disallow traffic to a TargetPod. -type PodRule struct { - TargetPod - Allowed bool -} - -// Host contains host with port and optional description. -type Host struct { - Description string - HostName string - Port int32 -} - -// Rule contains Pod and target Pods and Hosts to which it's (not) allowed to talk to. -type Rule struct { - *SourcePod - TargetPods []PodRule - TargetHosts []HostRule -} - -// CloudAware contains a Cloud-specific information for Source(s) to Target(s) communication. -type CloudAware interface { - // Rules returns a list of all Rules of the CloudProvider. - Rules() []Rule - - // Sources returns a list of all Sources of the CloudProvider. - Sources() []*SourcePod - - // EgressFromOtherNamespaces returns a list of all TargetPod. - EgressFromOtherNamespaces(source *SourcePod) Rule - - // Provider returns the CloudProvider. - Provider() string -} - -// NewPod creates a new instance of Pod. -func NewPod(name string, labels labels.Set, shootVersionConstraints ...string) Pod { - constraint := "" - if len(shootVersionConstraints) > 0 { - constraint = shootVersionConstraints[0] - } - return Pod{name, labels, constraint, nil} -} - -// ToString returns the string representation of TargetHost. -func (t *HostRule) ToString() string { - action := "block" - if t.Allowed { - action = "allow" - } - return fmt.Sprintf("should %s connection to %q %s:%d", action, t.Host.Description, t.Host.HostName, t.Host.Port) -} - -// ToString returns the string representation of TargetPod. -func (p *PodRule) ToString() string { - action := "block" - if p.Allowed { - action = "allow" - } - return fmt.Sprintf("should %s connection to Pod %q at port %d", action, p.TargetPod.Pod.Name, p.TargetPod.Port.Port) -} - -// NewSinglePort returns just one port. -func NewSinglePort(p int32) []Port { - return []Port{{Port: p}} -} - -// CheckVersion checks if shoot version is matched by ShootVersionConstraint. -func (p *Pod) CheckVersion(shoot *v1beta1.Shoot) bool { - if len(p.ShootVersionConstraint) == 0 { - return true - } - c, err := semver.NewConstraint(p.ShootVersionConstraint) - if err != nil { - panic(fmt.Sprintf("Error parsing Pod Version constraint for pod %v: %v", *p, err)) - } - v, err := semver.NewVersion(shoot.Spec.Kubernetes.Version) - if err != nil { - panic(fmt.Sprintf("Error parsing version %v", err)) - } - return c.Check(v) -} - -// CheckSeedCluster checks if Seed cluster is matched by ShootVersionConstraint. -func (p *Pod) CheckSeedCluster(provider string) bool { - return p.SeedClusterConstraints.Len() == 0 || p.SeedClusterConstraints.Has(string(provider)) -} - -// Selector returns label selector for specific pod. -func (p *Pod) Selector() labels.Selector { - return labels.SelectorFromSet(p.Labels) -} - -// AsTargetPods returns a list of TargetPods for each Port. -// Returned slice is not deep copied! -func (s *SourcePod) AsTargetPods() []*TargetPod { - - targetPods := []*TargetPod{} - - // Create a dummy port for testing - if len(s.Ports) == 0 { - targetPods = append(targetPods, s.DummyPort()) - } - for _, port := range s.Ports { - targetPods = append(targetPods, &TargetPod{ - Pod: s.Pod, - Port: port, - }) - } - return targetPods -} - -// FromPort returns a TargetPod containing only one specific port. -// This resource is not deep copied! -func (s *SourcePod) FromPort(portName string) *TargetPod { - for _, port := range s.Ports { - if port.Name == portName { - return &TargetPod{ - Pod: s.Pod, - Port: port, - } - } - } - panic(fmt.Sprintf("Port named %q not found", portName)) -} - -// DummyPort returns a TargetPod containing only one 8080 port. -// This resource is not deep copied! -func (s *SourcePod) DummyPort() *TargetPod { - if len(s.Ports) > 0 { - panic("DummyPort should only be used for Pods without a Port") - } - return &TargetPod{ - Pod: s.Pod, - Port: Port{Port: 8080, Name: "dummy"}, - } -} - -// NamespacedSourcePod holds namespaced PodInfo. -type NamespacedSourcePod struct { - *SourcePod - Namespace string -} - -// NewNamespacedSourcePod creates a new NamespacedSourcePod. -func NewNamespacedSourcePod(sp *SourcePod, namespace string) *NamespacedSourcePod { - return &NamespacedSourcePod{SourcePod: sp, Namespace: namespace} -} - -// NamespacedTargetPod holds namespaced TargetPod. -type NamespacedTargetPod struct { - *TargetPod - Namespace string -} - -// NewNamespacedTargetPod creates a new NamespacedTargetPod. -func NewNamespacedTargetPod(tp *TargetPod, namespace string) *NamespacedTargetPod { - return &NamespacedTargetPod{TargetPod: tp, Namespace: namespace} -} diff --git a/vendor/github.com/gardener/gardener/extensions/test/integration/healthcheck/healthcheck_operation.go b/vendor/github.com/gardener/gardener/extensions/test/integration/healthcheck/healthcheck_operation.go index 029f7fc1e..e7c19ca7d 100644 --- a/vendor/github.com/gardener/gardener/extensions/test/integration/healthcheck/healthcheck_operation.go +++ b/vendor/github.com/gardener/gardener/extensions/test/integration/healthcheck/healthcheck_operation.go @@ -19,25 +19,25 @@ import ( "fmt" "time" - extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" - "github.com/gardener/gardener/extensions/pkg/controller/healthcheck" - "github.com/gardener/gardener/extensions/test/integration/operation" - "k8s.io/utils/pointer" - resourcev1alpha1 "github.com/gardener/gardener-resource-manager/api/resources/v1alpha1" resourcev1alpha1helper "github.com/gardener/gardener-resource-manager/api/resources/v1alpha1/helper" - gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - kutil "github.com/gardener/gardener/pkg/utils/kubernetes" - "github.com/gardener/gardener/test/framework" machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" + "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" + + extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" + "github.com/gardener/gardener/extensions/pkg/controller/healthcheck" + "github.com/gardener/gardener/extensions/test/integration/operation" + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + kutil "github.com/gardener/gardener/pkg/utils/kubernetes" + "github.com/gardener/gardener/test/framework" ) // ControlPlaneHealthCheckWithManagedResource is a convenience function to tests that an unhealthy condition in a given ManagedResource leads to an unhealthy health check condition in the given ControlPlane CRD. @@ -108,8 +108,13 @@ func TestHealthCheckWithManagedResource(ctx context.Context, timeout time.Durati var ( err error resourceManagerDeploymentReplicasBeforeScaledown *int32 + + cancel context.CancelFunc ) - resourceManagerDeploymentReplicasBeforeScaledown, err = operation.ScaleGardenerResourceManager(timeout, f.ShootSeedNamespace(), f.SeedClient.Client(), pointer.Int32(0)) + ctx, cancel = context.WithTimeout(ctx, timeout) + defer cancel() + + resourceManagerDeploymentReplicasBeforeScaledown, err = operation.ScaleGardenerResourceManager(ctx, f.ShootSeedNamespace(), f.SeedClient.Client(), pointer.Int32(0)) if err != nil { return err } @@ -117,7 +122,7 @@ func TestHealthCheckWithManagedResource(ctx context.Context, timeout time.Durati defer func() { f.Logger.Infof("Cleanup: scaling resource manager to %d replicas again", int(*resourceManagerDeploymentReplicasBeforeScaledown)) // scale up again - _, err = operation.ScaleGardenerResourceManager(timeout, f.ShootSeedNamespace(), f.SeedClient.Client(), resourceManagerDeploymentReplicasBeforeScaledown) + _, err = operation.ScaleGardenerResourceManager(ctx, f.ShootSeedNamespace(), f.SeedClient.Client(), resourceManagerDeploymentReplicasBeforeScaledown) framework.ExpectNoError(err) // wait until healthy again @@ -153,10 +158,12 @@ func TestHealthCheckWithManagedResource(ctx context.Context, timeout time.Durati }, healthConditionType, gardencorev1beta1.ConditionFalse, healthcheck.ReasonUnsuccessful) } +// ControlPlaneHealthCheckDeleteSeedDeployment is a convenience function to delete the given deployment and check the control plane resource condition. func ControlPlaneHealthCheckDeleteSeedDeployment(ctx context.Context, f *framework.ShootFramework, controlPlaneName, deploymentName string, healthConditionType gardencorev1beta1.ConditionType) error { return deleteSeedDeploymentCheck(ctx, f, extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.ControlPlaneResource), controlPlaneName, deploymentName, healthConditionType) } +// WorkerHealthCheckDeleteSeedDeployment is a convenience function to delete the given deployment and check the worker resource condition. func WorkerHealthCheckDeleteSeedDeployment(ctx context.Context, f *framework.ShootFramework, controlPlaneName, deploymentName string, healthConditionType gardencorev1beta1.ConditionType) error { return deleteSeedDeploymentCheck(ctx, f, extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.WorkerResource), controlPlaneName, deploymentName, healthConditionType) } @@ -188,6 +195,7 @@ func deleteSeedDeploymentCheck(ctx context.Context, f *framework.ShootFramework, }, healthConditionType, gardencorev1beta1.ConditionUnknown, gardencorev1beta1.ConditionCheckError) } +// MachineDeletionHealthCheck is a convenience function to delete the first machine and check the worker resource condition. func MachineDeletionHealthCheck(ctx context.Context, f *framework.ShootFramework) error { var err error machineList := machinev1alpha1.MachineList{} diff --git a/vendor/github.com/gardener/gardener/extensions/test/integration/operation/shoot_operation.go b/vendor/github.com/gardener/gardener/extensions/test/integration/operation/shoot_operation.go index eeaaeea95..b70f77c85 100644 --- a/vendor/github.com/gardener/gardener/extensions/test/integration/operation/shoot_operation.go +++ b/vendor/github.com/gardener/gardener/extensions/test/integration/operation/shoot_operation.go @@ -19,16 +19,17 @@ import ( "fmt" "time" - "github.com/gardener/gardener/pkg/api/extensions" - gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - "github.com/gardener/gardener/pkg/utils/retry" - "github.com/gardener/gardener/test/framework" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/gardener/gardener/pkg/api/extensions" + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" + "github.com/gardener/gardener/pkg/utils/retry" + "github.com/gardener/gardener/test/framework" ) // WaitForExtensionCondition waits for the extension to contain the condition type, status and reason @@ -60,6 +61,6 @@ func WaitForExtensionCondition(ctx context.Context, logger *logrus.Logger, seedC } // ScaleGardenerResourceManager scales the gardener-resource-manager to the desired replicas -func ScaleGardenerResourceManager(setupContextTimeout time.Duration, namespace string, client client.Client, desiredReplicas *int32) (*int32, error) { - return framework.ScaleDeployment(setupContextTimeout, client, desiredReplicas, v1beta1constants.DeploymentNameGardenerResourceManager, namespace) +func ScaleGardenerResourceManager(ctx context.Context, namespace string, client client.Client, desiredReplicas *int32) (*int32, error) { + return framework.ScaleDeployment(ctx, client, desiredReplicas, v1beta1constants.DeploymentNameGardenerResourceManager, namespace) } diff --git a/vendor/github.com/gardener/gardener/hack/update-codegen.sh b/vendor/github.com/gardener/gardener/hack/update-codegen.sh index 9c9a26b0e..2a7b42add 100755 --- a/vendor/github.com/gardener/gardener/hack/update-codegen.sh +++ b/vendor/github.com/gardener/gardener/hack/update-codegen.sh @@ -246,7 +246,7 @@ gardenlet_groups() { } export -f gardenlet_groups -# Componentconfig for landscaper-gardenlet +# Componentconfig for the gardenlet landscaper component landscapergardenlet_groups() { echo "Generating API groups for landscaper/gardenlet/pkg/apis/imports" @@ -270,6 +270,30 @@ landscapergardenlet_groups() { } export -f landscapergardenlet_groups +# Componentconfig for control plane landscaper component + +landscapercontrolplane_groups() { + echo "Generating API groups for landscaper/controlplane/pkg/apis/imports" + + bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ + deepcopy,defaulter \ + github.com/gardener/gardener/pkg/client/componentconfig \ + github.com/gardener/gardener/landscaper/pkg/controlplane/apis \ + github.com/gardener/gardener/landscaper/pkg/controlplane/apis \ + "imports:v1alpha1" \ + -h "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt" + + bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \ + conversion \ + github.com/gardener/gardener/pkg/client/componentconfig \ + github.com/gardener/gardener/landscaper/pkg/controlplane/apis \ + github.com/gardener/gardener/landscaper/pkg/controlplane/apis \ + "imports:v1alpha1" \ + --extra-peer-dirs=k8s.io/apiserver/pkg/apis/apiserver/v1,k8s.io/apiserver/pkg/apis/audit/v1,k8s.io/apiserver/pkg/apis/config/v1,github.com/gardener/hvpa-controller/api/v1alpha1,github.com/gardener/landscaper/apis/core/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \ + -h "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt" +} +export -f landscapercontrolplane_groups + # Componentconfig for admission plugins shoottolerationrestriction_groups() { @@ -340,6 +364,7 @@ if [[ $# -gt 0 && "$1" == "--parallel" ]]; then gardenlet_groups \ shoottolerationrestriction_groups \ landscapergardenlet_groups + landscapercontrolplane_groups else authentication_groups core_groups @@ -353,6 +378,7 @@ else gardenlet_groups shoottolerationrestriction_groups landscapergardenlet_groups + landscapercontrolplane_groups fi openapi_definitions "$@" diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/helper/helpers.go b/vendor/github.com/gardener/gardener/pkg/apis/core/helper/helpers.go index 8e6a7c56c..aed056178 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/helper/helpers.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/helper/helpers.go @@ -26,6 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/utils/pointer" ) // GetConditionIndex returns the index of the condition with the given out of the list of . @@ -369,3 +370,25 @@ func ConvertSeedExternal(obj runtime.Object) (*gardencorev1beta1.Seed, error) { } return result, nil } + +// CalculateSeedUsage returns a map representing the number of shoots per seed from the given list of shoots. +// It takes both spec.seedName and status.seedName into account. +func CalculateSeedUsage(shootList []*core.Shoot) map[string]int { + m := map[string]int{} + + for _, shoot := range shootList { + var ( + specSeed = pointer.StringDeref(shoot.Spec.SeedName, "") + statusSeed = pointer.StringDeref(shoot.Status.SeedName, "") + ) + + if specSeed != "" { + m[specSeed]++ + } + if statusSeed != "" && specSeed != statusSeed { + m[statusSeed]++ + } + } + + return m +} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/types_quota.go b/vendor/github.com/gardener/gardener/pkg/apis/core/types_quota.go index bf9e0a976..5080e1252 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/types_quota.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/types_quota.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Quota represents a quota on resources consumed by shoot clusters either per project or per provider secret. type Quota struct { metav1.TypeMeta // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/types_secretbinding.go b/vendor/github.com/gardener/gardener/pkg/apis/core/types_secretbinding.go index 9732d385a..cb66ce201 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/types_secretbinding.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/types_secretbinding.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// SecretBinding represents a binding to a secret in the same or another namespace. type SecretBinding struct { metav1.TypeMeta // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/types_shoot.go b/vendor/github.com/gardener/gardener/pkg/apis/core/types_shoot.go index 9c6917598..608573911 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/types_shoot.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/types_shoot.go @@ -29,6 +29,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Shoot represents a Shoot cluster created and managed by Gardener. type Shoot struct { metav1.TypeMeta // Standard object metadata. @@ -225,10 +226,11 @@ type DNSProvider struct { Zones *DNSIncludeExclude } +// DNSIncludeExclude contains information about which domains shall be included/excluded. type DNSIncludeExclude struct { - // Include is a list of resources that shall be included. + // Include is a list of domains that shall be included. Include []string - // Exclude is a list of resources that shall be excluded. + // Exclude is a list of domains that shall be excluded. Exclude []string } @@ -934,8 +936,10 @@ type CRI struct { type CRIName string const ( + // CRINameContainerD is a constant for ContainerD CRI name. CRINameContainerD CRIName = "containerd" - CRINameDocker CRIName = "docker" + // CRINameDocker is a constant for Docker CRI name. + CRINameDocker CRIName = "docker" ) // ContainerRuntime contains information about worker's available container runtime diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/conversions.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/conversions.go index 48dce7b58..07a81b1c9 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/conversions.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/conversions.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//nolint:revive package v1alpha1 import ( diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/generated.proto b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/generated.proto index e53f6afcf..02adbb63f 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/generated.proto +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/generated.proto @@ -558,12 +558,13 @@ message DNS { repeated DNSProvider providers = 2; } +// DNSIncludeExclude contains information about which domains shall be included/excluded. message DNSIncludeExclude { - // Include is a list of resources that shall be included. + // Include is a list of domains that shall be included. // +optional repeated string include = 1; - // Exclude is a list of resources that shall be excluded. + // Exclude is a list of domains that shall be excluded. // +optional repeated string exclude = 2; } @@ -1489,6 +1490,7 @@ message OpenIDConnectClientAuthentication { optional string secret = 2; } +// Plant represents an external kubernetes cluster. message Plant { // Standard object metadata. // +optional @@ -1683,6 +1685,7 @@ message Provider { repeated Worker workers = 4; } +// Quota represents a quota on resources consumed by shoot clusters either per project or per provider secret. message Quota { // Standard object metadata. // +optional @@ -1757,6 +1760,7 @@ message ResourceWatchCacheSize { optional int32 size = 3; } +// SecretBinding represents a binding to a secret in the same or another namespace. message SecretBinding { // Standard object metadata. // +optional @@ -2071,6 +2075,7 @@ message ServiceAccountConfig { optional k8s.io.api.core.v1.LocalObjectReference signingKeySecretName = 2; } +// Shoot represents a Shoot cluster created and managed by Gardener. message Shoot { // Standard object metadata. // +optional diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/helper/helper.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/helper/helper.go index 457869af3..49ba49a83 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/helper/helper.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/helper/helper.go @@ -204,6 +204,7 @@ func TaintsHave(taints []gardencorev1alpha1.SeedTaint, key string) bool { return false } +// ShootedSeed contains the configuration of a shooted seed. type ShootedSeed struct { DisableDNS *bool DisableCapacityReservation *bool @@ -219,11 +220,13 @@ type ShootedSeed struct { WithSecretRef bool } +// ShootedSeedAPIServer contains the configuration of a shooted seed API server. type ShootedSeedAPIServer struct { Replicas *int32 Autoscaler *ShootedSeedAPIServerAutoscaler } +// ShootedSeedAPIServerAutoscaler contains the configuration of a shooted seed API server autoscaler. type ShootedSeedAPIServerAutoscaler struct { MinReplicas *int32 MaxReplicas int32 diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_plant.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_plant.go index 26d891e28..fcaeb9153 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_plant.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_plant.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Plant represents an external kubernetes cluster. type Plant struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_quota.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_quota.go index 07269b294..646fd19ee 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_quota.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_quota.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Quota represents a quota on resources consumed by shoot clusters either per project or per provider secret. type Quota struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_secretbinding.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_secretbinding.go index a391b5cba..8528c6c83 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_secretbinding.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_secretbinding.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// SecretBinding represents a binding to a secret in the same or another namespace. type SecretBinding struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_shoot.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_shoot.go index a2dfa1297..90d74e7c1 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_shoot.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1alpha1/types_shoot.go @@ -30,6 +30,7 @@ import ( // +genclient:method=CreateAdminKubeconfigRequest,verb=create,subresource=adminkubeconfig,input=github.com/gardener/gardener/pkg/apis/authentication/v1alpha1.AdminKubeconfigRequest,result=github.com/gardener/gardener/pkg/apis/authentication/v1alpha1.AdminKubeconfigRequest // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Shoot represents a Shoot cluster created and managed by Gardener. type Shoot struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. @@ -263,11 +264,12 @@ type DNSProvider struct { Zones *DNSIncludeExclude `json:"zones,omitempty" protobuf:"bytes,5,opt,name=zones"` } +// DNSIncludeExclude contains information about which domains shall be included/excluded. type DNSIncludeExclude struct { - // Include is a list of resources that shall be included. + // Include is a list of domains that shall be included. // +optional Include []string `json:"include,omitempty" protobuf:"bytes,1,rep,name=include"` - // Exclude is a list of resources that shall be excluded. + // Exclude is a list of domains that shall be excluded. // +optional Exclude []string `json:"exclude,omitempty" protobuf:"bytes,2,rep,name=exclude"` } @@ -1164,8 +1166,10 @@ type CRI struct { type CRIName string const ( + // CRINameContainerD is a constant for ContainerD CRI name. CRINameContainerD CRIName = "containerd" - CRINameDocker CRIName = "docker" + // CRINameDocker is a constant for Docker CRI name. + CRINameDocker CRIName = "docker" ) // ContainerRuntime contains information about worker's available container runtime diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go index 9fd324859..66cf9a03a 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/constants/types_constants.go @@ -309,6 +309,8 @@ const ( LabelNetworkPolicyFromPrometheus = "networking.gardener.cloud/from-prometheus" // LabelNetworkPolicyToAggregatePrometheus allows Egress traffic to the aggregate Prometheus. LabelNetworkPolicyToAggregatePrometheus = "networking.gardener.cloud/to-aggregate-prometheus" + // LabelNetworkPolicyToSeedPrometheus allows Egress traffic to the seed Prometheus. + LabelNetworkPolicyToSeedPrometheus = "networking.gardener.cloud/to-seed-prometheus" // LabelNetworkPolicyShootFromSeed allows Ingress traffic from the seed cluster (where the shoot's kube-apiserver // runs). LabelNetworkPolicyShootFromSeed = "networking.gardener.cloud/from-seed" diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/conversions.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/conversions.go index 621ae3f21..9db970b7a 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/conversions.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/conversions.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//nolint:revive package v1beta1 import ( diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/generated.proto b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/generated.proto index 50174abb9..56c207ef2 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/generated.proto +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/generated.proto @@ -559,12 +559,13 @@ message DNS { repeated DNSProvider providers = 2; } +// DNSIncludeExclude contains information about which domains shall be included/excluded. message DNSIncludeExclude { - // Include is a list of resources that shall be included. + // Include is a list of domains that shall be included. // +optional repeated string include = 1; - // Exclude is a list of resources that shall be excluded. + // Exclude is a list of domains that shall be excluded. // +optional repeated string exclude = 2; } @@ -1401,6 +1402,7 @@ message OpenIDConnectClientAuthentication { optional string secret = 2; } +// Plant represents an external kubernetes cluster. message Plant { // Standard object metadata. // +optional @@ -1595,6 +1597,7 @@ message Provider { repeated Worker workers = 4; } +// Quota represents a quota on resources consumed by shoot clusters either per project or per provider secret. message Quota { // Standard object metadata. // +optional @@ -1661,6 +1664,7 @@ message ResourceWatchCacheSize { optional int32 size = 3; } +// SecretBinding represents a binding to a secret in the same or another namespace. message SecretBinding { // Standard object metadata. // +optional @@ -1995,6 +1999,7 @@ message ServiceAccountConfig { optional k8s.io.api.core.v1.LocalObjectReference signingKeySecretName = 2; } +// Shoot represents a Shoot cluster created and managed by Gardener. message Shoot { // Standard object metadata. // +optional diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go index f77fe945c..b8fb979cb 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/helper/helper.go @@ -249,6 +249,7 @@ func TaintsAreTolerated(taints []gardencorev1beta1.SeedTaint, tolerations []gard return true } +// ShootedSeed contains the configuration of a shooted seed. type ShootedSeed struct { DisableDNS *bool DisableCapacityReservation *bool @@ -269,16 +270,19 @@ type ShootedSeed struct { Resources *ShootedSeedResources } +// ShootedSeedAPIServer contains the configuration of a shooted seed API server. type ShootedSeedAPIServer struct { Replicas *int32 Autoscaler *ShootedSeedAPIServerAutoscaler } +// ShootedSeedAPIServerAutoscaler contains the configuration of a shooted seed API server autoscaler. type ShootedSeedAPIServerAutoscaler struct { MinReplicas *int32 MaxReplicas int32 } +// ShootedSeedResources contains the resources capacity and reserved values of a shooted seed. type ShootedSeedResources struct { Capacity corev1.ResourceList Reserved corev1.ResourceList @@ -1016,6 +1020,7 @@ func FindPrimaryDNSProvider(providers []gardencorev1beta1.DNSProvider) *gardenco return nil } +// VersionPredicate is a function that evaluates a condition on the given versions. type VersionPredicate func(expirableVersion gardencorev1beta1.ExpirableVersion, version *semver.Version) (bool, error) // GetKubernetesVersionForPatchUpdate finds the latest Kubernetes patch version for its minor version in the compared @@ -1380,3 +1385,25 @@ func ShootWantsAnonymousAuthentication(kubeAPIServerConfig *gardencorev1beta1.Ku } return *kubeAPIServerConfig.EnableAnonymousAuthentication } + +// CalculateSeedUsage returns a map representing the number of shoots per seed from the given list of shoots. +// It takes both spec.seedName and status.seedName into account. +func CalculateSeedUsage(shootList []gardencorev1beta1.Shoot) map[string]int { + m := map[string]int{} + + for _, shoot := range shootList { + var ( + specSeed = pointer.StringDeref(shoot.Spec.SeedName, "") + statusSeed = pointer.StringDeref(shoot.Status.SeedName, "") + ) + + if specSeed != "" { + m[specSeed]++ + } + if statusSeed != "" && specSeed != statusSeed { + m[statusSeed]++ + } + } + + return m +} diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_plant.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_plant.go index 5177be625..5f96bd52c 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_plant.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_plant.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Plant represents an external kubernetes cluster. type Plant struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_quota.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_quota.go index 9803cb944..340bf33d9 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_quota.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_quota.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Quota represents a quota on resources consumed by shoot clusters either per project or per provider secret. type Quota struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_secretbinding.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_secretbinding.go index 5aa8bb22d..bba134e5b 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_secretbinding.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_secretbinding.go @@ -22,6 +22,7 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// SecretBinding represents a binding to a secret in the same or another namespace. type SecretBinding struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_shoot.go b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_shoot.go index 5a788e436..307d1f41b 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_shoot.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/v1beta1/types_shoot.go @@ -30,6 +30,7 @@ import ( // +genclient:method=CreateAdminKubeconfigRequest,verb=create,subresource=adminkubeconfig,input=github.com/gardener/gardener/pkg/apis/authentication/v1alpha1.AdminKubeconfigRequest,result=github.com/gardener/gardener/pkg/apis/authentication/v1alpha1.AdminKubeconfigRequest // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Shoot represents a Shoot cluster created and managed by Gardener. type Shoot struct { metav1.TypeMeta `json:",inline"` // Standard object metadata. @@ -275,11 +276,12 @@ type DNSProvider struct { Zones *DNSIncludeExclude `json:"zones,omitempty" protobuf:"bytes,5,opt,name=zones"` } +// DNSIncludeExclude contains information about which domains shall be included/excluded. type DNSIncludeExclude struct { - // Include is a list of resources that shall be included. + // Include is a list of domains that shall be included. // +optional Include []string `json:"include,omitempty" protobuf:"bytes,1,rep,name=include"` - // Exclude is a list of resources that shall be excluded. + // Exclude is a list of domains that shall be excluded. // +optional Exclude []string `json:"exclude,omitempty" protobuf:"bytes,2,rep,name=exclude"` } @@ -1176,8 +1178,10 @@ type CRI struct { type CRIName string const ( + // CRINameContainerD is a constant for ContainerD CRI name. CRINameContainerD CRIName = "containerd" - CRINameDocker CRIName = "docker" + // CRINameDocker is a constant for Docker CRI name. + CRINameDocker CRIName = "docker" ) // ContainerRuntime contains information about worker's available container runtime diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/cloudprofile.go b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/cloudprofile.go index 9f2213cbb..a7098c706 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/cloudprofile.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/cloudprofile.go @@ -239,9 +239,9 @@ func validateMachineTypes(machineTypes []core.MachineType, fldPath *field.Path) } names[machineType.Name] = struct{}{} - allErrs = append(allErrs, validateResourceQuantityValue("cpu", machineType.CPU, cpuPath)...) - allErrs = append(allErrs, validateResourceQuantityValue("gpu", machineType.GPU, gpuPath)...) - allErrs = append(allErrs, validateResourceQuantityValue("memory", machineType.Memory, memoryPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue("cpu", machineType.CPU, cpuPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue("gpu", machineType.GPU, gpuPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue("memory", machineType.Memory, memoryPath)...) if machineType.Storage != nil { allErrs = append(allErrs, validateMachineTypeStorage(*machineType.Storage, idxPath.Child("storage"))...) @@ -265,11 +265,11 @@ func validateMachineTypeStorage(storage core.MachineTypeStorage, fldPath *field. } if storage.StorageSize != nil { - allErrs = append(allErrs, validateResourceQuantityValue("size", *storage.StorageSize, fldPath.Child("size"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("size", *storage.StorageSize, fldPath.Child("size"))...) } if storage.MinSize != nil { - allErrs = append(allErrs, validateResourceQuantityValue("minSize", *storage.MinSize, fldPath.Child("minSize"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("minSize", *storage.MinSize, fldPath.Child("minSize"))...) } return allErrs @@ -386,7 +386,7 @@ func validateVolumeTypes(volumeTypes []core.VolumeType, fldPath *field.Path) fie } if volumeType.MinSize != nil { - allErrs = append(allErrs, validateResourceQuantityValue("minSize", *volumeType.MinSize, idxPath.Child("minSize"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("minSize", *volumeType.MinSize, idxPath.Child("minSize"))...) } } diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/quota.go b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/quota.go index 6805d2b69..2a28a2f39 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/quota.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/quota.go @@ -66,7 +66,7 @@ func ValidateQuotaSpec(quotaSpec *core.QuotaSpec, fldPath *field.Path) field.Err if !isValidQuotaMetric(corev1.ResourceName(k)) { allErrs = append(allErrs, field.Invalid(keyPath, v.String(), fmt.Sprintf("%s is no supported quota metric", string(k)))) } - allErrs = append(allErrs, validateResourceQuantityValue(string(k), v, keyPath)...) + allErrs = append(allErrs, ValidateResourceQuantityValue(string(k), v, keyPath)...) } return allErrs @@ -86,8 +86,8 @@ func isValidQuotaMetric(metric corev1.ResourceName) bool { return false } -// validateResourceQuantityValue validates the value of a resource quantity. -func validateResourceQuantityValue(key string, value resource.Quantity, fldPath *field.Path) field.ErrorList { +// ValidateResourceQuantityValue validates the value of a resource quantity. +func ValidateResourceQuantityValue(key string, value resource.Quantity, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if value.Cmp(resource.Quantity{}) < 0 { diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/seed.go b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/seed.go index acdcdacaf..9765c2f80 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/seed.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/seed.go @@ -148,7 +148,7 @@ func ValidateSeedSpec(seedSpec *core.SeedSpec, fldPath *field.Path, inTemplate b if seedSpec.Volume != nil { if seedSpec.Volume.MinimumSize != nil { - allErrs = append(allErrs, validateResourceQuantityValue("minimumSize", *seedSpec.Volume.MinimumSize, fldPath.Child("volume", "minimumSize"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("minimumSize", *seedSpec.Volume.MinimumSize, fldPath.Child("volume", "minimumSize"))...) } volumeProviderPurposes := make(map[string]struct{}, len(seedSpec.Volume.Providers)) diff --git a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/shoot.go b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/shoot.go index 3e71744ea..e28cb2496 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/core/validation/shoot.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/core/validation/shoot.go @@ -1160,19 +1160,19 @@ func validateKubeletConfigEviction(eviction *core.KubeletConfigEviction, fldPath func validateKubeletConfigEvictionMinimumReclaim(eviction *core.KubeletConfigEvictionMinimumReclaim, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if eviction.MemoryAvailable != nil { - allErrs = append(allErrs, validateResourceQuantityValue("memoryAvailable", *eviction.MemoryAvailable, fldPath.Child("memoryAvailable"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("memoryAvailable", *eviction.MemoryAvailable, fldPath.Child("memoryAvailable"))...) } if eviction.ImageFSAvailable != nil { - allErrs = append(allErrs, validateResourceQuantityValue("imagefsAvailable", *eviction.ImageFSAvailable, fldPath.Child("imagefsAvailable"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("imagefsAvailable", *eviction.ImageFSAvailable, fldPath.Child("imagefsAvailable"))...) } if eviction.ImageFSInodesFree != nil { - allErrs = append(allErrs, validateResourceQuantityValue("imagefsInodesFree", *eviction.ImageFSInodesFree, fldPath.Child("imagefsInodesFree"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("imagefsInodesFree", *eviction.ImageFSInodesFree, fldPath.Child("imagefsInodesFree"))...) } if eviction.NodeFSAvailable != nil { - allErrs = append(allErrs, validateResourceQuantityValue("nodefsAvailable", *eviction.NodeFSAvailable, fldPath.Child("nodefsAvailable"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("nodefsAvailable", *eviction.NodeFSAvailable, fldPath.Child("nodefsAvailable"))...) } if eviction.ImageFSInodesFree != nil { - allErrs = append(allErrs, validateResourceQuantityValue("imagefsInodesFree", *eviction.ImageFSInodesFree, fldPath.Child("imagefsInodesFree"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("imagefsInodesFree", *eviction.ImageFSInodesFree, fldPath.Child("imagefsInodesFree"))...) } return allErrs } @@ -1190,16 +1190,16 @@ func validateKubeletConfigEvictionSoftGracePeriod(eviction *core.KubeletConfigEv func validateKubeletConfigReserved(reserved *core.KubeletConfigReserved, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if reserved.CPU != nil { - allErrs = append(allErrs, validateResourceQuantityValue("cpu", *reserved.CPU, fldPath.Child("cpu"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("cpu", *reserved.CPU, fldPath.Child("cpu"))...) } if reserved.Memory != nil { - allErrs = append(allErrs, validateResourceQuantityValue("memory", *reserved.Memory, fldPath.Child("memory"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("memory", *reserved.Memory, fldPath.Child("memory"))...) } if reserved.EphemeralStorage != nil { - allErrs = append(allErrs, validateResourceQuantityValue("ephemeralStorage", *reserved.EphemeralStorage, fldPath.Child("ephemeralStorage"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("ephemeralStorage", *reserved.EphemeralStorage, fldPath.Child("ephemeralStorage"))...) } if reserved.PID != nil { - allErrs = append(allErrs, validateResourceQuantityValue("pid", *reserved.PID, fldPath.Child("pid"))...) + allErrs = append(allErrs, ValidateResourceQuantityValue("pid", *reserved.PID, fldPath.Child("pid"))...) } return allErrs } @@ -1426,7 +1426,7 @@ func ValidateResourceQuantityOrPercent(valuePtr *string, fldPath *field.Path, ke value := *valuePtr // check for resource quantity if quantity, err := resource.ParseQuantity(value); err == nil { - if len(validateResourceQuantityValue(key, quantity, fldPath)) == 0 { + if len(ValidateResourceQuantityValue(key, quantity, fldPath)) == 0 { return allErrs } } diff --git a/vendor/github.com/gardener/gardener/pkg/apis/extensions/register.go b/vendor/github.com/gardener/gardener/pkg/apis/extensions/register.go index c074510b8..5a16fbd58 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/extensions/register.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/extensions/register.go @@ -15,5 +15,6 @@ package extensions const ( + // GroupName is the name of the extensions API group. GroupName = "extensions.gardener.cloud" ) diff --git a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper/helper.go b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper/helper.go index 42bd623c5..9df68bb07 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper/helper.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper/helper.go @@ -35,9 +35,8 @@ func ClusterAutoscalerRequired(pools []extensionsv1alpha1.WorkerPool) bool { func GetDNSRecordType(address string) extensionsv1alpha1.DNSRecordType { if ip := net.ParseIP(address); ip != nil && ip.To4() != nil { return extensionsv1alpha1.DNSRecordTypeA - } else { - return extensionsv1alpha1.DNSRecordTypeCNAME } + return extensionsv1alpha1.DNSRecordTypeCNAME } // GetDNSRecordTTL returns the value of the given ttl, or 120 if nil. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/register.go b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/register.go index ea56f57a8..517b89f05 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/register.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/register.go @@ -36,8 +36,10 @@ func Resource(resource string) schema.GroupResource { } var ( + // SchemeBuilder is a new Scheme Builder which registers our API. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme + // AddToScheme is a reference to the Scheme Builder's AddToScheme function. + AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to Scheme. diff --git a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_containerruntime.go b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_containerruntime.go index 7578e242b..b096f2eba 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_containerruntime.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_containerruntime.go @@ -79,6 +79,7 @@ type ContainerRuntimeSpec struct { DefaultSpec `json:",inline"` } +// ContainerRuntimeWorkerPool identifies a Shoot worker pool by its name and selector. type ContainerRuntimeWorkerPool struct { // Name specifies the name of the worker pool the container runtime should be available for. Name string `json:"name"` diff --git a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_operatingsystemconfig.go b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_operatingsystemconfig.go index 6865151ed..62b9f6de7 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_operatingsystemconfig.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/types_operatingsystemconfig.go @@ -191,14 +191,14 @@ type OperatingSystemConfigStatus struct { Units []string `json:"units,omitempty"` } -// CloudConfig is a structure for containing the generated output for the given operating system +// CloudConfig contains the generated output for the given operating system // config spec. It contains a reference to a secret as the result may contain confidential data. type CloudConfig struct { // SecretRef is a reference to a secret that contains the actual result of the generated cloud config. SecretRef corev1.SecretReference `json:"secretRef"` } -// OperatingSystemConfigPurpose is a string alias. +// OperatingSystemConfigPurpose is a string alias. type OperatingSystemConfigPurpose string const ( @@ -216,7 +216,7 @@ const ( OperatingSystemConfigSecretDataKey = "cloud_config" ) -// CRI config is a structure contains configurations of the CRI library +// CRIConfig contains configurations of the CRI library. type CRIConfig struct { // Name is a mandatory string containing the name of the CRI library. Supported values are `docker` and `containerd`. Name CRIName `json:"name"` diff --git a/vendor/github.com/gardener/gardener/pkg/apis/operations/v1alpha1/conversions.go b/vendor/github.com/gardener/gardener/pkg/apis/operations/v1alpha1/conversions.go index fd4f0f45b..ed901f302 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/operations/v1alpha1/conversions.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/operations/v1alpha1/conversions.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//nolint:revive package v1alpha1 import ( diff --git a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/conversions.go b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/conversions.go index adb330b79..cb84b5c79 100644 --- a/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/conversions.go +++ b/vendor/github.com/gardener/gardener/pkg/apis/seedmanagement/v1alpha1/conversions.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//nolint:revive package v1alpha1 import ( diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/cache/cache.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/cache/cache.go index 717bca579..c2c78be42 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/cache/cache.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/cache/cache.go @@ -93,6 +93,11 @@ func (c *aggregator) GetInformerForKind(ctx context.Context, gvk schema.GroupVer } func (c *aggregator) Start(ctx context.Context) error { + // NB: this function might leak goroutines, when the context for this aggregator cache is cancelled. + // There is no way of waiting for caches to stop, so there's no point in waiting for the following + // goroutines to finish, because there might still be goroutines running under the hood of caches. + // However, this is not problematic, as long as the aggregator cache is not in any client set, that might + // be invalidated during runtime. for gvk, cache := range c.gvkToCache { go func(gvk schema.GroupVersionKind, cache runtimecache.Cache) { err := cache.Start(ctx) diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/chartoptions.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/chartoptions.go index 438a1ca5d..729c8e921 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/chartoptions.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/chartoptions.go @@ -108,6 +108,7 @@ type DeleteOptions struct { // TolerateErrorFunc is a function for which err is tolerated. type TolerateErrorFunc func(err error) bool +// MutateDeleteOptions applies this configuration to the given delete options. func (t TolerateErrorFunc) MutateDeleteOptions(opts *DeleteOptions) { if opts.TolerateErrorFuncs == nil { opts.TolerateErrorFuncs = []TolerateErrorFunc{} @@ -116,6 +117,7 @@ func (t TolerateErrorFunc) MutateDeleteOptions(opts *DeleteOptions) { opts.TolerateErrorFuncs = append(opts.TolerateErrorFuncs, t) } +// MutateDeleteManifestOptions applies this configuration to the given delete manifest options. func (t TolerateErrorFunc) MutateDeleteManifestOptions(opts *DeleteManifestOptions) { if opts.TolerateErrorFuncs == nil { opts.TolerateErrorFuncs = []TolerateErrorFunc{} diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/manifestoptions.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/manifestoptions.go index 0dc9affd7..3e73cb742 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/manifestoptions.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/manifestoptions.go @@ -16,11 +16,11 @@ package kubernetes // DeleteManifestOption is some configuration that modifies options for a delete request. type DeleteManifestOption interface { - // MutateDeleteOptions applies this configuration to the given delete options. + // MutateDeleteManifestOptions applies this configuration to the given delete options. MutateDeleteManifestOptions(opts *DeleteManifestOptions) } -// DeleteOptions contains options for delete requests +// DeleteManifestOptions contains options for delete requests. type DeleteManifestOptions struct { // TolerateErrorFuncs are functions for which errors are tolerated. TolerateErrorFuncs []TolerateErrorFunc diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go index 80ec022c9..0be6c0c6c 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/mock/mocks.go @@ -111,20 +111,6 @@ func (mr *MockInterfaceMockRecorder) ChartRenderer() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChartRenderer", reflect.TypeOf((*MockInterface)(nil).ChartRenderer)) } -// CheckForwardPodPort mocks base method. -func (m *MockInterface) CheckForwardPodPort(arg0, arg1 string, arg2, arg3 int) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CheckForwardPodPort", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// CheckForwardPodPort indicates an expected call of CheckForwardPodPort. -func (mr *MockInterfaceMockRecorder) CheckForwardPodPort(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckForwardPodPort", reflect.TypeOf((*MockInterface)(nil).CheckForwardPodPort), arg0, arg1, arg2, arg3) -} - // Client mocks base method. func (m *MockInterface) Client() client.Client { m.ctrl.T.Helper() diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go index a08c23667..2f6e4d534 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/pods.go @@ -17,12 +17,10 @@ package kubernetes import ( "bytes" "context" - "errors" "fmt" "io" "net/http" "strings" - "time" "github.com/gardener/gardener/pkg/utils" @@ -103,57 +101,71 @@ func GetPodLogs(ctx context.Context, podInterface corev1client.PodInterface, nam return io.ReadAll(stream) } -// CheckForwardPodPort tries to forward the port of the pod with name in namespace to -// the port. If equals zero, a free port will be chosen randomly. -// It returns true if the port forward connection has been established successfully or false otherwise. -func (c *clientSet) CheckForwardPodPort(namespace, name string, local, remote int) error { - fw, stopChan, err := c.setupForwardPodPort(namespace, name, local, remote) - if err != nil { - return fmt.Errorf("could not setup pod port forwarding: %w", err) - } - - errChan := make(chan error) +// CheckForwardPodPort tries to open a portForward connection with the passed PortForwarder. +// It returns nil if the port forward connection has been established successfully or an error otherwise. +func CheckForwardPodPort(fw PortForwarder) error { + errChan := make(chan error, 1) go func() { errChan <- fw.ForwardPorts() }() - defer close(stopChan) select { - case err = <-errChan: + case err := <-errChan: return fmt.Errorf("error forwarding ports: %w", err) - case <-fw.Ready: + case <-fw.Ready(): return nil - case <-time.After(time.Second * 5): - return errors.New("port forward connection could not be established within five seconds") } } -func (c *clientSet) setupForwardPodPort(namespace, name string, local, remote int) (*portforward.PortForwarder, chan struct{}, error) { +// PortForwarder knows how to forward a port connection +// Ready channel is expected to be closed once the connection becomes ready +type PortForwarder interface { + ForwardPorts() error + Ready() chan struct{} +} + +// SetupPortForwarder sets up a PortForwarder which forwards the port of the pod with name in namespace +// to the port. If equals zero, a free port will be chosen randomly. +// When calling ForwardPorts on the returned PortForwarder, it will run until the given context is cancelled. +// Hence, the given context should carry a timeout and should be cancelled once the forwarding is no longer needed. +func SetupPortForwarder(ctx context.Context, config *rest.Config, namespace, name string, local, remote int) (PortForwarder, error) { var ( - stopChan = make(chan struct{}, 1) readyChan = make(chan struct{}, 1) out = io.Discard localPort int ) - u := c.kubernetes.CoreV1().RESTClient().Post().Resource("pods").Namespace(namespace).Name(name).SubResource("portforward").URL() + client, err := corev1client.NewForConfig(config) + if err != nil { + return nil, err + } - transport, upgrader, err := spdy.RoundTripperFor(c.config) + u := client.RESTClient().Post().Resource("pods").Namespace(namespace).Name(name).SubResource("portforward").URL() + + transport, upgrader, err := spdy.RoundTripperFor(config) if err != nil { - return nil, nil, err + return nil, err } dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", u) if local == 0 { localPort, err = utils.FindFreePort() if err != nil { - return nil, nil, err + return nil, err } } - fw, err := portforward.New(dialer, []string{fmt.Sprintf("%d:%d", localPort, remote)}, stopChan, readyChan, out, out) + fw, err := portforward.New(dialer, []string{fmt.Sprintf("%d:%d", localPort, remote)}, ctx.Done(), readyChan, out, out) if err != nil { - return nil, nil, err + return nil, err } - return fw, stopChan, nil + return portForwarder{fw}, nil +} + +type portForwarder struct { + *portforward.PortForwarder +} + +func (p portForwarder) Ready() chan struct{} { + return p.PortForwarder.Ready } diff --git a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go index 9007753ff..8be9b5872 100644 --- a/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go +++ b/vendor/github.com/gardener/gardener/pkg/client/kubernetes/types.go @@ -168,8 +168,6 @@ type Interface interface { Kubernetes() kubernetesclientset.Interface - CheckForwardPodPort(string, string, int, int) error - // Version returns the server version of the targeted Kubernetes cluster. Version() string // DiscoverVersion tries to retrieve the server version of the targeted Kubernetes cluster and updates the diff --git a/vendor/github.com/gardener/gardener/pkg/controllerutils/worker.go b/vendor/github.com/gardener/gardener/pkg/controllerutils/worker.go index 847982469..030f5b419 100644 --- a/vendor/github.com/gardener/gardener/pkg/controllerutils/worker.go +++ b/vendor/github.com/gardener/gardener/pkg/controllerutils/worker.go @@ -35,7 +35,7 @@ import ( // added to the wait group when started and marked done when finished. // The given context is injected into the `reconciler` if it implements `inject.Stoppable`. // Optionally passed inject functions are called with the `reconciler` but potentially returned errors are disregarded. -func CreateWorker(ctx context.Context, queue workqueue.RateLimitingInterface, resourceType string, reconciler reconcile.Reconciler, waitGroup *sync.WaitGroup, workerCh chan int, injectFn ...inject.Func) { +func CreateWorker(ctx context.Context, queue workqueue.RateLimitingInterface, resourceType string, reconciler reconcile.Reconciler, waitGroup *sync.WaitGroup, workerCh chan<- int, injectFn ...inject.Func) { fns := append(injectFn, func(i interface{}) error { _, err := inject.StopChannelInto(ctx.Done(), i) return err diff --git a/vendor/github.com/gardener/gardener/pkg/extensions/customresources.go b/vendor/github.com/gardener/gardener/pkg/extensions/customresources.go index 47d933591..e53661258 100644 --- a/vendor/github.com/gardener/gardener/pkg/extensions/customresources.go +++ b/vendor/github.com/gardener/gardener/pkg/extensions/customresources.go @@ -57,18 +57,7 @@ func WaitUntilExtensionObjectReady( timeout time.Duration, postReadyFunc func() error, ) error { - return WaitUntilObjectReadyWithHealthFunction( - ctx, - c, - logger, - health.CheckExtensionObject, - obj, - kind, - interval, - severeThreshold, - timeout, - postReadyFunc, - ) + return WaitUntilObjectReadyWithHealthFunction(ctx, c, logger, health.CheckExtensionObject, obj, kind, interval, severeThreshold, timeout, postReadyFunc) } // WaitUntilObjectReadyWithHealthFunction waits until the given object has become ready. It takes the health check @@ -168,7 +157,7 @@ func DeleteExtensionObject( return client.IgnoreNotFound(c.Delete(ctx, obj, deleteOpts...)) } -// DeleteExtensionObjects lists all extension objects and loops over them. It executes the given for +// DeleteExtensionObjects lists all extension objects and loops over them. It executes the given predicateFunc for // each of them, and if it evaluates to true then the object will be deleted. func DeleteExtensionObjects( ctx context.Context, @@ -179,12 +168,7 @@ func DeleteExtensionObjects( deleteOpts ...client.DeleteOption, ) error { fns, err := applyFuncToExtensionObjects(ctx, c, listObj, namespace, predicateFunc, func(ctx context.Context, obj extensionsv1alpha1.Object) error { - return DeleteExtensionObject( - ctx, - c, - obj, - deleteOpts..., - ) + return DeleteExtensionObject(ctx, c, obj, deleteOpts...) }) if err != nil { return err @@ -194,8 +178,9 @@ func DeleteExtensionObjects( } // WaitUntilExtensionObjectsDeleted lists all extension objects and loops over them. It executes the given -// for each of them, and if it evaluates to true and the object is already marked for deletion, -// then it waits for the object to be deleted. +// predicateFunc for each of them, and if it evaluates to true, then it waits for the object to be deleted. +// If the component needs to wait for a given subset of all extension objects to be deleted (e.g. after deleting +// unwanted objects), it should pass a predicateFunc that filters objects to wait for by name. func WaitUntilExtensionObjectsDeleted( ctx context.Context, c client.Client, @@ -207,32 +192,9 @@ func WaitUntilExtensionObjectsDeleted( timeout time.Duration, predicateFunc func(obj extensionsv1alpha1.Object) bool, ) error { - fns, err := applyFuncToExtensionObjects( - ctx, - c, - listObj, - namespace, - func(obj extensionsv1alpha1.Object) bool { - if obj.GetDeletionTimestamp() == nil { - return false - } - if predicateFunc != nil && !predicateFunc(obj) { - return false - } - return true - }, - func(ctx context.Context, obj extensionsv1alpha1.Object) error { - return WaitUntilExtensionObjectDeleted( - ctx, - c, - logger, - obj, - kind, - interval, - timeout, - ) - }, - ) + fns, err := applyFuncToExtensionObjects(ctx, c, listObj, namespace, predicateFunc, func(ctx context.Context, obj extensionsv1alpha1.Object) error { + return WaitUntilExtensionObjectDeleted(ctx, c, logger, obj, kind, interval, timeout) + }) if err != nil { return err } @@ -448,13 +410,7 @@ func WaitUntilExtensionObjectsMigrated( timeout time.Duration, ) error { fns, err := applyFuncToExtensionObjects(ctx, c, listObj, namespace, nil, func(ctx context.Context, obj extensionsv1alpha1.Object) error { - return WaitUntilExtensionObjectMigrated( - ctx, - c, - obj, - interval, - timeout, - ) + return WaitUntilExtensionObjectMigrated(ctx, c, obj, interval, timeout) }) if err != nil { return err diff --git a/vendor/github.com/gardener/gardener/pkg/features/features.go b/vendor/github.com/gardener/gardener/pkg/features/features.go index 8a5938065..8f835fb41 100644 --- a/vendor/github.com/gardener/gardener/pkg/features/features.go +++ b/vendor/github.com/gardener/gardener/pkg/features/features.go @@ -83,7 +83,7 @@ const ( // AdminKubeconfigRequest enables the AdminKubeconfigRequest endpoint on shoot resources. // owner: @mvladev - // alpha: v1.23.0 + // alpha: v1.24.0 AdminKubeconfigRequest featuregate.Feature = "AdminKubeconfigRequest" // UseDNSRecords enables using DNSRecords resources for Gardener DNS records instead of DNSProvider and DNSEntry resources. @@ -95,6 +95,7 @@ const ( // for shoots that are already in the deletion phase, i.e. `metadata.deletionTimestamp` is set // owner: @vpnachev // alpha: v1.28.0 + // beta: v1.32.0 DisallowKubeconfigRotationForShootInDeletion featuregate.Feature = "DisallowKubeconfigRotationForShootInDeletion" // RotateSSHKeypairOnMaintenance enables SSH keypair rotation in the maintenance controller of the gardener-controller-manager. diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go index fba24b9b2..8ecd5ef68 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/types.go @@ -53,7 +53,7 @@ type GardenletConfiguration struct { // Server defines the configuration of the HTTP server. Server *ServerConfiguration // Debugging holds configuration for Debugging related features. - Debugging componentbaseconfig.DebuggingConfiguration + Debugging *componentbaseconfig.DebuggingConfiguration // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental // features. This field modifies piecemeal the built-in default values from // "github.com/gardener/gardener/pkg/gardenlet/features/features.go". @@ -419,7 +419,7 @@ type ExposureClassHandler struct { SNI *SNI } -// LoadBalancerService contains configuration which is used to configure the underlying +// LoadBalancerServiceConfig contains configuration which is used to configure the underlying // load balancer to apply the control plane endpoint exposure strategy. type LoadBalancerServiceConfig struct { // Annotations is a key value map to annotate the underlying load balancer services. diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/conversions.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/conversions.go index a92b1dc10..fcd4a62ab 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/conversions.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/conversions.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//nolint:revive package v1alpha1 import ( diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go index 242889495..e35960fec 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/types.go @@ -64,7 +64,8 @@ type GardenletConfiguration struct { // +optional Server *ServerConfiguration `json:"server,omitempty"` // Debugging holds configuration for Debugging related features. - Debugging componentbaseconfigv1alpha1.DebuggingConfiguration `json:"debugging"` + // +optional + Debugging *componentbaseconfigv1alpha1.DebuggingConfiguration `json:"debugging,omitempty"` // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental // features. This field modifies piecemeal the built-in default values from // "github.com/gardener/gardener/pkg/gardenlet/features/features.go". @@ -499,7 +500,7 @@ type ExposureClassHandler struct { SNI *SNI `json:"sni,omitempty"` } -// LoadBalancerService contains configuration which is used to configure the underlying +// LoadBalancerServiceConfig contains configuration which is used to configure the underlying // load balancer to apply the control plane endpoint exposure strategy. type LoadBalancerServiceConfig struct { // Annotations is a key value map to annotate the underlying load balancer services. diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go index 851cdaa18..330f11c03 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.conversion.go @@ -30,6 +30,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" + componentbaseconfig "k8s.io/component-base/config" configv1alpha1 "k8s.io/component-base/config/v1alpha1" klog "k8s.io/klog" ) @@ -711,8 +712,14 @@ func autoConvert_v1alpha1_GardenletConfiguration_To_config_GardenletConfiguratio out.LogFormat = (*string)(unsafe.Pointer(in.LogFormat)) out.KubernetesLogLevel = (*klog.Level)(unsafe.Pointer(in.KubernetesLogLevel)) out.Server = (*config.ServerConfiguration)(unsafe.Pointer(in.Server)) - if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { - return err + if in.Debugging != nil { + in, out := &in.Debugging, &out.Debugging + *out = new(componentbaseconfig.DebuggingConfiguration) + if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(*in, *out, s); err != nil { + return err + } + } else { + out.Debugging = nil } out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if in.SeedConfig != nil { @@ -786,8 +793,14 @@ func autoConvert_config_GardenletConfiguration_To_v1alpha1_GardenletConfiguratio out.LogFormat = (*string)(unsafe.Pointer(in.LogFormat)) out.KubernetesLogLevel = (*klog.Level)(unsafe.Pointer(in.KubernetesLogLevel)) out.Server = (*ServerConfiguration)(unsafe.Pointer(in.Server)) - if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil { - return err + if in.Debugging != nil { + in, out := &in.Debugging, &out.Debugging + *out = new(configv1alpha1.DebuggingConfiguration) + if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(*in, *out, s); err != nil { + return err + } + } else { + out.Debugging = nil } out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if in.SeedConfig != nil { diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go index 101fb6104..71c4b0ef3 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -25,6 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" + configv1alpha1 "k8s.io/component-base/config/v1alpha1" klog "k8s.io/klog" ) @@ -351,7 +352,11 @@ func (in *GardenletConfiguration) DeepCopyInto(out *GardenletConfiguration) { *out = new(ServerConfiguration) (*in).DeepCopyInto(*out) } - in.Debugging.DeepCopyInto(&out.Debugging) + if in.Debugging != nil { + in, out := &in.Debugging, &out.Debugging + *out = new(configv1alpha1.DebuggingConfiguration) + (*in).DeepCopyInto(*out) + } if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates *out = make(map[string]bool, len(*in)) diff --git a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go index 72d68ff3e..28449b175 100644 --- a/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/gardener/pkg/gardenlet/apis/config/zz_generated.deepcopy.go @@ -25,6 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" + componentbaseconfig "k8s.io/component-base/config" klog "k8s.io/klog" ) @@ -351,7 +352,11 @@ func (in *GardenletConfiguration) DeepCopyInto(out *GardenletConfiguration) { *out = new(ServerConfiguration) (*in).DeepCopyInto(*out) } - out.Debugging = in.Debugging + if in.Debugging != nil { + in, out := &in.Debugging, &out.Debugging + *out = new(componentbaseconfig.DebuggingConfiguration) + **out = **in + } if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates *out = make(map[string]bool, len(*in)) diff --git a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/bootstrap.go b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/bootstrap.go deleted file mode 100644 index 2d5ce1d6e..000000000 --- a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/bootstrap.go +++ /dev/null @@ -1,785 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package etcd - -import ( - "context" - "fmt" - "time" - - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - "github.com/gardener/gardener/pkg/client/kubernetes" - "github.com/gardener/gardener/pkg/operation/botanist/component" - gutil "github.com/gardener/gardener/pkg/utils/gardener" - "github.com/gardener/gardener/pkg/utils/imagevector" - kutil "github.com/gardener/gardener/pkg/utils/kubernetes" - "github.com/gardener/gardener/pkg/utils/managedresources" - - druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1" - "github.com/gardener/gardener-resource-manager/pkg/controller/garbagecollector/references" - appsv1 "k8s.io/api/apps/v1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - coordinationv1 "k8s.io/api/coordination/v1" - corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - autoscalingv1beta2 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2" - "k8s.io/utils/pointer" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -const ( - // Druid is a constant for the name of the etcd-druid. - Druid = "etcd-druid" - - druidRBACName = "gardener.cloud:system:" + Druid - druidServiceAccountName = Druid - druidVPAName = Druid + "-vpa" - druidConfigMapImageVectorOverwriteNamePrefix = Druid + "-imagevector-overwrite" - druidDeploymentName = Druid - managedResourceControlName = Druid - - druidConfigMapImageVectorOverwriteDataKey = "images_overwrite.yaml" - druidDeploymentVolumeMountPathImageVectorOverwrite = "/charts_overwrite" - druidDeploymentVolumeNameImageVectorOverwrite = "imagevector-overwrite" -) - -// NewBootstrapper creates a new instance of DeployWaiter for the etcd bootstrapper. -func NewBootstrapper(c client.Client, namespace string, image string, imageVectorOverwrite *string) component.DeployWaiter { - return &bootstrapper{ - client: c, - namespace: namespace, - image: image, - imageVectorOverwrite: imageVectorOverwrite, - } -} - -type bootstrapper struct { - client client.Client - namespace string - image string - imageVectorOverwrite *string -} - -func (b *bootstrapper) Deploy(ctx context.Context) error { - var ( - registry = managedresources.NewRegistry(kubernetes.SeedScheme, kubernetes.SeedCodec, kubernetes.SeedSerializer) - labels = func() map[string]string { return map[string]string{v1beta1constants.GardenRole: Druid} } - - serviceAccount = &corev1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidServiceAccountName, - Namespace: b.namespace, - Labels: labels(), - }, - } - - clusterRole = &rbacv1.ClusterRole{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidRBACName, - Labels: labels(), - }, - Rules: []rbacv1.PolicyRule{ - { - APIGroups: []string{corev1.GroupName}, - Resources: []string{"pods"}, - Verbs: []string{"list", "watch", "delete"}, - }, - { - APIGroups: []string{corev1.GroupName}, - Resources: []string{"secrets", "endpoints"}, - Verbs: []string{"get", "list", "patch", "update", "watch"}, - }, - { - APIGroups: []string{corev1.GroupName}, - Resources: []string{"events"}, - Verbs: []string{"create", "get", "list", "watch", "patch", "update"}, - }, - { - APIGroups: []string{corev1.GroupName, appsv1.GroupName}, - Resources: []string{"services", "configmaps", "statefulsets"}, - Verbs: []string{"get", "list", "patch", "update", "watch", "create", "delete"}, - }, - { - APIGroups: []string{druidv1alpha1.GroupVersion.Group}, - Resources: []string{"etcds"}, - Verbs: []string{"get", "list", "watch", "update", "patch"}, - }, - { - APIGroups: []string{druidv1alpha1.GroupVersion.Group}, - Resources: []string{"etcds/status", "etcds/finalizers"}, - Verbs: []string{"get", "update", "patch", "create"}, - }, - { - APIGroups: []string{coordinationv1.GroupName}, - Resources: []string{"leases"}, - Verbs: []string{"create"}, - }, - { - APIGroups: []string{coordinationv1.GroupName}, - Resources: []string{"leases"}, - ResourceNames: []string{"druid-leader-election"}, - Verbs: []string{"get", "update", "patch"}, - }, - { - APIGroups: []string{corev1.GroupName}, - Resources: []string{"persistentvolumeclaims"}, - Verbs: []string{"get", "list", "watch"}, - }, - }, - } - - clusterRoleBinding = &rbacv1.ClusterRoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidRBACName, - Labels: labels(), - }, - RoleRef: rbacv1.RoleRef{ - APIGroup: rbacv1.GroupName, - Kind: "ClusterRole", - Name: druidRBACName, - }, - Subjects: []rbacv1.Subject{ - { - Kind: rbacv1.ServiceAccountKind, - Name: druidServiceAccountName, - Namespace: b.namespace, - }, - }, - } - - configMapImageVectorOverwrite = &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidConfigMapImageVectorOverwriteNamePrefix, - Namespace: b.namespace, - Labels: labels(), - }, - } - - vpaUpdateMode = autoscalingv1beta2.UpdateModeAuto - vpa = &autoscalingv1beta2.VerticalPodAutoscaler{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidVPAName, - Namespace: b.namespace, - Labels: labels(), - }, - Spec: autoscalingv1beta2.VerticalPodAutoscalerSpec{ - TargetRef: &autoscalingv1.CrossVersionObjectReference{ - APIVersion: appsv1.SchemeGroupVersion.String(), - Kind: "Deployment", - Name: druidDeploymentName, - }, - UpdatePolicy: &autoscalingv1beta2.PodUpdatePolicy{ - UpdateMode: &vpaUpdateMode, - }, - ResourcePolicy: &autoscalingv1beta2.PodResourcePolicy{ - ContainerPolicies: []autoscalingv1beta2.ContainerResourcePolicy{{ - ContainerName: autoscalingv1beta2.DefaultContainerResourcePolicy, - MinAllowed: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("50m"), - corev1.ResourceMemory: resource.MustParse("100M"), - }, - }}, - }, - }, - } - - deployment = &appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: druidDeploymentName, - Namespace: b.namespace, - Labels: labels(), - }, - Spec: appsv1.DeploymentSpec{ - Replicas: pointer.Int32(1), - RevisionHistoryLimit: pointer.Int32(1), - Selector: &metav1.LabelSelector{ - MatchLabels: labels(), - }, - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: labels(), - }, - Spec: corev1.PodSpec{ - ServiceAccountName: druidServiceAccountName, - Containers: []corev1.Container{ - { - Name: Druid, - Image: b.image, - ImagePullPolicy: corev1.PullIfNotPresent, - Command: []string{ - "/bin/etcd-druid", - "--enable-leader-election=true", - "--ignore-operation-annotation=false", - "--workers=50", - }, - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("50m"), - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("300m"), - corev1.ResourceMemory: resource.MustParse("512Mi"), - }, - }, - Ports: []corev1.ContainerPort{{ - ContainerPort: 9569, - }}, - }, - }, - }, - }, - }, - } - - resourcesToAdd = []client.Object{ - serviceAccount, - clusterRole, - clusterRoleBinding, - vpa, - } - ) - - if b.imageVectorOverwrite != nil { - configMapImageVectorOverwrite.Data = map[string]string{druidConfigMapImageVectorOverwriteDataKey: *b.imageVectorOverwrite} - utilruntime.Must(kutil.MakeUnique(configMapImageVectorOverwrite)) - resourcesToAdd = append(resourcesToAdd, configMapImageVectorOverwrite) - - deployment.Spec.Template.Spec.Volumes = append(deployment.Spec.Template.Spec.Volumes, corev1.Volume{ - Name: druidDeploymentVolumeNameImageVectorOverwrite, - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: configMapImageVectorOverwrite.Name, - }, - }, - }, - }) - deployment.Spec.Template.Spec.Containers[0].VolumeMounts = append(deployment.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{ - Name: druidDeploymentVolumeNameImageVectorOverwrite, - MountPath: druidDeploymentVolumeMountPathImageVectorOverwrite, - ReadOnly: true, - }) - deployment.Spec.Template.Spec.Containers[0].Env = append(deployment.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{ - Name: imagevector.OverrideEnv, - Value: druidDeploymentVolumeMountPathImageVectorOverwrite + "/" + druidConfigMapImageVectorOverwriteDataKey, - }) - - utilruntime.Must(references.InjectAnnotations(deployment)) - } - - resources, err := registry.AddAllAndSerialize(append(resourcesToAdd, deployment)...) - if err != nil { - return err - } - resources["crd.yaml"] = []byte(crdYAML) - - return managedresources.CreateForSeed(ctx, b.client, b.namespace, managedResourceControlName, false, resources) -} - -func (b *bootstrapper) Destroy(ctx context.Context) error { - etcdList := &druidv1alpha1.EtcdList{} - // Need to check for both error types. The DynamicRestMapper can hold a stale cache returning a path to a non-existing api-resource leading to a NotFound error. - if err := b.client.List(ctx, etcdList); err != nil && !meta.IsNoMatchError(err) && !apierrors.IsNotFound(err) { - return err - } - - if len(etcdList.Items) > 0 { - return fmt.Errorf("cannot debootstrap etcd-druid because there are still druidv1alpha1.Etcd resources left in the cluster") - } - - if err := gutil.ConfirmDeletion(ctx, b.client, &apiextensionsv1.CustomResourceDefinition{ObjectMeta: metav1.ObjectMeta{Name: crdName}}); client.IgnoreNotFound(err) != nil { - return err - } - - return managedresources.DeleteForSeed(ctx, b.client, b.namespace, managedResourceControlName) -} - -// TimeoutWaitForManagedResource is the timeout used while waiting for the ManagedResources to become healthy -// or deleted. -var TimeoutWaitForManagedResource = 2 * time.Minute - -func (b *bootstrapper) Wait(ctx context.Context) error { - timeoutCtx, cancel := context.WithTimeout(ctx, TimeoutWaitForManagedResource) - defer cancel() - - return managedresources.WaitUntilHealthy(timeoutCtx, b.client, b.namespace, managedResourceControlName) -} - -func (b *bootstrapper) WaitCleanup(ctx context.Context) error { - timeoutCtx, cancel := context.WithTimeout(ctx, TimeoutWaitForManagedResource) - defer cancel() - - return managedresources.WaitUntilDeleted(timeoutCtx, b.client, b.namespace, managedResourceControlName) -} - -const ( - crdName = "etcds.druid.gardener.cloud" - crdYAML = `apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: ` + crdName + ` - annotations: - controller-gen.kubebuilder.io/version: v0.4.1 - labels: - ` + gutil.DeletionProtected + `: "true" -spec: - group: druid.gardener.cloud - names: - kind: Etcd - listKind: EtcdList - plural: etcds - singular: etcd - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.ready - name: Ready - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: Etcd is the Schema for the etcds API - properties: - apiVersion: - 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/sig-architecture/api-conventions.md#resources' - type: string - kind: - 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/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: EtcdSpec defines the desired state of Etcd - properties: - annotations: - additionalProperties: - type: string - type: object - backup: - description: BackupSpec defines parametes associated with the full and delta snapshots of etcd - properties: - compression: - description: SnapshotCompression defines the specification for compression of Snapshots. - properties: - enabled: - type: boolean - policy: - description: CompressionPolicy defines the type of policy for compression of snapshots. - enum: - - gzip - - lzw - - zlib - type: string - type: object - deltaSnapshotMemoryLimit: - anyOf: - - type: integer - - type: string - description: DeltaSnapshotMemoryLimit defines the memory limit after which delta snapshots will be taken - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - deltaSnapshotPeriod: - description: DeltaSnapshotPeriod defines the period after which delta snapshots will be taken - type: string - fullSnapshotSchedule: - description: FullSnapshotSchedule defines the cron standard schedule for full snapshots. - type: string - garbageCollectionPeriod: - description: GarbageCollectionPeriod defines the period for garbage collecting old backups - type: string - garbageCollectionPolicy: - description: GarbageCollectionPolicy defines the policy for garbage collecting old backups - enum: - - Exponential - - LimitBased - type: string - image: - description: Image defines the etcd container image and tag - type: string - port: - description: Port define the port on which etcd-backup-restore server will exposed. - format: int32 - type: integer - resources: - description: 'Resources defines the compute Resources required by backup-restore container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - type: object - store: - description: Store defines the specification of object store provider for storing backups. - properties: - container: - type: string - prefix: - type: string - provider: - description: StorageProvider defines the type of object store provider for storing backups. - type: string - secretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - required: - - prefix - type: object - tls: - description: TLSConfig hold the TLS configuration details. - properties: - clientTLSSecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - serverTLSSecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - tlsCASecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - required: - - clientTLSSecretRef - - serverTLSSecretRef - - tlsCASecretRef - type: object - type: object - etcd: - description: EtcdConfig defines parameters associated etcd deployed - properties: - authSecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - clientPort: - format: int32 - type: integer - defragmentationSchedule: - description: DefragmentationSchedule defines the cron standard schedule for defragmentation of etcd. - type: string - image: - description: Image defines the etcd container image and tag - type: string - metrics: - description: Metrics defines the level of detail for exported metrics of etcd, specify 'extensive' to include histogram metrics. - enum: - - basic - - extensive - type: string - quota: - anyOf: - - type: integer - - type: string - description: Quota defines the etcd DB quota. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resources: - description: 'Resources defines the compute Resources required by etcd container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - type: object - serverPort: - format: int32 - type: integer - tls: - description: TLSConfig hold the TLS configuration details. - properties: - clientTLSSecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - serverTLSSecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - tlsCASecretRef: - description: SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret name must be unique. - type: string - type: object - required: - - clientTLSSecretRef - - serverTLSSecretRef - - tlsCASecretRef - type: object - type: object - labels: - additionalProperties: - type: string - type: object - priorityClassName: - description: PriorityClassName is the name of a priority class that shall be used for the etcd pods. - type: string - replicas: - type: integer - selector: - description: 'selector is a label query over pods that should match the replica count. It must match the pod template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - sharedConfig: - description: SharedConfig defines parameters shared and used by Etcd as well as backup-restore sidecar. - properties: - autoCompactionMode: - description: AutoCompactionMode defines the auto-compaction-mode:'periodic' mode or 'revision' mode for etcd and embedded-Etcd of backup-restore sidecar. - enum: - - periodic - - revision - type: string - autoCompactionRetention: - description: AutoCompactionRetention defines the auto-compaction-retention length for etcd as well as for embedded-Etcd of backup-restore sidecar. - type: string - type: object - storageCapacity: - anyOf: - - type: integer - - type: string - description: StorageCapacity defines the size of persistent volume. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - storageClass: - description: 'StorageClass defines the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' - type: string - volumeClaimTemplate: - description: VolumeClaimTemplate defines the volume claim template to be created - type: string - required: - - backup - - etcd - - labels - - replicas - - selector - type: object - status: - description: EtcdStatus defines the observed state of Etcd - properties: - conditions: - items: - description: Condition holds the information about the state of a resource. - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status to another. - format: date-time - type: string - lastUpdateTime: - description: Last time the condition was updated. - format: date-time - type: string - message: - description: A human readable message indicating details about the transition. - type: string - reason: - description: The reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of the Etcd condition. - type: string - type: object - type: array - currentReplicas: - format: int32 - type: integer - etcd: - description: CrossVersionObjectReference contains enough information to let you identify the referred resource. - properties: - apiVersion: - description: API version of the referent - type: string - kind: - description: Kind of the referent - type: string - name: - description: Name of the referent - type: string - type: object - labelSelector: - description: selector is a label query over pods that should match the replica count. It must match the pod template's labels. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - lastError: - type: string - observedGeneration: - description: ObservedGeneration is the most recent generation observed for this resource. - format: int64 - type: integer - ready: - type: boolean - readyReplicas: - format: int32 - type: integer - replicas: - format: int32 - type: integer - serviceName: - type: string - updatedReplicas: - format: int32 - type: integer - type: object - type: object - served: true - storage: true - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} -` -) diff --git a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/dependency_watchdog.go b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/dependency_watchdog.go deleted file mode 100644 index 6a7681417..000000000 --- a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/dependency_watchdog.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package etcd - -import ( - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - - restarterapi "github.com/gardener/dependency-watchdog/pkg/restarter/api" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DependencyWatchdogEndpointConfiguration returns the configuration for the dependency watchdog ensuring that its dependant -// pods are restarted as soon as it recovers from a crash loop. -func DependencyWatchdogEndpointConfiguration(role string) (map[string]restarterapi.Service, error) { - return map[string]restarterapi.Service{ - ServiceName(role): { - Dependants: []restarterapi.DependantPods{ - { - Name: v1beta1constants.GardenRoleControlPlane, - Selector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - { - Key: v1beta1constants.GardenRole, - Operator: metav1.LabelSelectorOpIn, - Values: []string{v1beta1constants.GardenRoleControlPlane}, - }, - { - Key: v1beta1constants.LabelRole, - Operator: metav1.LabelSelectorOpIn, - Values: []string{v1beta1constants.LabelAPIServer}, - }, - }, - }, - }, - }, - }, - }, nil -} diff --git a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/etcd.go b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/etcd.go deleted file mode 100644 index a84d5fd12..000000000 --- a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/etcd.go +++ /dev/null @@ -1,696 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package etcd - -import ( - "context" - "fmt" - "time" - - druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1" - hvpav1alpha1 "github.com/gardener/hvpa-controller/api/v1alpha1" - "github.com/sirupsen/logrus" - appsv1 "k8s.io/api/apps/v1" - autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" - corev1 "k8s.io/api/core/v1" - networkingv1 "k8s.io/api/networking/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/selection" - "k8s.io/apimachinery/pkg/util/intstr" - autoscalingv1beta2 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2" - "k8s.io/utils/pointer" - - gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" - "github.com/gardener/gardener/pkg/client/kubernetes" - "github.com/gardener/gardener/pkg/controllerutils" - "github.com/gardener/gardener/pkg/operation/botanist/component" - "github.com/gardener/gardener/pkg/operation/botanist/component/monitoring" - "github.com/gardener/gardener/pkg/utils" - kutil "github.com/gardener/gardener/pkg/utils/kubernetes" - - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// Class is a string type alias for etcd classes. -type Class string - -const ( - // ClassNormal is a constant for a normal etcd (without extensive metrics or higher resource settings, etc.) - ClassNormal Class = "normal" - // ClassImportant is a constant for an important etcd (with extensive metrics or higher resource settings, etc.). - // Such etcds are also unsafe to evict (from the PoV of the cluster-autoscaler when trying to scale down). - ClassImportant Class = "important" - - // SecretNameCA is the name of the secret containing the CA certificate and key for the etcd. - SecretNameCA = v1beta1constants.SecretNameCAETCD - // SecretNameServer is the name of the secret containing the server certificate and key for the etcd. - SecretNameServer = "etcd-server-cert" - // SecretNameClient is the name of the secret containing the client certificate and key for the etcd. - SecretNameClient = "etcd-client-tls" - - // LabelAppValue is the value of a label whose key is 'app'. - LabelAppValue = "etcd-statefulset" - - // NetworkPolicyName is the name of a network policy that allows ingress traffic to etcd from certain sources. - NetworkPolicyName = "allow-etcd" - - portNameClient = "client" - portNameBackupRestore = "backuprestore" - - statefulSetNamePrefix = "etcd" - containerNameEtcd = "etcd" - containerNameBackupRestore = "backup-restore" -) - -var ( - // TimeNow is a function returning the current time exposed for testing. - TimeNow = time.Now - - // PortEtcdServer is the port exposed by etcd for server-to-server communication. - PortEtcdServer = int32(2380) - // PortEtcdClient is the port exposed by etcd for client communication. - PortEtcdClient = int32(2379) - // PortBackupRestore is the client port exposed by the backup-restore sidecar container. - PortBackupRestore = int32(8080) -) - -// ServiceName returns the service name for an etcd for the given role. -func ServiceName(role string) string { - return fmt.Sprintf("etcd-%s-client", role) -} - -// Interface contains functions for a etcd deployer. -type Interface interface { - component.DeployWaiter - component.MonitoringComponent - // ServiceDNSNames returns the service DNS names for the etcd. - ServiceDNSNames() []string - // Snapshot triggers the backup-restore sidecar to perform a full snapshot in case backup configuration is provided. - Snapshot(context.Context, kubernetes.PodExecutor) error - // SetSecrets sets the secrets. - SetSecrets(Secrets) - // SetBackupConfig sets the backup configuration. - SetBackupConfig(config *BackupConfig) - // SetHVPAConfig sets the HVPA configuration. - SetHVPAConfig(config *HVPAConfig) -} - -// New creates a new instance of DeployWaiter for the Etcd. -func New( - c client.Client, - logger logrus.FieldLogger, - namespace string, - role string, - class Class, - retainReplicas bool, - storageCapacity string, - defragmentationSchedule *string, -) Interface { - name := "etcd-" + role - - var etcdLog logrus.FieldLogger - if logger != nil { - etcdLog = logger.WithField("etcd", client.ObjectKey{Namespace: namespace, Name: name}) - } - - return &etcd{ - client: c, - logger: etcdLog, - namespace: namespace, - role: role, - class: class, - retainReplicas: retainReplicas, - storageCapacity: storageCapacity, - defragmentationSchedule: defragmentationSchedule, - - etcd: &druidv1alpha1.Etcd{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - }, - } -} - -type etcd struct { - client client.Client - logger logrus.FieldLogger - namespace string - role string - class Class - retainReplicas bool - storageCapacity string - defragmentationSchedule *string - - etcd *druidv1alpha1.Etcd - - secrets Secrets - backupConfig *BackupConfig - hvpaConfig *HVPAConfig -} - -func (e *etcd) Deploy(ctx context.Context) error { - if e.secrets.CA.Name == "" || e.secrets.CA.Checksum == "" { - return fmt.Errorf("missing CA secret information") - } - if e.secrets.Server.Name == "" || e.secrets.Server.Checksum == "" { - return fmt.Errorf("missing server secret information") - } - if e.secrets.Client.Name == "" || e.secrets.Client.Checksum == "" { - return fmt.Errorf("missing client secret information") - } - - var ( - networkPolicy = e.emptyNetworkPolicy() - hvpa = e.emptyHVPA() - - existingEtcd *druidv1alpha1.Etcd - existingSts = &appsv1.StatefulSet{} - foundEtcd, foundSts bool - ) - - if err := e.client.Get(ctx, client.ObjectKeyFromObject(e.etcd), e.etcd); err != nil { - if !apierrors.IsNotFound(err) { - return err - } - } else { - foundEtcd = true - existingEtcd = e.etcd.DeepCopy() - } - - stsName := e.etcd.Name - if foundEtcd && existingEtcd.Status.Etcd.Name != "" { - stsName = existingEtcd.Status.Etcd.Name - } - - if err := e.client.Get(ctx, client.ObjectKey{Namespace: e.namespace, Name: stsName}, existingSts); err != nil { - if !apierrors.IsNotFound(err) { - return err - } - } else { - foundSts = true - } - - var ( - replicas = e.computeReplicas(foundEtcd, existingEtcd) - - protocolTCP = corev1.ProtocolTCP - intStrPortEtcdClient = intstr.FromInt(int(PortEtcdClient)) - intStrPortBackupRestore = intstr.FromInt(int(PortBackupRestore)) - - resourcesEtcd, resourcesBackupRestore = e.computeContainerResources(foundSts, existingSts) - quota = resource.MustParse("8Gi") - storageCapacity = resource.MustParse(e.storageCapacity) - garbageCollectionPolicy = druidv1alpha1.GarbageCollectionPolicy(druidv1alpha1.GarbageCollectionPolicyExponential) - garbageCollectionPeriod = metav1.Duration{Duration: 12 * time.Hour} - compressionPolicy = druidv1alpha1.GzipCompression - compressionSpec = druidv1alpha1.CompressionSpec{ - Enabled: true, - Policy: &compressionPolicy, - } - - annotations = map[string]string{ - "checksum/secret-etcd-ca": e.secrets.CA.Checksum, - "checksum/secret-etcd-server-cert": e.secrets.Server.Checksum, - "checksum/secret-etcd-client-tls": e.secrets.Client.Checksum, - } - metrics = druidv1alpha1.Basic - volumeClaimTemplate = e.etcd.Name - minAllowed = corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("50m"), - corev1.ResourceMemory: resource.MustParse("200M"), - } - ) - - if e.class == ClassImportant { - annotations["cluster-autoscaler.kubernetes.io/safe-to-evict"] = "false" - metrics = druidv1alpha1.Extensive - volumeClaimTemplate = e.role + "-etcd" - minAllowed = corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("200m"), - corev1.ResourceMemory: resource.MustParse("700M"), - } - } - - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, e.client, networkPolicy, func() error { - networkPolicy.Annotations = map[string]string{ - v1beta1constants.GardenerDescription: "Allows Ingress to etcd pods from the Shoot's Kubernetes API Server.", - } - networkPolicy.Labels = map[string]string{ - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - } - networkPolicy.Spec.PodSelector = metav1.LabelSelector{ - MatchLabels: map[string]string{ - v1beta1constants.DeprecatedGardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelApp: LabelAppValue, - }, - } - networkPolicy.Spec.Ingress = []networkingv1.NetworkPolicyIngressRule{ - { - From: []networkingv1.NetworkPolicyPeer{ - { - PodSelector: &metav1.LabelSelector{ - // TODO: Replace below map with a function call to the to-be-introduced kubeapiserver package. - MatchLabels: map[string]string{ - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelApp: v1beta1constants.LabelKubernetes, - v1beta1constants.LabelRole: v1beta1constants.LabelAPIServer, - }, - }, - }, - { - PodSelector: &metav1.LabelSelector{ - MatchLabels: monitoring.GetPrometheusLabels(), - }, - }, - }, - Ports: []networkingv1.NetworkPolicyPort{ - { - Protocol: &protocolTCP, - Port: &intStrPortEtcdClient, - }, - { - Protocol: &protocolTCP, - Port: &intStrPortBackupRestore, - }, - }, - }, - } - networkPolicy.Spec.Egress = nil - networkPolicy.Spec.PolicyTypes = []networkingv1.PolicyType{networkingv1.PolicyTypeIngress} - return nil - }); err != nil { - return err - } - - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, e.client, e.etcd, func() error { - e.etcd.Annotations = map[string]string{ - v1beta1constants.GardenerOperation: v1beta1constants.GardenerOperationReconcile, - v1beta1constants.GardenerTimestamp: TimeNow().UTC().String(), - } - e.etcd.Labels = map[string]string{ - v1beta1constants.LabelRole: e.role, - v1beta1constants.GardenRole: v1beta1constants.GardenRoleControlPlane, - } - e.etcd.Spec.Replicas = replicas - e.etcd.Spec.PriorityClassName = pointer.String(v1beta1constants.PriorityClassNameShootControlPlane) - e.etcd.Spec.Annotations = annotations - e.etcd.Spec.Labels = utils.MergeStringMaps(e.getLabels(), map[string]string{ - v1beta1constants.LabelApp: LabelAppValue, - v1beta1constants.LabelNetworkPolicyToDNS: v1beta1constants.LabelNetworkPolicyAllowed, - v1beta1constants.LabelNetworkPolicyToPublicNetworks: v1beta1constants.LabelNetworkPolicyAllowed, - v1beta1constants.LabelNetworkPolicyToPrivateNetworks: v1beta1constants.LabelNetworkPolicyAllowed, - }) - e.etcd.Spec.Selector = &metav1.LabelSelector{ - MatchLabels: utils.MergeStringMaps(e.getLabels(), map[string]string{ - v1beta1constants.LabelApp: LabelAppValue, - }), - } - e.etcd.Spec.Etcd = druidv1alpha1.EtcdConfig{ - Resources: resourcesEtcd, - TLS: &druidv1alpha1.TLSConfig{ - TLSCASecretRef: corev1.SecretReference{ - Name: e.secrets.CA.Name, - Namespace: e.namespace, - }, - ServerTLSSecretRef: corev1.SecretReference{ - Name: e.secrets.Server.Name, - Namespace: e.namespace, - }, - ClientTLSSecretRef: corev1.SecretReference{ - Name: e.secrets.Client.Name, - Namespace: e.namespace, - }, - }, - ServerPort: &PortEtcdServer, - ClientPort: &PortEtcdClient, - Metrics: &metrics, - DefragmentationSchedule: e.computeDefragmentationSchedule(foundEtcd, existingEtcd), - Quota: "a, - } - e.etcd.Spec.Backup = druidv1alpha1.BackupSpec{ - Port: &PortBackupRestore, - Resources: resourcesBackupRestore, - GarbageCollectionPolicy: &garbageCollectionPolicy, - GarbageCollectionPeriod: &garbageCollectionPeriod, - SnapshotCompression: &compressionSpec, - } - - if e.backupConfig != nil { - var ( - provider = druidv1alpha1.StorageProvider(e.backupConfig.Provider) - deltaSnapshotPeriod = metav1.Duration{Duration: 5 * time.Minute} - deltaSnapshotMemoryLimit = resource.MustParse("100Mi") - ) - - e.etcd.Spec.Backup.Store = &druidv1alpha1.StoreSpec{ - SecretRef: &corev1.SecretReference{Name: e.backupConfig.SecretRefName}, - Container: &e.backupConfig.Container, - Provider: &provider, - Prefix: fmt.Sprintf("%s/etcd-%s", e.backupConfig.Prefix, e.role), - } - e.etcd.Spec.Backup.FullSnapshotSchedule = e.computeFullSnapshotSchedule(foundEtcd, existingEtcd) - e.etcd.Spec.Backup.DeltaSnapshotPeriod = &deltaSnapshotPeriod - e.etcd.Spec.Backup.DeltaSnapshotMemoryLimit = &deltaSnapshotMemoryLimit - } - - e.etcd.Spec.StorageCapacity = &storageCapacity - e.etcd.Spec.VolumeClaimTemplate = &volumeClaimTemplate - return nil - }); err != nil { - return err - } - - if e.hvpaConfig != nil && e.hvpaConfig.Enabled { - var ( - hpaLabels = map[string]string{v1beta1constants.LabelRole: "etcd-hpa-" + e.role} - vpaLabels = map[string]string{v1beta1constants.LabelRole: "etcd-vpa-" + e.role} - updateModeAuto = hvpav1alpha1.UpdateModeAuto - containerPolicyOff = autoscalingv1beta2.ContainerScalingModeOff - ) - - scaleDownUpdateMode := e.hvpaConfig.ScaleDownUpdateMode - if scaleDownUpdateMode == nil { - scaleDownUpdateMode = pointer.String(hvpav1alpha1.UpdateModeMaintenanceWindow) - } - - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, e.client, hvpa, func() error { - hvpa.Labels = utils.MergeStringMaps(e.getLabels(), map[string]string{ - v1beta1constants.LabelApp: LabelAppValue, - }) - hvpa.Spec.Replicas = pointer.Int32(1) - hvpa.Spec.MaintenanceTimeWindow = &hvpav1alpha1.MaintenanceTimeWindow{ - Begin: e.hvpaConfig.MaintenanceTimeWindow.Begin, - End: e.hvpaConfig.MaintenanceTimeWindow.End, - } - hvpa.Spec.Hpa = hvpav1alpha1.HpaSpec{ - Selector: &metav1.LabelSelector{MatchLabels: hpaLabels}, - Deploy: false, - Template: hvpav1alpha1.HpaTemplate{ - ObjectMeta: metav1.ObjectMeta{ - Labels: hpaLabels, - }, - Spec: hvpav1alpha1.HpaTemplateSpec{ - MinReplicas: pointer.Int32(int32(replicas)), - MaxReplicas: int32(replicas), - Metrics: []autoscalingv2beta1.MetricSpec{ - { - Type: autoscalingv2beta1.ResourceMetricSourceType, - Resource: &autoscalingv2beta1.ResourceMetricSource{ - Name: corev1.ResourceCPU, - TargetAverageUtilization: pointer.Int32(80), - }, - }, - { - Type: autoscalingv2beta1.ResourceMetricSourceType, - Resource: &autoscalingv2beta1.ResourceMetricSource{ - Name: corev1.ResourceMemory, - TargetAverageUtilization: pointer.Int32(80), - }, - }, - }, - }, - }, - } - hvpa.Spec.Vpa = hvpav1alpha1.VpaSpec{ - Selector: &metav1.LabelSelector{MatchLabels: vpaLabels}, - Deploy: true, - ScaleUp: hvpav1alpha1.ScaleType{ - UpdatePolicy: hvpav1alpha1.UpdatePolicy{ - UpdateMode: &updateModeAuto, - }, - StabilizationDuration: pointer.String("5m"), - MinChange: hvpav1alpha1.ScaleParams{ - CPU: hvpav1alpha1.ChangeParams{ - Value: pointer.String("1"), - Percentage: pointer.Int32(80), - }, - Memory: hvpav1alpha1.ChangeParams{ - Value: pointer.String("2G"), - Percentage: pointer.Int32(80), - }, - }, - }, - ScaleDown: hvpav1alpha1.ScaleType{ - UpdatePolicy: hvpav1alpha1.UpdatePolicy{ - UpdateMode: scaleDownUpdateMode, - }, - StabilizationDuration: pointer.String("15m"), - MinChange: hvpav1alpha1.ScaleParams{ - CPU: hvpav1alpha1.ChangeParams{ - Value: pointer.String("1"), - Percentage: pointer.Int32(80), - }, - Memory: hvpav1alpha1.ChangeParams{ - Value: pointer.String("2G"), - Percentage: pointer.Int32(80), - }, - }, - }, - LimitsRequestsGapScaleParams: hvpav1alpha1.ScaleParams{ - CPU: hvpav1alpha1.ChangeParams{ - Value: pointer.String("2"), - Percentage: pointer.Int32(40), - }, - Memory: hvpav1alpha1.ChangeParams{ - Value: pointer.String("5G"), - Percentage: pointer.Int32(40), - }, - }, - Template: hvpav1alpha1.VpaTemplate{ - ObjectMeta: metav1.ObjectMeta{ - Labels: vpaLabels, - }, - Spec: hvpav1alpha1.VpaTemplateSpec{ - ResourcePolicy: &autoscalingv1beta2.PodResourcePolicy{ - ContainerPolicies: []autoscalingv1beta2.ContainerResourcePolicy{ - { - ContainerName: containerNameEtcd, - MinAllowed: minAllowed, - MaxAllowed: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("4"), - corev1.ResourceMemory: resource.MustParse("30G"), - }, - }, - { - ContainerName: containerNameBackupRestore, - Mode: &containerPolicyOff, - }, - }, - }, - }, - }, - } - hvpa.Spec.WeightBasedScalingIntervals = []hvpav1alpha1.WeightBasedScalingInterval{ - { - VpaWeight: hvpav1alpha1.VpaOnly, - StartReplicaCount: int32(replicas), - LastReplicaCount: int32(replicas), - }, - } - hvpa.Spec.TargetRef = &autoscalingv2beta1.CrossVersionObjectReference{ - APIVersion: appsv1.SchemeGroupVersion.String(), - Kind: "StatefulSet", - Name: stsName, - } - return nil - }); err != nil { - return err - } - } else { - if err := kutil.DeleteObjects(ctx, e.client, hvpa); err != nil { - return err - } - } - - return nil -} - -func (e *etcd) Destroy(ctx context.Context) error { - return kutil.DeleteObjects( - ctx, - e.client, - e.emptyHVPA(), - e.etcd, - e.emptyNetworkPolicy(), - ) -} - -func (e *etcd) getLabels() map[string]string { - return map[string]string{ - v1beta1constants.DeprecatedGardenRole: v1beta1constants.GardenRoleControlPlane, - v1beta1constants.LabelRole: e.role, - } -} - -func (e *etcd) emptyNetworkPolicy() *networkingv1.NetworkPolicy { - return &networkingv1.NetworkPolicy{ObjectMeta: metav1.ObjectMeta{Name: NetworkPolicyName, Namespace: e.namespace}} -} - -func (e *etcd) emptyHVPA() *hvpav1alpha1.Hvpa { - return &hvpav1alpha1.Hvpa{ObjectMeta: metav1.ObjectMeta{Name: e.etcd.Name, Namespace: e.namespace}} -} - -func (e *etcd) Snapshot(ctx context.Context, podExecutor kubernetes.PodExecutor) error { - if e.backupConfig == nil { - return fmt.Errorf("no backup is configured for this etcd, cannot make a snapshot") - } - - etcdMainSelector := e.podLabelSelector() - - podsList := &corev1.PodList{} - if err := e.client.List(ctx, podsList, client.InNamespace(e.namespace), client.MatchingLabelsSelector{Selector: etcdMainSelector}); err != nil { - return err - } - if len(podsList.Items) == 0 { - return fmt.Errorf("didn't find any pods for selector: %v", etcdMainSelector) - } - if len(podsList.Items) > 1 { - return fmt.Errorf("multiple ETCD Pods found. Pod list found: %v", podsList.Items) - } - - _, err := podExecutor.Execute( - e.namespace, - podsList.Items[0].GetName(), - containerNameBackupRestore, - "/bin/sh", - fmt.Sprintf("curl -k https://etcd-%s-local:%d/snapshot/full", e.role, PortBackupRestore), - ) - return err -} - -func (e *etcd) ServiceDNSNames() []string { - return append( - []string{fmt.Sprintf("etcd-%s-local", e.role)}, - kutil.DNSNamesForService(fmt.Sprintf("etcd-%s-client", e.role), e.namespace)..., - ) -} - -func (e *etcd) SetSecrets(secrets Secrets) { e.secrets = secrets } -func (e *etcd) SetBackupConfig(backupConfig *BackupConfig) { e.backupConfig = backupConfig } -func (e *etcd) SetHVPAConfig(hvpaConfig *HVPAConfig) { e.hvpaConfig = hvpaConfig } - -func (e *etcd) podLabelSelector() labels.Selector { - app, _ := labels.NewRequirement(v1beta1constants.LabelApp, selection.Equals, []string{LabelAppValue}) - role, _ := labels.NewRequirement(v1beta1constants.LabelRole, selection.Equals, []string{e.role}) - return labels.NewSelector().Add(*role, *app) -} - -func (e *etcd) computeContainerResources(foundSts bool, existingSts *appsv1.StatefulSet) (*corev1.ResourceRequirements, *corev1.ResourceRequirements) { - var ( - resourcesEtcd = &corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("300m"), - corev1.ResourceMemory: resource.MustParse("1G"), - }, - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2300m"), - corev1.ResourceMemory: resource.MustParse("6G"), - }, - } - resourcesBackupRestore = &corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("23m"), - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("1"), - corev1.ResourceMemory: resource.MustParse("10G"), - }, - } - ) - - if foundSts && e.hvpaConfig != nil && e.hvpaConfig.Enabled { - for k := range existingSts.Spec.Template.Spec.Containers { - v := existingSts.Spec.Template.Spec.Containers[k] - switch v.Name { - case containerNameEtcd: - resourcesEtcd = v.Resources.DeepCopy() - case containerNameBackupRestore: - resourcesBackupRestore = v.Resources.DeepCopy() - } - } - } - - return resourcesEtcd, resourcesBackupRestore -} - -func (e *etcd) computeReplicas(foundEtcd bool, existingEtcd *druidv1alpha1.Etcd) int { - if !e.retainReplicas { - return 1 - } - - if foundEtcd { - return existingEtcd.Spec.Replicas - } - - return 0 -} - -func (e *etcd) computeDefragmentationSchedule(foundEtcd bool, existingEtcd *druidv1alpha1.Etcd) *string { - defragmentationSchedule := e.defragmentationSchedule - if foundEtcd && existingEtcd.Spec.Etcd.DefragmentationSchedule != nil { - defragmentationSchedule = existingEtcd.Spec.Etcd.DefragmentationSchedule - } - return defragmentationSchedule -} - -func (e *etcd) computeFullSnapshotSchedule(foundEtcd bool, existingEtcd *druidv1alpha1.Etcd) *string { - fullSnapshotSchedule := &e.backupConfig.FullSnapshotSchedule - if foundEtcd && existingEtcd.Spec.Backup.FullSnapshotSchedule != nil { - fullSnapshotSchedule = existingEtcd.Spec.Backup.FullSnapshotSchedule - } - return fullSnapshotSchedule -} - -// Secrets is collection of secrets for the etcd. -type Secrets struct { - // CA is a secret containing the CA certificate and key. - CA component.Secret - // Server is a secret containing the server certificate and key. - Server component.Secret - // Client is a secret containing the client certificate and key. - Client component.Secret -} - -// BackupConfig contains information for configuring the backup-restore sidecar so that it takes regularly backups of -// the etcd's data directory. -type BackupConfig struct { - // Provider is the name of the infrastructure provider for the blob storage bucket. - Provider string - // Container is the name of the blob storage bucket. - Container string - // SecretRefName is the name of a Secret object containing the credentials of the selected infrastructure provider. - SecretRefName string - // Prefix is a prefix that shall be used for the filename of the backups of this etcd. - Prefix string - // FullSnapshotSchedule is a cron schedule that declares how frequent full snapshots shall be taken. - FullSnapshotSchedule string -} - -// HVPAConfig contains information for configuring the HVPA object for the etcd. -type HVPAConfig struct { - // Enabled states whether an HVPA object shall be deployed. - Enabled bool - // MaintenanceTimeWindow contains begin and end of a time window that allows down-scaling the etcd in case its - // resource requests/limits are unnecessarily high. - MaintenanceTimeWindow gardencorev1beta1.MaintenanceTimeWindow - // The update mode to use for scale down. - ScaleDownUpdateMode *string -} diff --git a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/logging.go b/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/logging.go deleted file mode 100644 index fcb8b08e8..000000000 --- a/vendor/github.com/gardener/gardener/pkg/operation/botanist/component/etcd/logging.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package etcd - -import ( - "github.com/gardener/gardener/pkg/operation/botanist/component" -) - -const ( - loggingParserEtcdName = "etcdParser" - loggingParserBackupRestoreName = "backupRestoreParser" - - loggingParser = `[PARSER] - Name ` + loggingParserEtcdName + ` - Format regex - Regex ^(?