diff --git a/PROJECT b/PROJECT index 61a5cd296b..aacaa8e201 100644 --- a/PROJECT +++ b/PROJECT @@ -1,3 +1,3 @@ version: "1" -domain: k8s.io +domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-openstack diff --git a/config/crds/infrastructure_v1alpha2_openstackcluster.yaml b/config/crds/infrastructure_v1alpha2_openstackcluster.yaml new file mode 100644 index 0000000000..7a2cc89343 --- /dev/null +++ b/config/crds/infrastructure_v1alpha2_openstackcluster.yaml @@ -0,0 +1,701 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: openstackclusters.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + kind: OpenStackCluster + plural: openstackclusters + scope: Namespaced + validation: + openAPIV3Schema: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + apiServerLoadBalancerAdditionalPorts: + description: APIServerLoadBalancerAdditionalPorts adds additional ports + to the APIServerLoadBalancer + items: + format: int64 + type: integer + type: array + apiServerLoadBalancerFloatingIP: + description: APIServerLoadBalancerFloatingIP is the floatingIP which + will be associated to the APIServer loadbalancer. The floatingIP will + be created if it not already exists. + type: string + apiServerLoadBalancerPort: + description: APIServerLoadBalancerPort is the port on which the listener + on the APIServer loadbalancer will be created + format: int64 + type: integer + caKeyPair: + description: CAKeyPair is the key pair for ca certs. + properties: + cert: + description: base64 encoded cert and key + format: byte + type: string + key: + format: byte + type: string + type: object + cloudName: + description: The name of the cloud to use from the clouds secret + type: string + cloudsSecret: + description: The name of the secret containing the openstack credentials + type: object + clusterConfiguration: + description: ClusterConfiguration holds the cluster-wide information + used during a kubeadm init call. + properties: + apiServer: + description: APIServer contains extra settings for the API server + control plane component + properties: + certSANs: + description: CertSANs sets extra Subject Alternative Names for + the API Server signing cert. + items: + type: string + type: array + extraArgs: + description: 'ExtraArgs is an extra set of flags to pass to + the control plane component. TODO: This is temporary and ideally + we would like to switch all components to use ComponentConfig + + ConfigMaps.' + type: object + extraVolumes: + description: ExtraVolumes is an extra set of host volumes, mounted + to the control plane component. + items: + properties: + hostPath: + description: HostPath is the path in the host that will + be mounted inside the pod. + type: string + mountPath: + description: MountPath is the path inside the pod where + hostPath will be mounted. + type: string + name: + description: Name of the volume inside the pod template. + type: string + pathType: + description: PathType is the type of the HostPath. + type: string + readOnly: + description: ReadOnly controls write access to the volume + type: boolean + required: + - name + - hostPath + - mountPath + type: object + type: array + timeoutForControlPlane: + description: TimeoutForControlPlane controls the timeout that + we use for API server to appear + type: string + type: object + 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/api-conventions.md#resources' + type: string + certificatesDir: + description: CertificatesDir specifies where to store or look for + all required certificates. + type: string + clusterName: + description: The cluster name + type: string + controlPlaneEndpoint: + description: 'ControlPlaneEndpoint sets a stable IP address or DNS + name for the control plane; it can be a valid IP address or a + RFC-1123 DNS subdomain, both with optional TCP port. In case the + ControlPlaneEndpoint is not specified, the AdvertiseAddress + + BindPort are used; in case the ControlPlaneEndpoint is specified + but without a TCP port, the BindPort is used. Possible usages + are: e.g. In a cluster with more than one control plane instances, + this field should be assigned the address of the external load + balancer in front of the control plane instances. e.g. in environments + with enforced node recycling, the ControlPlaneEndpoint could be + used for assigning a stable DNS to the control plane.' + type: string + controllerManager: + description: ControllerManager contains extra settings for the controller + manager control plane component + properties: + extraArgs: + description: 'ExtraArgs is an extra set of flags to pass to + the control plane component. TODO: This is temporary and ideally + we would like to switch all components to use ComponentConfig + + ConfigMaps.' + type: object + extraVolumes: + description: ExtraVolumes is an extra set of host volumes, mounted + to the control plane component. + items: + properties: + hostPath: + description: HostPath is the path in the host that will + be mounted inside the pod. + type: string + mountPath: + description: MountPath is the path inside the pod where + hostPath will be mounted. + type: string + name: + description: Name of the volume inside the pod template. + type: string + pathType: + description: PathType is the type of the HostPath. + type: string + readOnly: + description: ReadOnly controls write access to the volume + type: boolean + required: + - name + - hostPath + - mountPath + type: object + type: array + type: object + dns: + description: DNS defines the options for the DNS add-on installed + in the cluster. + properties: + imageRepository: + description: ImageRepository sets the container registry to + pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + type: + description: Type defines the DNS add-on to be used + type: string + required: + - type + type: object + etcd: + description: Etcd holds configuration for etcd. + properties: + external: + description: External describes how to connect to an external + etcd cluster Local and External are mutually exclusive + properties: + caFile: + description: CAFile is an SSL Certificate Authority file + used to secure etcd communication. Required if using a + TLS connection. + type: string + certFile: + description: CertFile is an SSL certification file used + to secure etcd communication. Required if using a TLS + connection. + type: string + endpoints: + description: Endpoints of etcd members. Required for ExternalEtcd. + items: + type: string + type: array + keyFile: + description: KeyFile is an SSL key file used to secure etcd + communication. Required if using a TLS connection. + type: string + required: + - endpoints + - caFile + - certFile + - keyFile + type: object + local: + description: Local provides configuration knobs for configuring + the local etcd instance Local and External are mutually exclusive + properties: + dataDir: + description: DataDir is the directory etcd will place its + data. Defaults to "/var/lib/etcd". + type: string + extraArgs: + description: ExtraArgs are extra arguments provided to the + etcd binary when run inside a static pod. + type: object + imageRepository: + description: ImageRepository sets the container registry + to pull images from. if not set, the ImageRepository defined + in ClusterConfiguration will be used instead. + type: string + imageTag: + description: ImageTag allows to specify a tag for the image. + In case this value is set, kubeadm does not change automatically + the version of the above components during upgrades. + type: string + peerCertSANs: + description: PeerCertSANs sets extra Subject Alternative + Names for the etcd peer signing cert. + items: + type: string + type: array + serverCertSANs: + description: ServerCertSANs sets extra Subject Alternative + Names for the etcd server signing cert. + items: + type: string + type: array + required: + - dataDir + type: object + type: object + featureGates: + description: FeatureGates enabled by the user. + type: object + imageRepository: + description: ImageRepository sets the container registry to pull + images from. If empty, `k8s.gcr.io` will be used by default; in + case of kubernetes version is a CI build (kubernetes version starts + with `ci/` or `ci-cross/`) `gcr.io/kubernetes-ci-images` will + be used as a default for control plane components and for kube-proxy, + while `k8s.gcr.io` will be used for all the other images. + 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/api-conventions.md#types-kinds' + type: string + kubernetesVersion: + description: KubernetesVersion is the target version of the control + plane. + type: string + networking: + description: Networking holds configuration for the networking topology + of the cluster. + properties: + dnsDomain: + description: DNSDomain is the dns domain used by k8s services. + Defaults to "cluster.local". + type: string + podSubnet: + description: PodSubnet is the subnet used by pods. + type: string + serviceSubnet: + description: ServiceSubnet is the subnet used by k8s services. + Defaults to "10.96.0.0/12". + type: string + required: + - serviceSubnet + - podSubnet + - dnsDomain + type: object + scheduler: + description: Scheduler contains extra settings for the scheduler + control plane component + properties: + extraArgs: + description: 'ExtraArgs is an extra set of flags to pass to + the control plane component. TODO: This is temporary and ideally + we would like to switch all components to use ComponentConfig + + ConfigMaps.' + type: object + extraVolumes: + description: ExtraVolumes is an extra set of host volumes, mounted + to the control plane component. + items: + properties: + hostPath: + description: HostPath is the path in the host that will + be mounted inside the pod. + type: string + mountPath: + description: MountPath is the path inside the pod where + hostPath will be mounted. + type: string + name: + description: Name of the volume inside the pod template. + type: string + pathType: + description: PathType is the type of the HostPath. + type: string + readOnly: + description: ReadOnly controls write access to the volume + type: boolean + required: + - name + - hostPath + - mountPath + type: object + type: array + type: object + useHyperKubeImage: + description: UseHyperKubeImage controls if hyperkube should be used + for Kubernetes components instead of their respective separate + images + type: boolean + required: + - etcd + - networking + - kubernetesVersion + - controlPlaneEndpoint + - dns + - certificatesDir + - imageRepository + type: object + disablePortSecurity: + description: DisablePortSecurity disables the port security of the network + created for the Kubernetes cluster, which also disables SecurityGroups + type: boolean + disableServerTags: + description: 'Default: True. In case of server tag errors, set to False' + type: boolean + dnsNameservers: + description: DNSNameservers is the list of nameservers for OpenStack + Subnet being created. + items: + type: string + type: array + etcdCAKeyPair: + description: EtcdCAKeyPair is the key pair for etcd. + properties: + cert: + description: base64 encoded cert and key + format: byte + type: string + key: + format: byte + type: string + type: object + externalNetworkId: + description: ExternalNetworkID is the ID of an external OpenStack Network. + This is necessary to get public internet to the VMs. + type: string + externalRouterIPs: + description: ExternalRouterIPs is an array of externalIPs on the respective + subnets. This is necessary if the router needs a fixed ip in a specific + subnet. + items: + properties: + fixedIP: + description: The FixedIP in the corresponding subnet + type: string + subnet: + description: The subnet in which the FixedIP is used for the Gateway + of this router + properties: + filter: + description: Filters for optional network query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + id: + type: string + ipVersion: + format: int64 + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + format: int64 + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: The UUID of the network. Required if you omit + the port attribute. + type: string + type: object + required: + - subnet + type: object + type: array + frontProxyCAKeyPair: + description: FrontProxyCAKeyPair is the key pair for FrontProxyKeyPair. + properties: + cert: + description: base64 encoded cert and key + format: byte + type: string + key: + format: byte + type: string + type: object + managedAPIServerLoadBalancer: + description: 'ManagedAPIServerLoadBalancer defines whether a LoadBalancer + for the APIServer should be created. If set to true the following + properties are mandatory: APIServerLoadBalancerFloatingIP, APIServerLoadBalancerPort' + type: boolean + managedSecurityGroups: + description: ManagedSecurityGroups defines that kubernetes manages the + OpenStack security groups for now, that means that we'll create two + security groups, one allowing SSH and API access from everywhere, + and another one that allows all traffic to/from machines belonging + to that group. In the future, we could make this more flexible. + type: boolean + nodeCidr: + description: NodeCIDR is the OpenStack Subnet to be created. Cluster + actuator will create a network, a subnet with NodeCIDR, and a router + connected to this subnet. If you leave this empty, no network will + be created. + type: string + saKeyPair: + description: SAKeyPair is the service account key pair. + properties: + cert: + description: base64 encoded cert and key + format: byte + type: string + key: + format: byte + type: string + type: object + tags: + description: Tags for all resources in cluster + items: + type: string + type: array + useOctavia: + description: UseOctavia is weather LoadBalancer Service is Octavia or + not + type: boolean + required: + - cloudsSecret + - cloudName + - useOctavia + - managedAPIServerLoadBalancer + - managedSecurityGroups + type: object + status: + properties: + apiEndpoints: + description: APIEndpoints represents the endpoints to communicate with + the control plane. + items: + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int64 + type: integer + required: + - host + - port + type: object + type: array + controlPlaneSecurityGroup: + description: 'ControlPlaneSecurityGroups contains all the information + about the OpenStack Security Group that needs to be applied to control + plane nodes. TODO: Maybe instead of two properties, we add a property + to the group?' + properties: + id: + type: string + name: + type: string + rules: + items: + properties: + direction: + type: string + etherType: + type: string + name: + type: string + portRangeMax: + format: int64 + type: integer + portRangeMin: + format: int64 + type: integer + protocol: + type: string + remoteGroupID: + type: string + remoteIPPrefix: + type: string + securityGroupID: + type: string + required: + - name + - direction + - etherType + - securityGroupID + - portRangeMin + - portRangeMax + - protocol + - remoteGroupID + - remoteIPPrefix + type: object + type: array + required: + - name + - id + - rules + type: object + globalSecurityGroup: + description: GlobalSecurityGroup contains all the information about + the OpenStack Security Group that needs to be applied to all nodes, + both control plane and worker nodes. + properties: + id: + type: string + name: + type: string + rules: + items: + properties: + direction: + type: string + etherType: + type: string + name: + type: string + portRangeMax: + format: int64 + type: integer + portRangeMin: + format: int64 + type: integer + protocol: + type: string + remoteGroupID: + type: string + remoteIPPrefix: + type: string + securityGroupID: + type: string + required: + - name + - direction + - etherType + - securityGroupID + - portRangeMin + - portRangeMax + - protocol + - remoteGroupID + - remoteIPPrefix + type: object + type: array + required: + - name + - id + - rules + type: object + network: + description: Network contains all information about the created OpenStack + Network. It includes Subnets and Router. + properties: + apiServerLoadBalancer: + description: Be careful when using APIServerLoadBalancer, because + this field is optional and therefore not set in all cases + properties: + id: + type: string + internalIP: + type: string + ip: + type: string + name: + type: string + required: + - name + - id + - ip + - internalIP + type: object + id: + type: string + name: + type: string + router: + properties: + id: + type: string + name: + type: string + required: + - name + - id + type: object + subnet: + properties: + cidr: + type: string + id: + type: string + name: + type: string + required: + - name + - id + - cidr + type: object + required: + - name + - id + type: object + ready: + type: boolean + required: + - ready + type: object + version: v1alpha2 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/crds/infrastructure_v1alpha2_openstackmachine.yaml b/config/crds/infrastructure_v1alpha2_openstackmachine.yaml new file mode 100644 index 0000000000..8458d1286a --- /dev/null +++ b/config/crds/infrastructure_v1alpha2_openstackmachine.yaml @@ -0,0 +1,544 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: openstackmachines.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + kind: OpenStackMachine + plural: openstackmachines + scope: Namespaced + validation: + openAPIV3Schema: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + availabilityZone: + description: The availability zone from which to launch the server. + type: string + cloudName: + description: The name of the cloud to use from the clouds secret + type: string + cloudsSecret: + description: The name of the secret containing the openstack credentials + type: object + configDrive: + description: Config Drive support + type: boolean + flavor: + description: The flavor reference for the flavor for your server instance. + type: string + floatingIP: + description: The floatingIP which will be associated to the machine, + only used for master. The floatingIP should have been created and + haven't been associated. + type: string + image: + description: The name of the image to use for your server instance. + If the RootVolume is specified, this will be ignored and use rootVolume + directly. + type: string + keyName: + description: The ssh key to inject in the instance + type: string + kubeadmConfiguration: + description: KubeadmConfiguration holds the kubeadm configuration options + properties: + init: + description: InitConfiguration is used to customize any kubeadm + init configuration parameters. + 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/api-conventions.md#resources' + type: string + bootstrapTokens: + description: BootstrapTokens is respected at `kubeadm init` + time and describes a set of Bootstrap Tokens to create. This + information IS NOT uploaded to the kubeadm cluster configmap, + partly because of its sensitive nature + items: + properties: + description: + description: Description sets a human-friendly message + why this token exists and what it's used for, so other + administrators can know its purpose. + type: string + expires: + description: Expires specifies the timestamp when this + token expires. Defaults to being set dynamically at + runtime based on the TTL. Expires and TTL are mutually + exclusive. + format: date-time + type: string + groups: + description: Groups specifies the extra groups that this + token will authenticate as when/if used for authentication + items: + type: string + type: array + token: + description: Token is used for establishing bidirectional + trust between nodes and masters. Used for joining nodes + in the cluster. + type: object + ttl: + description: TTL defines the time to live for this token. + Defaults to 24h. Expires and TTL are mutually exclusive. + type: string + usages: + description: Usages describes the ways in which this token + can be used. Can by default be used for establishing + bidirectional trust, but that can be changed here. + items: + type: string + type: array + required: + - token + type: object + type: array + 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/api-conventions.md#types-kinds' + type: string + localAPIEndpoint: + description: LocalAPIEndpoint represents the endpoint of the + API server instance that's deployed on this control plane + node In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint + in the sense that ControlPlaneEndpoint is the global endpoint + for the cluster, which then loadbalances the requests to each + individual API server. This configuration object lets you + customize what IP/DNS name and port the local API server advertises + it's accessible on. By default, kubeadm tries to auto-detect + the IP of the default interface and use that, but in case + that process fails you may set the desired value here. + properties: + advertiseAddress: + description: AdvertiseAddress sets the IP address for the + API server to advertise. + type: string + bindPort: + description: BindPort sets the secure port for the API Server + to bind to. Defaults to 6443. + format: int32 + type: integer + required: + - advertiseAddress + - bindPort + type: object + nodeRegistration: + description: NodeRegistration holds fields that relate to registering + the new master node to the cluster + properties: + criSocket: + description: CRISocket is used to retrieve container runtime + info. This information will be annotated to the Node API + object, for later re-use + type: string + kubeletExtraArgs: + description: KubeletExtraArgs passes through extra arguments + to the kubelet. The arguments here are passed to the kubelet + command line via the environment file kubeadm writes at + runtime for the kubelet to source. This overrides the + generic base-level configuration in the kubelet-config-1.X + ConfigMap Flags have higher priority when parsing. These + values are local and specific to the node kubeadm is executing + on. + type: object + name: + description: Name is the `.Metadata.Name` field of the Node + API object that will be created in this `kubeadm init` + or `kubeadm joiń` operation. This field is also used in + the CommonName field of the kubelet's client certificate + to the API server. Defaults to the hostname of the node + if not provided. + type: string + taints: + description: 'Taints specifies the taints the Node API object + should be registered with. If this field is unset, i.e. + nil, in the `kubeadm init` process it will be defaulted + to []v1.Taint{''node-role.kubernetes.io/master=""''}. + If you don''t want to taint your master node, set this + field to an empty slice, i.e. `taints: {}` in the YAML + file. This field is solely used for Node registration.' + items: + type: object + type: array + type: object + type: object + join: + description: JoinConfiguration is used to customize any kubeadm + join configuration parameters. + 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/api-conventions.md#resources' + type: string + caCertPath: + description: CACertPath is the path to the SSL certificate authority + used to secure comunications between node and master. Defaults + to "/etc/kubernetes/pki/ca.crt". + type: string + controlPlane: + description: ControlPlane defines the additional control plane + instance to be deployed on the joining node. If nil, no additional + control plane instance will be deployed. + properties: + localAPIEndpoint: + description: LocalAPIEndpoint represents the endpoint of + the API server instance to be deployed on this node. + properties: + advertiseAddress: + description: AdvertiseAddress sets the IP address for + the API server to advertise. + type: string + bindPort: + description: BindPort sets the secure port for the API + Server to bind to. Defaults to 6443. + format: int32 + type: integer + required: + - advertiseAddress + - bindPort + type: object + type: object + discovery: + description: Discovery specifies the options for the kubelet + to use during the TLS Bootstrap process + properties: + bootstrapToken: + description: BootstrapToken is used to set the options for + bootstrap token based discovery BootstrapToken and File + are mutually exclusive + properties: + apiServerEndpoint: + description: APIServerEndpoint is an IP or domain name + to the API server from which info will be fetched. + type: string + caCertHashes: + description: 'CACertHashes specifies a set of public + key pins to verify when token-based discovery is used. + The root CA found during discovery must match one + of these values. Specifying an empty set disables + root CA pinning, which can be unsafe. Each hash is + specified as ":", where the only currently + supported type is "sha256". This is a hex-encoded + SHA-256 hash of the Subject Public Key Info (SPKI) + object in DER-encoded ASN.1. These hashes can be calculated + using, for example, OpenSSL: openssl x509 -pubkey + -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null + | openssl dgst -sha256 -hex' + items: + type: string + type: array + token: + description: Token is a token used to validate cluster + information fetched from the master. + type: string + unsafeSkipCAVerification: + description: UnsafeSkipCAVerification allows token-based + discovery without CA verification via CACertHashes. + This can weaken the security of kubeadm since other + nodes can impersonate the master. + type: boolean + required: + - token + - unsafeSkipCAVerification + type: object + file: + description: File is used to specify a file or URL to a + kubeconfig file from which to load cluster information + BootstrapToken and File are mutually exclusive + properties: + kubeConfigPath: + description: KubeConfigPath is used to specify the actual + file path or URL to the kubeconfig file from which + to load cluster information + type: string + required: + - kubeConfigPath + type: object + timeout: + description: Timeout modifies the discovery timeout + type: string + tlsBootstrapToken: + description: TLSBootstrapToken is a token used for TLS bootstrapping. + If .BootstrapToken is set, this field is defaulted to + .BootstrapToken.Token, but can be overridden. If .File + is set, this field **must be set** in case the KubeConfigFile + does not contain any other authentication information + type: string + required: + - tlsBootstrapToken + type: object + 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/api-conventions.md#types-kinds' + type: string + nodeRegistration: + description: NodeRegistration holds fields that relate to registering + the new master node to the cluster + properties: + criSocket: + description: CRISocket is used to retrieve container runtime + info. This information will be annotated to the Node API + object, for later re-use + type: string + kubeletExtraArgs: + description: KubeletExtraArgs passes through extra arguments + to the kubelet. The arguments here are passed to the kubelet + command line via the environment file kubeadm writes at + runtime for the kubelet to source. This overrides the + generic base-level configuration in the kubelet-config-1.X + ConfigMap Flags have higher priority when parsing. These + values are local and specific to the node kubeadm is executing + on. + type: object + name: + description: Name is the `.Metadata.Name` field of the Node + API object that will be created in this `kubeadm init` + or `kubeadm joiń` operation. This field is also used in + the CommonName field of the kubelet's client certificate + to the API server. Defaults to the hostname of the node + if not provided. + type: string + taints: + description: 'Taints specifies the taints the Node API object + should be registered with. If this field is unset, i.e. + nil, in the `kubeadm init` process it will be defaulted + to []v1.Taint{''node-role.kubernetes.io/master=""''}. + If you don''t want to taint your master node, set this + field to an empty slice, i.e. `taints: {}` in the YAML + file. This field is solely used for Node registration.' + items: + type: object + type: array + type: object + required: + - nodeRegistration + - caCertPath + - discovery + type: object + type: object + networks: + description: A networks object. Required parameter when there are multiple + networks defined for the tenant. When you do not specify the networks + parameter, the server attaches to the only network created for the + current tenant. + items: + properties: + filter: + description: Filters for optional network query + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + format: int64 + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + fixedIp: + description: A fixed IPv4 address for the NIC. + type: string + subnets: + description: Subnet within a network to use + items: + properties: + filter: + description: Filters for optional network query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + id: + type: string + ipVersion: + format: int64 + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + format: int64 + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: The UUID of the network. Required if you omit + the port attribute. + type: string + type: object + type: array + uuid: + description: The UUID of the network. Required if you omit the + port attribute. + type: string + type: object + type: array + rootVolume: + description: The volume metadata to boot from + properties: + deviceType: + type: string + diskSize: + format: int64 + type: integer + sourceType: + type: string + sourceUUID: + type: string + required: + - deviceType + type: object + securityGroups: + description: The names of the security groups to assign to the instance + items: + properties: + filter: + description: Filters used to query security groups in openstack + properties: + description: + type: string + id: + type: string + limit: + format: int64 + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + name: + description: Security Group name + type: string + uuid: + description: Security Group UID + type: string + type: object + type: array + serverMetadata: + description: Metadata mapping. Allows you to create a map of key value + pairs to add to the server instance. + type: object + tags: + description: Machine tags Requires Nova api 2.52 minimum! + items: + type: string + type: array + trunk: + description: Whether the server instance is created on a trunk port + or not. + type: boolean + userDataSecret: + description: The name of the secret containing the user data (startup + script in most cases) + type: object + required: + - cloudsSecret + - cloudName + - flavor + - image + type: object + status: + type: object + version: v1alpha2 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/samples/infrastructure_v1alpha2_openstackcluster.yaml b/config/samples/infrastructure_v1alpha2_openstackcluster.yaml new file mode 100644 index 0000000000..5df4b13f92 --- /dev/null +++ b/config/samples/infrastructure_v1alpha2_openstackcluster.yaml @@ -0,0 +1,9 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2 +kind: OpenStackCluster +metadata: + labels: + controller-tools.k8s.io: "1.0" + name: openstackcluster-sample +spec: + # Add fields here + foo: bar diff --git a/config/samples/infrastructure_v1alpha2_openstackmachine.yaml b/config/samples/infrastructure_v1alpha2_openstackmachine.yaml new file mode 100644 index 0000000000..704867a1d6 --- /dev/null +++ b/config/samples/infrastructure_v1alpha2_openstackmachine.yaml @@ -0,0 +1,9 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2 +kind: OpenStackMachine +metadata: + labels: + controller-tools.k8s.io: "1.0" + name: openstackmachine-sample +spec: + # Add fields here + foo: bar diff --git a/go.mod b/go.mod index 4a2bb171a9..f829712447 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,10 @@ require ( github.com/coreos/ignition v0.33.0 // indirect github.com/gophercloud/gophercloud v0.3.0 github.com/gophercloud/utils v0.0.0-20190527093828-25f1b77b8c03 + github.com/onsi/gomega v1.5.0 github.com/pkg/errors v0.8.1 github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb // indirect + golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 gopkg.in/yaml.v2 v2.2.2 k8s.io/api v0.0.0-20190814101207-0772a1bdf941 k8s.io/apimachinery v0.0.0-20190814100815-533d101be9a6 diff --git a/pkg/apis/infrastructure/group.go b/pkg/apis/infrastructure/group.go new file mode 100644 index 0000000000..4cc06ba5ea --- /dev/null +++ b/pkg/apis/infrastructure/group.go @@ -0,0 +1,18 @@ +/* +Copyright 2018 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 infrastructure contains infrastructure API versions +package infrastructure diff --git a/pkg/apis/infrastructure/v1alpha2/doc.go b/pkg/apis/infrastructure/v1alpha2/doc.go new file mode 100644 index 0000000000..024aca6339 --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2018 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 v1alpha2 contains API Schema definitions for the infrastructure v1alpha2 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/infrastructure +// +k8s:defaulter-gen=TypeMeta +// +groupName=infrastructure.cluster.x-k8s.io +package v1alpha2 diff --git a/pkg/apis/infrastructure/v1alpha2/openstackcluster_types.go b/pkg/apis/infrastructure/v1alpha2/openstackcluster_types.go new file mode 100644 index 0000000000..93e6a50b7b --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/openstackcluster_types.go @@ -0,0 +1,153 @@ +/* +Copyright 2018 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 v1alpha2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + kubeadmv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// OpenStackClusterSpec defines the desired state of OpenStackCluster +type OpenStackClusterSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // The name of the secret containing the openstack credentials + CloudsSecret *corev1.SecretReference `json:"cloudsSecret"` + + // The name of the cloud to use from the clouds secret + CloudName string `json:"cloudName"` + + // NodeCIDR is the OpenStack Subnet to be created. Cluster actuator will create a + // network, a subnet with NodeCIDR, and a router connected to this subnet. + // If you leave this empty, no network will be created. + NodeCIDR string `json:"nodeCidr,omitempty"` + // DNSNameservers is the list of nameservers for OpenStack Subnet being created. + DNSNameservers []string `json:"dnsNameservers,omitempty"` + // ExternalRouterIPs is an array of externalIPs on the respective subnets. + // This is necessary if the router needs a fixed ip in a specific subnet. + ExternalRouterIPs []ExternalRouterIPParam `json:"externalRouterIPs,omitempty"` + // ExternalNetworkID is the ID of an external OpenStack Network. This is necessary + // to get public internet to the VMs. + ExternalNetworkID string `json:"externalNetworkId,omitempty"` + // UseOctavia is weather LoadBalancer Service is Octavia or not + UseOctavia bool `json:"useOctavia"` + + // ManagedAPIServerLoadBalancer defines whether a LoadBalancer for the + // APIServer should be created. If set to true the following properties are + // mandatory: APIServerLoadBalancerFloatingIP, APIServerLoadBalancerPort + ManagedAPIServerLoadBalancer bool `json:"managedAPIServerLoadBalancer"` + + // APIServerLoadBalancerFloatingIP is the floatingIP which will be associated + // to the APIServer loadbalancer. The floatingIP will be created if it not + // already exists. + APIServerLoadBalancerFloatingIP string `json:"apiServerLoadBalancerFloatingIP,omitempty"` + + // APIServerLoadBalancerPort is the port on which the listener on the APIServer + // loadbalancer will be created + APIServerLoadBalancerPort int `json:"apiServerLoadBalancerPort,omitempty"` + + // APIServerLoadBalancerAdditionalPorts adds additional ports to the APIServerLoadBalancer + APIServerLoadBalancerAdditionalPorts []int `json:"apiServerLoadBalancerAdditionalPorts,omitempty"` + + // ManagedSecurityGroups defines that kubernetes manages the OpenStack security groups + // for now, that means that we'll create two security groups, one allowing SSH + // and API access from everywhere, and another one that allows all traffic to/from + // machines belonging to that group. In the future, we could make this more flexible. + ManagedSecurityGroups bool `json:"managedSecurityGroups"` + + // DisablePortSecurity disables the port security of the network created for the + // Kubernetes cluster, which also disables SecurityGroups + DisablePortSecurity bool `json:"disablePortSecurity,omitempty"` + + // Tags for all resources in cluster + Tags []string `json:"tags,omitempty"` + + // Default: True. In case of server tag errors, set to False + DisableServerTags bool `json:"disableServerTags,omitempty"` + + // CAKeyPair is the key pair for ca certs. + CAKeyPair KeyPair `json:"caKeyPair,omitempty"` + + //EtcdCAKeyPair is the key pair for etcd. + EtcdCAKeyPair KeyPair `json:"etcdCAKeyPair,omitempty"` + + // FrontProxyCAKeyPair is the key pair for FrontProxyKeyPair. + FrontProxyCAKeyPair KeyPair `json:"frontProxyCAKeyPair,omitempty"` + + // SAKeyPair is the service account key pair. + SAKeyPair KeyPair `json:"saKeyPair,omitempty"` + + // ClusterConfiguration holds the cluster-wide information used during a + // kubeadm init call. + ClusterConfiguration kubeadmv1beta1.ClusterConfiguration `json:"clusterConfiguration,omitempty"` +} + +// OpenStackClusterStatus defines the observed state of OpenStackCluster +type OpenStackClusterStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file + + Ready bool `json:"ready"` + // APIEndpoints represents the endpoints to communicate with the control plane. + // +optional + APIEndpoints []APIEndpoint `json:"apiEndpoints,omitempty"` + + // Network contains all information about the created OpenStack Network. + // It includes Subnets and Router. + Network *Network `json:"network,omitempty"` + + // ControlPlaneSecurityGroups contains all the information about the OpenStack + // Security Group that needs to be applied to control plane nodes. + // TODO: Maybe instead of two properties, we add a property to the group? + ControlPlaneSecurityGroup *SecurityGroup `json:"controlPlaneSecurityGroup,omitempty"` + + // GlobalSecurityGroup contains all the information about the OpenStack Security + // Group that needs to be applied to all nodes, both control plane and worker nodes. + GlobalSecurityGroup *SecurityGroup `json:"globalSecurityGroup,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OpenStackCluster is the Schema for the openstackclusters API +// +k8s:openapi-gen=true +type OpenStackCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackClusterSpec `json:"spec,omitempty"` + Status OpenStackClusterStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OpenStackClusterList contains a list of OpenStackCluster +type OpenStackClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&OpenStackCluster{}, &OpenStackClusterList{}) +} diff --git a/pkg/apis/infrastructure/v1alpha2/openstackcluster_types_test.go b/pkg/apis/infrastructure/v1alpha2/openstackcluster_types_test.go new file mode 100644 index 0000000000..8bb65e866e --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/openstackcluster_types_test.go @@ -0,0 +1,61 @@ +/* +Copyright 2018 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 v1alpha2 + +import ( + "testing" + + "github.com/onsi/gomega" + "golang.org/x/net/context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +func TestStorageOpenStackCluster(t *testing.T) { + // For now, until the migration to v1alpha2 is finished + t.Skip() + + key := types.NamespacedName{ + Name: "foo", + Namespace: "default", + } + created := &OpenStackCluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "default", + }} + g := gomega.NewGomegaWithT(t) + + // Test Create + fetched := &OpenStackCluster{} + g.Expect(c.Create(context.TODO(), created)).To(gomega.Succeed()) + + g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed()) + g.Expect(fetched).To(gomega.Equal(created)) + + // Test Updating the Labels + updated := fetched.DeepCopy() + updated.Labels = map[string]string{"hello": "world"} + g.Expect(c.Update(context.TODO(), updated)).To(gomega.Succeed()) + + g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed()) + g.Expect(fetched).To(gomega.Equal(updated)) + + // Test Delete + g.Expect(c.Delete(context.TODO(), fetched)).To(gomega.Succeed()) + g.Expect(c.Get(context.TODO(), key, fetched)).ToNot(gomega.Succeed()) +} diff --git a/pkg/apis/infrastructure/v1alpha2/openstackmachine_types.go b/pkg/apis/infrastructure/v1alpha2/openstackmachine_types.go new file mode 100644 index 0000000000..6e6d3879f1 --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/openstackmachine_types.go @@ -0,0 +1,115 @@ +/* +Copyright 2018 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 v1alpha2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// OpenStackMachineSpec defines the desired state of OpenStackMachine +type OpenStackMachineSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // The name of the secret containing the openstack credentials + CloudsSecret *corev1.SecretReference `json:"cloudsSecret"` + + // The name of the cloud to use from the clouds secret + CloudName string `json:"cloudName"` + + // The flavor reference for the flavor for your server instance. + Flavor string `json:"flavor"` + + // The name of the image to use for your server instance. + // If the RootVolume is specified, this will be ignored and use rootVolume directly. + Image string `json:"image"` + + // The ssh key to inject in the instance + KeyName string `json:"keyName,omitempty"` + + // A networks object. Required parameter when there are multiple networks defined for the tenant. + // When you do not specify the networks parameter, the server attaches to the only network created for the current tenant. + Networks []NetworkParam `json:"networks,omitempty"` + // The floatingIP which will be associated to the machine, only used for master. + // The floatingIP should have been created and haven't been associated. + FloatingIP string `json:"floatingIP,omitempty"` + + // The availability zone from which to launch the server. + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // The names of the security groups to assign to the instance + SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"` + + // The name of the secret containing the user data (startup script in most cases) + UserDataSecret *corev1.SecretReference `json:"userDataSecret,omitempty"` + + // Whether the server instance is created on a trunk port or not. + Trunk bool `json:"trunk,omitempty"` + + // Machine tags + // Requires Nova api 2.52 minimum! + Tags []string `json:"tags,omitempty"` + + // Metadata mapping. Allows you to create a map of key value pairs to add to the server instance. + ServerMetadata map[string]string `json:"serverMetadata,omitempty"` + + // Config Drive support + ConfigDrive *bool `json:"configDrive,omitempty"` + + // The volume metadata to boot from + RootVolume *RootVolume `json:"rootVolume,omitempty"` + + // KubeadmConfiguration holds the kubeadm configuration options + // +optional + KubeadmConfiguration KubeadmConfiguration `json:"kubeadmConfiguration,omitempty"` +} + +// OpenStackMachineStatus defines the observed state of OpenStackMachine +type OpenStackMachineStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OpenStackMachine is the Schema for the openstackmachines API +// +k8s:openapi-gen=true +type OpenStackMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackMachineSpec `json:"spec,omitempty"` + Status OpenStackMachineStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OpenStackMachineList contains a list of OpenStackMachine +type OpenStackMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&OpenStackMachine{}, &OpenStackMachineList{}) +} diff --git a/pkg/apis/infrastructure/v1alpha2/openstackmachine_types_test.go b/pkg/apis/infrastructure/v1alpha2/openstackmachine_types_test.go new file mode 100644 index 0000000000..46a056d38d --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/openstackmachine_types_test.go @@ -0,0 +1,61 @@ +/* +Copyright 2018 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 v1alpha2 + +import ( + "testing" + + "github.com/onsi/gomega" + "golang.org/x/net/context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +func TestStorageOpenStackMachine(t *testing.T) { + // For now, until the migration to v1alpha2 is finished + t.Skip() + + key := types.NamespacedName{ + Name: "foo", + Namespace: "default", + } + created := &OpenStackMachine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Namespace: "default", + }} + g := gomega.NewGomegaWithT(t) + + // Test Create + fetched := &OpenStackMachine{} + g.Expect(c.Create(context.TODO(), created)).To(gomega.Succeed()) + + g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed()) + g.Expect(fetched).To(gomega.Equal(created)) + + // Test Updating the Labels + updated := fetched.DeepCopy() + updated.Labels = map[string]string{"hello": "world"} + g.Expect(c.Update(context.TODO(), updated)).To(gomega.Succeed()) + + g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed()) + g.Expect(fetched).To(gomega.Equal(updated)) + + // Test Delete + g.Expect(c.Delete(context.TODO(), fetched)).To(gomega.Succeed()) + g.Expect(c.Get(context.TODO(), key, fetched)).ToNot(gomega.Succeed()) +} diff --git a/pkg/apis/infrastructure/v1alpha2/register.go b/pkg/apis/infrastructure/v1alpha2/register.go new file mode 100644 index 0000000000..5e427884bb --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/register.go @@ -0,0 +1,46 @@ +/* +Copyright 2018 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. +*/ + +// NOTE: Boilerplate only. Ignore this file. + +// Package v1alpha2 contains API Schema definitions for the infrastructure v1alpha2 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/infrastructure +// +k8s:defaulter-gen=TypeMeta +// +groupName=infrastructure.cluster.x-k8s.io +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha2"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme is required by pkg/client/... + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource is required by pkg/client/listers/... +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/pkg/apis/infrastructure/v1alpha2/types.go b/pkg/apis/infrastructure/v1alpha2/types.go new file mode 100644 index 0000000000..61d18247f6 --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/types.go @@ -0,0 +1,207 @@ +package v1alpha2 + +import ( + kubeadmv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" +) + +type ExternalRouterIPParam struct { + // The FixedIP in the corresponding subnet + FixedIP string `json:"fixedIP,omitempty"` + // The subnet in which the FixedIP is used for the Gateway of this router + Subnet SubnetParam `json:"subnet"` +} + +// KubeadmConfiguration holds the various configurations that kubeadm uses +type KubeadmConfiguration struct { + // JoinConfiguration is used to customize any kubeadm join configuration + // parameters. + Join kubeadmv1beta1.JoinConfiguration `json:"join,omitempty"` + + // InitConfiguration is used to customize any kubeadm init configuration + // parameters. + Init kubeadmv1beta1.InitConfiguration `json:"init,omitempty"` +} + +type SecurityGroupParam struct { + // Security Group UID + UUID string `json:"uuid,omitempty"` + // Security Group name + Name string `json:"name,omitempty"` + // Filters used to query security groups in openstack + Filter SecurityGroupFilter `json:"filter,omitempty"` +} + +type SecurityGroupFilter struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + TenantID string `json:"tenantId,omitempty"` + ProjectID string `json:"projectId,omitempty"` + Limit int `json:"limit,omitempty"` + Marker string `json:"marker,omitempty"` + SortKey string `json:"sortKey,omitempty"` + SortDir string `json:"sortDir,omitempty"` + Tags string `json:"tags,omitempty"` + TagsAny string `json:"tagsAny,omitempty"` + NotTags string `json:"notTags,omitempty"` + NotTagsAny string `json:"notTagsAny,omitempty"` +} + +type NetworkParam struct { + // The UUID of the network. Required if you omit the port attribute. + UUID string `json:"uuid,omitempty"` + // A fixed IPv4 address for the NIC. + FixedIp string `json:"fixedIp,omitempty"` + // Filters for optional network query + Filter Filter `json:"filter,omitempty"` + // Subnet within a network to use + Subnets []SubnetParam `json:"subnets,omitempty"` +} + +type Filter struct { + Status string `json:"status,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + AdminStateUp *bool `json:"adminStateUp,omitempty"` + TenantID string `json:"tenantId,omitempty"` + ProjectID string `json:"projectId,omitempty"` + Shared *bool `json:"shared,omitempty"` + ID string `json:"id,omitempty"` + Marker string `json:"marker,omitempty"` + Limit int `json:"limit,omitempty"` + SortKey string `json:"sortKey,omitempty"` + SortDir string `json:"sortDir,omitempty"` + Tags string `json:"tags,omitempty"` + TagsAny string `json:"tagsAny,omitempty"` + NotTags string `json:"notTags,omitempty"` + NotTagsAny string `json:"notTagsAny,omitempty"` +} + +type SubnetParam struct { + // The UUID of the network. Required if you omit the port attribute. + UUID string `json:"uuid,omitempty"` + + // Filters for optional network query + Filter SubnetFilter `json:"filter,omitempty"` +} + +type SubnetFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + EnableDHCP *bool `json:"enableDhcp,omitempty"` + NetworkID string `json:"networkId,omitempty"` + TenantID string `json:"tenantId,omitempty"` + ProjectID string `json:"projectId,omitempty"` + IPVersion int `json:"ipVersion,omitempty"` + GatewayIP string `json:"gateway_ip,omitempty"` + CIDR string `json:"cidr,omitempty"` + IPv6AddressMode string `json:"ipv6AddressMode,omitempty"` + IPv6RAMode string `json:"ipv6RaMode,omitempty"` + ID string `json:"id,omitempty"` + SubnetPoolID string `json:"subnetpoolId,omitempty"` + Limit int `json:"limit,omitempty"` + Marker string `json:"marker,omitempty"` + SortKey string `json:"sortKey,omitempty"` + SortDir string `json:"sortDir,omitempty"` + Tags string `json:"tags,omitempty"` + TagsAny string `json:"tagsAny,omitempty"` + NotTags string `json:"notTags,omitempty"` + NotTagsAny string `json:"notTagsAny,omitempty"` +} + +// APIEndpoint represents a reachable Kubernetes API endpoint. +type APIEndpoint struct { + // The hostname on which the API server is serving. + Host string `json:"host"` + + // The port on which the API server is serving. + Port int `json:"port"` +} + +type RootVolume struct { + SourceType string `json:"sourceType,omitempty"` + SourceUUID string `json:"sourceUUID,omitempty"` + DeviceType string `json:"deviceType"` + Size int `json:"diskSize,omitempty"` +} + +// KeyPair is how operators can supply custom keypairs for kubeadm to use. +type KeyPair struct { + // base64 encoded cert and key + Cert []byte `json:"cert,omitempty"` + Key []byte `json:"key,omitempty"` +} + +// HasCertAndKey returns whether a keypair contains cert and key of non-zero length. +func (kp *KeyPair) HasCertAndKey() bool { + return len(kp.Cert) != 0 && len(kp.Key) != 0 +} + +// Network represents basic information about the associated OpenStach Neutron Network +type Network struct { + Name string `json:"name"` + ID string `json:"id"` + + Subnet *Subnet `json:"subnet,omitempty"` + Router *Router `json:"router,omitempty"` + + // Be careful when using APIServerLoadBalancer, because this field is optional and therefore not + // set in all cases + APIServerLoadBalancer *LoadBalancer `json:"apiServerLoadBalancer,omitempty"` +} + +// Subnet represents basic information about the associated OpenStack Neutron Subnet +type Subnet struct { + Name string `json:"name"` + ID string `json:"id"` + + CIDR string `json:"cidr"` +} + +// Router represents basic information about the associated OpenStack Neutron Router +type Router struct { + Name string `json:"name"` + ID string `json:"id"` +} + +// LoadBalancer represents basic information about the associated OpenStack LoadBalancer +type LoadBalancer struct { + Name string `json:"name"` + ID string `json:"id"` + IP string `json:"ip"` + InternalIP string `json:"internalIP"` +} + +// SecurityGroup represents the basic information of the associated +// OpenStack Neutron Security Group. +type SecurityGroup struct { + Name string `json:"name"` + ID string `json:"id"` + Rules []SecurityGroupRule `json:"rules"` +} + +// SecurityGroupRule represent the basic information of the associated OpenStack +// Security Group Role. +type SecurityGroupRule struct { + ID string `json:"name"` + Direction string `json:"direction"` + EtherType string `json:"etherType"` + SecurityGroupID string `json:"securityGroupID"` + PortRangeMin int `json:"portRangeMin"` + PortRangeMax int `json:"portRangeMax"` + Protocol string `json:"protocol"` + RemoteGroupID string `json:"remoteGroupID"` + RemoteIPPrefix string `json:"remoteIPPrefix"` +} + +// Equal checks if two SecurityGroupRules are the same. +func (r SecurityGroupRule) Equal(x SecurityGroupRule) bool { + return (r.Direction == x.Direction && + r.EtherType == x.EtherType && + r.PortRangeMin == x.PortRangeMin && + r.PortRangeMax == x.PortRangeMax && + r.Protocol == x.Protocol && + r.RemoteGroupID == x.RemoteGroupID && + r.RemoteIPPrefix == x.RemoteIPPrefix) + +} diff --git a/pkg/apis/infrastructure/v1alpha2/v1alpha2_suite_test.go b/pkg/apis/infrastructure/v1alpha2/v1alpha2_suite_test.go new file mode 100644 index 0000000000..69aa80b105 --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/v1alpha2_suite_test.go @@ -0,0 +1,53 @@ +/* +Copyright 2018 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 v1alpha2 + +import ( + "testing" + + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +var cfg *rest.Config +var c client.Client + +func TestMain(m *testing.M) { + // For now, until the migration to v1alpha2 is finished + return + + //t := &envtest.Environment{ + // CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "config", "crds")}, + //} + // + //err := SchemeBuilder.AddToScheme(scheme.Scheme) + //if err != nil { + // log.Fatal(err) + //} + // + //if cfg, err = t.Start(); err != nil { + // log.Fatal(err) + //} + // + //if c, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}); err != nil { + // log.Fatal(err) + //} + // + //code := m.Run() + //t.Stop() + //os.Exit(code) +} diff --git a/pkg/apis/infrastructure/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/infrastructure/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 0000000000..13646a0186 --- /dev/null +++ b/pkg/apis/infrastructure/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,639 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 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 main. DO NOT EDIT. + +package v1alpha2 + +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 *APIEndpoint) DeepCopyInto(out *APIEndpoint) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. +func (in *APIEndpoint) DeepCopy() *APIEndpoint { + if in == nil { + return nil + } + out := new(APIEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalRouterIPParam) DeepCopyInto(out *ExternalRouterIPParam) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRouterIPParam. +func (in *ExternalRouterIPParam) DeepCopy() *ExternalRouterIPParam { + if in == nil { + return nil + } + out := new(ExternalRouterIPParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.AdminStateUp != nil { + in, out := &in.AdminStateUp, &out.AdminStateUp + *out = new(bool) + **out = **in + } + if in.Shared != nil { + in, out := &in.Shared, &out.Shared + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyPair) DeepCopyInto(out *KeyPair) { + *out = *in + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = make([]byte, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyPair. +func (in *KeyPair) DeepCopy() *KeyPair { + if in == nil { + return nil + } + out := new(KeyPair) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeadmConfiguration) DeepCopyInto(out *KubeadmConfiguration) { + *out = *in + in.Join.DeepCopyInto(&out.Join) + in.Init.DeepCopyInto(&out.Init) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfiguration. +func (in *KubeadmConfiguration) DeepCopy() *KubeadmConfiguration { + if in == nil { + return nil + } + out := new(KubeadmConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Network) DeepCopyInto(out *Network) { + *out = *in + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(Subnet) + **out = **in + } + if in.Router != nil { + in, out := &in.Router, &out.Router + *out = new(Router) + **out = **in + } + if in.APIServerLoadBalancer != nil { + in, out := &in.APIServerLoadBalancer, &out.APIServerLoadBalancer + *out = new(LoadBalancer) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. +func (in *Network) DeepCopy() *Network { + if in == nil { + return nil + } + out := new(Network) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkParam) DeepCopyInto(out *NetworkParam) { + *out = *in + in.Filter.DeepCopyInto(&out.Filter) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]SubnetParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkParam. +func (in *NetworkParam) DeepCopy() *NetworkParam { + if in == nil { + return nil + } + out := new(NetworkParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackCluster) DeepCopyInto(out *OpenStackCluster) { + *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 OpenStackCluster. +func (in *OpenStackCluster) DeepCopy() *OpenStackCluster { + if in == nil { + return nil + } + out := new(OpenStackCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackCluster) 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 *OpenStackClusterList) DeepCopyInto(out *OpenStackClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterList. +func (in *OpenStackClusterList) DeepCopy() *OpenStackClusterList { + if in == nil { + return nil + } + out := new(OpenStackClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackClusterList) 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 *OpenStackClusterSpec) DeepCopyInto(out *OpenStackClusterSpec) { + *out = *in + if in.CloudsSecret != nil { + in, out := &in.CloudsSecret, &out.CloudsSecret + *out = new(v1.SecretReference) + **out = **in + } + if in.DNSNameservers != nil { + in, out := &in.DNSNameservers, &out.DNSNameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExternalRouterIPs != nil { + in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs + *out = make([]ExternalRouterIPParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.APIServerLoadBalancerAdditionalPorts != nil { + in, out := &in.APIServerLoadBalancerAdditionalPorts, &out.APIServerLoadBalancerAdditionalPorts + *out = make([]int, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.CAKeyPair.DeepCopyInto(&out.CAKeyPair) + in.EtcdCAKeyPair.DeepCopyInto(&out.EtcdCAKeyPair) + in.FrontProxyCAKeyPair.DeepCopyInto(&out.FrontProxyCAKeyPair) + in.SAKeyPair.DeepCopyInto(&out.SAKeyPair) + in.ClusterConfiguration.DeepCopyInto(&out.ClusterConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterSpec. +func (in *OpenStackClusterSpec) DeepCopy() *OpenStackClusterSpec { + if in == nil { + return nil + } + out := new(OpenStackClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterStatus) DeepCopyInto(out *OpenStackClusterStatus) { + *out = *in + if in.APIEndpoints != nil { + in, out := &in.APIEndpoints, &out.APIEndpoints + *out = make([]APIEndpoint, len(*in)) + copy(*out, *in) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(Network) + (*in).DeepCopyInto(*out) + } + if in.ControlPlaneSecurityGroup != nil { + in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup + *out = new(SecurityGroup) + (*in).DeepCopyInto(*out) + } + if in.GlobalSecurityGroup != nil { + in, out := &in.GlobalSecurityGroup, &out.GlobalSecurityGroup + *out = new(SecurityGroup) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterStatus. +func (in *OpenStackClusterStatus) DeepCopy() *OpenStackClusterStatus { + if in == nil { + return nil + } + out := new(OpenStackClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachine) DeepCopyInto(out *OpenStackMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachine. +func (in *OpenStackMachine) DeepCopy() *OpenStackMachine { + if in == nil { + return nil + } + out := new(OpenStackMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachine) 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 *OpenStackMachineList) DeepCopyInto(out *OpenStackMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineList. +func (in *OpenStackMachineList) DeepCopy() *OpenStackMachineList { + if in == nil { + return nil + } + out := new(OpenStackMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachineList) 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 *OpenStackMachineSpec) DeepCopyInto(out *OpenStackMachineSpec) { + *out = *in + if in.CloudsSecret != nil { + in, out := &in.CloudsSecret, &out.CloudsSecret + *out = new(v1.SecretReference) + **out = **in + } + if in.Networks != nil { + in, out := &in.Networks, &out.Networks + *out = make([]NetworkParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]SecurityGroupParam, len(*in)) + copy(*out, *in) + } + if in.UserDataSecret != nil { + in, out := &in.UserDataSecret, &out.UserDataSecret + *out = new(v1.SecretReference) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServerMetadata != nil { + in, out := &in.ServerMetadata, &out.ServerMetadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ConfigDrive != nil { + in, out := &in.ConfigDrive, &out.ConfigDrive + *out = new(bool) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(RootVolume) + **out = **in + } + in.KubeadmConfiguration.DeepCopyInto(&out.KubeadmConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineSpec. +func (in *OpenStackMachineSpec) DeepCopy() *OpenStackMachineSpec { + if in == nil { + return nil + } + out := new(OpenStackMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineStatus) DeepCopyInto(out *OpenStackMachineStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineStatus. +func (in *OpenStackMachineStatus) DeepCopy() *OpenStackMachineStatus { + if in == nil { + return nil + } + out := new(OpenStackMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RootVolume) DeepCopyInto(out *RootVolume) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootVolume. +func (in *RootVolume) DeepCopy() *RootVolume { + if in == nil { + return nil + } + out := new(RootVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Router) DeepCopyInto(out *Router) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Router. +func (in *Router) DeepCopy() *Router { + if in == nil { + return nil + } + out := new(Router) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]SecurityGroupRule, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupFilter) DeepCopyInto(out *SecurityGroupFilter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupFilter. +func (in *SecurityGroupFilter) DeepCopy() *SecurityGroupFilter { + if in == nil { + return nil + } + out := new(SecurityGroupFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupParam) DeepCopyInto(out *SecurityGroupParam) { + *out = *in + out.Filter = in.Filter + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupParam. +func (in *SecurityGroupParam) DeepCopy() *SecurityGroupParam { + if in == nil { + return nil + } + out := new(SecurityGroupParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupRule) DeepCopyInto(out *SecurityGroupRule) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupRule. +func (in *SecurityGroupRule) DeepCopy() *SecurityGroupRule { + if in == nil { + return nil + } + out := new(SecurityGroupRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subnet) DeepCopyInto(out *Subnet) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. +func (in *Subnet) DeepCopy() *Subnet { + if in == nil { + return nil + } + out := new(Subnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetFilter) DeepCopyInto(out *SubnetFilter) { + *out = *in + if in.EnableDHCP != nil { + in, out := &in.EnableDHCP, &out.EnableDHCP + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetFilter. +func (in *SubnetFilter) DeepCopy() *SubnetFilter { + if in == nil { + return nil + } + out := new(SubnetFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetParam) DeepCopyInto(out *SubnetParam) { + *out = *in + in.Filter.DeepCopyInto(&out.Filter) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetParam. +func (in *SubnetParam) DeepCopy() *SubnetParam { + if in == nil { + return nil + } + out := new(SubnetParam) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5080661ff3..435097640c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -136,15 +136,15 @@ github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 # github.com/onsi/gomega v1.5.0 +github.com/onsi/gomega github.com/onsi/gomega/gbytes github.com/onsi/gomega/gexec -github.com/onsi/gomega/format -github.com/onsi/gomega github.com/onsi/gomega/internal/assertion github.com/onsi/gomega/internal/asyncassertion github.com/onsi/gomega/internal/testingtsupport github.com/onsi/gomega/matchers github.com/onsi/gomega/types +github.com/onsi/gomega/format github.com/onsi/gomega/internal/oraclematcher github.com/onsi/gomega/matchers/support/goraph/bipartitegraph github.com/onsi/gomega/matchers/support/goraph/edge @@ -216,13 +216,13 @@ go4.org/errorutil # golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 +golang.org/x/net/context golang.org/x/net/http2 golang.org/x/net/http/httpguts golang.org/x/net/http2/hpack golang.org/x/net/idna -golang.org/x/net/context/ctxhttp -golang.org/x/net/context golang.org/x/net/html/charset +golang.org/x/net/context/ctxhttp golang.org/x/net/html golang.org/x/net/html/atom golang.org/x/net/trace