diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-aws/pkg/aws/apis/aws_provider_spec.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-aws/pkg/aws/apis/aws_provider_spec.go new file mode 100644 index 000000000000..24ec569e0a9e --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-aws/pkg/aws/apis/aws_provider_spec.go @@ -0,0 +1,189 @@ +/* +Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package api + +const ( + // V1alpha1 is the API version + V1alpha1 = "mcm.gardener.cloud/v1alpha1" + + // AWSAccessKeyID is a constant for a key name that is part of the AWS cloud credentials. + AWSAccessKeyID string = "providerAccessKeyId" + // AWSSecretAccessKey is a constant for a key name that is part of the AWS cloud credentials. + AWSSecretAccessKey string = "providerSecretAccessKey" + + // AWSAlternativeAccessKeyID is a constant for a key name of a secret containing the AWS credentials (access key + // id). + AWSAlternativeAccessKeyID = "accessKeyID" + // AWSAlternativeSecretAccessKey is a constant for a key name of a secret containing the AWS credentials (secret + // access key). + AWSAlternativeSecretAccessKey = "secretAccessKey" +) + +//AWSProviderSpec is the spec to be used while parsing the calls. +type AWSProviderSpec struct { + // APIVersion determines the APIversion for the provider APIs + APIVersion string `json:"apiVersion,omitempty"` + + // AMI is the disk image version + AMI string `json:"ami,omitempty"` + + // BlockDevices is the list of block devices to be mapped to the instances + BlockDevices []AWSBlockDeviceMappingSpec `json:"blockDevices,omitempty"` + + // EbsOptimized specifies that the EBS is optimized + EbsOptimized bool `json:"ebsOptimized,omitempty"` + + // IAM details for the machine + IAM AWSIAMProfileSpec `json:"iam,omitempty"` + + // MachineType contains the EC2 instance type + MachineType string `json:"machineType,omitempty"` + + // KeyName contains the SSH keypair + KeyName string `json:"keyName,omitempty"` + + // Monitoring specifies if monitoring is enabled + Monitoring bool `json:"monitoring,omitempty"` + + // NetworkInterfaces contains a list of NetworkInterfaceSpecs + NetworkInterfaces []AWSNetworkInterfaceSpec `json:"networkInterfaces,omitempty"` + + // Region contains the AWS region for the machine + Region string `json:"region,omitempty"` + + // SpotPrice is an optional field that if set specifies to use spot instances + // When set to "" there is no maxPrice else, specifies the maxPrice + SpotPrice *string `json:"spotPrice,omitempty"` + + // Tags to be specified on the EC2 instances + Tags map[string]string `json:"tags,omitempty"` +} + +// AWSBlockDeviceMappingSpec stores info about AWS block device mappings +type AWSBlockDeviceMappingSpec struct { + // The device name exposed to the machine (for example, /dev/sdh or xvdh). + DeviceName string `json:"deviceName,omitempty"` + + // Parameters used to automatically set up EBS volumes when the machine is + // launched. + Ebs AWSEbsBlockDeviceSpec `json:"ebs,omitempty"` + + // Suppresses the specified device included in the block device mapping of the + // AMI. + NoDevice string `json:"noDevice,omitempty"` + + // The virtual device name (ephemeralN). Machine store volumes are numbered + // starting from 0. An machine type with 2 available machine store volumes + // can specify mappings for ephemeral0 and ephemeral1.The number of available + // machine store volumes depends on the machine type. After you connect to + // the machine, you must mount the volume. + // + // Constraints: For M3 machines, you must specify machine store volumes in + // the block device mapping for the machine. When you launch an M3 machine, + // we ignore any machine store volumes specified in the block device mapping + // for the AMI. + VirtualName string `json:"virtualName,omitempty"` +} + +// AWSEbsBlockDeviceSpec describes a block device for an EBS volume. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsBlockDevice +type AWSEbsBlockDeviceSpec struct { + // Indicates whether the EBS volume is deleted on machine termination. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + + // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes + // may only be attached to machines that support Amazon EBS encryption. + Encrypted bool `json:"encrypted,omitempty"` + + // The number of I/O operations per second (IOPS) that the volume supports. + // For io1, this represents the number of IOPS that are provisioned for the + // volume. For gp2, this represents the baseline performance of the volume and + // the rate at which the volume accumulates I/O credits for bursting. For more + // information about General Purpose SSD baseline performance, I/O credits, + // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. + // + // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for + // gp2 volumes. + // + // Condition: This parameter is required for requests to create io1 volumes; + // it is not used in requests to create gp2, st1, sc1, or standard volumes. + Iops int64 `json:"iops,omitempty"` + + // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed + // CMK under which the EBS volume is encrypted. + // + // This parameter is only supported on BlockDeviceMapping objects called by + // RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), + // RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html), + // and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). + KmsKeyID *string `json:"kmsKeyID,omitempty"` + + // The ID of the snapshot. + SnapshotID *string `json:"snapshotID,omitempty"` + + // The size of the volume, in GiB. + // + // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned + // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for + // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify + // a snapshot, the volume size must be equal to or larger than the snapshot + // size. + // + // Default: If you're creating the volume from a snapshot and don't specify + // a volume size, the default is the snapshot size. + VolumeSize int64 `json:"volumeSize,omitempty"` + + // The volume type: gp2, io1, st1, sc1, or standard. + // + // Default: standard + VolumeType string `json:"volumeType,omitempty"` +} + +// AWSIAMProfileSpec describes an IAM machine profile. +type AWSIAMProfileSpec struct { + // The Amazon Resource Name (ARN) of the machine profile. + ARN string `json:"arn,omitempty"` + + // The name of the machine profile. + Name string `json:"name,omitempty"` +} + +// AWSNetworkInterfaceSpec describes a network interface. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MachineAWSNetworkInterfaceSpecification +type AWSNetworkInterfaceSpec struct { + // Indicates whether to assign a public IPv4 address to an machine you launch + // in a VPC. The public IP address can only be assigned to a network interface + // for eth0, and can only be assigned to a new network interface, not an existing + // one. You cannot specify more than one network interface in the request. If + // launching into a default subnet, the default value is true. + AssociatePublicIPAddress *bool `json:"associatePublicIPAddress,omitempty"` + + // If set to true, the interface is deleted when the machine is terminated. + // You can specify true only if creating a new network interface when launching + // an machine. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + + // The description of the network interface. Applies only if creating a network + // interface when launching an machine. + Description *string `json:"description,omitempty"` + + // The IDs of the security groups for the network interface. Applies only if + // creating a network interface when launching an machine. + SecurityGroupIDs []string `json:"securityGroupIDs,omitempty"` + + // The ID of the subnet associated with the network string. Applies only if + // creating a network interface when launching an machine. + SubnetID string `json:"subnetID,omitempty"` +} diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-azure/pkg/azure/apis/azure_provider_spec.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-azure/pkg/azure/apis/azure_provider_spec.go new file mode 100644 index 000000000000..96ad94462bc7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager-provider-azure/pkg/azure/apis/azure_provider_spec.go @@ -0,0 +1,169 @@ +/* +SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors + +SPDX-License-Identifier: Apache-2.0 +*/ + +package api + +const ( + // AzureClientID is a constant for a key name that is part of the Azure cloud credentials. + AzureClientID string = "azureClientId" + // AzureClientSecret is a constant for a key name that is part of the Azure cloud credentials. + AzureClientSecret string = "azureClientSecret" + // AzureSubscriptionID is a constant for a key name that is part of the Azure cloud credentials. + AzureSubscriptionID string = "azureSubscriptionId" + // AzureTenantID is a constant for a key name that is part of the Azure cloud credentials. + AzureTenantID string = "azureTenantId" + + // AzureAlternativeClientID is a constant for a key name of a secret containing the Azure credentials (client id). + AzureAlternativeClientID = "clientID" + // AzureAlternativeClientSecret is a constant for a key name of a secret containing the Azure credentials (client + // secret). + AzureAlternativeClientSecret = "clientSecret" + // AzureAlternativeSubscriptionID is a constant for a key name of a secret containing the Azure credentials + // (subscription id). + AzureAlternativeSubscriptionID = "subscriptionID" + // AzureAlternativeTenantID is a constant for a key name of a secret containing the Azure credentials (tenant id). + AzureAlternativeTenantID = "tenantID" + + // MachineSetKindAvailabilitySet is the machine set kind for AvailabilitySet + MachineSetKindAvailabilitySet string = "availabilityset" + // MachineSetKindVMO is the machine set kind for VirtualMachineScaleSet Orchestration Mode VM (VMO) + MachineSetKindVMO string = "vmo" +) + +// AzureProviderSpec is the spec to be used while parsing the calls. +type AzureProviderSpec struct { + Location string `json:"location,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Properties AzureVirtualMachineProperties `json:"properties,omitempty"` + ResourceGroup string `json:"resourceGroup,omitempty"` + SubnetInfo AzureSubnetInfo `json:"subnetInfo,omitempty"` +} + +// AzureVirtualMachineProperties is describes the properties of a Virtual Machine. +type AzureVirtualMachineProperties struct { + HardwareProfile AzureHardwareProfile `json:"hardwareProfile,omitempty"` + StorageProfile AzureStorageProfile `json:"storageProfile,omitempty"` + OsProfile AzureOSProfile `json:"osProfile,omitempty"` + NetworkProfile AzureNetworkProfile `json:"networkProfile,omitempty"` + AvailabilitySet *AzureSubResource `json:"availabilitySet,omitempty"` + IdentityID *string `json:"identityID,omitempty"` + Zone *int `json:"zone,omitempty"` + MachineSet *AzureMachineSetConfig `json:"machineSet,omitempty"` +} + +// AzureHardwareProfile is specifies the hardware settings for the virtual machine. +// Refer github.com/Azure/azure-sdk-for-go/arm/compute/models.go for VMSizes +type AzureHardwareProfile struct { + VMSize string `json:"vmSize,omitempty"` +} + +// AzureMachineSetConfig contains the information about the machine set +type AzureMachineSetConfig struct { + ID string `json:"id"` + Kind string `json:"kind"` +} + +// AzureStorageProfile is specifies the storage settings for the virtual machine disks. +type AzureStorageProfile struct { + ImageReference AzureImageReference `json:"imageReference,omitempty"` + OsDisk AzureOSDisk `json:"osDisk,omitempty"` + DataDisks []AzureDataDisk `json:"dataDisks,omitempty"` +} + +// AzureImageReference is specifies information about the image to use. You can specify information about platform images, +// marketplace images, or virtual machine images. This element is required when you want to use a platform image, +// marketplace image, or virtual machine image, but is not used in other creation operations. +type AzureImageReference struct { + ID string `json:"id,omitempty"` + // Uniform Resource Name of the OS image to be used , it has the format 'publisher:offer:sku:version' + URN *string `json:"urn,omitempty"` +} + +// AzureOSDisk is specifies information about the operating system disk used by the virtual machine.

For more +// information about disks, see [About disks and VHDs for Azure virtual +// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). +type AzureOSDisk struct { + Name string `json:"name,omitempty"` + Caching string `json:"caching,omitempty"` + ManagedDisk AzureManagedDiskParameters `json:"managedDisk,omitempty"` + DiskSizeGB int32 `json:"diskSizeGB,omitempty"` + CreateOption string `json:"createOption,omitempty"` +} + +// AzureDataDisk specifies information about the data disk used by the virtual machine. +type AzureDataDisk struct { + Name string `json:"name,omitempty"` + Lun *int32 `json:"lun,omitempty"` + Caching string `json:"caching,omitempty"` + StorageAccountType string `json:"storageAccountType,omitempty"` + DiskSizeGB int32 `json:"diskSizeGB,omitempty"` +} + +// AzureManagedDiskParameters is the parameters of a managed disk. +type AzureManagedDiskParameters struct { + ID string `json:"id,omitempty"` + StorageAccountType string `json:"storageAccountType,omitempty"` +} + +// AzureOSProfile is specifies the operating system settings for the virtual machine. +type AzureOSProfile struct { + ComputerName string `json:"computerName,omitempty"` + AdminUsername string `json:"adminUsername,omitempty"` + AdminPassword string `json:"adminPassword,omitempty"` + CustomData string `json:"customData,omitempty"` + LinuxConfiguration AzureLinuxConfiguration `json:"linuxConfiguration,omitempty"` +} + +// AzureLinuxConfiguration is specifies the Linux operating system settings on the virtual machine.

For a list of +// supported Linux distributions, see [Linux on Azure-Endorsed +// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +//

For running non-endorsed distributions, see [Information for Non-Endorsed +// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). +type AzureLinuxConfiguration struct { + DisablePasswordAuthentication bool `json:"disablePasswordAuthentication,omitempty"` + SSH AzureSSHConfiguration `json:"ssh,omitempty"` +} + +// AzureSSHConfiguration is SSH configuration for Linux based VMs running on Azure +type AzureSSHConfiguration struct { + PublicKeys AzureSSHPublicKey `json:"publicKeys,omitempty"` +} + +// AzureSSHPublicKey is contains information about SSH certificate public key and the path on the Linux VM where the public +// key is placed. +type AzureSSHPublicKey struct { + Path string `json:"path,omitempty"` + KeyData string `json:"keyData,omitempty"` +} + +// AzureNetworkProfile is specifies the network interfaces of the virtual machine. +type AzureNetworkProfile struct { + NetworkInterfaces AzureNetworkInterfaceReference `json:"networkInterfaces,omitempty"` + AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"` +} + +// AzureNetworkInterfaceReference is describes a network interface reference. +type AzureNetworkInterfaceReference struct { + ID string `json:"id,omitempty"` + *AzureNetworkInterfaceReferenceProperties `json:"properties,omitempty"` +} + +// AzureNetworkInterfaceReferenceProperties is describes a network interface reference properties. +type AzureNetworkInterfaceReferenceProperties struct { + Primary bool `json:"primary,omitempty"` +} + +// AzureSubResource is the Sub Resource definition. +type AzureSubResource struct { + ID string `json:"id,omitempty"` +} + +// AzureSubnetInfo is the information containing the subnet details +type AzureSubnetInfo struct { + VnetName string `json:"vnetName,omitempty"` + VnetResourceGroup *string `json:"vnetResourceGroup,omitempty"` + SubnetName string `json:"subnetName,omitempty"` +} diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go index f9ab97907f08..34799bd5209e 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go @@ -20,6 +20,7 @@ package machine import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -1235,3 +1236,33 @@ type PacketMachineClassSpec struct { // TODO add more here } + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClass can be used to templatize and re-use provider configuration +// across multiple Machines / MachineSets / MachineDeployments. +// +k8s:openapi-gen=true +// +resource:path=machineclasses +type MachineClass struct { + metav1.TypeMeta + // +optional + metav1.ObjectMeta + // Provider-specific configuration to use during node creation. + ProviderSpec runtime.RawExtension + // SecretRef stores the necessary secrets such as credetials or userdata. + SecretRef *corev1.SecretReference + // Provider is the combination of name and location of cloud-specific drivers. + // eg. awsdriver//127.0.0.1:8080 + Provider string +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClassList contains a list of MachineClasses +type MachineClassList struct { + metav1.TypeMeta + metav1.ListMeta + Items []MachineClass +} diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go index d9ee1f53654b..d6c85928deb1 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go @@ -70,6 +70,9 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PacketMachineClass{}, &PacketMachineClassList{}, + &MachineClass{}, + &MachineClassList{}, + &Machine{}, &MachineList{}, diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/types.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/types.go index 87fe5abe12e6..34dc325c6d9a 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/types.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/types.go @@ -18,6 +18,7 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -1279,3 +1280,32 @@ type PacketMachineClassSpec struct { SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` } + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClass can be used to templatize and re-use provider configuration +// across multiple Machines / MachineSets / MachineDeployments. +// +k8s:openapi-gen=true +// +resource:path=machineclasses +type MachineClass struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // Provider-specific configuration to use during node creation. + ProviderSpec runtime.RawExtension `json:"providerSpec"` + // SecretRef stores the necessary secrets such as credetials or userdata. + SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` + // Provider is the combination of name and location of cloud-specific drivers. + Provider string `json:"provider,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClassList contains a list of MachineClasses +type MachineClassList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineClass `json:"items"` +} diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go index 2a4ecb0a4321..9876e1e70752 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go @@ -432,6 +432,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*MachineClass)(nil), (*machine.MachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_MachineClass_To_machine_MachineClass(a.(*MachineClass), b.(*machine.MachineClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*machine.MachineClass)(nil), (*MachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_MachineClass_To_v1alpha1_MachineClass(a.(*machine.MachineClass), b.(*MachineClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineClassList)(nil), (*machine.MachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_MachineClassList_To_machine_MachineClassList(a.(*MachineClassList), b.(*machine.MachineClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*machine.MachineClassList)(nil), (*MachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_MachineClassList_To_v1alpha1_MachineClassList(a.(*machine.MachineClassList), b.(*MachineClassList), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*machine.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_MachineDeployment_To_machine_MachineDeployment(a.(*MachineDeployment), b.(*machine.MachineDeployment), scope) }); err != nil { @@ -1869,6 +1889,54 @@ func Convert_machine_Machine_To_v1alpha1_Machine(in *machine.Machine, out *Machi return autoConvert_machine_Machine_To_v1alpha1_Machine(in, out, s) } +func autoConvert_v1alpha1_MachineClass_To_machine_MachineClass(in *MachineClass, out *machine.MachineClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + out.ProviderSpec = in.ProviderSpec + out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) + out.Provider = in.Provider + return nil +} + +// Convert_v1alpha1_MachineClass_To_machine_MachineClass is an autogenerated conversion function. +func Convert_v1alpha1_MachineClass_To_machine_MachineClass(in *MachineClass, out *machine.MachineClass, s conversion.Scope) error { + return autoConvert_v1alpha1_MachineClass_To_machine_MachineClass(in, out, s) +} + +func autoConvert_machine_MachineClass_To_v1alpha1_MachineClass(in *machine.MachineClass, out *MachineClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + out.ProviderSpec = in.ProviderSpec + out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) + out.Provider = in.Provider + return nil +} + +// Convert_machine_MachineClass_To_v1alpha1_MachineClass is an autogenerated conversion function. +func Convert_machine_MachineClass_To_v1alpha1_MachineClass(in *machine.MachineClass, out *MachineClass, s conversion.Scope) error { + return autoConvert_machine_MachineClass_To_v1alpha1_MachineClass(in, out, s) +} + +func autoConvert_v1alpha1_MachineClassList_To_machine_MachineClassList(in *MachineClassList, out *machine.MachineClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]machine.MachineClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha1_MachineClassList_To_machine_MachineClassList is an autogenerated conversion function. +func Convert_v1alpha1_MachineClassList_To_machine_MachineClassList(in *MachineClassList, out *machine.MachineClassList, s conversion.Scope) error { + return autoConvert_v1alpha1_MachineClassList_To_machine_MachineClassList(in, out, s) +} + +func autoConvert_machine_MachineClassList_To_v1alpha1_MachineClassList(in *machine.MachineClassList, out *MachineClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachineClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_machine_MachineClassList_To_v1alpha1_MachineClassList is an autogenerated conversion function. +func Convert_machine_MachineClassList_To_v1alpha1_MachineClassList(in *machine.MachineClassList, out *MachineClassList, s conversion.Scope) error { + return autoConvert_machine_MachineClassList_To_v1alpha1_MachineClassList(in, out, s) +} + func autoConvert_v1alpha1_MachineDeployment_To_machine_MachineDeployment(in *MachineDeployment, out *machine.MachineDeployment, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1alpha1_MachineDeploymentSpec_To_machine_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go index b12cf045797c..55170da0eeb4 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go @@ -1021,6 +1021,71 @@ func (in *Machine) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineClass) DeepCopyInto(out *MachineClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) + if in.SecretRef != nil { + in, out := &in.SecretRef, &out.SecretRef + *out = new(v1.SecretReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClass. +func (in *MachineClass) DeepCopy() *MachineClass { + if in == nil { + return nil + } + out := new(MachineClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClass) 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 *MachineClassList) DeepCopyInto(out *MachineClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassList. +func (in *MachineClassList) DeepCopy() *MachineClassList { + if in == nil { + return nil + } + out := new(MachineClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClassList) 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 *MachineDeployment) DeepCopyInto(out *MachineDeployment) { *out = *in diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/generated_expansion.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/generated_expansion.go index 97e060a24fe2..139c40bf6bd2 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/generated_expansion.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/generated_expansion.go @@ -21,3 +21,5 @@ type MachineTemplateExpansion interface{} type OpenStackMachineClassExpansion interface{} type ScaleExpansion interface{} + +type MachineClassExpansion interface{} diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machine_client.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machine_client.go index 4fec4186c995..cba53c497449 100644 --- a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machine_client.go +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machine_client.go @@ -15,6 +15,7 @@ type MachineV1alpha1Interface interface { AlicloudMachineClassesGetter AzureMachineClassesGetter GCPMachineClassesGetter + MachineClassesGetter MachinesGetter MachineDeploymentsGetter MachineSetsGetter @@ -48,6 +49,10 @@ func (c *MachineV1alpha1Client) Machines(namespace string) MachineInterface { return newMachines(c, namespace) } +func (c *MachineV1alpha1Client) MachineClasses(namespace string) MachineClassInterface { + return newMachineClasses(c, namespace) +} + func (c *MachineV1alpha1Client) MachineDeployments(namespace string) MachineDeploymentInterface { return newMachineDeployments(c, namespace) } diff --git a/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machineclass.go b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machineclass.go new file mode 100644 index 000000000000..2e7ee3b348e6 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/typed/machine/v1alpha1/machineclass.go @@ -0,0 +1,141 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + scheme "github.com/gardener/machine-controller-manager/pkg/client/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" +) + +// MachineClassesGetter has a method to return a MachineClassInterface. +// A group's client should implement this interface. +type MachineClassesGetter interface { + MachineClasses(namespace string) MachineClassInterface +} + +// MachineClassInterface has methods to work with MachineClass resources. +type MachineClassInterface interface { + Create(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) + Update(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.MachineClass, error) + List(opts v1.ListOptions) (*v1alpha1.MachineClassList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) + MachineClassExpansion +} + +// machineClasses implements MachineClassInterface +type machineClasses struct { + client rest.Interface + ns string +} + +// newMachineClasses returns a MachineClasses +func newMachineClasses(c *MachineV1alpha1Client, namespace string) *machineClasses { + return &machineClasses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. +func (c *machineClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. +func (c *machineClasses) List(opts v1.ListOptions) (result *v1alpha1.MachineClassList, err error) { + result = &v1alpha1.MachineClassList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineClasses. +func (c *machineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Create(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machineclasses"). + Body(machineClass). + Do(). + Into(result) + return +} + +// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Update(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machineclasses"). + Name(machineClass.Name). + Body(machineClass). + Do(). + Into(result) + return +} + +// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. +func (c *machineClasses) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machineClass. +func (c *machineClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machineclasses"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +}