Tarmak
@@ -297,7 +297,7 @@
Cluster v1alpha1
-
Instance v1alpha1
+
Machine v1alpha1
@@ -310,7 +310,7 @@ Instance v1alpha1
wing |
v1alpha1 |
-Instance |
+Machine |
@@ -327,14 +327,108 @@
Instance v1alpha1
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 |
-instanceID string |
+kind string |
+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 |
+
+
+metadata ObjectMeta |
+ |
+
+
+spec MachineSpec |
+ |
+
+
+status MachineStatus |
|
+
+
+
MachineSpec v1alpha1
+
+
+
+
MachineStatus v1alpha1
+
+
+
+
+
MachineSet v1alpha1
+
+
+
+Group |
+Version |
+Kind |
+
+
+
+
+wing |
+v1alpha1 |
+MachineSet |
+
+
+
+
MachineSet is the Schema for the machinesets API
+
-
InstanceSpec v1alpha1
+
MachineSetSpec v1alpha1
@@ -369,21 +463,33 @@ InstanceSpec v1alpha1
-converge InstanceSpecManifest |
+maxReplicas integer |
|
-dryRun InstanceSpecManifest |
- |
+minReadySeconds integer |
+MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. Defaults to 0 (machine will be considered available as soon as it is ready) |
+
+
+minReplicas integer |
+Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. |
+
+
+selector LabelSelector |
+Selector is a label query over machines that should match the replica count. Label keys and values that must match in order to be controlled by this MachineSet. It must match the machine template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors |
+
+
+template MachineTemplateSpec |
+Template is the object that describes the machine that will be created if insufficient replicas are detected. |
-
InstanceStatus v1alpha1
+
MachineSetStatus v1alpha1
@@ -395,15 +501,206 @@ InstanceStatus v1alpha1
-converge InstanceStatusManifest |
+availableReplicas integer |
+The number of available replicas (ready for at least minReadySeconds) for this MachineSet. |
+
+
+errorMessage string |
+ErrorReason *string json:"errorReason,omitempty" |
+
+
+errorReason string |
+In the event that there is a terminal problem reconciling the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason will be populated with a succinct value suitable for machine interpretation, while ErrorMessage will contain a more verbose string suitable for logging and human consumption. These fields should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the MachineTemplates's spec or the configuration of the machine controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the machine controller, or the responsible machine controller itself being critically misconfigured. Any transient errors that occur during the reconciliation of Machines can be added as events to the MachineSet object and/or logged in the controller's output. |
+
+
+fullyLabeledReplicas integer |
+The number of replicas that have labels matching the labels of the machine template of the MachineSet. |
+
+
+observedGeneration integer |
+ObservedGeneration reflects the generation of the most recently observed MachineSet. |
+
+
+readyReplicas integer |
+The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". |
+
+
+replicas integer |
+Replicas is the most recently observed number of replicas. |
+
+
+
+
+
MachineDeployment v1alpha1
+
+
+
+Group |
+Version |
+Kind |
+
+
+
+
+wing |
+v1alpha1 |
+MachineDeployment |
+
+
+
+
MachineDeployment is the Schema for the machinedeployments API
+
+
MachineDeploymentSpec v1alpha1
+
+
+
+
+
+Field |
+Description |
+
+
+
+
+maxReplicas integer |
+ |
+
+
+minReadySeconds integer |
+Minimum number of seconds for which a newly created machine should be ready. Defaults to 0 (machine will be considered available as soon as it is ready) |
+
+
+minReplicas integer |
+Number of desired machines. Defaults to 1. This is a pointer to distinguish between explicit zero and not specified. |
+
+
+paused boolean |
+Indicates that the deployment is paused. |
+
+
+progressDeadlineSeconds integer |
+The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. |
+
+
+revisionHistoryLimit integer |
+The number of old MachineSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. |
+
+
+selector LabelSelector |
+Label selector for machines. Existing MachineSets whose machines are selected by this will be the ones affected by this deployment. It must match the machine template's labels. |
+
+
+strategy MachineDeploymentStrategy |
+The deployment strategy to use to replace existing machines with new ones. |
+
+
+template MachineTemplateSpec |
+Template describes the machines that will be created. |
+
+
+
+
MachineDeploymentStatus v1alpha1
+
+
+
+
+
+Field |
+Description |
+
+
+
+
+availableReplicas integer |
+Total number of available machines (ready for at least minReadySeconds) targeted by this deployment. |
+
+
+observedGeneration integer |
+The generation observed by the deployment controller. |
+
+
+readyReplicas integer |
+Total number of ready machines targeted by this deployment. |
+
+
+replicas integer |
+Total number of non-terminated machines targeted by this deployment (their labels match the selector). |
+
+
+unavailableReplicas integer |
+Total number of unavailable machines targeted by this deployment. This is the total number of machines that are still required for the deployment to have 100% available capacity. They may either be machines that are running but not yet available or machines that still have not been created. |
+
+
+updatedReplicas integer |
+Total number of non-terminated machines targeted by this deployment that have the desired template spec. |
+
+
+
+
MachineDeploymentStrategy v1alpha1
+
+
+
+
+
+Field |
+Description |
+
+
+
+
+rollingUpdate MachineRollingUpdateDeployment |
+Rolling update config params. Present only if MachineDeploymentStrategyType = RollingUpdate. |
+
+
+type string |
+Type of deployment. Currently the only supported strategy is "RollingUpdate". Default is RollingUpdate. |
+
+
+
Old API Versions
Field Definitions
@@ -2087,7 +2384,7 @@
InstancePoolKubernetes v1alpha1
-
InstanceSpecManifest v1alpha1
+
InternetGW v1alpha1
@@ -2098,18 +2395,17 @@ InstanceSpecManifest v1alpha1
-wing |
+cluster |
v1alpha1 |
-InstanceSpecManifest |
+InternetGW |
-
InstaceSpecManifest defines location and hash for a specific manifest
@@ -2121,20 +2417,24 @@ InstanceSpecManifest v1alpha1
-hash string |
-PATH to manifests (tar.gz) |
+apiVersion string |
+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 |
-path string |
+identifier string |
|
-requestTimestamp Time |
-hash of manifests, prefixed with type (eg: sha256:xyz) |
+kind string |
+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 |
+
+
+metadata ObjectMeta |
+ |
-
InstanceStatusManifest v1alpha1
+
KubernetesAPI v1alpha1
@@ -2145,18 +2445,17 @@ InstanceStatusManifest v1alpha1
-wing |
+cluster |
v1alpha1 |
-InstanceStatusManifest |
+KubernetesAPI |
-
InstaceSpecManifest defines the state and hash of a run manifest
@@ -2168,28 +2467,28 @@ InstanceStatusManifest v1alpha1
-exitCodes integer array |
-contains output of the retries |
+apiVersion string |
+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 |
-hash string |
+endpoint string |
|
-lastUpdateTimestamp Time |
-hash of manifests, prefixed with type (eg: sha256:xyz) |
+kind string |
+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 |
-messages string array |
-timestamp when a converge was requested |
+metadata ObjectMeta |
+ |
-state string |
+port string |
|
-
InternetGW v1alpha1
+
Label v1alpha1
@@ -2202,15 +2501,16 @@ InternetGW v1alpha1
cluster |
v1alpha1 |
-InternetGW |
+Label |
+
Label structure for instancepool node labels
@@ -2222,24 +2522,58 @@ InternetGW v1alpha1
-apiVersion string |
-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 |
+key string |
+ |
-identifier string |
+value string |
|
+
+
+
LoggingSink v1alpha1
+
+
+
+
-
KubernetesAPI v1alpha1
+
LoggingSinkElasticsearch v1alpha1
@@ -2252,7 +2586,7 @@ KubernetesAPI v1alpha1
cluster |
v1alpha1 |
-KubernetesAPI |
+LoggingSinkElasticsearch |
@@ -2260,7 +2594,7 @@
KubernetesAPI v1alpha1
Appears In:
-
Label v1alpha1
+
MachineRollingUpdateDeployment v1alpha1
@@ -2304,18 +2650,18 @@ Label v1alpha1
-cluster |
+wing |
v1alpha1 |
-Label |
+MachineRollingUpdateDeployment |
-
Label structure for instancepool node labels
+
Spec to control the desired behavior of rolling update.
@@ -2327,16 +2673,16 @@ Label v1alpha1
-key string |
- |
+maxSurge IntOrString |
+The maximum number of machines that can be scheduled above the desired number of machines. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 1. Example: when this is set to 30%, the new MachineSet can be scaled up immediately when the rolling update starts, such that the total number of old and new machines do not exceed 130% of desired machines. Once old machines have been killed, new MachineSet can be scaled up further, ensuring that total number of machines running at any time during the update is at most 130% of desired machines. |
-value string |
- |
+maxUnavailable IntOrString |
+The maximum number of machines that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 0. Example: when this is set to 30%, the old MachineSet can be scaled down to 70% of desired machines immediately when the rolling update starts. Once new machines are ready, old MachineSet can be scaled down further, followed by scaling up the new MachineSet, ensuring that the total number of machines available at all times during the update is at least 70% of desired machines. |
-
LoggingSink v1alpha1
+
MachineSpecManifest v1alpha1
@@ -2347,17 +2693,18 @@ LoggingSink v1alpha1
-cluster |
+wing |
v1alpha1 |
-LoggingSink |
+MachineSpecManifest |
+
InstaceSpecManifest defines location and hash for a specific manifest
@@ -2369,16 +2716,20 @@ LoggingSink v1alpha1
-elasticsearch LoggingSinkElasticsearch |
- |
+hash string |
+PATH to manifests (tar.gz) |
-types string array |
+path string |
|
+
+requestTimestamp Time |
+hash of manifests, prefixed with type (eg: sha256:xyz) |
+
-
LoggingSinkElasticsearch v1alpha1
+
MachineStatusManifest v1alpha1
@@ -2389,17 +2740,18 @@ LoggingSinkElasticsearch v1alpha1
-cluster |
+wing |
v1alpha1 |
-LoggingSinkElasticsearch |
+MachineStatusManifest |
+
InstaceSpecManifest defines the state and hash of a run manifest
@@ -2411,36 +2763,68 @@ LoggingSinkElasticsearch v1alpha1
-amazonESProxy AmazonESProxy |
+exitCodes integer array |
+contains output of the retries |
+
+
+hash string |
|
-host string |
-https://fluentbit.io/documentation/0.12/output/elasticsearch.html |
+lastUpdateTimestamp Time |
+hash of manifests, prefixed with type (eg: sha256:xyz) |
-httpBasicAuth HTTPBasicAuth |
- |
+messages string array |
+timestamp when a converge was requested |
-logstashPrefix string |
+state string |
|
+
+
+
MachineTemplateSpec v1alpha1
+
+
-port integer |
- |
+Group |
+Version |
+Kind |
+
+
-tls boolean |
- |
+wing |
+v1alpha1 |
+MachineTemplateSpec |
+
+
+
MachineTemplateSpec describes the data needed to create a Machine from a template
+
+
+
diff --git a/docs/generated/reference/output/navData.js b/docs/generated/reference/output/navData.js
index 4a6a007661..77112e2b93 100644
--- a/docs/generated/reference/output/navData.js
+++ b/docs/generated/reference/output/navData.js
@@ -1 +1 @@
-(function(){navData = {"toc":[{"section":"-strong-field-definitions-strong-","subsections":[{"section":"volume-v1alpha1"},{"section":"values-v1alpha1"},{"section":"taint-v1alpha1"},{"section":"subnet-v1alpha1"},{"section":"ssh-v1alpha1"},{"section":"providergcp-v1alpha1"},{"section":"providerazure-v1alpha1"},{"section":"provideramazon-v1alpha1"},{"section":"provider-v1alpha1"},{"section":"network-v1alpha1"},{"section":"loggingsinkelasticsearch-v1alpha1"},{"section":"loggingsink-v1alpha1"},{"section":"label-v1alpha1"},{"section":"kubernetesapi-v1alpha1"},{"section":"internetgw-v1alpha1"},{"section":"instancestatusmanifest-v1alpha1"},{"section":"instancespecmanifest-v1alpha1"},{"section":"instancepoolkubernetes-v1alpha1"},{"section":"instancepoolamazon-v1alpha1"},{"section":"instancepool-v1alpha1"},{"section":"ingressrule-v1alpha1"},{"section":"httpbasicauth-v1alpha1"},{"section":"firewall-v1alpha1"},{"section":"environment-v1alpha1"},{"section":"egressrule-v1alpha1"},{"section":"clustervaulthelper-v1alpha1"},{"section":"clusterpodsecuritypolicy-v1alpha1"},{"section":"clusterplanflags-v1alpha1"},{"section":"clusterkubernetestiller-v1alpha1"},{"section":"clusterkubernetesscheduler-v1alpha1"},{"section":"clusterkubernetesproxy-v1alpha1"},{"section":"clusterkubernetesprometheus-v1alpha1"},{"section":"clusterkuberneteskubelet-v1alpha1"},{"section":"clusterkubernetesdashboard-v1alpha1"},{"section":"clusterkubernetescontrollermanager-v1alpha1"},{"section":"clusterkubernetesclusterautoscaleroverprovisioning-v1alpha1"},{"section":"clusterkubernetesclusterautoscaler-v1alpha1"},{"section":"clusterkubernetesapiserveroidc-v1alpha1"},{"section":"clusterkubernetesapiserveramazonaccesslogs-v1alpha1"},{"section":"clusterkubernetesapiserveramazon-v1alpha1"},{"section":"clusterkubernetesapiserver-v1alpha1"},{"section":"clusterkubernetes-v1alpha1"},{"section":"clusterkubeconfigflags-v1alpha1"},{"section":"clusterimagesflags-v1alpha1"},{"section":"clusterimagesbuildflags-v1alpha1"},{"section":"clusterflags-v1alpha1"},{"section":"clusterdestroyflags-v1alpha1"},{"section":"clusterapplyflags-v1alpha1"},{"section":"clusteramazon-v1alpha1"},{"section":"amazonesproxy-v1alpha1"}]},{"section":"-strong-old-api-versions-strong-","subsections":[]},{"section":"instance-v1alpha1","subsections":[]},{"section":"cluster-v1alpha1","subsections":[]},{"section":"flags-v1alpha1","subsections":[]},{"section":"image-v1alpha1","subsections":[]},{"section":"config-v1alpha1","subsections":[]},{"section":"-strong-tarmak-strong-","subsections":[]}],"flatToc":["volume-v1alpha1","values-v1alpha1","taint-v1alpha1","subnet-v1alpha1","ssh-v1alpha1","providergcp-v1alpha1","providerazure-v1alpha1","provideramazon-v1alpha1","provider-v1alpha1","network-v1alpha1","loggingsinkelasticsearch-v1alpha1","loggingsink-v1alpha1","label-v1alpha1","kubernetesapi-v1alpha1","internetgw-v1alpha1","instancestatusmanifest-v1alpha1","instancespecmanifest-v1alpha1","instancepoolkubernetes-v1alpha1","instancepoolamazon-v1alpha1","instancepool-v1alpha1","ingressrule-v1alpha1","httpbasicauth-v1alpha1","firewall-v1alpha1","environment-v1alpha1","egressrule-v1alpha1","clustervaulthelper-v1alpha1","clusterpodsecuritypolicy-v1alpha1","clusterplanflags-v1alpha1","clusterkubernetestiller-v1alpha1","clusterkubernetesscheduler-v1alpha1","clusterkubernetesproxy-v1alpha1","clusterkubernetesprometheus-v1alpha1","clusterkuberneteskubelet-v1alpha1","clusterkubernetesdashboard-v1alpha1","clusterkubernetescontrollermanager-v1alpha1","clusterkubernetesclusterautoscaleroverprovisioning-v1alpha1","clusterkubernetesclusterautoscaler-v1alpha1","clusterkubernetesapiserveroidc-v1alpha1","clusterkubernetesapiserveramazonaccesslogs-v1alpha1","clusterkubernetesapiserveramazon-v1alpha1","clusterkubernetesapiserver-v1alpha1","clusterkubernetes-v1alpha1","clusterkubeconfigflags-v1alpha1","clusterimagesflags-v1alpha1","clusterimagesbuildflags-v1alpha1","clusterflags-v1alpha1","clusterdestroyflags-v1alpha1","clusterapplyflags-v1alpha1","clusteramazon-v1alpha1","amazonesproxy-v1alpha1","-strong-field-definitions-strong-","-strong-old-api-versions-strong-","instance-v1alpha1","cluster-v1alpha1","flags-v1alpha1","image-v1alpha1","config-v1alpha1","-strong-tarmak-strong-"]};})();
\ No newline at end of file
+(function(){navData = {"toc":[{"section":"-strong-field-definitions-strong-","subsections":[{"section":"volume-v1alpha1"},{"section":"values-v1alpha1"},{"section":"taint-v1alpha1"},{"section":"subnet-v1alpha1"},{"section":"ssh-v1alpha1"},{"section":"providergcp-v1alpha1"},{"section":"providerazure-v1alpha1"},{"section":"provideramazon-v1alpha1"},{"section":"provider-v1alpha1"},{"section":"network-v1alpha1"},{"section":"machinetemplatespec-v1alpha1"},{"section":"machinestatusmanifest-v1alpha1"},{"section":"machinespecmanifest-v1alpha1"},{"section":"machinerollingupdatedeployment-v1alpha1"},{"section":"loggingsinkelasticsearch-v1alpha1"},{"section":"loggingsink-v1alpha1"},{"section":"label-v1alpha1"},{"section":"kubernetesapi-v1alpha1"},{"section":"internetgw-v1alpha1"},{"section":"instancepoolkubernetes-v1alpha1"},{"section":"instancepoolamazon-v1alpha1"},{"section":"instancepool-v1alpha1"},{"section":"ingressrule-v1alpha1"},{"section":"httpbasicauth-v1alpha1"},{"section":"firewall-v1alpha1"},{"section":"environment-v1alpha1"},{"section":"egressrule-v1alpha1"},{"section":"clustervaulthelper-v1alpha1"},{"section":"clusterpodsecuritypolicy-v1alpha1"},{"section":"clusterplanflags-v1alpha1"},{"section":"clusterkubernetestiller-v1alpha1"},{"section":"clusterkubernetesscheduler-v1alpha1"},{"section":"clusterkubernetesproxy-v1alpha1"},{"section":"clusterkubernetesprometheus-v1alpha1"},{"section":"clusterkuberneteskubelet-v1alpha1"},{"section":"clusterkubernetesdashboard-v1alpha1"},{"section":"clusterkubernetescontrollermanager-v1alpha1"},{"section":"clusterkubernetesclusterautoscaleroverprovisioning-v1alpha1"},{"section":"clusterkubernetesclusterautoscaler-v1alpha1"},{"section":"clusterkubernetesapiserveroidc-v1alpha1"},{"section":"clusterkubernetesapiserveramazonaccesslogs-v1alpha1"},{"section":"clusterkubernetesapiserveramazon-v1alpha1"},{"section":"clusterkubernetesapiserver-v1alpha1"},{"section":"clusterkubernetes-v1alpha1"},{"section":"clusterkubeconfigflags-v1alpha1"},{"section":"clusterimagesflags-v1alpha1"},{"section":"clusterimagesbuildflags-v1alpha1"},{"section":"clusterflags-v1alpha1"},{"section":"clusterdestroyflags-v1alpha1"},{"section":"clusterapplyflags-v1alpha1"},{"section":"clusteramazon-v1alpha1"},{"section":"amazonesproxy-v1alpha1"}]},{"section":"-strong-old-api-versions-strong-","subsections":[]},{"section":"machinedeployment-v1alpha1","subsections":[]},{"section":"machineset-v1alpha1","subsections":[]},{"section":"machine-v1alpha1","subsections":[]},{"section":"cluster-v1alpha1","subsections":[]},{"section":"flags-v1alpha1","subsections":[]},{"section":"image-v1alpha1","subsections":[]},{"section":"config-v1alpha1","subsections":[]},{"section":"-strong-tarmak-strong-","subsections":[]}],"flatToc":["volume-v1alpha1","values-v1alpha1","taint-v1alpha1","subnet-v1alpha1","ssh-v1alpha1","providergcp-v1alpha1","providerazure-v1alpha1","provideramazon-v1alpha1","provider-v1alpha1","network-v1alpha1","machinetemplatespec-v1alpha1","machinestatusmanifest-v1alpha1","machinespecmanifest-v1alpha1","machinerollingupdatedeployment-v1alpha1","loggingsinkelasticsearch-v1alpha1","loggingsink-v1alpha1","label-v1alpha1","kubernetesapi-v1alpha1","internetgw-v1alpha1","instancepoolkubernetes-v1alpha1","instancepoolamazon-v1alpha1","instancepool-v1alpha1","ingressrule-v1alpha1","httpbasicauth-v1alpha1","firewall-v1alpha1","environment-v1alpha1","egressrule-v1alpha1","clustervaulthelper-v1alpha1","clusterpodsecuritypolicy-v1alpha1","clusterplanflags-v1alpha1","clusterkubernetestiller-v1alpha1","clusterkubernetesscheduler-v1alpha1","clusterkubernetesproxy-v1alpha1","clusterkubernetesprometheus-v1alpha1","clusterkuberneteskubelet-v1alpha1","clusterkubernetesdashboard-v1alpha1","clusterkubernetescontrollermanager-v1alpha1","clusterkubernetesclusterautoscaleroverprovisioning-v1alpha1","clusterkubernetesclusterautoscaler-v1alpha1","clusterkubernetesapiserveroidc-v1alpha1","clusterkubernetesapiserveramazonaccesslogs-v1alpha1","clusterkubernetesapiserveramazon-v1alpha1","clusterkubernetesapiserver-v1alpha1","clusterkubernetes-v1alpha1","clusterkubeconfigflags-v1alpha1","clusterimagesflags-v1alpha1","clusterimagesbuildflags-v1alpha1","clusterflags-v1alpha1","clusterdestroyflags-v1alpha1","clusterapplyflags-v1alpha1","clusteramazon-v1alpha1","amazonesproxy-v1alpha1","-strong-field-definitions-strong-","-strong-old-api-versions-strong-","machinedeployment-v1alpha1","machineset-v1alpha1","machine-v1alpha1","cluster-v1alpha1","flags-v1alpha1","image-v1alpha1","config-v1alpha1","-strong-tarmak-strong-"]};})();
\ No newline at end of file
diff --git a/hack/update-cmd-docs.sh b/hack/update-cmd-docs.sh
index e8413a2222..4061691e83 100755
--- a/hack/update-cmd-docs.sh
+++ b/hack/update-cmd-docs.sh
@@ -33,13 +33,13 @@ OUTPUT_DIR="${CMD_ROOT}"
BINDIR=$REPO_ROOT/bin
HACKDIR=$REPO_ROOT/hack
+echo "+++ Building cmd-gen"
+go build -o ${BINDIR}/cmd-gen ./hack/cmd-gen
+
echo "+++ Removing old output"
rm -Rf "${OUTPUT_DIR}"
mkdir -p "${OUTPUT_DIR}"
-echo "+++ Building cmd-gen"
-go build -o ${BINDIR}/cmd-gen ./hack/cmd-gen
-
echo "+++ Running cmd-gen"
${BINDIR}/cmd-gen ${OUTPUT_DIR}
diff --git a/pkg/apis/wing/common/consts.go b/pkg/apis/wing/common/consts.go
new file mode 100644
index 0000000000..34917f09fd
--- /dev/null
+++ b/pkg/apis/wing/common/consts.go
@@ -0,0 +1,24 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package common
+
+const (
+ MachineManifestStateConverging = MachineManifestState("converging")
+ MachineManifestStateConverged = MachineManifestState("converged")
+ MachineManifestStateError = MachineManifestState("error")
+
+ // Replace the old MachineSet by new one using rolling update
+ // i.e gradually scale down the old MachineSet and scale up the new one.
+ RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate"
+)
+
+type MachineStatusError string
+type MachineManifestState string
+type MachineDeploymentStrategyType string
+
+type Flags struct {
+ ManifestURL string
+ ServerURL string
+ ClusterName string
+ MachineName string
+ Pool string
+}
diff --git a/pkg/apis/wing/types.go b/pkg/apis/wing/machine_types.go
similarity index 54%
rename from pkg/apis/wing/types.go
rename to pkg/apis/wing/machine_types.go
index 4f2db40f55..6da7f3a8c1 100644
--- a/pkg/apis/wing/types.go
+++ b/pkg/apis/wing/machine_types.go
@@ -3,45 +3,43 @@ package wing
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-type Instance struct {
+type Machine struct {
metav1.TypeMeta
metav1.ObjectMeta
- InstanceID string
- InstancePool string
-
- Spec *InstanceSpec
- Status *InstanceStatus
+ Spec *MachineSpec
+ Status *MachineStatus
}
-// InstanceSpec defines the desired state of Instance
-type InstanceSpec struct {
- Converge *InstanceSpecManifest
- DryRun *InstanceSpecManifest
+// MachineSpec defines the desired state of Machine
+type MachineSpec struct {
+ Converge *MachineSpecManifest
+ DryRun *MachineSpecManifest
}
// InstaceSpecManifest defines location and hash for a specific manifest
-type InstanceSpecManifest struct {
+type MachineSpecManifest struct {
Path string
Hash string
RequestTimestamp metav1.Time
}
-// InstanceStatus defines the observed state of Instance
-type InstanceStatus struct {
- Converge *InstanceStatusManifest
- DryRun *InstanceStatusManifest
+// MachineStatus defines the observed state of Machine
+type MachineStatus struct {
+ Converge *MachineStatusManifest
+ DryRun *MachineStatusManifest
}
// InstaceSpecManifest defines the state and hash of a run manifest
-type InstanceManifestState string
-type InstanceStatusManifest struct {
- State InstanceManifestState
+type MachineStatusManifest struct {
+ State common.MachineManifestState
Hash string
LastUpdateTimestamp metav1.Time
Messages []string
@@ -50,10 +48,10 @@ type InstanceStatusManifest struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-type InstanceList struct {
+type MachineList struct {
metav1.TypeMeta
// +optional
metav1.ListMeta
- Items []Instance
+ Items []Machine
}
diff --git a/pkg/apis/wing/machinedeployment_types.go b/pkg/apis/wing/machinedeployment_types.go
new file mode 100644
index 0000000000..0ef3b305ea
--- /dev/null
+++ b/pkg/apis/wing/machinedeployment_types.go
@@ -0,0 +1,160 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package wing
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/intstr"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+)
+
+// MachineDeploymentSpec defines the desired state of MachineDeployment
+type MachineDeploymentSpec struct {
+
+ // Number of desired machines. Defaults to 1.
+ // This is a pointer to distinguish between explicit zero and not specified.
+ // +optional
+ MinReplicas *int32
+
+ // +optional
+ MaxReplicas *int32
+
+ // Label selector for machines. Existing MachineSets whose machines are
+ // selected by this will be the ones affected by this deployment.
+ // It must match the machine template's labels.
+ Selector metav1.LabelSelector
+
+ // Template describes the machines that will be created.
+ Template MachineTemplateSpec
+
+ // The deployment strategy to use to replace existing machines with
+ // new ones.
+ // +optional
+ Strategy *MachineDeploymentStrategy
+
+ // Minimum number of seconds for which a newly created machine should
+ // be ready.
+ // Defaults to 0 (machine will be considered available as soon as it
+ // is ready)
+ // +optional
+ MinReadySeconds *int32
+
+ // The number of old MachineSets to retain to allow rollback.
+ // This is a pointer to distinguish between explicit zero and not specified.
+ // Defaults to 1.
+ // +optional
+ RevisionHistoryLimit *int32
+
+ // Indicates that the deployment is paused.
+ // +optional
+ Paused bool
+
+ // The maximum time in seconds for a deployment to make progress before it
+ // is considered to be failed. The deployment controller will continue to
+ // process failed deployments and a condition with a ProgressDeadlineExceeded
+ // reason will be surfaced in the deployment status. Note that progress will
+ // not be estimated during the time a deployment is paused. Defaults to 600s.
+ ProgressDeadlineSeconds *int32
+}
+
+type MachineDeploymentStrategy struct {
+ // Type of deployment. Currently the only supported strategy is
+ // "RollingUpdate".
+ // Default is RollingUpdate.
+ // +optional
+ Type common.MachineDeploymentStrategyType
+
+ // Rolling update config params. Present only if
+ // MachineDeploymentStrategyType = RollingUpdate.
+ // +optional
+ RollingUpdate *MachineRollingUpdateDeployment
+}
+
+// Spec to control the desired behavior of rolling update.
+type MachineRollingUpdateDeployment struct {
+ // The maximum number of machines that can be unavailable during the update.
+ // Value can be an absolute number (ex: 5) or a percentage of desired
+ // machines (ex: 10%).
+ // Absolute number is calculated from percentage by rounding down.
+ // This can not be 0 if MaxSurge is 0.
+ // Defaults to 0.
+ // Example: when this is set to 30%, the old MachineSet can be scaled
+ // down to 70% of desired machines immediately when the rolling update
+ // starts. Once new machines are ready, old MachineSet can be scaled
+ // down further, followed by scaling up the new MachineSet, ensuring
+ // that the total number of machines available at all times
+ // during the update is at least 70% of desired machines.
+ // +optional
+ MaxUnavailable *intstr.IntOrString
+
+ // The maximum number of machines that can be scheduled above the
+ // desired number of machines.
+ // Value can be an absolute number (ex: 5) or a percentage of
+ // desired machines (ex: 10%).
+ // This can not be 0 if MaxUnavailable is 0.
+ // Absolute number is calculated from percentage by rounding up.
+ // Defaults to 1.
+ // Example: when this is set to 30%, the new MachineSet can be scaled
+ // up immediately when the rolling update starts, such that the total
+ // number of old and new machines do not exceed 130% of desired
+ // machines. Once old machines have been killed, new MachineSet can
+ // be scaled up further, ensuring that total number of machines running
+ // at any time during the update is at most 130% of desired machines.
+ // +optional
+ MaxSurge *intstr.IntOrString
+}
+
+type MachineDeploymentStatus struct {
+ // The generation observed by the deployment controller.
+ // +optional
+ ObservedGeneration int64
+
+ // Total number of non-terminated machines targeted by this deployment
+ // (their labels match the selector).
+ // +optional
+ Replicas int32
+
+ // Total number of non-terminated machines targeted by this deployment
+ // that have the desired template spec.
+ // +optional
+ UpdatedReplicas int32
+
+ // Total number of ready machines targeted by this deployment.
+ // +optional
+ ReadyReplicas int32
+
+ // Total number of available machines (ready for at least minReadySeconds)
+ // targeted by this deployment.
+ // +optional
+ AvailableReplicas int32
+
+ // Total number of unavailable machines targeted by this deployment.
+ // This is the total number of machines that are still required for
+ // the deployment to have 100% available capacity. They may either
+ // be machines that are running but not yet available or machines
+ // that still have not been created.
+ // +optional
+ UnavailableReplicas int32
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineDeployment is the Schema for the machinedeployments API
+// +k8s:openapi-gen=true
+type MachineDeployment struct {
+ metav1.TypeMeta
+ metav1.ObjectMeta
+
+ Spec *MachineDeploymentSpec
+ Status *MachineDeploymentStatus
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineDeploymentList contains a list of MachineDeployment
+type MachineDeploymentList struct {
+ metav1.TypeMeta
+ metav1.ListMeta
+ Items []MachineDeployment
+}
diff --git a/pkg/apis/wing/machineset_types.go b/pkg/apis/wing/machineset_types.go
new file mode 100644
index 0000000000..6adf2b9556
--- /dev/null
+++ b/pkg/apis/wing/machineset_types.go
@@ -0,0 +1,113 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package wing
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+)
+
+// MachineSetSpec defines the desired state of MachineSet
+type MachineSetSpec struct {
+ // Replicas is the number of desired minimum and maximum replicas.
+ // This is a pointer to distinguish between explicit zero and unspecified.
+ // Defaults to 1.
+ // +optional
+ MinReplicas *int32
+ MaxReplicas *int32
+
+ // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready.
+ // Defaults to 0 (machine will be considered available as soon as it is ready)
+ // +optional
+ MinReadySeconds int32
+
+ // Selector is a label query over machines that should match the replica count.
+ // Label keys and values that must match in order to be controlled by this MachineSet.
+ // It must match the machine template's labels.
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
+ Selector metav1.LabelSelector
+
+ // Template is the object that describes the machine that will be created if
+ // insufficient replicas are detected.
+ // +optional
+ Template MachineTemplateSpec
+}
+
+// MachineTemplateSpec describes the data needed to create a Machine from a template
+type MachineTemplateSpec struct {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta
+
+ // Specification of the desired behavior of the machine.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+ Spec MachineSpec
+}
+
+// MachineSetStatus defines the observed state of MachineSet
+type MachineSetStatus struct {
+ // Replicas is the most recently observed number of replicas.
+ Replicas int32
+
+ // The number of replicas that have labels matching the labels of the machine template of the MachineSet.
+ // +optional
+ FullyLabeledReplicas int32
+
+ // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready".
+ // +optional
+ ReadyReplicas int32
+
+ // The number of available replicas (ready for at least minReadySeconds) for this MachineSet.
+ // +optional
+ AvailableReplicas int32
+
+ // ObservedGeneration reflects the generation of the most recently observed MachineSet.
+ // +optional
+ ObservedGeneration int64
+
+ // In the event that there is a terminal problem reconciling the
+ // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason
+ // will be populated with a succinct value suitable for machine
+ // interpretation, while ErrorMessage will contain a more verbose
+ // string suitable for logging and human consumption.
+ //
+ // These fields should not be set for transitive errors that a
+ // controller faces that are expected to be fixed automatically over
+ // time (like service outages), but instead indicate that something is
+ // fundamentally wrong with the MachineTemplates's spec or the configuration of
+ // the machine controller, and that manual intervention is required. Examples
+ // of terminal errors would be invalid combinations of settings in the
+ // spec, values that are unsupported by the machine controller, or the
+ // responsible machine controller itself being critically misconfigured.
+ //
+ // Any transient errors that occur during the reconciliation of Machines
+ // can be added as events to the MachineSet object and/or logged in the
+ // controller's output.
+ // +optional
+ ErrorReason common.MachineStatusError
+ // +optional
+ ErrorMessage *string
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineSet is the Schema for the machinesets API
+// +k8s:openapi-gen=true
+type MachineSet struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec *MachineSetSpec `json:"spec,omitempty"`
+ Status *MachineSetStatus `json:"status,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineSetList contains a list of MachineSet
+type MachineSetList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []MachineSet `json:"items"`
+}
diff --git a/pkg/apis/wing/register.go b/pkg/apis/wing/register.go
index ea18a4b08c..fa71bc7217 100644
--- a/pkg/apis/wing/register.go
+++ b/pkg/apis/wing/register.go
@@ -29,8 +29,12 @@ var (
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
- &Instance{},
- &InstanceList{},
+ &Machine{},
+ &MachineList{},
+ &MachineSet{},
+ &MachineSetList{},
+ &MachineDeployment{},
+ &MachineDeploymentList{},
)
return nil
}
diff --git a/pkg/apis/wing/v1alpha1/constants.go b/pkg/apis/wing/v1alpha1/constants.go
deleted file mode 100644
index 2692c97415..0000000000
--- a/pkg/apis/wing/v1alpha1/constants.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package v1alpha1
-
-type InstanceManifestState string
-
-const (
- InstanceManifestStateConverging = InstanceManifestState("converging")
- InstanceManifestStateConverged = InstanceManifestState("converged")
- InstanceManifestStateError = InstanceManifestState("error")
-)
diff --git a/pkg/apis/wing/v1alpha1/machine_types.go b/pkg/apis/wing/v1alpha1/machine_types.go
new file mode 100644
index 0000000000..429e9bf407
--- /dev/null
+++ b/pkg/apis/wing/v1alpha1/machine_types.go
@@ -0,0 +1,58 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+)
+
+// +genclient
+// +k8s:openapi-gen=true
+// +resource:path=wing
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+type Machine struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec *MachineSpec `json:"spec,omitempty"`
+ Status *MachineStatus `json:"status,omitempty"`
+}
+
+// MachineSpec defines the desired state of Machine
+type MachineSpec struct {
+ Converge *MachineSpecManifest `json:"converge,omitempty"`
+ DryRun *MachineSpecManifest `json:"dryRun,omitempty"`
+}
+
+// InstaceSpecManifest defines location and hash for a specific manifest
+type MachineSpecManifest struct {
+ Path string `json:"path,omitempty"` // PATH to manifests (tar.gz)
+ Hash string `json:"hash,omitempty"` // hash of manifests, prefixed with type (eg: sha256:xyz)
+ RequestTimestamp metav1.Time `json:"requestTimestamp,omitempty"` // timestamp when a converge was requested
+}
+
+// MachineStatus defines the observed state of Machine
+type MachineStatus struct {
+ Converge *MachineStatusManifest `json:"converge,omitempty"`
+ DryRun *MachineStatusManifest `json:"dryRun,omitempty"`
+}
+
+// InstaceSpecManifest defines the state and hash of a run manifest
+type MachineStatusManifest struct {
+ State common.MachineManifestState `json:"state,omitempty"`
+ Hash string `json:"hash,omitempty"` // hash of manifests, prefixed with type (eg: sha256:xyz)
+ LastUpdateTimestamp metav1.Time `json:"lastUpdateTimestamp,omitempty"` // timestamp when a converge was requested
+ Messages []string `json:"messages,omitempty"` // contains output of the retries
+ ExitCodes []int `json:"exitCodes,omitempty"` // return code of the retries
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+type MachineList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+
+ Items []Machine `json:"items"`
+}
diff --git a/pkg/apis/wing/v1alpha1/machinedeployment_types.go b/pkg/apis/wing/v1alpha1/machinedeployment_types.go
new file mode 100644
index 0000000000..46039d5949
--- /dev/null
+++ b/pkg/apis/wing/v1alpha1/machinedeployment_types.go
@@ -0,0 +1,162 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/intstr"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+)
+
+// MachineDeploymentSpec defines the desired state of MachineDeployment
+type MachineDeploymentSpec struct {
+
+ // Number of desired machines. Defaults to 1.
+ // This is a pointer to distinguish between explicit zero and not specified.
+ // +optional
+ MinReplicas *int32 `json:"minReplicas,omitempty"`
+
+ // +optional
+ MaxReplicas *int32 `json:"maxReplicas,omitempty"`
+
+ // Label selector for machines. Existing MachineSets whose machines are
+ // selected by this will be the ones affected by this deployment.
+ // It must match the machine template's labels.
+ Selector metav1.LabelSelector `json:"selector"`
+
+ // Template describes the machines that will be created.
+ Template MachineTemplateSpec `json:"template"`
+
+ // The deployment strategy to use to replace existing machines with
+ // new ones.
+ // +optional
+ Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"`
+
+ // Minimum number of seconds for which a newly created machine should
+ // be ready.
+ // Defaults to 0 (machine will be considered available as soon as it
+ // is ready)
+ // +optional
+ MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
+
+ // The number of old MachineSets to retain to allow rollback.
+ // This is a pointer to distinguish between explicit zero and not specified.
+ // Defaults to 1.
+ // +optional
+ RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
+
+ // Indicates that the deployment is paused.
+ // +optional
+ Paused bool `json:"paused,omitempty"`
+
+ // The maximum time in seconds for a deployment to make progress before it
+ // is considered to be failed. The deployment controller will continue to
+ // process failed deployments and a condition with a ProgressDeadlineExceeded
+ // reason will be surfaced in the deployment status. Note that progress will
+ // not be estimated during the time a deployment is paused. Defaults to 600s.
+ ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"`
+}
+
+type MachineDeploymentStrategy struct {
+ // Type of deployment. Currently the only supported strategy is
+ // "RollingUpdate".
+ // Default is RollingUpdate.
+ // +optional
+ Type common.MachineDeploymentStrategyType `json:"type,omitempty"`
+
+ // Rolling update config params. Present only if
+ // MachineDeploymentStrategyType = RollingUpdate.
+ // +optional
+ RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"`
+}
+
+// Spec to control the desired behavior of rolling update.
+type MachineRollingUpdateDeployment struct {
+ // The maximum number of machines that can be unavailable during the update.
+ // Value can be an absolute number (ex: 5) or a percentage of desired
+ // machines (ex: 10%).
+ // Absolute number is calculated from percentage by rounding down.
+ // This can not be 0 if MaxSurge is 0.
+ // Defaults to 0.
+ // Example: when this is set to 30%, the old MachineSet can be scaled
+ // down to 70% of desired machines immediately when the rolling update
+ // starts. Once new machines are ready, old MachineSet can be scaled
+ // down further, followed by scaling up the new MachineSet, ensuring
+ // that the total number of machines available at all times
+ // during the update is at least 70% of desired machines.
+ // +optional
+ MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
+
+ // The maximum number of machines that can be scheduled above the
+ // desired number of machines.
+ // Value can be an absolute number (ex: 5) or a percentage of
+ // desired machines (ex: 10%).
+ // This can not be 0 if MaxUnavailable is 0.
+ // Absolute number is calculated from percentage by rounding up.
+ // Defaults to 1.
+ // Example: when this is set to 30%, the new MachineSet can be scaled
+ // up immediately when the rolling update starts, such that the total
+ // number of old and new machines do not exceed 130% of desired
+ // machines. Once old machines have been killed, new MachineSet can
+ // be scaled up further, ensuring that total number of machines running
+ // at any time during the update is at most 130% of desired machines.
+ // +optional
+ MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
+}
+
+type MachineDeploymentStatus struct {
+ // The generation observed by the deployment controller.
+ // +optional
+ ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
+
+ // Total number of non-terminated machines targeted by this deployment
+ // (their labels match the selector).
+ // +optional
+ Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"`
+
+ // Total number of non-terminated machines targeted by this deployment
+ // that have the desired template spec.
+ // +optional
+ UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"`
+
+ // Total number of ready machines targeted by this deployment.
+ // +optional
+ ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"`
+
+ // Total number of available machines (ready for at least minReadySeconds)
+ // targeted by this deployment.
+ // +optional
+ AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"`
+
+ // Total number of unavailable machines targeted by this deployment.
+ // This is the total number of machines that are still required for
+ // the deployment to have 100% available capacity. They may either
+ // be machines that are running but not yet available or machines
+ // that still have not been created.
+ // +optional
+ UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"`
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:openapi-gen=true
+// +resource:path=wing
+
+// MachineDeployment is the Schema for the machinedeployments API
+// +k8s:openapi-gen=true
+type MachineDeployment struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec *MachineDeploymentSpec `json:"spec,omitempty"`
+ Status *MachineDeploymentStatus `json:"status,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineDeploymentList contains a list of MachineDeployment
+type MachineDeploymentList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []MachineDeployment `json:"items"`
+}
diff --git a/pkg/apis/wing/v1alpha1/machineset_types.go b/pkg/apis/wing/v1alpha1/machineset_types.go
new file mode 100644
index 0000000000..4f966b2149
--- /dev/null
+++ b/pkg/apis/wing/v1alpha1/machineset_types.go
@@ -0,0 +1,116 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+)
+
+// MachineSetSpec defines the desired state of MachineSet
+type MachineSetSpec struct {
+ // Replicas is the number of desired replicas.
+ // This is a pointer to distinguish between explicit zero and unspecified.
+ // Defaults to 1.
+ // +optional
+ MinReplicas *int32 `json:"minReplicas,omitempty"`
+ MaxReplicas *int32 `json:"maxReplicas,omitempty"`
+
+ // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready.
+ // Defaults to 0 (machine will be considered available as soon as it is ready)
+ // +optional
+ MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
+
+ // Selector is a label query over machines that should match the replica count.
+ // Label keys and values that must match in order to be controlled by this MachineSet.
+ // It must match the machine template's labels.
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
+ Selector metav1.LabelSelector `json:"selector"`
+
+ // Template is the object that describes the machine that will be created if
+ // insufficient replicas are detected.
+ // +optional
+ Template MachineTemplateSpec `json:"template,omitempty"`
+}
+
+// MachineTemplateSpec describes the data needed to create a Machine from a template
+type MachineTemplateSpec struct {
+ // Standard object's metadata.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // Specification of the desired behavior of the machine.
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
+ Spec MachineSpec `json:"spec,omitempty"`
+}
+
+// MachineSetStatus defines the observed state of MachineSet
+type MachineSetStatus struct {
+ // Replicas is the most recently observed number of replicas.
+ Replicas int32 `json:"replicas"`
+
+ // The number of replicas that have labels matching the labels of the machine template of the MachineSet.
+ // +optional
+ FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
+
+ // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready".
+ // +optional
+ ReadyReplicas int32 `json:"readyReplicas,omitempty"`
+
+ // The number of available replicas (ready for at least minReadySeconds) for this MachineSet.
+ // +optional
+ AvailableReplicas int32 `json:"availableReplicas,omitempty"`
+
+ // ObservedGeneration reflects the generation of the most recently observed MachineSet.
+ // +optional
+ ObservedGeneration int64 `json:"observedGeneration,omitempty"`
+
+ // In the event that there is a terminal problem reconciling the
+ // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason
+ // will be populated with a succinct value suitable for machine
+ // interpretation, while ErrorMessage will contain a more verbose
+ // string suitable for logging and human consumption.
+ //
+ // These fields should not be set for transitive errors that a
+ // controller faces that are expected to be fixed automatically over
+ // time (like service outages), but instead indicate that something is
+ // fundamentally wrong with the MachineTemplates's spec or the configuration of
+ // the machine controller, and that manual intervention is required. Examples
+ // of terminal errors would be invalid combinations of settings in the
+ // spec, values that are unsupported by the machine controller, or the
+ // responsible machine controller itself being critically misconfigured.
+ //
+ // Any transient errors that occur during the reconciliation of Machines
+ // can be added as events to the MachineSet object and/or logged in the
+ // controller's output.
+ // +optional
+ ErrorReason common.MachineStatusError `json:"errorReason,omitempty"`
+ //ErrorReason *string `json:"errorReason,omitempty"`
+ // +optional
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+}
+
+// +genclient
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +k8s:openapi-gen=true
+// +resource:path=wing
+
+// MachineSet is the Schema for the machinesets API
+// +k8s:openapi-gen=true
+type MachineSet struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec *MachineSetSpec `json:"spec,omitempty"`
+ Status *MachineSetStatus `json:"status,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// MachineSetList contains a list of MachineSet
+type MachineSetList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []MachineSet `json:"items"`
+}
diff --git a/pkg/apis/wing/v1alpha1/register.go b/pkg/apis/wing/v1alpha1/register.go
index 89e76a9336..1b0731348d 100644
--- a/pkg/apis/wing/v1alpha1/register.go
+++ b/pkg/apis/wing/v1alpha1/register.go
@@ -30,8 +30,12 @@ func init() {
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
- &Instance{},
- &InstanceList{},
+ &Machine{},
+ &MachineList{},
+ &MachineSet{},
+ &MachineSetList{},
+ &MachineDeployment{},
+ &MachineDeploymentList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
diff --git a/pkg/apis/wing/v1alpha1/types.go b/pkg/apis/wing/v1alpha1/types.go
deleted file mode 100644
index 94bab71419..0000000000
--- a/pkg/apis/wing/v1alpha1/types.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-type Instance struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- InstanceID string `json:"instanceID,omitempty"`
- InstancePool string `json:"instancePool,omitempty"`
-
- Spec *InstanceSpec `json:"spec,omitempty"`
- Status *InstanceStatus `json:"status,omitempty"`
-}
-
-// InstanceSpec defines the desired state of Instance
-type InstanceSpec struct {
- Converge *InstanceSpecManifest `json:"converge,omitempty"`
- DryRun *InstanceSpecManifest `json:"dryRun,omitempty"`
-}
-
-// InstaceSpecManifest defines location and hash for a specific manifest
-type InstanceSpecManifest struct {
- Path string `json:"path,omitempty"` // PATH to manifests (tar.gz)
- Hash string `json:"hash,omitempty"` // hash of manifests, prefixed with type (eg: sha256:xyz)
- RequestTimestamp metav1.Time `json:"requestTimestamp,omitempty"` // timestamp when a converge was requested
-}
-
-// InstanceStatus defines the observed state of Instance
-type InstanceStatus struct {
- Converge *InstanceStatusManifest `json:"converge,omitempty"`
- DryRun *InstanceStatusManifest `json:"dryRun,omitempty"`
-}
-
-// InstaceSpecManifest defines the state and hash of a run manifest
-type InstanceStatusManifest struct {
- State InstanceManifestState `json:"state,omitempty"`
- Hash string `json:"hash,omitempty"` // hash of manifests, prefixed with type (eg: sha256:xyz)
- LastUpdateTimestamp metav1.Time `json:"lastUpdateTimestamp,omitempty"` // timestamp when a converge was requested
- Messages []string `json:"messages,omitempty"` // contains output of the retries
- ExitCodes []int `json:"exitCodes,omitempty"` // return code of the retries
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-type InstanceList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
-
- Items []Instance `json:"items"`
-}
diff --git a/pkg/apis/wing/v1alpha1/zz_generated.conversion.go b/pkg/apis/wing/v1alpha1/zz_generated.conversion.go
index 284270f80d..e2b34a793f 100644
--- a/pkg/apis/wing/v1alpha1/zz_generated.conversion.go
+++ b/pkg/apis/wing/v1alpha1/zz_generated.conversion.go
@@ -8,8 +8,10 @@ package v1alpha1
import (
wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ common "github.com/jetstack/tarmak/pkg/apis/wing/common"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
unsafe "unsafe"
)
@@ -21,141 +23,429 @@ func init() {
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
- Convert_v1alpha1_Instance_To_wing_Instance,
- Convert_wing_Instance_To_v1alpha1_Instance,
- Convert_v1alpha1_InstanceList_To_wing_InstanceList,
- Convert_wing_InstanceList_To_v1alpha1_InstanceList,
- Convert_v1alpha1_InstanceSpec_To_wing_InstanceSpec,
- Convert_wing_InstanceSpec_To_v1alpha1_InstanceSpec,
- Convert_v1alpha1_InstanceSpecManifest_To_wing_InstanceSpecManifest,
- Convert_wing_InstanceSpecManifest_To_v1alpha1_InstanceSpecManifest,
- Convert_v1alpha1_InstanceStatus_To_wing_InstanceStatus,
- Convert_wing_InstanceStatus_To_v1alpha1_InstanceStatus,
- Convert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest,
- Convert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest,
+ Convert_v1alpha1_Machine_To_wing_Machine,
+ Convert_wing_Machine_To_v1alpha1_Machine,
+ Convert_v1alpha1_MachineDeployment_To_wing_MachineDeployment,
+ Convert_wing_MachineDeployment_To_v1alpha1_MachineDeployment,
+ Convert_v1alpha1_MachineDeploymentList_To_wing_MachineDeploymentList,
+ Convert_wing_MachineDeploymentList_To_v1alpha1_MachineDeploymentList,
+ Convert_v1alpha1_MachineDeploymentSpec_To_wing_MachineDeploymentSpec,
+ Convert_wing_MachineDeploymentSpec_To_v1alpha1_MachineDeploymentSpec,
+ Convert_v1alpha1_MachineDeploymentStatus_To_wing_MachineDeploymentStatus,
+ Convert_wing_MachineDeploymentStatus_To_v1alpha1_MachineDeploymentStatus,
+ Convert_v1alpha1_MachineDeploymentStrategy_To_wing_MachineDeploymentStrategy,
+ Convert_wing_MachineDeploymentStrategy_To_v1alpha1_MachineDeploymentStrategy,
+ Convert_v1alpha1_MachineList_To_wing_MachineList,
+ Convert_wing_MachineList_To_v1alpha1_MachineList,
+ Convert_v1alpha1_MachineRollingUpdateDeployment_To_wing_MachineRollingUpdateDeployment,
+ Convert_wing_MachineRollingUpdateDeployment_To_v1alpha1_MachineRollingUpdateDeployment,
+ Convert_v1alpha1_MachineSet_To_wing_MachineSet,
+ Convert_wing_MachineSet_To_v1alpha1_MachineSet,
+ Convert_v1alpha1_MachineSetList_To_wing_MachineSetList,
+ Convert_wing_MachineSetList_To_v1alpha1_MachineSetList,
+ Convert_v1alpha1_MachineSetSpec_To_wing_MachineSetSpec,
+ Convert_wing_MachineSetSpec_To_v1alpha1_MachineSetSpec,
+ Convert_v1alpha1_MachineSetStatus_To_wing_MachineSetStatus,
+ Convert_wing_MachineSetStatus_To_v1alpha1_MachineSetStatus,
+ Convert_v1alpha1_MachineSpec_To_wing_MachineSpec,
+ Convert_wing_MachineSpec_To_v1alpha1_MachineSpec,
+ Convert_v1alpha1_MachineSpecManifest_To_wing_MachineSpecManifest,
+ Convert_wing_MachineSpecManifest_To_v1alpha1_MachineSpecManifest,
+ Convert_v1alpha1_MachineStatus_To_wing_MachineStatus,
+ Convert_wing_MachineStatus_To_v1alpha1_MachineStatus,
+ Convert_v1alpha1_MachineStatusManifest_To_wing_MachineStatusManifest,
+ Convert_wing_MachineStatusManifest_To_v1alpha1_MachineStatusManifest,
+ Convert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec,
+ Convert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec,
)
}
-func autoConvert_v1alpha1_Instance_To_wing_Instance(in *Instance, out *wing.Instance, s conversion.Scope) error {
+func autoConvert_v1alpha1_Machine_To_wing_Machine(in *Machine, out *wing.Machine, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
- out.InstanceID = in.InstanceID
- out.InstancePool = in.InstancePool
- out.Spec = (*wing.InstanceSpec)(unsafe.Pointer(in.Spec))
- out.Status = (*wing.InstanceStatus)(unsafe.Pointer(in.Status))
+ out.Spec = (*wing.MachineSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*wing.MachineStatus)(unsafe.Pointer(in.Status))
return nil
}
-// Convert_v1alpha1_Instance_To_wing_Instance is an autogenerated conversion function.
-func Convert_v1alpha1_Instance_To_wing_Instance(in *Instance, out *wing.Instance, s conversion.Scope) error {
- return autoConvert_v1alpha1_Instance_To_wing_Instance(in, out, s)
+// Convert_v1alpha1_Machine_To_wing_Machine is an autogenerated conversion function.
+func Convert_v1alpha1_Machine_To_wing_Machine(in *Machine, out *wing.Machine, s conversion.Scope) error {
+ return autoConvert_v1alpha1_Machine_To_wing_Machine(in, out, s)
}
-func autoConvert_wing_Instance_To_v1alpha1_Instance(in *wing.Instance, out *Instance, s conversion.Scope) error {
+func autoConvert_wing_Machine_To_v1alpha1_Machine(in *wing.Machine, out *Machine, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
- out.InstanceID = in.InstanceID
- out.InstancePool = in.InstancePool
- out.Spec = (*InstanceSpec)(unsafe.Pointer(in.Spec))
- out.Status = (*InstanceStatus)(unsafe.Pointer(in.Status))
+ out.Spec = (*MachineSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*MachineStatus)(unsafe.Pointer(in.Status))
return nil
}
-// Convert_wing_Instance_To_v1alpha1_Instance is an autogenerated conversion function.
-func Convert_wing_Instance_To_v1alpha1_Instance(in *wing.Instance, out *Instance, s conversion.Scope) error {
- return autoConvert_wing_Instance_To_v1alpha1_Instance(in, out, s)
+// Convert_wing_Machine_To_v1alpha1_Machine is an autogenerated conversion function.
+func Convert_wing_Machine_To_v1alpha1_Machine(in *wing.Machine, out *Machine, s conversion.Scope) error {
+ return autoConvert_wing_Machine_To_v1alpha1_Machine(in, out, s)
}
-func autoConvert_v1alpha1_InstanceList_To_wing_InstanceList(in *InstanceList, out *wing.InstanceList, s conversion.Scope) error {
+func autoConvert_v1alpha1_MachineDeployment_To_wing_MachineDeployment(in *MachineDeployment, out *wing.MachineDeployment, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Spec = (*wing.MachineDeploymentSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*wing.MachineDeploymentStatus)(unsafe.Pointer(in.Status))
+ return nil
+}
+
+// Convert_v1alpha1_MachineDeployment_To_wing_MachineDeployment is an autogenerated conversion function.
+func Convert_v1alpha1_MachineDeployment_To_wing_MachineDeployment(in *MachineDeployment, out *wing.MachineDeployment, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineDeployment_To_wing_MachineDeployment(in, out, s)
+}
+
+func autoConvert_wing_MachineDeployment_To_v1alpha1_MachineDeployment(in *wing.MachineDeployment, out *MachineDeployment, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Spec = (*MachineDeploymentSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*MachineDeploymentStatus)(unsafe.Pointer(in.Status))
+ return nil
+}
+
+// Convert_wing_MachineDeployment_To_v1alpha1_MachineDeployment is an autogenerated conversion function.
+func Convert_wing_MachineDeployment_To_v1alpha1_MachineDeployment(in *wing.MachineDeployment, out *MachineDeployment, s conversion.Scope) error {
+ return autoConvert_wing_MachineDeployment_To_v1alpha1_MachineDeployment(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineDeploymentList_To_wing_MachineDeploymentList(in *MachineDeploymentList, out *wing.MachineDeploymentList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]wing.MachineDeployment)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_v1alpha1_MachineDeploymentList_To_wing_MachineDeploymentList is an autogenerated conversion function.
+func Convert_v1alpha1_MachineDeploymentList_To_wing_MachineDeploymentList(in *MachineDeploymentList, out *wing.MachineDeploymentList, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineDeploymentList_To_wing_MachineDeploymentList(in, out, s)
+}
+
+func autoConvert_wing_MachineDeploymentList_To_v1alpha1_MachineDeploymentList(in *wing.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]MachineDeployment)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_wing_MachineDeploymentList_To_v1alpha1_MachineDeploymentList is an autogenerated conversion function.
+func Convert_wing_MachineDeploymentList_To_v1alpha1_MachineDeploymentList(in *wing.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error {
+ return autoConvert_wing_MachineDeploymentList_To_v1alpha1_MachineDeploymentList(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineDeploymentSpec_To_wing_MachineDeploymentSpec(in *MachineDeploymentSpec, out *wing.MachineDeploymentSpec, s conversion.Scope) error {
+ out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
+ out.MaxReplicas = (*int32)(unsafe.Pointer(in.MaxReplicas))
+ out.Selector = in.Selector
+ if err := Convert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil {
+ return err
+ }
+ out.Strategy = (*wing.MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy))
+ out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds))
+ out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
+ out.Paused = in.Paused
+ out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds))
+ return nil
+}
+
+// Convert_v1alpha1_MachineDeploymentSpec_To_wing_MachineDeploymentSpec is an autogenerated conversion function.
+func Convert_v1alpha1_MachineDeploymentSpec_To_wing_MachineDeploymentSpec(in *MachineDeploymentSpec, out *wing.MachineDeploymentSpec, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineDeploymentSpec_To_wing_MachineDeploymentSpec(in, out, s)
+}
+
+func autoConvert_wing_MachineDeploymentSpec_To_v1alpha1_MachineDeploymentSpec(in *wing.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error {
+ out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
+ out.MaxReplicas = (*int32)(unsafe.Pointer(in.MaxReplicas))
+ out.Selector = in.Selector
+ if err := Convert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil {
+ return err
+ }
+ out.Strategy = (*MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy))
+ out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds))
+ out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
+ out.Paused = in.Paused
+ out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds))
+ return nil
+}
+
+// Convert_wing_MachineDeploymentSpec_To_v1alpha1_MachineDeploymentSpec is an autogenerated conversion function.
+func Convert_wing_MachineDeploymentSpec_To_v1alpha1_MachineDeploymentSpec(in *wing.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error {
+ return autoConvert_wing_MachineDeploymentSpec_To_v1alpha1_MachineDeploymentSpec(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineDeploymentStatus_To_wing_MachineDeploymentStatus(in *MachineDeploymentStatus, out *wing.MachineDeploymentStatus, s conversion.Scope) error {
+ out.ObservedGeneration = in.ObservedGeneration
+ out.Replicas = in.Replicas
+ out.UpdatedReplicas = in.UpdatedReplicas
+ out.ReadyReplicas = in.ReadyReplicas
+ out.AvailableReplicas = in.AvailableReplicas
+ out.UnavailableReplicas = in.UnavailableReplicas
+ return nil
+}
+
+// Convert_v1alpha1_MachineDeploymentStatus_To_wing_MachineDeploymentStatus is an autogenerated conversion function.
+func Convert_v1alpha1_MachineDeploymentStatus_To_wing_MachineDeploymentStatus(in *MachineDeploymentStatus, out *wing.MachineDeploymentStatus, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineDeploymentStatus_To_wing_MachineDeploymentStatus(in, out, s)
+}
+
+func autoConvert_wing_MachineDeploymentStatus_To_v1alpha1_MachineDeploymentStatus(in *wing.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error {
+ out.ObservedGeneration = in.ObservedGeneration
+ out.Replicas = in.Replicas
+ out.UpdatedReplicas = in.UpdatedReplicas
+ out.ReadyReplicas = in.ReadyReplicas
+ out.AvailableReplicas = in.AvailableReplicas
+ out.UnavailableReplicas = in.UnavailableReplicas
+ return nil
+}
+
+// Convert_wing_MachineDeploymentStatus_To_v1alpha1_MachineDeploymentStatus is an autogenerated conversion function.
+func Convert_wing_MachineDeploymentStatus_To_v1alpha1_MachineDeploymentStatus(in *wing.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error {
+ return autoConvert_wing_MachineDeploymentStatus_To_v1alpha1_MachineDeploymentStatus(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineDeploymentStrategy_To_wing_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *wing.MachineDeploymentStrategy, s conversion.Scope) error {
+ out.Type = common.MachineDeploymentStrategyType(in.Type)
+ out.RollingUpdate = (*wing.MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate))
+ return nil
+}
+
+// Convert_v1alpha1_MachineDeploymentStrategy_To_wing_MachineDeploymentStrategy is an autogenerated conversion function.
+func Convert_v1alpha1_MachineDeploymentStrategy_To_wing_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *wing.MachineDeploymentStrategy, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineDeploymentStrategy_To_wing_MachineDeploymentStrategy(in, out, s)
+}
+
+func autoConvert_wing_MachineDeploymentStrategy_To_v1alpha1_MachineDeploymentStrategy(in *wing.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error {
+ out.Type = common.MachineDeploymentStrategyType(in.Type)
+ out.RollingUpdate = (*MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate))
+ return nil
+}
+
+// Convert_wing_MachineDeploymentStrategy_To_v1alpha1_MachineDeploymentStrategy is an autogenerated conversion function.
+func Convert_wing_MachineDeploymentStrategy_To_v1alpha1_MachineDeploymentStrategy(in *wing.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error {
+ return autoConvert_wing_MachineDeploymentStrategy_To_v1alpha1_MachineDeploymentStrategy(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineList_To_wing_MachineList(in *MachineList, out *wing.MachineList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]wing.Machine)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_v1alpha1_MachineList_To_wing_MachineList is an autogenerated conversion function.
+func Convert_v1alpha1_MachineList_To_wing_MachineList(in *MachineList, out *wing.MachineList, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineList_To_wing_MachineList(in, out, s)
+}
+
+func autoConvert_wing_MachineList_To_v1alpha1_MachineList(in *wing.MachineList, out *MachineList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]wing.Instance)(unsafe.Pointer(&in.Items))
+ out.Items = *(*[]Machine)(unsafe.Pointer(&in.Items))
return nil
}
-// Convert_v1alpha1_InstanceList_To_wing_InstanceList is an autogenerated conversion function.
-func Convert_v1alpha1_InstanceList_To_wing_InstanceList(in *InstanceList, out *wing.InstanceList, s conversion.Scope) error {
- return autoConvert_v1alpha1_InstanceList_To_wing_InstanceList(in, out, s)
+// Convert_wing_MachineList_To_v1alpha1_MachineList is an autogenerated conversion function.
+func Convert_wing_MachineList_To_v1alpha1_MachineList(in *wing.MachineList, out *MachineList, s conversion.Scope) error {
+ return autoConvert_wing_MachineList_To_v1alpha1_MachineList(in, out, s)
}
-func autoConvert_wing_InstanceList_To_v1alpha1_InstanceList(in *wing.InstanceList, out *InstanceList, s conversion.Scope) error {
+func autoConvert_v1alpha1_MachineRollingUpdateDeployment_To_wing_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *wing.MachineRollingUpdateDeployment, s conversion.Scope) error {
+ out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable))
+ out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge))
+ return nil
+}
+
+// Convert_v1alpha1_MachineRollingUpdateDeployment_To_wing_MachineRollingUpdateDeployment is an autogenerated conversion function.
+func Convert_v1alpha1_MachineRollingUpdateDeployment_To_wing_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *wing.MachineRollingUpdateDeployment, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineRollingUpdateDeployment_To_wing_MachineRollingUpdateDeployment(in, out, s)
+}
+
+func autoConvert_wing_MachineRollingUpdateDeployment_To_v1alpha1_MachineRollingUpdateDeployment(in *wing.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error {
+ out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable))
+ out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge))
+ return nil
+}
+
+// Convert_wing_MachineRollingUpdateDeployment_To_v1alpha1_MachineRollingUpdateDeployment is an autogenerated conversion function.
+func Convert_wing_MachineRollingUpdateDeployment_To_v1alpha1_MachineRollingUpdateDeployment(in *wing.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error {
+ return autoConvert_wing_MachineRollingUpdateDeployment_To_v1alpha1_MachineRollingUpdateDeployment(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineSet_To_wing_MachineSet(in *MachineSet, out *wing.MachineSet, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Spec = (*wing.MachineSetSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*wing.MachineSetStatus)(unsafe.Pointer(in.Status))
+ return nil
+}
+
+// Convert_v1alpha1_MachineSet_To_wing_MachineSet is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSet_To_wing_MachineSet(in *MachineSet, out *wing.MachineSet, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSet_To_wing_MachineSet(in, out, s)
+}
+
+func autoConvert_wing_MachineSet_To_v1alpha1_MachineSet(in *wing.MachineSet, out *MachineSet, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ out.Spec = (*MachineSetSpec)(unsafe.Pointer(in.Spec))
+ out.Status = (*MachineSetStatus)(unsafe.Pointer(in.Status))
+ return nil
+}
+
+// Convert_wing_MachineSet_To_v1alpha1_MachineSet is an autogenerated conversion function.
+func Convert_wing_MachineSet_To_v1alpha1_MachineSet(in *wing.MachineSet, out *MachineSet, s conversion.Scope) error {
+ return autoConvert_wing_MachineSet_To_v1alpha1_MachineSet(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineSetList_To_wing_MachineSetList(in *MachineSetList, out *wing.MachineSetList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
- out.Items = *(*[]Instance)(unsafe.Pointer(&in.Items))
+ out.Items = *(*[]wing.MachineSet)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_v1alpha1_MachineSetList_To_wing_MachineSetList is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSetList_To_wing_MachineSetList(in *MachineSetList, out *wing.MachineSetList, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSetList_To_wing_MachineSetList(in, out, s)
+}
+
+func autoConvert_wing_MachineSetList_To_v1alpha1_MachineSetList(in *wing.MachineSetList, out *MachineSetList, s conversion.Scope) error {
+ out.ListMeta = in.ListMeta
+ out.Items = *(*[]MachineSet)(unsafe.Pointer(&in.Items))
+ return nil
+}
+
+// Convert_wing_MachineSetList_To_v1alpha1_MachineSetList is an autogenerated conversion function.
+func Convert_wing_MachineSetList_To_v1alpha1_MachineSetList(in *wing.MachineSetList, out *MachineSetList, s conversion.Scope) error {
+ return autoConvert_wing_MachineSetList_To_v1alpha1_MachineSetList(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineSetSpec_To_wing_MachineSetSpec(in *MachineSetSpec, out *wing.MachineSetSpec, s conversion.Scope) error {
+ out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
+ out.MaxReplicas = (*int32)(unsafe.Pointer(in.MaxReplicas))
+ out.MinReadySeconds = in.MinReadySeconds
+ out.Selector = in.Selector
+ if err := Convert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_v1alpha1_MachineSetSpec_To_wing_MachineSetSpec is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSetSpec_To_wing_MachineSetSpec(in *MachineSetSpec, out *wing.MachineSetSpec, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSetSpec_To_wing_MachineSetSpec(in, out, s)
+}
+
+func autoConvert_wing_MachineSetSpec_To_v1alpha1_MachineSetSpec(in *wing.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error {
+ out.MinReplicas = (*int32)(unsafe.Pointer(in.MinReplicas))
+ out.MaxReplicas = (*int32)(unsafe.Pointer(in.MaxReplicas))
+ out.MinReadySeconds = in.MinReadySeconds
+ out.Selector = in.Selector
+ if err := Convert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_wing_MachineSetSpec_To_v1alpha1_MachineSetSpec is an autogenerated conversion function.
+func Convert_wing_MachineSetSpec_To_v1alpha1_MachineSetSpec(in *wing.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error {
+ return autoConvert_wing_MachineSetSpec_To_v1alpha1_MachineSetSpec(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineSetStatus_To_wing_MachineSetStatus(in *MachineSetStatus, out *wing.MachineSetStatus, s conversion.Scope) error {
+ out.Replicas = in.Replicas
+ out.FullyLabeledReplicas = in.FullyLabeledReplicas
+ out.ReadyReplicas = in.ReadyReplicas
+ out.AvailableReplicas = in.AvailableReplicas
+ out.ObservedGeneration = in.ObservedGeneration
+ out.ErrorReason = common.MachineStatusError(in.ErrorReason)
+ out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage))
+ return nil
+}
+
+// Convert_v1alpha1_MachineSetStatus_To_wing_MachineSetStatus is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSetStatus_To_wing_MachineSetStatus(in *MachineSetStatus, out *wing.MachineSetStatus, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSetStatus_To_wing_MachineSetStatus(in, out, s)
+}
+
+func autoConvert_wing_MachineSetStatus_To_v1alpha1_MachineSetStatus(in *wing.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error {
+ out.Replicas = in.Replicas
+ out.FullyLabeledReplicas = in.FullyLabeledReplicas
+ out.ReadyReplicas = in.ReadyReplicas
+ out.AvailableReplicas = in.AvailableReplicas
+ out.ObservedGeneration = in.ObservedGeneration
+ out.ErrorReason = common.MachineStatusError(in.ErrorReason)
+ out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage))
return nil
}
-// Convert_wing_InstanceList_To_v1alpha1_InstanceList is an autogenerated conversion function.
-func Convert_wing_InstanceList_To_v1alpha1_InstanceList(in *wing.InstanceList, out *InstanceList, s conversion.Scope) error {
- return autoConvert_wing_InstanceList_To_v1alpha1_InstanceList(in, out, s)
+// Convert_wing_MachineSetStatus_To_v1alpha1_MachineSetStatus is an autogenerated conversion function.
+func Convert_wing_MachineSetStatus_To_v1alpha1_MachineSetStatus(in *wing.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error {
+ return autoConvert_wing_MachineSetStatus_To_v1alpha1_MachineSetStatus(in, out, s)
}
-func autoConvert_v1alpha1_InstanceSpec_To_wing_InstanceSpec(in *InstanceSpec, out *wing.InstanceSpec, s conversion.Scope) error {
- out.Converge = (*wing.InstanceSpecManifest)(unsafe.Pointer(in.Converge))
- out.DryRun = (*wing.InstanceSpecManifest)(unsafe.Pointer(in.DryRun))
+func autoConvert_v1alpha1_MachineSpec_To_wing_MachineSpec(in *MachineSpec, out *wing.MachineSpec, s conversion.Scope) error {
+ out.Converge = (*wing.MachineSpecManifest)(unsafe.Pointer(in.Converge))
+ out.DryRun = (*wing.MachineSpecManifest)(unsafe.Pointer(in.DryRun))
return nil
}
-// Convert_v1alpha1_InstanceSpec_To_wing_InstanceSpec is an autogenerated conversion function.
-func Convert_v1alpha1_InstanceSpec_To_wing_InstanceSpec(in *InstanceSpec, out *wing.InstanceSpec, s conversion.Scope) error {
- return autoConvert_v1alpha1_InstanceSpec_To_wing_InstanceSpec(in, out, s)
+// Convert_v1alpha1_MachineSpec_To_wing_MachineSpec is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSpec_To_wing_MachineSpec(in *MachineSpec, out *wing.MachineSpec, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSpec_To_wing_MachineSpec(in, out, s)
}
-func autoConvert_wing_InstanceSpec_To_v1alpha1_InstanceSpec(in *wing.InstanceSpec, out *InstanceSpec, s conversion.Scope) error {
- out.Converge = (*InstanceSpecManifest)(unsafe.Pointer(in.Converge))
- out.DryRun = (*InstanceSpecManifest)(unsafe.Pointer(in.DryRun))
+func autoConvert_wing_MachineSpec_To_v1alpha1_MachineSpec(in *wing.MachineSpec, out *MachineSpec, s conversion.Scope) error {
+ out.Converge = (*MachineSpecManifest)(unsafe.Pointer(in.Converge))
+ out.DryRun = (*MachineSpecManifest)(unsafe.Pointer(in.DryRun))
return nil
}
-// Convert_wing_InstanceSpec_To_v1alpha1_InstanceSpec is an autogenerated conversion function.
-func Convert_wing_InstanceSpec_To_v1alpha1_InstanceSpec(in *wing.InstanceSpec, out *InstanceSpec, s conversion.Scope) error {
- return autoConvert_wing_InstanceSpec_To_v1alpha1_InstanceSpec(in, out, s)
+// Convert_wing_MachineSpec_To_v1alpha1_MachineSpec is an autogenerated conversion function.
+func Convert_wing_MachineSpec_To_v1alpha1_MachineSpec(in *wing.MachineSpec, out *MachineSpec, s conversion.Scope) error {
+ return autoConvert_wing_MachineSpec_To_v1alpha1_MachineSpec(in, out, s)
}
-func autoConvert_v1alpha1_InstanceSpecManifest_To_wing_InstanceSpecManifest(in *InstanceSpecManifest, out *wing.InstanceSpecManifest, s conversion.Scope) error {
+func autoConvert_v1alpha1_MachineSpecManifest_To_wing_MachineSpecManifest(in *MachineSpecManifest, out *wing.MachineSpecManifest, s conversion.Scope) error {
out.Path = in.Path
out.Hash = in.Hash
out.RequestTimestamp = in.RequestTimestamp
return nil
}
-// Convert_v1alpha1_InstanceSpecManifest_To_wing_InstanceSpecManifest is an autogenerated conversion function.
-func Convert_v1alpha1_InstanceSpecManifest_To_wing_InstanceSpecManifest(in *InstanceSpecManifest, out *wing.InstanceSpecManifest, s conversion.Scope) error {
- return autoConvert_v1alpha1_InstanceSpecManifest_To_wing_InstanceSpecManifest(in, out, s)
+// Convert_v1alpha1_MachineSpecManifest_To_wing_MachineSpecManifest is an autogenerated conversion function.
+func Convert_v1alpha1_MachineSpecManifest_To_wing_MachineSpecManifest(in *MachineSpecManifest, out *wing.MachineSpecManifest, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineSpecManifest_To_wing_MachineSpecManifest(in, out, s)
}
-func autoConvert_wing_InstanceSpecManifest_To_v1alpha1_InstanceSpecManifest(in *wing.InstanceSpecManifest, out *InstanceSpecManifest, s conversion.Scope) error {
+func autoConvert_wing_MachineSpecManifest_To_v1alpha1_MachineSpecManifest(in *wing.MachineSpecManifest, out *MachineSpecManifest, s conversion.Scope) error {
out.Path = in.Path
out.Hash = in.Hash
out.RequestTimestamp = in.RequestTimestamp
return nil
}
-// Convert_wing_InstanceSpecManifest_To_v1alpha1_InstanceSpecManifest is an autogenerated conversion function.
-func Convert_wing_InstanceSpecManifest_To_v1alpha1_InstanceSpecManifest(in *wing.InstanceSpecManifest, out *InstanceSpecManifest, s conversion.Scope) error {
- return autoConvert_wing_InstanceSpecManifest_To_v1alpha1_InstanceSpecManifest(in, out, s)
+// Convert_wing_MachineSpecManifest_To_v1alpha1_MachineSpecManifest is an autogenerated conversion function.
+func Convert_wing_MachineSpecManifest_To_v1alpha1_MachineSpecManifest(in *wing.MachineSpecManifest, out *MachineSpecManifest, s conversion.Scope) error {
+ return autoConvert_wing_MachineSpecManifest_To_v1alpha1_MachineSpecManifest(in, out, s)
}
-func autoConvert_v1alpha1_InstanceStatus_To_wing_InstanceStatus(in *InstanceStatus, out *wing.InstanceStatus, s conversion.Scope) error {
- out.Converge = (*wing.InstanceStatusManifest)(unsafe.Pointer(in.Converge))
- out.DryRun = (*wing.InstanceStatusManifest)(unsafe.Pointer(in.DryRun))
+func autoConvert_v1alpha1_MachineStatus_To_wing_MachineStatus(in *MachineStatus, out *wing.MachineStatus, s conversion.Scope) error {
+ out.Converge = (*wing.MachineStatusManifest)(unsafe.Pointer(in.Converge))
+ out.DryRun = (*wing.MachineStatusManifest)(unsafe.Pointer(in.DryRun))
return nil
}
-// Convert_v1alpha1_InstanceStatus_To_wing_InstanceStatus is an autogenerated conversion function.
-func Convert_v1alpha1_InstanceStatus_To_wing_InstanceStatus(in *InstanceStatus, out *wing.InstanceStatus, s conversion.Scope) error {
- return autoConvert_v1alpha1_InstanceStatus_To_wing_InstanceStatus(in, out, s)
+// Convert_v1alpha1_MachineStatus_To_wing_MachineStatus is an autogenerated conversion function.
+func Convert_v1alpha1_MachineStatus_To_wing_MachineStatus(in *MachineStatus, out *wing.MachineStatus, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineStatus_To_wing_MachineStatus(in, out, s)
}
-func autoConvert_wing_InstanceStatus_To_v1alpha1_InstanceStatus(in *wing.InstanceStatus, out *InstanceStatus, s conversion.Scope) error {
- out.Converge = (*InstanceStatusManifest)(unsafe.Pointer(in.Converge))
- out.DryRun = (*InstanceStatusManifest)(unsafe.Pointer(in.DryRun))
+func autoConvert_wing_MachineStatus_To_v1alpha1_MachineStatus(in *wing.MachineStatus, out *MachineStatus, s conversion.Scope) error {
+ out.Converge = (*MachineStatusManifest)(unsafe.Pointer(in.Converge))
+ out.DryRun = (*MachineStatusManifest)(unsafe.Pointer(in.DryRun))
return nil
}
-// Convert_wing_InstanceStatus_To_v1alpha1_InstanceStatus is an autogenerated conversion function.
-func Convert_wing_InstanceStatus_To_v1alpha1_InstanceStatus(in *wing.InstanceStatus, out *InstanceStatus, s conversion.Scope) error {
- return autoConvert_wing_InstanceStatus_To_v1alpha1_InstanceStatus(in, out, s)
+// Convert_wing_MachineStatus_To_v1alpha1_MachineStatus is an autogenerated conversion function.
+func Convert_wing_MachineStatus_To_v1alpha1_MachineStatus(in *wing.MachineStatus, out *MachineStatus, s conversion.Scope) error {
+ return autoConvert_wing_MachineStatus_To_v1alpha1_MachineStatus(in, out, s)
}
-func autoConvert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest(in *InstanceStatusManifest, out *wing.InstanceStatusManifest, s conversion.Scope) error {
- out.State = wing.InstanceManifestState(in.State)
+func autoConvert_v1alpha1_MachineStatusManifest_To_wing_MachineStatusManifest(in *MachineStatusManifest, out *wing.MachineStatusManifest, s conversion.Scope) error {
+ out.State = common.MachineManifestState(in.State)
out.Hash = in.Hash
out.LastUpdateTimestamp = in.LastUpdateTimestamp
out.Messages = *(*[]string)(unsafe.Pointer(&in.Messages))
@@ -163,13 +453,13 @@ func autoConvert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest(
return nil
}
-// Convert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest is an autogenerated conversion function.
-func Convert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest(in *InstanceStatusManifest, out *wing.InstanceStatusManifest, s conversion.Scope) error {
- return autoConvert_v1alpha1_InstanceStatusManifest_To_wing_InstanceStatusManifest(in, out, s)
+// Convert_v1alpha1_MachineStatusManifest_To_wing_MachineStatusManifest is an autogenerated conversion function.
+func Convert_v1alpha1_MachineStatusManifest_To_wing_MachineStatusManifest(in *MachineStatusManifest, out *wing.MachineStatusManifest, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineStatusManifest_To_wing_MachineStatusManifest(in, out, s)
}
-func autoConvert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest(in *wing.InstanceStatusManifest, out *InstanceStatusManifest, s conversion.Scope) error {
- out.State = InstanceManifestState(in.State)
+func autoConvert_wing_MachineStatusManifest_To_v1alpha1_MachineStatusManifest(in *wing.MachineStatusManifest, out *MachineStatusManifest, s conversion.Scope) error {
+ out.State = common.MachineManifestState(in.State)
out.Hash = in.Hash
out.LastUpdateTimestamp = in.LastUpdateTimestamp
out.Messages = *(*[]string)(unsafe.Pointer(&in.Messages))
@@ -177,7 +467,33 @@ func autoConvert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest(
return nil
}
-// Convert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest is an autogenerated conversion function.
-func Convert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest(in *wing.InstanceStatusManifest, out *InstanceStatusManifest, s conversion.Scope) error {
- return autoConvert_wing_InstanceStatusManifest_To_v1alpha1_InstanceStatusManifest(in, out, s)
+// Convert_wing_MachineStatusManifest_To_v1alpha1_MachineStatusManifest is an autogenerated conversion function.
+func Convert_wing_MachineStatusManifest_To_v1alpha1_MachineStatusManifest(in *wing.MachineStatusManifest, out *MachineStatusManifest, s conversion.Scope) error {
+ return autoConvert_wing_MachineStatusManifest_To_v1alpha1_MachineStatusManifest(in, out, s)
+}
+
+func autoConvert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec(in *MachineTemplateSpec, out *wing.MachineTemplateSpec, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ if err := Convert_v1alpha1_MachineSpec_To_wing_MachineSpec(&in.Spec, &out.Spec, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec is an autogenerated conversion function.
+func Convert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec(in *MachineTemplateSpec, out *wing.MachineTemplateSpec, s conversion.Scope) error {
+ return autoConvert_v1alpha1_MachineTemplateSpec_To_wing_MachineTemplateSpec(in, out, s)
+}
+
+func autoConvert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(in *wing.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error {
+ out.ObjectMeta = in.ObjectMeta
+ if err := Convert_wing_MachineSpec_To_v1alpha1_MachineSpec(&in.Spec, &out.Spec, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+// Convert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec is an autogenerated conversion function.
+func Convert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(in *wing.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error {
+ return autoConvert_wing_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(in, out, s)
}
diff --git a/pkg/apis/wing/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/wing/v1alpha1/zz_generated.deepcopy.go
index 68e3769737..74664716d9 100644
--- a/pkg/apis/wing/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/wing/v1alpha1/zz_generated.deepcopy.go
@@ -8,10 +8,11 @@ package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Instance) DeepCopyInto(out *Instance) {
+func (in *Machine) DeepCopyInto(out *Machine) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -20,7 +21,7 @@ func (in *Instance) DeepCopyInto(out *Instance) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpec)
+ *out = new(MachineSpec)
(*in).DeepCopyInto(*out)
}
}
@@ -29,25 +30,25 @@ func (in *Instance) DeepCopyInto(out *Instance) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatus)
+ *out = new(MachineStatus)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.
-func (in *Instance) DeepCopy() *Instance {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine.
+func (in *Machine) DeepCopy() *Machine {
if in == nil {
return nil
}
- out := new(Instance)
+ out := new(Machine)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Instance) DeepCopyObject() runtime.Object {
+func (in *Machine) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
@@ -56,13 +57,318 @@ func (in *Instance) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceList) DeepCopyInto(out *InstanceList) {
+func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Spec != nil {
+ in, out := &in.Spec, &out.Spec
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentStatus)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment.
+func (in *MachineDeployment) DeepCopy() *MachineDeployment {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeployment)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineDeployment) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MachineDeployment, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList.
+func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineDeploymentList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) {
+ *out = *in
+ if in.MinReplicas != nil {
+ in, out := &in.MinReplicas, &out.MinReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.MaxReplicas != nil {
+ in, out := &in.MaxReplicas, &out.MaxReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ in.Selector.DeepCopyInto(&out.Selector)
+ in.Template.DeepCopyInto(&out.Template)
+ if in.Strategy != nil {
+ in, out := &in.Strategy, &out.Strategy
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentStrategy)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.MinReadySeconds != nil {
+ in, out := &in.MinReadySeconds, &out.MinReadySeconds
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.RevisionHistoryLimit != nil {
+ in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.ProgressDeadlineSeconds != nil {
+ in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec.
+func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus.
+func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) {
+ *out = *in
+ if in.RollingUpdate != nil {
+ in, out := &in.RollingUpdate, &out.RollingUpdate
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineRollingUpdateDeployment)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy.
+func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentStrategy)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineList) DeepCopyInto(out *MachineList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Machine, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList.
+func (in *MachineList) DeepCopy() *MachineList {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) {
+ *out = *in
+ if in.MaxUnavailable != nil {
+ in, out := &in.MaxUnavailable, &out.MaxUnavailable
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ }
+ if in.MaxSurge != nil {
+ in, out := &in.MaxSurge, &out.MaxSurge
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment.
+func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineRollingUpdateDeployment)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSet) DeepCopyInto(out *MachineSet) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Spec != nil {
+ in, out := &in.Spec, &out.Spec
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineSetSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineSetStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet.
+func (in *MachineSet) DeepCopy() *MachineSet {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSet)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineSet) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSetList) DeepCopyInto(out *MachineSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
- *out = make([]Instance, len(*in))
+ *out = make([]MachineSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -70,18 +376,18 @@ func (in *InstanceList) DeepCopyInto(out *InstanceList) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceList.
-func (in *InstanceList) DeepCopy() *InstanceList {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList.
+func (in *MachineSetList) DeepCopy() *MachineSetList {
if in == nil {
return nil
}
- out := new(InstanceList)
+ out := new(MachineSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InstanceList) DeepCopyObject() runtime.Object {
+func (in *MachineSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
@@ -90,14 +396,75 @@ func (in *InstanceList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) {
+func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) {
+ *out = *in
+ if in.MinReplicas != nil {
+ in, out := &in.MinReplicas, &out.MinReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.MaxReplicas != nil {
+ in, out := &in.MaxReplicas, &out.MaxReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ in.Selector.DeepCopyInto(&out.Selector)
+ in.Template.DeepCopyInto(&out.Template)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec.
+func (in *MachineSetSpec) DeepCopy() *MachineSetSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSetSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) {
+ *out = *in
+ if in.ErrorMessage != nil {
+ in, out := &in.ErrorMessage, &out.ErrorMessage
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(string)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus.
+func (in *MachineSetStatus) DeepCopy() *MachineSetStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSetStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSpec) DeepCopyInto(out *MachineSpec) {
*out = *in
if in.Converge != nil {
in, out := &in.Converge, &out.Converge
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpecManifest)
+ *out = new(MachineSpecManifest)
(*in).DeepCopyInto(*out)
}
}
@@ -106,49 +473,49 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpecManifest)
+ *out = new(MachineSpecManifest)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec.
-func (in *InstanceSpec) DeepCopy() *InstanceSpec {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec.
+func (in *MachineSpec) DeepCopy() *MachineSpec {
if in == nil {
return nil
}
- out := new(InstanceSpec)
+ out := new(MachineSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceSpecManifest) DeepCopyInto(out *InstanceSpecManifest) {
+func (in *MachineSpecManifest) DeepCopyInto(out *MachineSpecManifest) {
*out = *in
in.RequestTimestamp.DeepCopyInto(&out.RequestTimestamp)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpecManifest.
-func (in *InstanceSpecManifest) DeepCopy() *InstanceSpecManifest {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpecManifest.
+func (in *MachineSpecManifest) DeepCopy() *MachineSpecManifest {
if in == nil {
return nil
}
- out := new(InstanceSpecManifest)
+ out := new(MachineSpecManifest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) {
+func (in *MachineStatus) DeepCopyInto(out *MachineStatus) {
*out = *in
if in.Converge != nil {
in, out := &in.Converge, &out.Converge
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatusManifest)
+ *out = new(MachineStatusManifest)
(*in).DeepCopyInto(*out)
}
}
@@ -157,25 +524,25 @@ func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatusManifest)
+ *out = new(MachineStatusManifest)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus.
-func (in *InstanceStatus) DeepCopy() *InstanceStatus {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus.
+func (in *MachineStatus) DeepCopy() *MachineStatus {
if in == nil {
return nil
}
- out := new(InstanceStatus)
+ out := new(MachineStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceStatusManifest) DeepCopyInto(out *InstanceStatusManifest) {
+func (in *MachineStatusManifest) DeepCopyInto(out *MachineStatusManifest) {
*out = *in
in.LastUpdateTimestamp.DeepCopyInto(&out.LastUpdateTimestamp)
if in.Messages != nil {
@@ -191,12 +558,30 @@ func (in *InstanceStatusManifest) DeepCopyInto(out *InstanceStatusManifest) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatusManifest.
-func (in *InstanceStatusManifest) DeepCopy() *InstanceStatusManifest {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatusManifest.
+func (in *MachineStatusManifest) DeepCopy() *MachineStatusManifest {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineStatusManifest)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) {
+ *out = *in
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec.
+func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec {
if in == nil {
return nil
}
- out := new(InstanceStatusManifest)
+ out := new(MachineTemplateSpec)
in.DeepCopyInto(out)
return out
}
diff --git a/pkg/apis/wing/zz_generated.deepcopy.go b/pkg/apis/wing/zz_generated.deepcopy.go
index 60477ce627..d82943944e 100644
--- a/pkg/apis/wing/zz_generated.deepcopy.go
+++ b/pkg/apis/wing/zz_generated.deepcopy.go
@@ -8,10 +8,11 @@ package wing
import (
runtime "k8s.io/apimachinery/pkg/runtime"
+ intstr "k8s.io/apimachinery/pkg/util/intstr"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Instance) DeepCopyInto(out *Instance) {
+func (in *Machine) DeepCopyInto(out *Machine) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -20,7 +21,7 @@ func (in *Instance) DeepCopyInto(out *Instance) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpec)
+ *out = new(MachineSpec)
(*in).DeepCopyInto(*out)
}
}
@@ -29,25 +30,25 @@ func (in *Instance) DeepCopyInto(out *Instance) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatus)
+ *out = new(MachineStatus)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.
-func (in *Instance) DeepCopy() *Instance {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine.
+func (in *Machine) DeepCopy() *Machine {
if in == nil {
return nil
}
- out := new(Instance)
+ out := new(Machine)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Instance) DeepCopyObject() runtime.Object {
+func (in *Machine) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
@@ -56,13 +57,318 @@ func (in *Instance) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceList) DeepCopyInto(out *InstanceList) {
+func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Spec != nil {
+ in, out := &in.Spec, &out.Spec
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentStatus)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment.
+func (in *MachineDeployment) DeepCopy() *MachineDeployment {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeployment)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineDeployment) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]MachineDeployment, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList.
+func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineDeploymentList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) {
+ *out = *in
+ if in.MinReplicas != nil {
+ in, out := &in.MinReplicas, &out.MinReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.MaxReplicas != nil {
+ in, out := &in.MaxReplicas, &out.MaxReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ in.Selector.DeepCopyInto(&out.Selector)
+ in.Template.DeepCopyInto(&out.Template)
+ if in.Strategy != nil {
+ in, out := &in.Strategy, &out.Strategy
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineDeploymentStrategy)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.MinReadySeconds != nil {
+ in, out := &in.MinReadySeconds, &out.MinReadySeconds
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.RevisionHistoryLimit != nil {
+ in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.ProgressDeadlineSeconds != nil {
+ in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec.
+func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus.
+func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) {
+ *out = *in
+ if in.RollingUpdate != nil {
+ in, out := &in.RollingUpdate, &out.RollingUpdate
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineRollingUpdateDeployment)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy.
+func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineDeploymentStrategy)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineList) DeepCopyInto(out *MachineList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ out.ListMeta = in.ListMeta
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Machine, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList.
+func (in *MachineList) DeepCopy() *MachineList {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) {
+ *out = *in
+ if in.MaxUnavailable != nil {
+ in, out := &in.MaxUnavailable, &out.MaxUnavailable
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ }
+ if in.MaxSurge != nil {
+ in, out := &in.MaxSurge, &out.MaxSurge
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(intstr.IntOrString)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment.
+func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineRollingUpdateDeployment)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSet) DeepCopyInto(out *MachineSet) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ if in.Spec != nil {
+ in, out := &in.Spec, &out.Spec
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineSetSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(MachineSetStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet.
+func (in *MachineSet) DeepCopy() *MachineSet {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSet)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MachineSet) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ } else {
+ return nil
+ }
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSetList) DeepCopyInto(out *MachineSetList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
- *out = make([]Instance, len(*in))
+ *out = make([]MachineSet, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -70,18 +376,18 @@ func (in *InstanceList) DeepCopyInto(out *InstanceList) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceList.
-func (in *InstanceList) DeepCopy() *InstanceList {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList.
+func (in *MachineSetList) DeepCopy() *MachineSetList {
if in == nil {
return nil
}
- out := new(InstanceList)
+ out := new(MachineSetList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InstanceList) DeepCopyObject() runtime.Object {
+func (in *MachineSetList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
@@ -90,14 +396,75 @@ func (in *InstanceList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) {
+func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) {
+ *out = *in
+ if in.MinReplicas != nil {
+ in, out := &in.MinReplicas, &out.MinReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ if in.MaxReplicas != nil {
+ in, out := &in.MaxReplicas, &out.MaxReplicas
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(int32)
+ **out = **in
+ }
+ }
+ in.Selector.DeepCopyInto(&out.Selector)
+ in.Template.DeepCopyInto(&out.Template)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec.
+func (in *MachineSetSpec) DeepCopy() *MachineSetSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSetSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) {
+ *out = *in
+ if in.ErrorMessage != nil {
+ in, out := &in.ErrorMessage, &out.ErrorMessage
+ if *in == nil {
+ *out = nil
+ } else {
+ *out = new(string)
+ **out = **in
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus.
+func (in *MachineSetStatus) DeepCopy() *MachineSetStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineSetStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineSpec) DeepCopyInto(out *MachineSpec) {
*out = *in
if in.Converge != nil {
in, out := &in.Converge, &out.Converge
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpecManifest)
+ *out = new(MachineSpecManifest)
(*in).DeepCopyInto(*out)
}
}
@@ -106,49 +473,49 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceSpecManifest)
+ *out = new(MachineSpecManifest)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec.
-func (in *InstanceSpec) DeepCopy() *InstanceSpec {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec.
+func (in *MachineSpec) DeepCopy() *MachineSpec {
if in == nil {
return nil
}
- out := new(InstanceSpec)
+ out := new(MachineSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceSpecManifest) DeepCopyInto(out *InstanceSpecManifest) {
+func (in *MachineSpecManifest) DeepCopyInto(out *MachineSpecManifest) {
*out = *in
in.RequestTimestamp.DeepCopyInto(&out.RequestTimestamp)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpecManifest.
-func (in *InstanceSpecManifest) DeepCopy() *InstanceSpecManifest {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpecManifest.
+func (in *MachineSpecManifest) DeepCopy() *MachineSpecManifest {
if in == nil {
return nil
}
- out := new(InstanceSpecManifest)
+ out := new(MachineSpecManifest)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) {
+func (in *MachineStatus) DeepCopyInto(out *MachineStatus) {
*out = *in
if in.Converge != nil {
in, out := &in.Converge, &out.Converge
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatusManifest)
+ *out = new(MachineStatusManifest)
(*in).DeepCopyInto(*out)
}
}
@@ -157,25 +524,25 @@ func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) {
if *in == nil {
*out = nil
} else {
- *out = new(InstanceStatusManifest)
+ *out = new(MachineStatusManifest)
(*in).DeepCopyInto(*out)
}
}
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus.
-func (in *InstanceStatus) DeepCopy() *InstanceStatus {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus.
+func (in *MachineStatus) DeepCopy() *MachineStatus {
if in == nil {
return nil
}
- out := new(InstanceStatus)
+ out := new(MachineStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InstanceStatusManifest) DeepCopyInto(out *InstanceStatusManifest) {
+func (in *MachineStatusManifest) DeepCopyInto(out *MachineStatusManifest) {
*out = *in
in.LastUpdateTimestamp.DeepCopyInto(&out.LastUpdateTimestamp)
if in.Messages != nil {
@@ -191,12 +558,30 @@ func (in *InstanceStatusManifest) DeepCopyInto(out *InstanceStatusManifest) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatusManifest.
-func (in *InstanceStatusManifest) DeepCopy() *InstanceStatusManifest {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatusManifest.
+func (in *MachineStatusManifest) DeepCopy() *MachineStatusManifest {
+ if in == nil {
+ return nil
+ }
+ out := new(MachineStatusManifest)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) {
+ *out = *in
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec.
+func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec {
if in == nil {
return nil
}
- out := new(InstanceStatusManifest)
+ out := new(MachineTemplateSpec)
in.DeepCopyInto(out)
return out
}
diff --git a/pkg/tarmak/cluster/cluster.go b/pkg/tarmak/cluster/cluster.go
index c66347e32d..45c46135db 100644
--- a/pkg/tarmak/cluster/cluster.go
+++ b/pkg/tarmak/cluster/cluster.go
@@ -31,6 +31,7 @@ const (
// returns a server
type Cluster struct {
conf *clusterv1alpha1.Cluster
+ ctx interfaces.CancellationContext
environment interfaces.Environment
networkCIDR *net.IPNet
@@ -53,6 +54,7 @@ var _ interfaces.Cluster = &Cluster{}
func NewFromConfig(environment interfaces.Environment, conf *clusterv1alpha1.Cluster) (*Cluster, error) {
cluster := &Cluster{
conf: conf,
+ ctx: environment.Tarmak().CancellationContext(),
environment: environment,
log: environment.Log().WithField("cluster", conf.Name),
}
diff --git a/pkg/tarmak/cluster/cluster_test.go b/pkg/tarmak/cluster/cluster_test.go
index 1d4a473b5b..3bb1a42c5f 100644
--- a/pkg/tarmak/cluster/cluster_test.go
+++ b/pkg/tarmak/cluster/cluster_test.go
@@ -11,6 +11,7 @@ import (
clusterv1alpha1 "github.com/jetstack/tarmak/pkg/apis/cluster/v1alpha1"
"github.com/jetstack/tarmak/pkg/tarmak/config"
"github.com/jetstack/tarmak/pkg/tarmak/mocks"
+ "github.com/jetstack/tarmak/pkg/tarmak/utils"
)
type fakeCluster struct {
@@ -40,6 +41,7 @@ func newFakeCluster(t *testing.T, cluster *clusterv1alpha1.Cluster) *fakeCluster
c.fakeConfig = mocks.NewMockConfig(c.ctrl)
c.fakeEnvironment = mocks.NewMockEnvironment(c.ctrl)
c.environment = c.fakeEnvironment
+ c.ctx = utils.NewCancellationContext(c.fakeTarmak)
// setup custom logger
logger := logrus.New()
@@ -60,6 +62,7 @@ func newFakeCluster(t *testing.T, cluster *clusterv1alpha1.Cluster) *fakeCluster
c.fakeProvider.EXPECT().Name().Return("provider-name").AnyTimes()
c.fakeTarmak.EXPECT().Config().AnyTimes().Return(c.fakeConfig)
+ c.fakeTarmak.EXPECT().CancellationContext().Return(c.ctx).AnyTimes()
return c
}
diff --git a/pkg/tarmak/cluster/configuration.go b/pkg/tarmak/cluster/configuration.go
index 6460116164..aac7736059 100644
--- a/pkg/tarmak/cluster/configuration.go
+++ b/pkg/tarmak/cluster/configuration.go
@@ -6,8 +6,12 @@ import (
"crypto/md5"
"encoding/hex"
"fmt"
+ "strings"
"time"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
wingv1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
)
@@ -38,31 +42,36 @@ func (c *Cluster) UploadConfiguration() error {
)
}
-// This enforces a reapply of the puppet.tar.gz on every instance in the cluster
+// This enforces a reapply of the puppet.tar.gz on every machine in the cluster
func (c *Cluster) ReapplyConfiguration() error {
- c.log.Infof("making sure all instances apply the latest manifest")
+ c.log.Infof("making sure all machines apply the latest manifest")
+
+ if err := c.deleteUnusedMachines(); err != nil {
+ return err
+ }
- // connect to wing
- client, err := c.wingInstanceClient()
+ if err := c.updateMachineDeployments(); err != nil {
+ return err
+ }
+
+ client, err := c.wingMachineClient()
if err != nil {
- return fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ return err
}
- // list instances
- instances, err := c.listInstances()
+ // here we need to start the mechanism to trigger a re-converge
+ machines, err := c.listMachines()
if err != nil {
- return fmt.Errorf("failed to list instances: %s", err)
+ return fmt.Errorf("failed to list machines: %s", err)
}
- for pos, _ := range instances {
- instance := instances[pos]
- if instance.Spec == nil {
- instance.Spec = &wingv1alpha1.InstanceSpec{}
- }
- instance.Spec.Converge = &wingv1alpha1.InstanceSpecManifest{}
+ for pos, _ := range machines {
+ machine := machines[pos]
+ machine.Status = &wingv1alpha1.MachineStatus{}
+ machine.Status.Converge = &wingv1alpha1.MachineStatusManifest{}
- if _, err := client.Update(instance); err != nil {
- c.log.Warnf("error updating instance %s in wing API: %s", instance.Name, err)
+ if _, err := client.Update(machine); err != nil {
+ c.log.Warnf("error updating machine %s in wing API: %s", machine.Name, err)
}
}
@@ -72,53 +81,99 @@ func (c *Cluster) ReapplyConfiguration() error {
return nil
}
-// This waits until all instances have congverged successfully
+// This waits until all machines have congverged successfully
func (c *Cluster) WaitForConvergance() error {
- c.log.Debugf("making sure all instances have converged using puppet")
+ c.log.Debugf("making sure all machine have converged using puppet")
retries := retries
for {
- instances, err := c.listInstances()
+ deployments, err := c.listMachineDeployments()
if err != nil {
- return fmt.Errorf("failed to list instances: %s", err)
+ return fmt.Errorf("failed to list machines: %s", err)
}
- instanceByState := make(map[wingv1alpha1.InstanceManifestState][]*wingv1alpha1.Instance)
-
- for pos, _ := range instances {
- instance := instances[pos]
+ var converged []*wingv1alpha1.MachineDeployment
+ var converging []*wingv1alpha1.MachineDeployment
+ for pos, _ := range deployments {
+ deployment := deployments[pos]
- // index by instance convergance state
- if instance.Status == nil || instance.Status.Converge == nil || instance.Status.Converge.State == "" {
+ if deployment.Status == nil {
+ deployment.Status = &wingv1alpha1.MachineDeploymentStatus{}
+ converging = append(converging, deployment)
continue
}
- state := instance.Status.Converge.State
- if _, ok := instanceByState[state]; !ok {
- instanceByState[state] = []*wingv1alpha1.Instance{}
+ if deployment.Status.ReadyReplicas >= deployment.Status.Replicas &&
+ deployment.Status.ReadyReplicas >= *deployment.Spec.MinReplicas {
+ converged = append(converged, deployment)
+ continue
}
- instanceByState[state] = append(
- instanceByState[state],
- instance,
- )
+ converging = append(converging, deployment)
}
- err = c.checkAllInstancesConverged(instanceByState)
- if err == nil {
- c.log.Info("all instances converged")
+ var convergedSlice []string
+ for _, d := range converged {
+ convergedSlice = append(convergedSlice, d.Name)
+ }
+ convergedStr := fmt.Sprintf("converged deployments [%s]", strings.Join(convergedSlice, " "))
+
+ if len(converging) == 0 {
+ c.log.Info("all deployments converged")
+ c.log.Info(convergedStr)
return nil
- } else {
- c.log.Debug(err)
+ }
+
+ c.log.Debug("--------")
+ if len(converged) > 0 {
+ c.log.Debug(convergedStr)
+ }
+
+ client, err := c.wingMachineClient()
+ if err != nil {
+ return err
+ }
+
+ for _, d := range converging {
+
+ mList, err := client.List(metav1.ListOptions{
+ LabelSelector: fmt.Sprintf("pool=%s,cluster=%s",
+ d.Labels["pool"], d.Labels["cluster"]),
+ })
+ if err != nil {
+ return err
+ }
+
+ var convergingMachines []string
+ for _, m := range mList.Items {
+ if m.Status == nil || m.Status.Converge == nil ||
+ m.Status.Converge.State != common.MachineManifestStateConverged {
+ convergingMachines = append(convergingMachines, m.Name)
+ }
+ }
+
+ reps := d.Status.Replicas
+ if d.Spec != nil && d.Spec.MinReplicas != nil && reps < *d.Spec.MinReplicas {
+ reps = *d.Spec.MinReplicas
+ }
+
+ c.log.Debugf("converging %s [%v/%v] (%s)",
+ d.Name, d.Status.ReadyReplicas, reps, strings.Join(convergingMachines, ", "))
}
retries--
if retries == 0 {
break
}
- time.Sleep(time.Second * 5)
+ tok := time.Tick(time.Second * 5)
+
+ select {
+ case <-c.ctx.Done():
+ return c.ctx.Err()
+ case <-tok:
+ }
}
- return fmt.Errorf("instances failed to converge in time")
+ return fmt.Errorf("machines failed to converge in time")
}
diff --git a/pkg/tarmak/cluster/wing.go b/pkg/tarmak/cluster/wing.go
index 28d26d9586..e62db2b0a3 100644
--- a/pkg/tarmak/cluster/wing.go
+++ b/pkg/tarmak/cluster/wing.go
@@ -3,114 +3,246 @@ package cluster
import (
"fmt"
- "strings"
"time"
"github.com/cenkalti/backoff"
"golang.org/x/net/context"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
wingv1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
"github.com/jetstack/tarmak/pkg/tarmak/interfaces"
+ "github.com/jetstack/tarmak/pkg/tarmak/utils"
+ wingclient "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
wingclientv1alpha1 "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1"
)
-func (c *Cluster) wingInstanceClient() (wingclientv1alpha1.InstanceInterface, error) {
- var err error
+func (c *Cluster) listMachineDeployments() ([]*wingv1alpha1.MachineDeployment, error) {
- if c.wingClientset == nil {
- // connect to wing
+ client, err := c.wingMachineDeploymentClient()
+ if err != nil {
+ return nil, fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ }
- wingClientsetTry := func() error {
- c.wingClientset, c.wingTunnel, err = c.Environment().WingClientset()
- if err != nil {
- return fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ machineDeploymentsList, err := client.List(metav1.ListOptions{})
+ if err != nil {
+ return nil, err
+ }
+
+ var deployments []*wingv1alpha1.MachineDeployment
+ for i := range machineDeploymentsList.Items {
+ deployments = append(deployments, &machineDeploymentsList.Items[i])
+ }
+
+ return deployments, nil
+}
+
+func (c *Cluster) listMachines() ([]*wingv1alpha1.Machine, error) {
+
+ client, err := c.wingMachineClient()
+ if err != nil {
+ return nil, fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ }
+
+ hosts, err := c.ListHosts()
+ if err != nil {
+ return nil, err
+ }
+
+ var machines []*wingv1alpha1.Machine
+ for _, h := range hosts {
+ m, err := client.Get(h.ID(), metav1.GetOptions{})
+ if err != nil {
+ if kerr, ok := err.(*apierrors.StatusError); ok && kerr.ErrStatus.Reason == metav1.StatusReasonNotFound {
+ machine := &wingv1alpha1.Machine{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: h.ID(),
+ },
+ Status: &wingv1alpha1.MachineStatus{
+ Converge: &wingv1alpha1.MachineStatusManifest{
+ State: common.MachineManifestStateConverging,
+ },
+ },
+ }
+
+ m, err = client.Create(machine)
+ if err != nil {
+ return nil, fmt.Errorf("error creating machine: %s", err)
+ }
+ } else {
+ return nil, fmt.Errorf("failed to get machine resource %s: %s", h.ID(), err)
}
+ }
+
+ machines = append(machines, m)
+ }
+
+ return machines, nil
+}
+
+func (c *Cluster) updateMachineDeployments() error {
+ client, err := c.wingMachineDeploymentClient()
+ if err != nil {
+ return fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ }
+
+ // list all deployments in wing
+ deployments, err := client.List(metav1.ListOptions{})
+ if err != nil {
+ return err
+ }
+
+ deploymentsMap := make(map[string]*wingv1alpha1.MachineDeployment)
+ if err != nil {
+ return fmt.Errorf("failed to list provider's machines: %s", err)
+ }
- return nil
+ for i := range deployments.Items {
+ deploymentsMap[deployments.Items[i].Name] = &deployments.Items[i]
+ }
+
+ for _, i := range c.InstancePools() {
+ if i.Role().Name() == "bastion" || i.Role().Name() == "vault" {
+ continue
}
- expBackoff := backoff.NewExponentialBackOff()
- expBackoff.InitialInterval = time.Second
- expBackoff.MaxElapsedTime = time.Minute * 2
+ d, ok := deploymentsMap[i.Name()]
+ if !ok {
+
+ md := &wingv1alpha1.MachineDeployment{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: i.Role().Name(),
+ Namespace: i.Config().ClusterName,
+ Labels: map[string]string{
+ "pool": i.Name(),
+ "cluster": c.ClusterName(),
+ },
+ },
+ Spec: c.deploymentSpec(i),
+ }
+
+ _, err := client.Create(md)
+ if err != nil {
+ return fmt.Errorf("failed to create new deployment %s: %s", i.Name(), err)
+ }
- b := backoff.WithContext(expBackoff, context.Background())
+ c.log.Debugf("created new machine deployment %s", i.Name())
- if err := backoff.Retry(wingClientsetTry, b); err != nil {
- return nil, err
+ continue
}
+ d.Spec = c.deploymentSpec(i)
+ _, err = client.Update(d)
+ if err != nil {
+ return fmt.Errorf("failed to update deployment sepc %s: %s", i.Name(), err)
+ }
}
- return c.wingClientset.WingV1alpha1().Instances(c.ClusterName()), nil
+ return nil
+}
+
+func (c *Cluster) deploymentSpec(instancePool interfaces.InstancePool) *wingv1alpha1.MachineDeploymentSpec {
+ return &wingv1alpha1.MachineDeploymentSpec{
+ MaxReplicas: utils.PointerInt32(instancePool.Config().MaxCount),
+ MinReplicas: utils.PointerInt32(instancePool.Config().MinCount),
+ ProgressDeadlineSeconds: new(int32),
+ RevisionHistoryLimit: new(int32),
+ Strategy: &wingv1alpha1.MachineDeploymentStrategy{},
+ Paused: false,
+ Selector: metav1.LabelSelector{
+ MatchLabels: map[string]string{
+ "pool": instancePool.Name(),
+ "cluster": c.ClusterName(),
+ },
+ },
+ }
}
-func (c *Cluster) listInstances() (instances []*wingv1alpha1.Instance, err error) {
+func (c *Cluster) deleteUnusedMachines() error {
// connect to wing
- client, err := c.wingInstanceClient()
+ client, err := c.wingMachineClient()
if err != nil {
- return instances, fmt.Errorf("failed to connect to wing API on bastion: %s", err)
+ return fmt.Errorf("failed to connect to wing API on bastion: %s", err)
}
- // list all instances in Provider
- providerInstances, err := c.ListHosts()
+ // list all machines in Provider
+ providerMachines, err := c.ListHosts()
providerInstaceMap := make(map[string]interfaces.Host)
if err != nil {
- return instances, fmt.Errorf("failed to list provider's instances: %s", err)
+ return fmt.Errorf("failed to list provider's machines: %s", err)
}
- for pos, _ := range providerInstances {
- providerInstaceMap[providerInstances[pos].ID()] = providerInstances[pos]
+ for pos, _ := range providerMachines {
+ providerInstaceMap[providerMachines[pos].ID()] = providerMachines[pos]
}
- // list all instances in wing
- wingInstances, err := client.List(metav1.ListOptions{})
+ // list all machines in wing
+ wingMachines, err := client.List(metav1.ListOptions{})
if err != nil {
- return instances, err
+ return err
}
- // loop through instances
- for pos, _ := range wingInstances.Items {
- instance := &wingInstances.Items[pos]
+ // loop through machines
+ for pos, _ := range wingMachines.Items {
+ m := &wingMachines.Items[pos]
- // removes instances not in AWS
- if _, ok := providerInstaceMap[instance.Name]; !ok {
- c.log.Debugf("deleting unused instance %s in wing API", instance.Name)
- if err := client.Delete(instance.Name, &metav1.DeleteOptions{}); err != nil {
- c.log.Warnf("error deleting instance %s in wing API: %s", instance.Name, err)
+ // removes machines not in AWS
+ if _, ok := providerInstaceMap[m.Name]; !ok {
+ c.log.Debugf("deleting unused machine %s in wing API", m.Name)
+ if err := client.Delete(m.Name, &metav1.DeleteOptions{}); err != nil {
+ c.log.Warnf("error deleting machine %s in wing API: %s", m.Name, err)
}
continue
}
- instances = append(instances, instance)
}
- return instances, nil
-
+ return nil
}
-func (c *Cluster) checkAllInstancesConverged(byState map[wingv1alpha1.InstanceManifestState][]*wingv1alpha1.Instance) error {
- instancesNotConverged := []*wingv1alpha1.Instance{}
- for key, instances := range byState {
- if len(instances) == 0 {
- continue
- }
- if key != wingv1alpha1.InstanceManifestStateConverged {
- instancesNotConverged = append(instancesNotConverged, instances...)
+func (c *Cluster) wingClient() (*wingclient.Clientset, error) {
+ if c.wingClientset != nil {
+ return c.wingClientset, nil
+ }
+
+ // connect to wing
+ var err error
+ wingClientsetTry := func() error {
+ c.wingClientset, c.wingTunnel, err = c.Environment().WingClientset()
+ if err != nil {
+ return fmt.Errorf("failed to connect to wing API on bastion: %s", err)
}
- c.Log().Debugf("%d instances in state %s: %s", len(instances), key, outputInstances(instances))
+
+ return nil
+ }
+
+ expBackoff := backoff.NewExponentialBackOff()
+ expBackoff.InitialInterval = time.Second
+ expBackoff.MaxElapsedTime = time.Minute * 2
+
+ b := backoff.WithContext(expBackoff, context.Background())
+
+ if err := backoff.Retry(wingClientsetTry, b); err != nil {
+ return nil, err
}
- if len(instancesNotConverged) > 0 {
- return fmt.Errorf("not all instances have converged yet %s", outputInstances(instancesNotConverged))
+ return c.wingClientset, nil
+}
+
+func (c *Cluster) wingMachineClient() (wingclientv1alpha1.MachineInterface, error) {
+ client, err := c.wingClient()
+ if err != nil {
+ return nil, err
}
- return nil
+ return client.WingV1alpha1().Machines(c.ClusterName()), nil
}
-func outputInstances(instances []*wingv1alpha1.Instance) string {
- var output []string
- for _, instance := range instances {
- output = append(output, instance.Name)
+func (c *Cluster) wingMachineDeploymentClient() (wingclientv1alpha1.MachineDeploymentInterface, error) {
+ client, err := c.wingClient()
+ if err != nil {
+ return nil, err
}
- return strings.Join(output, ", ")
+
+ return client.WingV1alpha1().MachineDeployments(c.ClusterName()), nil
}
diff --git a/pkg/tarmak/utils/maps.go b/pkg/tarmak/utils/maps.go
index bd46968445..c99a585cfb 100644
--- a/pkg/tarmak/utils/maps.go
+++ b/pkg/tarmak/utils/maps.go
@@ -26,3 +26,11 @@ func DuplicateMapBool(base map[string]bool) map[string]bool {
}
return newMap
}
+
+func DuplicateMapString(base map[string]string) map[string]string {
+ newMap := make(map[string]string)
+ for key, value := range base {
+ newMap[key] = value
+ }
+ return newMap
+}
diff --git a/pkg/tarmak/utils/pointer.go b/pkg/tarmak/utils/pointer.go
new file mode 100644
index 0000000000..ea0c1f1c9a
--- /dev/null
+++ b/pkg/tarmak/utils/pointer.go
@@ -0,0 +1,7 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package utils
+
+func PointerInt32(i int) *int32 {
+ j := int32(i)
+ return &j
+}
diff --git a/pkg/terraform/templating.go b/pkg/terraform/templating.go
index f50c02ce43..9e3e11fbb8 100644
--- a/pkg/terraform/templating.go
+++ b/pkg/terraform/templating.go
@@ -141,6 +141,7 @@ func (t *terraformTemplate) Generate() error {
{"outputs", "outputs"},
{"providers", "providers"},
{"jenkins_elb", "modules/jenkins/jenkins_elb"},
+ {"wing_s3", "modules/bastion/wing_s3"},
{"wing_s3", "modules/kubernetes/wing_s3"},
{"vault_instances", "modules/vault/vault_instances"},
} {
@@ -152,6 +153,9 @@ func (t *terraformTemplate) Generate() error {
if err := t.generateTemplate("puppet_agent_user_data", "modules/kubernetes/templates/puppet_agent_user_data", "yaml"); err != nil {
result = multierror.Append(result, err)
}
+ if err := t.generateTemplate("bastion_user_data", "modules/bastion/templates/bastion_user_data", "yaml"); err != nil {
+ result = multierror.Append(result, err)
+ }
if err := t.generateTerraformVariables(); err != nil {
result = multierror.Append(result, err)
}
diff --git a/pkg/wing/admission/plugin/instanceinittime/admission.go b/pkg/wing/admission/plugin/instanceinittime/admission.go
deleted file mode 100644
index 353b4cbad0..0000000000
--- a/pkg/wing/admission/plugin/instanceinittime/admission.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package instaceinittime
-
-import (
- "errors"
- "io"
- "time"
-
- "k8s.io/apiserver/pkg/admission"
-
- "github.com/jetstack/tarmak/pkg/apis/wing"
-)
-
-const PluginName = "InstanceInitTime"
-
-// Register registers a plugin
-func Register(plugins *admission.Plugins) {
- plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
- return New()
- })
-}
-
-type instanceInitTime struct {
- *admission.Handler
-}
-
-// Admit ensures that the object in-flight is of kind Flunder.
-// In addition checks that the Name is not on the banned list.
-// The list is stored in Fischers API objects.
-func (d *instanceInitTime) Admit(a admission.Attributes) error {
- // we are only interested in instances
- if a.GetKind().GroupKind() != wing.Kind("Instance") {
- return nil
- }
-
- instance, ok := a.GetObject().(*wing.Instance)
- if !ok {
- return errors.New("unexpected object time")
- }
-
- if instance.Status != nil {
- if instance.Status.Converge != nil && instance.Status.Converge.LastUpdateTimestamp.IsZero() {
- instance.Status.Converge.LastUpdateTimestamp.Time = time.Now()
- }
- if instance.Status.DryRun != nil && instance.Status.DryRun.LastUpdateTimestamp.IsZero() {
- instance.Status.DryRun.LastUpdateTimestamp.Time = time.Now()
- }
- }
- if instance.Spec != nil {
- if instance.Spec.Converge != nil && instance.Spec.Converge.RequestTimestamp.IsZero() {
- instance.Spec.Converge.RequestTimestamp.Time = time.Now()
- }
- if instance.Spec.DryRun != nil && instance.Spec.DryRun.RequestTimestamp.IsZero() {
- instance.Spec.DryRun.RequestTimestamp.Time = time.Now()
- }
- }
-
- return nil
-}
-
-// Validate checks whether the plugin was correctly initialized.
-func (d *instanceInitTime) Validate() error {
- return nil
-}
-
-// New creates a new instances init time admission plugin
-func New() (admission.Interface, error) {
- return &instanceInitTime{
- Handler: admission.NewHandler(admission.Create, admission.Update),
- }, nil
-}
diff --git a/pkg/wing/admission/plugin/machinedeploymentinittime/admission.go b/pkg/wing/admission/plugin/machinedeploymentinittime/admission.go
new file mode 100644
index 0000000000..928071d0c5
--- /dev/null
+++ b/pkg/wing/admission/plugin/machinedeploymentinittime/admission.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machinedeploymentinittime
+
+import (
+ "errors"
+ "fmt"
+ "io"
+
+ "k8s.io/apiserver/pkg/admission"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ informers "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions"
+ listers "github.com/jetstack/tarmak/pkg/wing/client/listers/wing/v1alpha1"
+)
+
+const PluginName = "MachineDeploymentInitTime"
+
+type machinedeploymentInitTime struct {
+ *admission.Handler
+ lister listers.MachineDeploymentLister
+}
+
+// Register registers a plugin
+func Register(plugins *admission.Plugins) {
+ plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
+ return New()
+ })
+}
+
+// Admit ensures that the object in-flight is of kind Flunder.
+// In addition checks that the Name is not on the banned list.
+// The list is stored in Fischers API objects.
+func (d *machinedeploymentInitTime) Admit(a admission.Attributes) error {
+ // we are only interested in machinedeployments
+ if a.GetKind().GroupKind() != wing.Kind("MachineDeployment") {
+ return nil
+ }
+
+ if !d.WaitForReady() {
+ return admission.NewForbidden(a, fmt.Errorf("not yet ready to handle request"))
+ }
+
+ deployment, ok := a.GetObject().(*wing.MachineDeployment)
+ if !ok {
+ return errors.New("failed to converte obj to Machien Deployment type")
+ }
+
+ if deployment.Spec == nil {
+ return errors.New("machine deployment spec cannot be nil")
+ }
+
+ if deployment.Spec.MinReplicas == nil || deployment.Spec.MaxReplicas == nil {
+ return fmt.Errorf("machine deployment min or max replicas cannot be nil: nil: min=%v max=%v",
+ deployment.Spec.MinReplicas, deployment.Spec.MaxReplicas)
+ }
+
+ return nil
+}
+
+// Validate checks whether the plugin was correctly initialized.
+func (d *machinedeploymentInitTime) ValidateInitialization() error {
+ return nil
+}
+
+func (d *machinedeploymentInitTime) SetInternalWingInformerFactory(f informers.SharedInformerFactory) {
+ d.lister = f.Wing().V1alpha1().MachineDeployments().Lister()
+}
+
+// New creates a new machines init time admission plugin
+func New() (admission.Interface, error) {
+ return &machinedeploymentInitTime{
+ Handler: admission.NewHandler(admission.Create, admission.Update),
+ }, nil
+}
diff --git a/pkg/wing/admission/plugin/machineinittime/admission.go b/pkg/wing/admission/plugin/machineinittime/admission.go
new file mode 100644
index 0000000000..70a24ea9a1
--- /dev/null
+++ b/pkg/wing/admission/plugin/machineinittime/admission.go
@@ -0,0 +1,72 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machineinittime
+
+import (
+ "errors"
+ "io"
+ "time"
+
+ "k8s.io/apiserver/pkg/admission"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+)
+
+const PluginName = "MachineInitTime"
+
+// Register registers a plugin
+func Register(plugins *admission.Plugins) {
+ plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
+ return New()
+ })
+}
+
+type machineInitTime struct {
+ *admission.Handler
+}
+
+// Admit ensures that the object in-flight is of kind Flunder.
+// In addition checks that the Name is not on the banned list.
+// The list is stored in Fischers API objects.
+func (d *machineInitTime) Admit(a admission.Attributes) error {
+ // we are only interested in machines
+ if a.GetKind().GroupKind() != wing.Kind("Machine") {
+ return nil
+ }
+
+ machine, ok := a.GetObject().(*wing.Machine)
+ if !ok {
+ return errors.New("unexpected object type")
+ }
+ machine = machine.DeepCopy()
+
+ if machine.Status != nil {
+ if machine.Status.Converge != nil && machine.Status.Converge.LastUpdateTimestamp.IsZero() {
+ machine.Status.Converge.LastUpdateTimestamp.Time = time.Now()
+ }
+ if machine.Status.DryRun != nil && machine.Status.DryRun.LastUpdateTimestamp.IsZero() {
+ machine.Status.DryRun.LastUpdateTimestamp.Time = time.Now()
+ }
+ }
+ if machine.Spec != nil {
+ if machine.Spec.Converge != nil && machine.Spec.Converge.RequestTimestamp.IsZero() {
+ machine.Spec.Converge.RequestTimestamp.Time = time.Now()
+ }
+ if machine.Spec.DryRun != nil && machine.Spec.DryRun.RequestTimestamp.IsZero() {
+ machine.Spec.DryRun.RequestTimestamp.Time = time.Now()
+ }
+ }
+
+ return nil
+}
+
+// Validate checks whether the plugin was correctly initialized.
+func (d *machineInitTime) Validate() error {
+ return nil
+}
+
+// New creates a new machines init time admission plugin
+func New() (admission.Interface, error) {
+ return &machineInitTime{
+ Handler: admission.NewHandler(admission.Create, admission.Update),
+ }, nil
+}
diff --git a/pkg/wing/admission/plugin/machinesetinittime/admission.go b/pkg/wing/admission/plugin/machinesetinittime/admission.go
new file mode 100644
index 0000000000..94830a374d
--- /dev/null
+++ b/pkg/wing/admission/plugin/machinesetinittime/admission.go
@@ -0,0 +1,63 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machinesetinittime
+
+import (
+ "errors"
+ "fmt"
+ "io"
+
+ "k8s.io/apiserver/pkg/admission"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+)
+
+const PluginName = "MachineSetInitTime"
+
+// Register registers a plugin
+func Register(plugins *admission.Plugins) {
+ plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) {
+ return New()
+ })
+}
+
+type machinesetInitTime struct {
+ *admission.Handler
+}
+
+// Admit ensures that the object in-flight is of kind Flunder.
+// In addition checks that the Name is not on the banned list.
+// The list is stored in Fischers API objects.
+func (d *machinesetInitTime) Admit(a admission.Attributes) error {
+ // we are only interested in machinesetss
+ if a.GetKind().GroupKind() != wing.Kind("MachineSet") {
+ return nil
+ }
+
+ machineset, ok := a.GetObject().(*wing.MachineSet)
+ if !ok {
+ return errors.New("unexpected object type")
+ }
+
+ if machineset.Spec == nil {
+ return errors.New("machineset spec cannot be nil")
+ }
+
+ if machineset.Spec.MinReplicas == nil || machineset.Spec.MaxReplicas == nil {
+ return fmt.Errorf("machineset min or max replicas cannot be nil: min=%v max=%v",
+ machineset.Spec.MinReplicas, machineset.Spec.MaxReplicas)
+ }
+
+ return nil
+}
+
+// Validate checks whether the plugin was correctly initialized.
+func (d *machinesetInitTime) Validate() error {
+ return nil
+}
+
+// New creates a new machines init time admission plugin
+func New() (admission.Interface, error) {
+ return &machinesetInitTime{
+ Handler: admission.NewHandler(admission.Create, admission.Update),
+ }, nil
+}
diff --git a/pkg/wing/admission/winginitializer/interfaces.go b/pkg/wing/admission/winginitializer/interfaces.go
index c2766db0af..6391ec5b58 100644
--- a/pkg/wing/admission/winginitializer/interfaces.go
+++ b/pkg/wing/admission/winginitializer/interfaces.go
@@ -3,7 +3,7 @@
package winginitializer
import (
- informers "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion"
+ informers "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)
diff --git a/pkg/wing/admission/winginitializer/winginitializer.go b/pkg/wing/admission/winginitializer/winginitializer.go
index c432837150..4da088cda0 100644
--- a/pkg/wing/admission/winginitializer/winginitializer.go
+++ b/pkg/wing/admission/winginitializer/winginitializer.go
@@ -3,7 +3,7 @@
package winginitializer
import (
- informers "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion"
+ informers "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)
@@ -13,7 +13,7 @@ type pluginInitializer struct {
var _ admission.PluginInitializer = pluginInitializer{}
-// New creates an instance of wing admission plugins initializer.
+// New creates an machine of wing admission plugins initializer.
func New(informers informers.SharedInformerFactory) (pluginInitializer, error) {
return pluginInitializer{
informers: informers,
diff --git a/pkg/wing/admission/winginitializer/winginitializer_test.go b/pkg/wing/admission/winginitializer/winginitializer_test.go
index 4672028239..5dc5b6d250 100644
--- a/pkg/wing/admission/winginitializer/winginitializer_test.go
+++ b/pkg/wing/admission/winginitializer/winginitializer_test.go
@@ -6,19 +6,19 @@ import (
"time"
"github.com/jetstack/tarmak/pkg/wing/admission/winginitializer"
- "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion/fake"
- informers "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion"
+ "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ informers "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions"
"k8s.io/apiserver/pkg/admission"
)
// TestWantsInternalWingInformerFactory ensures that the informer factory is injected
// when the WantsInternalWingInformerFactory interface is implemented by a plugin.
func TestWantsInternalWingInformerFactory(t *testing.T) {
- cs := &fake.Clientset{}
+ cs := &versioned.Clientset{}
sf := informers.NewSharedInformerFactory(cs, time.Duration(1)*time.Second)
target, err := winginitializer.New(sf)
if err != nil {
- t.Fatalf("expected to create an instance of initializer but got an error = %s", err.Error())
+ t.Fatalf("expected to create an machine of initializer but got an error = %s", err.Error())
}
wantWingInformerFactory := &wantInternalWingInformerFactory{}
target.Initialize(wantWingInformerFactory)
diff --git a/pkg/wing/apiserver/apiserver.go b/pkg/wing/apiserver/apiserver.go
index 17b6754e30..7c3433929e 100644
--- a/pkg/wing/apiserver/apiserver.go
+++ b/pkg/wing/apiserver/apiserver.go
@@ -17,7 +17,9 @@ import (
"github.com/jetstack/tarmak/pkg/apis/wing/install"
"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
wingregistry "github.com/jetstack/tarmak/pkg/wing/registry"
- instancestorage "github.com/jetstack/tarmak/pkg/wing/registry/wing/instance"
+ machinestorage "github.com/jetstack/tarmak/pkg/wing/registry/wing/machine"
+ machinedeploymentstorage "github.com/jetstack/tarmak/pkg/wing/registry/wing/machinedeployment"
+ machinesetstorage "github.com/jetstack/tarmak/pkg/wing/registry/wing/machineset"
)
var (
@@ -77,7 +79,7 @@ func (cfg *Config) Complete() CompletedConfig {
return CompletedConfig{&c}
}
-// New returns a new instance of WingServer from the given config.
+// New returns a new machine of WingServer from the given config.
func (c completedConfig) New() (*WingServer, error) {
genericServer, err := c.GenericConfig.New("wing", genericapiserver.EmptyDelegate)
if err != nil {
@@ -91,7 +93,9 @@ func (c completedConfig) New() (*WingServer, error) {
apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(wing.GroupName, registry, Scheme, metav1.ParameterCodec, Codecs)
apiGroupInfo.GroupMeta.GroupVersion = v1alpha1.SchemeGroupVersion
v1alpha1storage := map[string]rest.Storage{}
- v1alpha1storage["instances"] = wingregistry.RESTInPeace(instancestorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
+ v1alpha1storage["machines"] = wingregistry.RESTInPeace(machinestorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
+ v1alpha1storage["machinesets"] = wingregistry.RESTInPeace(machinesetstorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
+ v1alpha1storage["machinedeployments"] = wingregistry.RESTInPeace(machinedeploymentstorage.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter))
apiGroupInfo.VersionedResourcesStorageMap["v1alpha1"] = v1alpha1storage
if err := s.GenericAPIServer.InstallAPIGroup(&apiGroupInfo); err != nil {
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_instance.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_instance.go
deleted file mode 100644
index 36ead13d3f..0000000000
--- a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_instance.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package fake
-
-import (
- wing "github.com/jetstack/tarmak/pkg/apis/wing"
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- labels "k8s.io/apimachinery/pkg/labels"
- schema "k8s.io/apimachinery/pkg/runtime/schema"
- types "k8s.io/apimachinery/pkg/types"
- watch "k8s.io/apimachinery/pkg/watch"
- testing "k8s.io/client-go/testing"
-)
-
-// FakeInstances implements InstanceInterface
-type FakeInstances struct {
- Fake *FakeWing
- ns string
-}
-
-var instancesResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "", Resource: "instances"}
-
-var instancesKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "", Kind: "Instance"}
-
-// Get takes name of the instance, and returns the corresponding instance object, and an error if there is any.
-func (c *FakeInstances) Get(name string, options v1.GetOptions) (result *wing.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewGetAction(instancesResource, c.ns, name), &wing.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*wing.Instance), err
-}
-
-// List takes label and field selectors, and returns the list of Instances that match those selectors.
-func (c *FakeInstances) List(opts v1.ListOptions) (result *wing.InstanceList, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewListAction(instancesResource, instancesKind, c.ns, opts), &wing.InstanceList{})
-
- if obj == nil {
- return nil, err
- }
-
- label, _, _ := testing.ExtractFromListOptions(opts)
- if label == nil {
- label = labels.Everything()
- }
- list := &wing.InstanceList{}
- for _, item := range obj.(*wing.InstanceList).Items {
- if label.Matches(labels.Set(item.Labels)) {
- list.Items = append(list.Items, item)
- }
- }
- return list, err
-}
-
-// Watch returns a watch.Interface that watches the requested instances.
-func (c *FakeInstances) Watch(opts v1.ListOptions) (watch.Interface, error) {
- return c.Fake.
- InvokesWatch(testing.NewWatchAction(instancesResource, c.ns, opts))
-
-}
-
-// Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *FakeInstances) Create(instance *wing.Instance) (result *wing.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewCreateAction(instancesResource, c.ns, instance), &wing.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*wing.Instance), err
-}
-
-// Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *FakeInstances) Update(instance *wing.Instance) (result *wing.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(instancesResource, c.ns, instance), &wing.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*wing.Instance), err
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeInstances) UpdateStatus(instance *wing.Instance) (*wing.Instance, error) {
- obj, err := c.Fake.
- Invokes(testing.NewUpdateSubresourceAction(instancesResource, "status", c.ns, instance), &wing.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*wing.Instance), err
-}
-
-// Delete takes name of the instance and deletes it. Returns an error if one occurs.
-func (c *FakeInstances) Delete(name string, options *v1.DeleteOptions) error {
- _, err := c.Fake.
- Invokes(testing.NewDeleteAction(instancesResource, c.ns, name), &wing.Instance{})
-
- return err
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *FakeInstances) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(instancesResource, c.ns, listOptions)
-
- _, err := c.Fake.Invokes(action, &wing.InstanceList{})
- return err
-}
-
-// Patch applies the patch and returns the patched instance.
-func (c *FakeInstances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(instancesResource, c.ns, name, data, subresources...), &wing.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*wing.Instance), err
-}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machine.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machine.go
new file mode 100644
index 0000000000..81a29e7396
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machine.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachines implements MachineInterface
+type FakeMachines struct {
+ Fake *FakeWing
+ ns string
+}
+
+var machinesResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "", Resource: "machines"}
+
+var machinesKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "", Kind: "Machine"}
+
+// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any.
+func (c *FakeMachines) Get(name string, options v1.GetOptions) (result *wing.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinesResource, c.ns, name), &wing.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.Machine), err
+}
+
+// List takes label and field selectors, and returns the list of Machines that match those selectors.
+func (c *FakeMachines) List(opts v1.ListOptions) (result *wing.MachineList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &wing.MachineList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &wing.MachineList{}
+ for _, item := range obj.(*wing.MachineList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machines.
+func (c *FakeMachines) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *FakeMachines) Create(machine *wing.Machine) (result *wing.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &wing.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.Machine), err
+}
+
+// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *FakeMachines) Update(machine *wing.Machine) (result *wing.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &wing.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.Machine), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachines) UpdateStatus(machine *wing.Machine) (*wing.Machine, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &wing.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.Machine), err
+}
+
+// Delete takes name of the machine and deletes it. Returns an error if one occurs.
+func (c *FakeMachines) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinesResource, c.ns, name), &wing.Machine{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &wing.MachineList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machine.
+func (c *FakeMachines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, data, subresources...), &wing.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.Machine), err
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machinedeployment.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machinedeployment.go
new file mode 100644
index 0000000000..c969515857
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machinedeployment.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachineDeployments implements MachineDeploymentInterface
+type FakeMachineDeployments struct {
+ Fake *FakeWing
+ ns string
+}
+
+var machinedeploymentsResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "", Resource: "machinedeployments"}
+
+var machinedeploymentsKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "", Kind: "MachineDeployment"}
+
+// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any.
+func (c *FakeMachineDeployments) Get(name string, options v1.GetOptions) (result *wing.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinedeploymentsResource, c.ns, name), &wing.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineDeployment), err
+}
+
+// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors.
+func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *wing.MachineDeploymentList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinedeploymentsResource, machinedeploymentsKind, c.ns, opts), &wing.MachineDeploymentList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &wing.MachineDeploymentList{}
+ for _, item := range obj.(*wing.MachineDeploymentList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machineDeployments.
+func (c *FakeMachineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinedeploymentsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *FakeMachineDeployments) Create(machineDeployment *wing.MachineDeployment) (result *wing.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinedeploymentsResource, c.ns, machineDeployment), &wing.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineDeployment), err
+}
+
+// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *FakeMachineDeployments) Update(machineDeployment *wing.MachineDeployment) (result *wing.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinedeploymentsResource, c.ns, machineDeployment), &wing.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineDeployment), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachineDeployments) UpdateStatus(machineDeployment *wing.MachineDeployment) (*wing.MachineDeployment, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinedeploymentsResource, "status", c.ns, machineDeployment), &wing.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineDeployment), err
+}
+
+// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs.
+func (c *FakeMachineDeployments) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinedeploymentsResource, c.ns, name), &wing.MachineDeployment{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinedeploymentsResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &wing.MachineDeploymentList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machineDeployment.
+func (c *FakeMachineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinedeploymentsResource, c.ns, name, data, subresources...), &wing.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineDeployment), err
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machineset.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machineset.go
new file mode 100644
index 0000000000..cf93ebbd4c
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_machineset.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachineSets implements MachineSetInterface
+type FakeMachineSets struct {
+ Fake *FakeWing
+ ns string
+}
+
+var machinesetsResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "", Resource: "machinesets"}
+
+var machinesetsKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "", Kind: "MachineSet"}
+
+// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any.
+func (c *FakeMachineSets) Get(name string, options v1.GetOptions) (result *wing.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinesetsResource, c.ns, name), &wing.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineSet), err
+}
+
+// List takes label and field selectors, and returns the list of MachineSets that match those selectors.
+func (c *FakeMachineSets) List(opts v1.ListOptions) (result *wing.MachineSetList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinesetsResource, machinesetsKind, c.ns, opts), &wing.MachineSetList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &wing.MachineSetList{}
+ for _, item := range obj.(*wing.MachineSetList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machineSets.
+func (c *FakeMachineSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinesetsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *FakeMachineSets) Create(machineSet *wing.MachineSet) (result *wing.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinesetsResource, c.ns, machineSet), &wing.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineSet), err
+}
+
+// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *FakeMachineSets) Update(machineSet *wing.MachineSet) (result *wing.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinesetsResource, c.ns, machineSet), &wing.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineSet), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachineSets) UpdateStatus(machineSet *wing.MachineSet) (*wing.MachineSet, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinesetsResource, "status", c.ns, machineSet), &wing.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineSet), err
+}
+
+// Delete takes name of the machineSet and deletes it. Returns an error if one occurs.
+func (c *FakeMachineSets) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinesetsResource, c.ns, name), &wing.MachineSet{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinesetsResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &wing.MachineSetList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machineSet.
+func (c *FakeMachineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinesetsResource, c.ns, name, data, subresources...), &wing.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*wing.MachineSet), err
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_wing_client.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_wing_client.go
index 831aa39aca..103879c1e7 100644
--- a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_wing_client.go
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/fake/fake_wing_client.go
@@ -11,8 +11,16 @@ type FakeWing struct {
*testing.Fake
}
-func (c *FakeWing) Instances(namespace string) internalversion.InstanceInterface {
- return &FakeInstances{c, namespace}
+func (c *FakeWing) Machines(namespace string) internalversion.MachineInterface {
+ return &FakeMachines{c, namespace}
+}
+
+func (c *FakeWing) MachineDeployments(namespace string) internalversion.MachineDeploymentInterface {
+ return &FakeMachineDeployments{c, namespace}
+}
+
+func (c *FakeWing) MachineSets(namespace string) internalversion.MachineSetInterface {
+ return &FakeMachineSets{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/generated_expansion.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/generated_expansion.go
index 95e2524747..b0cff6f03a 100644
--- a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/generated_expansion.go
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/generated_expansion.go
@@ -1,4 +1,8 @@
// Copyright Jetstack Ltd. See LICENSE for details.
package internalversion
-type InstanceExpansion interface{}
+type MachineExpansion interface{}
+
+type MachineDeploymentExpansion interface{}
+
+type MachineSetExpansion interface{}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/instance.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/instance.go
deleted file mode 100644
index f089791805..0000000000
--- a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/instance.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package internalversion
-
-import (
- wing "github.com/jetstack/tarmak/pkg/apis/wing"
- scheme "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion/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"
-)
-
-// InstancesGetter has a method to return a InstanceInterface.
-// A group's client should implement this interface.
-type InstancesGetter interface {
- Instances(namespace string) InstanceInterface
-}
-
-// InstanceInterface has methods to work with Instance resources.
-type InstanceInterface interface {
- Create(*wing.Instance) (*wing.Instance, error)
- Update(*wing.Instance) (*wing.Instance, error)
- UpdateStatus(*wing.Instance) (*wing.Instance, error)
- Delete(name string, options *v1.DeleteOptions) error
- DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
- Get(name string, options v1.GetOptions) (*wing.Instance, error)
- List(opts v1.ListOptions) (*wing.InstanceList, error)
- Watch(opts v1.ListOptions) (watch.Interface, error)
- Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Instance, err error)
- InstanceExpansion
-}
-
-// instances implements InstanceInterface
-type instances struct {
- client rest.Interface
- ns string
-}
-
-// newInstances returns a Instances
-func newInstances(c *WingClient, namespace string) *instances {
- return &instances{
- client: c.RESTClient(),
- ns: namespace,
- }
-}
-
-// Get takes name of the instance, and returns the corresponding instance object, and an error if there is any.
-func (c *instances) Get(name string, options v1.GetOptions) (result *wing.Instance, err error) {
- result = &wing.Instance{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do().
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Instances that match those selectors.
-func (c *instances) List(opts v1.ListOptions) (result *wing.InstanceList, err error) {
- result = &wing.InstanceList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&opts, scheme.ParameterCodec).
- Do().
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested instances.
-func (c *instances) Watch(opts v1.ListOptions) (watch.Interface, error) {
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&opts, scheme.ParameterCodec).
- Watch()
-}
-
-// Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *instances) Create(instance *wing.Instance) (result *wing.Instance, err error) {
- result = &wing.Instance{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("instances").
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *instances) Update(instance *wing.Instance) (result *wing.Instance, err error) {
- result = &wing.Instance{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("instances").
- Name(instance.Name).
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-
-func (c *instances) UpdateStatus(instance *wing.Instance) (result *wing.Instance, err error) {
- result = &wing.Instance{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("instances").
- Name(instance.Name).
- SubResource("status").
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// Delete takes name of the instance and deletes it. Returns an error if one occurs.
-func (c *instances) Delete(name string, options *v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("instances").
- Name(name).
- Body(options).
- Do().
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *instances) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&listOptions, scheme.ParameterCodec).
- Body(options).
- Do().
- Error()
-}
-
-// Patch applies the patch and returns the patched instance.
-func (c *instances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Instance, err error) {
- result = &wing.Instance{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("instances").
- SubResource(subresources...).
- Name(name).
- Body(data).
- Do().
- Into(result)
- return
-}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machine.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machine.go
new file mode 100644
index 0000000000..dc83a370bf
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machine.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ scheme "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion/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"
+)
+
+// MachinesGetter has a method to return a MachineInterface.
+// A group's client should implement this interface.
+type MachinesGetter interface {
+ Machines(namespace string) MachineInterface
+}
+
+// MachineInterface has methods to work with Machine resources.
+type MachineInterface interface {
+ Create(*wing.Machine) (*wing.Machine, error)
+ Update(*wing.Machine) (*wing.Machine, error)
+ UpdateStatus(*wing.Machine) (*wing.Machine, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*wing.Machine, error)
+ List(opts v1.ListOptions) (*wing.MachineList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Machine, err error)
+ MachineExpansion
+}
+
+// machines implements MachineInterface
+type machines struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachines returns a Machines
+func newMachines(c *WingClient, namespace string) *machines {
+ return &machines{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any.
+func (c *machines) Get(name string, options v1.GetOptions) (result *wing.Machine, err error) {
+ result = &wing.Machine{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of Machines that match those selectors.
+func (c *machines) List(opts v1.ListOptions) (result *wing.MachineList, err error) {
+ result = &wing.MachineList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machines.
+func (c *machines) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *machines) Create(machine *wing.Machine) (result *wing.Machine, err error) {
+ result = &wing.Machine{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machines").
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *machines) Update(machine *wing.Machine) (result *wing.Machine, err error) {
+ result = &wing.Machine{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(machine.Name).
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machines) UpdateStatus(machine *wing.Machine) (result *wing.Machine, err error) {
+ result = &wing.Machine{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(machine.Name).
+ SubResource("status").
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machine and deletes it. Returns an error if one occurs.
+func (c *machines) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machine.
+func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.Machine, err error) {
+ result = &wing.Machine{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machines").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machinedeployment.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machinedeployment.go
new file mode 100644
index 0000000000..7d4bf2c44c
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machinedeployment.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ scheme "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion/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"
+)
+
+// MachineDeploymentsGetter has a method to return a MachineDeploymentInterface.
+// A group's client should implement this interface.
+type MachineDeploymentsGetter interface {
+ MachineDeployments(namespace string) MachineDeploymentInterface
+}
+
+// MachineDeploymentInterface has methods to work with MachineDeployment resources.
+type MachineDeploymentInterface interface {
+ Create(*wing.MachineDeployment) (*wing.MachineDeployment, error)
+ Update(*wing.MachineDeployment) (*wing.MachineDeployment, error)
+ UpdateStatus(*wing.MachineDeployment) (*wing.MachineDeployment, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*wing.MachineDeployment, error)
+ List(opts v1.ListOptions) (*wing.MachineDeploymentList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineDeployment, err error)
+ MachineDeploymentExpansion
+}
+
+// machineDeployments implements MachineDeploymentInterface
+type machineDeployments struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachineDeployments returns a MachineDeployments
+func newMachineDeployments(c *WingClient, namespace string) *machineDeployments {
+ return &machineDeployments{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any.
+func (c *machineDeployments) Get(name string, options v1.GetOptions) (result *wing.MachineDeployment, err error) {
+ result = &wing.MachineDeployment{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors.
+func (c *machineDeployments) List(opts v1.ListOptions) (result *wing.MachineDeploymentList, err error) {
+ result = &wing.MachineDeploymentList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machineDeployments.
+func (c *machineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *machineDeployments) Create(machineDeployment *wing.MachineDeployment) (result *wing.MachineDeployment, err error) {
+ result = &wing.MachineDeployment{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *machineDeployments) Update(machineDeployment *wing.MachineDeployment) (result *wing.MachineDeployment, err error) {
+ result = &wing.MachineDeployment{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(machineDeployment.Name).
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machineDeployments) UpdateStatus(machineDeployment *wing.MachineDeployment) (result *wing.MachineDeployment, err error) {
+ result = &wing.MachineDeployment{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(machineDeployment.Name).
+ SubResource("status").
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs.
+func (c *machineDeployments) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machineDeployment.
+func (c *machineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineDeployment, err error) {
+ result = &wing.MachineDeployment{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machineset.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machineset.go
new file mode 100644
index 0000000000..f014a04e52
--- /dev/null
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/machineset.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ scheme "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion/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"
+)
+
+// MachineSetsGetter has a method to return a MachineSetInterface.
+// A group's client should implement this interface.
+type MachineSetsGetter interface {
+ MachineSets(namespace string) MachineSetInterface
+}
+
+// MachineSetInterface has methods to work with MachineSet resources.
+type MachineSetInterface interface {
+ Create(*wing.MachineSet) (*wing.MachineSet, error)
+ Update(*wing.MachineSet) (*wing.MachineSet, error)
+ UpdateStatus(*wing.MachineSet) (*wing.MachineSet, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*wing.MachineSet, error)
+ List(opts v1.ListOptions) (*wing.MachineSetList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineSet, err error)
+ MachineSetExpansion
+}
+
+// machineSets implements MachineSetInterface
+type machineSets struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachineSets returns a MachineSets
+func newMachineSets(c *WingClient, namespace string) *machineSets {
+ return &machineSets{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any.
+func (c *machineSets) Get(name string, options v1.GetOptions) (result *wing.MachineSet, err error) {
+ result = &wing.MachineSet{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of MachineSets that match those selectors.
+func (c *machineSets) List(opts v1.ListOptions) (result *wing.MachineSetList, err error) {
+ result = &wing.MachineSetList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machineSets.
+func (c *machineSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *machineSets) Create(machineSet *wing.MachineSet) (result *wing.MachineSet, err error) {
+ result = &wing.MachineSet{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *machineSets) Update(machineSet *wing.MachineSet) (result *wing.MachineSet, err error) {
+ result = &wing.MachineSet{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(machineSet.Name).
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machineSets) UpdateStatus(machineSet *wing.MachineSet) (result *wing.MachineSet, err error) {
+ result = &wing.MachineSet{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(machineSet.Name).
+ SubResource("status").
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machineSet and deletes it. Returns an error if one occurs.
+func (c *machineSets) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machineSet.
+func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *wing.MachineSet, err error) {
+ result = &wing.MachineSet{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machinesets").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/wing_client.go b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/wing_client.go
index abd7834ce4..00e7093577 100644
--- a/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/wing_client.go
+++ b/pkg/wing/client/clientset/internalversion/typed/wing/internalversion/wing_client.go
@@ -8,7 +8,9 @@ import (
type WingInterface interface {
RESTClient() rest.Interface
- InstancesGetter
+ MachinesGetter
+ MachineDeploymentsGetter
+ MachineSetsGetter
}
// WingClient is used to interact with features provided by the wing.tarmak.io group.
@@ -16,8 +18,16 @@ type WingClient struct {
restClient rest.Interface
}
-func (c *WingClient) Instances(namespace string) InstanceInterface {
- return newInstances(c, namespace)
+func (c *WingClient) Machines(namespace string) MachineInterface {
+ return newMachines(c, namespace)
+}
+
+func (c *WingClient) MachineDeployments(namespace string) MachineDeploymentInterface {
+ return newMachineDeployments(c, namespace)
+}
+
+func (c *WingClient) MachineSets(namespace string) MachineSetInterface {
+ return newMachineSets(c, namespace)
}
// NewForConfig creates a new WingClient for the given config.
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_instance.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_instance.go
deleted file mode 100644
index 67bd5c5f0d..0000000000
--- a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_instance.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package fake
-
-import (
- v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- labels "k8s.io/apimachinery/pkg/labels"
- schema "k8s.io/apimachinery/pkg/runtime/schema"
- types "k8s.io/apimachinery/pkg/types"
- watch "k8s.io/apimachinery/pkg/watch"
- testing "k8s.io/client-go/testing"
-)
-
-// FakeInstances implements InstanceInterface
-type FakeInstances struct {
- Fake *FakeWingV1alpha1
- ns string
-}
-
-var instancesResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "v1alpha1", Resource: "instances"}
-
-var instancesKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "v1alpha1", Kind: "Instance"}
-
-// Get takes name of the instance, and returns the corresponding instance object, and an error if there is any.
-func (c *FakeInstances) Get(name string, options v1.GetOptions) (result *v1alpha1.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewGetAction(instancesResource, c.ns, name), &v1alpha1.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*v1alpha1.Instance), err
-}
-
-// List takes label and field selectors, and returns the list of Instances that match those selectors.
-func (c *FakeInstances) List(opts v1.ListOptions) (result *v1alpha1.InstanceList, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewListAction(instancesResource, instancesKind, c.ns, opts), &v1alpha1.InstanceList{})
-
- if obj == nil {
- return nil, err
- }
-
- label, _, _ := testing.ExtractFromListOptions(opts)
- if label == nil {
- label = labels.Everything()
- }
- list := &v1alpha1.InstanceList{}
- for _, item := range obj.(*v1alpha1.InstanceList).Items {
- if label.Matches(labels.Set(item.Labels)) {
- list.Items = append(list.Items, item)
- }
- }
- return list, err
-}
-
-// Watch returns a watch.Interface that watches the requested instances.
-func (c *FakeInstances) Watch(opts v1.ListOptions) (watch.Interface, error) {
- return c.Fake.
- InvokesWatch(testing.NewWatchAction(instancesResource, c.ns, opts))
-
-}
-
-// Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *FakeInstances) Create(instance *v1alpha1.Instance) (result *v1alpha1.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewCreateAction(instancesResource, c.ns, instance), &v1alpha1.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*v1alpha1.Instance), err
-}
-
-// Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *FakeInstances) Update(instance *v1alpha1.Instance) (result *v1alpha1.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewUpdateAction(instancesResource, c.ns, instance), &v1alpha1.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*v1alpha1.Instance), err
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-func (c *FakeInstances) UpdateStatus(instance *v1alpha1.Instance) (*v1alpha1.Instance, error) {
- obj, err := c.Fake.
- Invokes(testing.NewUpdateSubresourceAction(instancesResource, "status", c.ns, instance), &v1alpha1.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*v1alpha1.Instance), err
-}
-
-// Delete takes name of the instance and deletes it. Returns an error if one occurs.
-func (c *FakeInstances) Delete(name string, options *v1.DeleteOptions) error {
- _, err := c.Fake.
- Invokes(testing.NewDeleteAction(instancesResource, c.ns, name), &v1alpha1.Instance{})
-
- return err
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *FakeInstances) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
- action := testing.NewDeleteCollectionAction(instancesResource, c.ns, listOptions)
-
- _, err := c.Fake.Invokes(action, &v1alpha1.InstanceList{})
- return err
-}
-
-// Patch applies the patch and returns the patched instance.
-func (c *FakeInstances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Instance, err error) {
- obj, err := c.Fake.
- Invokes(testing.NewPatchSubresourceAction(instancesResource, c.ns, name, data, subresources...), &v1alpha1.Instance{})
-
- if obj == nil {
- return nil, err
- }
- return obj.(*v1alpha1.Instance), err
-}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machine.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machine.go
new file mode 100644
index 0000000000..8fcdc10a40
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machine.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachines implements MachineInterface
+type FakeMachines struct {
+ Fake *FakeWingV1alpha1
+ ns string
+}
+
+var machinesResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "v1alpha1", Resource: "machines"}
+
+var machinesKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "v1alpha1", Kind: "Machine"}
+
+// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any.
+func (c *FakeMachines) Get(name string, options v1.GetOptions) (result *v1alpha1.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha1.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.Machine), err
+}
+
+// List takes label and field selectors, and returns the list of Machines that match those selectors.
+func (c *FakeMachines) List(opts v1.ListOptions) (result *v1alpha1.MachineList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha1.MachineList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1alpha1.MachineList{}
+ for _, item := range obj.(*v1alpha1.MachineList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machines.
+func (c *FakeMachines) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *FakeMachines) Create(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.Machine), err
+}
+
+// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *FakeMachines) Update(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.Machine), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachines) UpdateStatus(machine *v1alpha1.Machine) (*v1alpha1.Machine, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha1.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.Machine), err
+}
+
+// Delete takes name of the machine and deletes it. Returns an error if one occurs.
+func (c *FakeMachines) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinesResource, c.ns, name), &v1alpha1.Machine{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v1alpha1.MachineList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machine.
+func (c *FakeMachines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, data, subresources...), &v1alpha1.Machine{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.Machine), err
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machinedeployment.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machinedeployment.go
new file mode 100644
index 0000000000..d48ff60dc3
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machinedeployment.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachineDeployments implements MachineDeploymentInterface
+type FakeMachineDeployments struct {
+ Fake *FakeWingV1alpha1
+ ns string
+}
+
+var machinedeploymentsResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "v1alpha1", Resource: "machinedeployments"}
+
+var machinedeploymentsKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "v1alpha1", Kind: "MachineDeployment"}
+
+// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any.
+func (c *FakeMachineDeployments) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinedeploymentsResource, c.ns, name), &v1alpha1.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineDeployment), err
+}
+
+// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors.
+func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *v1alpha1.MachineDeploymentList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinedeploymentsResource, machinedeploymentsKind, c.ns, opts), &v1alpha1.MachineDeploymentList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1alpha1.MachineDeploymentList{}
+ for _, item := range obj.(*v1alpha1.MachineDeploymentList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machineDeployments.
+func (c *FakeMachineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinedeploymentsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *FakeMachineDeployments) Create(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha1.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineDeployment), err
+}
+
+// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *FakeMachineDeployments) Update(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha1.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineDeployment), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachineDeployments) UpdateStatus(machineDeployment *v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinedeploymentsResource, "status", c.ns, machineDeployment), &v1alpha1.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineDeployment), err
+}
+
+// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs.
+func (c *FakeMachineDeployments) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinedeploymentsResource, c.ns, name), &v1alpha1.MachineDeployment{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinedeploymentsResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v1alpha1.MachineDeploymentList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machineDeployment.
+func (c *FakeMachineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinedeploymentsResource, c.ns, name, data, subresources...), &v1alpha1.MachineDeployment{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineDeployment), err
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machineset.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machineset.go
new file mode 100644
index 0000000000..4f11c21bc4
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_machineset.go
@@ -0,0 +1,123 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package fake
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakeMachineSets implements MachineSetInterface
+type FakeMachineSets struct {
+ Fake *FakeWingV1alpha1
+ ns string
+}
+
+var machinesetsResource = schema.GroupVersionResource{Group: "wing.tarmak.io", Version: "v1alpha1", Resource: "machinesets"}
+
+var machinesetsKind = schema.GroupVersionKind{Group: "wing.tarmak.io", Version: "v1alpha1", Kind: "MachineSet"}
+
+// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any.
+func (c *FakeMachineSets) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(machinesetsResource, c.ns, name), &v1alpha1.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineSet), err
+}
+
+// List takes label and field selectors, and returns the list of MachineSets that match those selectors.
+func (c *FakeMachineSets) List(opts v1.ListOptions) (result *v1alpha1.MachineSetList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(machinesetsResource, machinesetsKind, c.ns, opts), &v1alpha1.MachineSetList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1alpha1.MachineSetList{}
+ for _, item := range obj.(*v1alpha1.MachineSetList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested machineSets.
+func (c *FakeMachineSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(machinesetsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *FakeMachineSets) Create(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(machinesetsResource, c.ns, machineSet), &v1alpha1.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineSet), err
+}
+
+// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *FakeMachineSets) Update(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(machinesetsResource, c.ns, machineSet), &v1alpha1.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineSet), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeMachineSets) UpdateStatus(machineSet *v1alpha1.MachineSet) (*v1alpha1.MachineSet, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(machinesetsResource, "status", c.ns, machineSet), &v1alpha1.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineSet), err
+}
+
+// Delete takes name of the machineSet and deletes it. Returns an error if one occurs.
+func (c *FakeMachineSets) Delete(name string, options *v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(machinesetsResource, c.ns, name), &v1alpha1.MachineSet{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeMachineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(machinesetsResource, c.ns, listOptions)
+
+ _, err := c.Fake.Invokes(action, &v1alpha1.MachineSetList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched machineSet.
+func (c *FakeMachineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(machinesetsResource, c.ns, name, data, subresources...), &v1alpha1.MachineSet{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.MachineSet), err
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_wing_client.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_wing_client.go
index 7785d8908b..fbb5605244 100644
--- a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_wing_client.go
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/fake/fake_wing_client.go
@@ -11,8 +11,16 @@ type FakeWingV1alpha1 struct {
*testing.Fake
}
-func (c *FakeWingV1alpha1) Instances(namespace string) v1alpha1.InstanceInterface {
- return &FakeInstances{c, namespace}
+func (c *FakeWingV1alpha1) Machines(namespace string) v1alpha1.MachineInterface {
+ return &FakeMachines{c, namespace}
+}
+
+func (c *FakeWingV1alpha1) MachineDeployments(namespace string) v1alpha1.MachineDeploymentInterface {
+ return &FakeMachineDeployments{c, namespace}
+}
+
+func (c *FakeWingV1alpha1) MachineSets(namespace string) v1alpha1.MachineSetInterface {
+ return &FakeMachineSets{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/generated_expansion.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/generated_expansion.go
index 74e0c14501..afcc92ee13 100644
--- a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/generated_expansion.go
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/generated_expansion.go
@@ -1,4 +1,8 @@
// Copyright Jetstack Ltd. See LICENSE for details.
package v1alpha1
-type InstanceExpansion interface{}
+type MachineExpansion interface{}
+
+type MachineDeploymentExpansion interface{}
+
+type MachineSetExpansion interface{}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/instance.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/instance.go
deleted file mode 100644
index f92b4aab00..0000000000
--- a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/instance.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package v1alpha1
-
-import (
- v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
- scheme "github.com/jetstack/tarmak/pkg/wing/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"
-)
-
-// InstancesGetter has a method to return a InstanceInterface.
-// A group's client should implement this interface.
-type InstancesGetter interface {
- Instances(namespace string) InstanceInterface
-}
-
-// InstanceInterface has methods to work with Instance resources.
-type InstanceInterface interface {
- Create(*v1alpha1.Instance) (*v1alpha1.Instance, error)
- Update(*v1alpha1.Instance) (*v1alpha1.Instance, error)
- UpdateStatus(*v1alpha1.Instance) (*v1alpha1.Instance, error)
- Delete(name string, options *v1.DeleteOptions) error
- DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
- Get(name string, options v1.GetOptions) (*v1alpha1.Instance, error)
- List(opts v1.ListOptions) (*v1alpha1.InstanceList, error)
- Watch(opts v1.ListOptions) (watch.Interface, error)
- Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Instance, err error)
- InstanceExpansion
-}
-
-// instances implements InstanceInterface
-type instances struct {
- client rest.Interface
- ns string
-}
-
-// newInstances returns a Instances
-func newInstances(c *WingV1alpha1Client, namespace string) *instances {
- return &instances{
- client: c.RESTClient(),
- ns: namespace,
- }
-}
-
-// Get takes name of the instance, and returns the corresponding instance object, and an error if there is any.
-func (c *instances) Get(name string, options v1.GetOptions) (result *v1alpha1.Instance, err error) {
- result = &v1alpha1.Instance{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- Name(name).
- VersionedParams(&options, scheme.ParameterCodec).
- Do().
- Into(result)
- return
-}
-
-// List takes label and field selectors, and returns the list of Instances that match those selectors.
-func (c *instances) List(opts v1.ListOptions) (result *v1alpha1.InstanceList, err error) {
- result = &v1alpha1.InstanceList{}
- err = c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&opts, scheme.ParameterCodec).
- Do().
- Into(result)
- return
-}
-
-// Watch returns a watch.Interface that watches the requested instances.
-func (c *instances) Watch(opts v1.ListOptions) (watch.Interface, error) {
- opts.Watch = true
- return c.client.Get().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&opts, scheme.ParameterCodec).
- Watch()
-}
-
-// Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *instances) Create(instance *v1alpha1.Instance) (result *v1alpha1.Instance, err error) {
- result = &v1alpha1.Instance{}
- err = c.client.Post().
- Namespace(c.ns).
- Resource("instances").
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any.
-func (c *instances) Update(instance *v1alpha1.Instance) (result *v1alpha1.Instance, err error) {
- result = &v1alpha1.Instance{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("instances").
- Name(instance.Name).
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// UpdateStatus was generated because the type contains a Status member.
-// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
-
-func (c *instances) UpdateStatus(instance *v1alpha1.Instance) (result *v1alpha1.Instance, err error) {
- result = &v1alpha1.Instance{}
- err = c.client.Put().
- Namespace(c.ns).
- Resource("instances").
- Name(instance.Name).
- SubResource("status").
- Body(instance).
- Do().
- Into(result)
- return
-}
-
-// Delete takes name of the instance and deletes it. Returns an error if one occurs.
-func (c *instances) Delete(name string, options *v1.DeleteOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("instances").
- Name(name).
- Body(options).
- Do().
- Error()
-}
-
-// DeleteCollection deletes a collection of objects.
-func (c *instances) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
- return c.client.Delete().
- Namespace(c.ns).
- Resource("instances").
- VersionedParams(&listOptions, scheme.ParameterCodec).
- Body(options).
- Do().
- Error()
-}
-
-// Patch applies the patch and returns the patched instance.
-func (c *instances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Instance, err error) {
- result = &v1alpha1.Instance{}
- err = c.client.Patch(pt).
- Namespace(c.ns).
- Resource("instances").
- SubResource(subresources...).
- Name(name).
- Body(data).
- Do().
- Into(result)
- return
-}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machine.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machine.go
new file mode 100644
index 0000000000..a9aa05431f
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machine.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ scheme "github.com/jetstack/tarmak/pkg/wing/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"
+)
+
+// MachinesGetter has a method to return a MachineInterface.
+// A group's client should implement this interface.
+type MachinesGetter interface {
+ Machines(namespace string) MachineInterface
+}
+
+// MachineInterface has methods to work with Machine resources.
+type MachineInterface interface {
+ Create(*v1alpha1.Machine) (*v1alpha1.Machine, error)
+ Update(*v1alpha1.Machine) (*v1alpha1.Machine, error)
+ UpdateStatus(*v1alpha1.Machine) (*v1alpha1.Machine, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*v1alpha1.Machine, error)
+ List(opts v1.ListOptions) (*v1alpha1.MachineList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error)
+ MachineExpansion
+}
+
+// machines implements MachineInterface
+type machines struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachines returns a Machines
+func newMachines(c *WingV1alpha1Client, namespace string) *machines {
+ return &machines{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any.
+func (c *machines) Get(name string, options v1.GetOptions) (result *v1alpha1.Machine, err error) {
+ result = &v1alpha1.Machine{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of Machines that match those selectors.
+func (c *machines) List(opts v1.ListOptions) (result *v1alpha1.MachineList, err error) {
+ result = &v1alpha1.MachineList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machines.
+func (c *machines) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *machines) Create(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) {
+ result = &v1alpha1.Machine{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machines").
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any.
+func (c *machines) Update(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) {
+ result = &v1alpha1.Machine{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(machine.Name).
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machines) UpdateStatus(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) {
+ result = &v1alpha1.Machine{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(machine.Name).
+ SubResource("status").
+ Body(machine).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machine and deletes it. Returns an error if one occurs.
+func (c *machines) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machines").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machines").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machine.
+func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error) {
+ result = &v1alpha1.Machine{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machines").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machinedeployment.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machinedeployment.go
new file mode 100644
index 0000000000..c659b2460c
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machinedeployment.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ scheme "github.com/jetstack/tarmak/pkg/wing/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"
+)
+
+// MachineDeploymentsGetter has a method to return a MachineDeploymentInterface.
+// A group's client should implement this interface.
+type MachineDeploymentsGetter interface {
+ MachineDeployments(namespace string) MachineDeploymentInterface
+}
+
+// MachineDeploymentInterface has methods to work with MachineDeployment resources.
+type MachineDeploymentInterface interface {
+ Create(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error)
+ Update(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error)
+ UpdateStatus(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*v1alpha1.MachineDeployment, error)
+ List(opts v1.ListOptions) (*v1alpha1.MachineDeploymentList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error)
+ MachineDeploymentExpansion
+}
+
+// machineDeployments implements MachineDeploymentInterface
+type machineDeployments struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachineDeployments returns a MachineDeployments
+func newMachineDeployments(c *WingV1alpha1Client, namespace string) *machineDeployments {
+ return &machineDeployments{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any.
+func (c *machineDeployments) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineDeployment, err error) {
+ result = &v1alpha1.MachineDeployment{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors.
+func (c *machineDeployments) List(opts v1.ListOptions) (result *v1alpha1.MachineDeploymentList, err error) {
+ result = &v1alpha1.MachineDeploymentList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machineDeployments.
+func (c *machineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *machineDeployments) Create(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) {
+ result = &v1alpha1.MachineDeployment{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any.
+func (c *machineDeployments) Update(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) {
+ result = &v1alpha1.MachineDeployment{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(machineDeployment.Name).
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machineDeployments) UpdateStatus(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) {
+ result = &v1alpha1.MachineDeployment{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(machineDeployment.Name).
+ SubResource("status").
+ Body(machineDeployment).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs.
+func (c *machineDeployments) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machineDeployment.
+func (c *machineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error) {
+ result = &v1alpha1.MachineDeployment{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machinedeployments").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machineset.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machineset.go
new file mode 100644
index 0000000000..9b86627633
--- /dev/null
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/machineset.go
@@ -0,0 +1,157 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ scheme "github.com/jetstack/tarmak/pkg/wing/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"
+)
+
+// MachineSetsGetter has a method to return a MachineSetInterface.
+// A group's client should implement this interface.
+type MachineSetsGetter interface {
+ MachineSets(namespace string) MachineSetInterface
+}
+
+// MachineSetInterface has methods to work with MachineSet resources.
+type MachineSetInterface interface {
+ Create(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error)
+ Update(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error)
+ UpdateStatus(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error)
+ Delete(name string, options *v1.DeleteOptions) error
+ DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
+ Get(name string, options v1.GetOptions) (*v1alpha1.MachineSet, error)
+ List(opts v1.ListOptions) (*v1alpha1.MachineSetList, error)
+ Watch(opts v1.ListOptions) (watch.Interface, error)
+ Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error)
+ MachineSetExpansion
+}
+
+// machineSets implements MachineSetInterface
+type machineSets struct {
+ client rest.Interface
+ ns string
+}
+
+// newMachineSets returns a MachineSets
+func newMachineSets(c *WingV1alpha1Client, namespace string) *machineSets {
+ return &machineSets{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any.
+func (c *machineSets) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineSet, err error) {
+ result = &v1alpha1.MachineSet{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of MachineSets that match those selectors.
+func (c *machineSets) List(opts v1.ListOptions) (result *v1alpha1.MachineSetList, err error) {
+ result = &v1alpha1.MachineSetList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Do().
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested machineSets.
+func (c *machineSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Watch()
+}
+
+// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *machineSets) Create(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) {
+ result = &v1alpha1.MachineSet{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any.
+func (c *machineSets) Update(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) {
+ result = &v1alpha1.MachineSet{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(machineSet.Name).
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+
+func (c *machineSets) UpdateStatus(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) {
+ result = &v1alpha1.MachineSet{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(machineSet.Name).
+ SubResource("status").
+ Body(machineSet).
+ Do().
+ Into(result)
+ return
+}
+
+// Delete takes name of the machineSet and deletes it. Returns an error if one occurs.
+func (c *machineSets) Delete(name string, options *v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinesets").
+ Name(name).
+ Body(options).
+ Do().
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *machineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("machinesets").
+ VersionedParams(&listOptions, scheme.ParameterCodec).
+ Body(options).
+ Do().
+ Error()
+}
+
+// Patch applies the patch and returns the patched machineSet.
+func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error) {
+ result = &v1alpha1.MachineSet{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("machinesets").
+ SubResource(subresources...).
+ Name(name).
+ Body(data).
+ Do().
+ Into(result)
+ return
+}
diff --git a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/wing_client.go b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/wing_client.go
index 6debfb84db..f713067f54 100644
--- a/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/wing_client.go
+++ b/pkg/wing/client/clientset/versioned/typed/wing/v1alpha1/wing_client.go
@@ -10,7 +10,9 @@ import (
type WingV1alpha1Interface interface {
RESTClient() rest.Interface
- InstancesGetter
+ MachinesGetter
+ MachineDeploymentsGetter
+ MachineSetsGetter
}
// WingV1alpha1Client is used to interact with features provided by the wing.tarmak.io group.
@@ -18,8 +20,16 @@ type WingV1alpha1Client struct {
restClient rest.Interface
}
-func (c *WingV1alpha1Client) Instances(namespace string) InstanceInterface {
- return newInstances(c, namespace)
+func (c *WingV1alpha1Client) Machines(namespace string) MachineInterface {
+ return newMachines(c, namespace)
+}
+
+func (c *WingV1alpha1Client) MachineDeployments(namespace string) MachineDeploymentInterface {
+ return newMachineDeployments(c, namespace)
+}
+
+func (c *WingV1alpha1Client) MachineSets(namespace string) MachineSetInterface {
+ return newMachineSets(c, namespace)
}
// NewForConfig creates a new WingV1alpha1Client for the given config.
diff --git a/pkg/wing/client/informers/externalversions/apis/interface.go b/pkg/wing/client/informers/externalversions/apis/interface.go
new file mode 100644
index 0000000000..bae0632a80
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/apis/interface.go
@@ -0,0 +1,32 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package wing
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/apis/wing"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to each of this group's versions.
+type Interface interface {
+ // Wing provides access to shared informers for resources in Wing.
+ Wing() wing.Interface
+}
+
+type group struct {
+ factory internalinterfaces.SharedInformerFactory
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
+ return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
+}
+
+// Wing returns a new wing.Interface.
+func (g *group) Wing() wing.Interface {
+ return wing.New(g.factory, g.namespace, g.tweakListOptions)
+}
diff --git a/pkg/wing/client/informers/externalversions/apis/wing/interface.go b/pkg/wing/client/informers/externalversions/apis/wing/interface.go
new file mode 100644
index 0000000000..3af0ab9d4e
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/apis/wing/interface.go
@@ -0,0 +1,45 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package wing
+
+import (
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // Machines returns a MachineInformer.
+ Machines() MachineInformer
+ // MachineDeployments returns a MachineDeploymentInformer.
+ MachineDeployments() MachineDeploymentInformer
+ // MachineSets returns a MachineSetInformer.
+ MachineSets() MachineSetInformer
+}
+
+type version struct {
+ factory internalinterfaces.SharedInformerFactory
+ namespace string
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+}
+
+// New returns a new Interface.
+func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
+ return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
+}
+
+// Machines returns a MachineInformer.
+func (v *version) Machines() MachineInformer {
+ return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineDeployments returns a MachineDeploymentInformer.
+func (v *version) MachineDeployments() MachineDeploymentInformer {
+ return &machineDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineSets returns a MachineSetInformer.
+func (v *version) MachineSets() MachineSetInformer {
+ return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
diff --git a/pkg/wing/client/informers/externalversions/apis/wing/machine.go b/pkg/wing/client/informers/externalversions/apis/wing/machine.go
new file mode 100644
index 0000000000..96b74ab5c9
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/apis/wing/machine.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package wing
+
+import (
+ apis_wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ versioned "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+ wing "github.com/jetstack/tarmak/pkg/wing/client/listers/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineInformer provides access to a shared informer and lister for
+// Machines.
+type MachineInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() wing.MachineLister
+}
+
+type machineInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineInformer constructs a new informer for Machine type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineInformer constructs a new informer for Machine type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().Machines(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().Machines(namespace).Watch(options)
+ },
+ },
+ &apis_wing.Machine{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&apis_wing.Machine{}, f.defaultInformer)
+}
+
+func (f *machineInformer) Lister() wing.MachineLister {
+ return wing.NewMachineLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/externalversions/apis/wing/machinedeployment.go b/pkg/wing/client/informers/externalversions/apis/wing/machinedeployment.go
new file mode 100644
index 0000000000..6539d92d21
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/apis/wing/machinedeployment.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package wing
+
+import (
+ apis_wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ versioned "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+ wing "github.com/jetstack/tarmak/pkg/wing/client/listers/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineDeploymentInformer provides access to a shared informer and lister for
+// MachineDeployments.
+type MachineDeploymentInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() wing.MachineDeploymentLister
+}
+
+type machineDeploymentInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineDeployments(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineDeployments(namespace).Watch(options)
+ },
+ },
+ &apis_wing.MachineDeployment{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineDeploymentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&apis_wing.MachineDeployment{}, f.defaultInformer)
+}
+
+func (f *machineDeploymentInformer) Lister() wing.MachineDeploymentLister {
+ return wing.NewMachineDeploymentLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/externalversions/apis/wing/machineset.go b/pkg/wing/client/informers/externalversions/apis/wing/machineset.go
new file mode 100644
index 0000000000..68bd38a838
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/apis/wing/machineset.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package wing
+
+import (
+ apis_wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ versioned "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+ wing "github.com/jetstack/tarmak/pkg/wing/client/listers/apis/wing"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineSetInformer provides access to a shared informer and lister for
+// MachineSets.
+type MachineSetInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() wing.MachineSetLister
+}
+
+type machineSetInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineSetInformer constructs a new informer for MachineSet type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineSetInformer constructs a new informer for MachineSet type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineSets(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineSets(namespace).Watch(options)
+ },
+ },
+ &apis_wing.MachineSet{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineSetInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&apis_wing.MachineSet{}, f.defaultInformer)
+}
+
+func (f *machineSetInformer) Lister() wing.MachineSetLister {
+ return wing.NewMachineSetLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/externalversions/generic.go b/pkg/wing/client/informers/externalversions/generic.go
index 42d5bf9f58..d8127fd480 100644
--- a/pkg/wing/client/informers/externalversions/generic.go
+++ b/pkg/wing/client/informers/externalversions/generic.go
@@ -38,8 +38,12 @@ func (f *genericInformer) Lister() cache.GenericLister {
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=wing.tarmak.io, Version=v1alpha1
- case v1alpha1.SchemeGroupVersion.WithResource("instances"):
- return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().V1alpha1().Instances().Informer()}, nil
+ case v1alpha1.SchemeGroupVersion.WithResource("machines"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().V1alpha1().Machines().Informer()}, nil
+ case v1alpha1.SchemeGroupVersion.WithResource("machinedeployments"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().V1alpha1().MachineDeployments().Informer()}, nil
+ case v1alpha1.SchemeGroupVersion.WithResource("machinesets"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().V1alpha1().MachineSets().Informer()}, nil
}
diff --git a/pkg/wing/client/informers/externalversions/wing/v1alpha1/interface.go b/pkg/wing/client/informers/externalversions/wing/v1alpha1/interface.go
index 818004ff7e..f4914be766 100644
--- a/pkg/wing/client/informers/externalversions/wing/v1alpha1/interface.go
+++ b/pkg/wing/client/informers/externalversions/wing/v1alpha1/interface.go
@@ -10,8 +10,12 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
- // Instances returns a InstanceInformer.
- Instances() InstanceInformer
+ // Machines returns a MachineInformer.
+ Machines() MachineInformer
+ // MachineDeployments returns a MachineDeploymentInformer.
+ MachineDeployments() MachineDeploymentInformer
+ // MachineSets returns a MachineSetInformer.
+ MachineSets() MachineSetInformer
}
type version struct {
@@ -25,7 +29,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
-// Instances returns a InstanceInformer.
-func (v *version) Instances() InstanceInformer {
- return &instanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+// Machines returns a MachineInformer.
+func (v *version) Machines() MachineInformer {
+ return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineDeployments returns a MachineDeploymentInformer.
+func (v *version) MachineDeployments() MachineDeploymentInformer {
+ return &machineDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineSets returns a MachineSetInformer.
+func (v *version) MachineSets() MachineSetInformer {
+ return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
diff --git a/pkg/wing/client/informers/externalversions/wing/v1alpha1/machine.go b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machine.go
new file mode 100644
index 0000000000..756d5ce9e6
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machine.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package v1alpha1
+
+import (
+ wing_v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ versioned "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+ v1alpha1 "github.com/jetstack/tarmak/pkg/wing/client/listers/wing/v1alpha1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineInformer provides access to a shared informer and lister for
+// Machines.
+type MachineInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1alpha1.MachineLister
+}
+
+type machineInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineInformer constructs a new informer for Machine type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineInformer constructs a new informer for Machine type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.WingV1alpha1().Machines(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.WingV1alpha1().Machines(namespace).Watch(options)
+ },
+ },
+ &wing_v1alpha1.Machine{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing_v1alpha1.Machine{}, f.defaultInformer)
+}
+
+func (f *machineInformer) Lister() v1alpha1.MachineLister {
+ return v1alpha1.NewMachineLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/externalversions/wing/v1alpha1/machinedeployment.go b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machinedeployment.go
new file mode 100644
index 0000000000..abd9881207
--- /dev/null
+++ b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machinedeployment.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package v1alpha1
+
+import (
+ wing_v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ versioned "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions/internalinterfaces"
+ v1alpha1 "github.com/jetstack/tarmak/pkg/wing/client/listers/wing/v1alpha1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineDeploymentInformer provides access to a shared informer and lister for
+// MachineDeployments.
+type MachineDeploymentInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1alpha1.MachineDeploymentLister
+}
+
+type machineDeploymentInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.WingV1alpha1().MachineDeployments(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.WingV1alpha1().MachineDeployments(namespace).Watch(options)
+ },
+ },
+ &wing_v1alpha1.MachineDeployment{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineDeploymentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing_v1alpha1.MachineDeployment{}, f.defaultInformer)
+}
+
+func (f *machineDeploymentInformer) Lister() v1alpha1.MachineDeploymentLister {
+ return v1alpha1.NewMachineDeploymentLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/externalversions/wing/v1alpha1/instance.go b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machineset.go
similarity index 51%
rename from pkg/wing/client/informers/externalversions/wing/v1alpha1/instance.go
rename to pkg/wing/client/informers/externalversions/wing/v1alpha1/machineset.go
index 665411072b..a35656cf25 100644
--- a/pkg/wing/client/informers/externalversions/wing/v1alpha1/instance.go
+++ b/pkg/wing/client/informers/externalversions/wing/v1alpha1/machineset.go
@@ -16,59 +16,59 @@ import (
time "time"
)
-// InstanceInformer provides access to a shared informer and lister for
-// Instances.
-type InstanceInformer interface {
+// MachineSetInformer provides access to a shared informer and lister for
+// MachineSets.
+type MachineSetInformer interface {
Informer() cache.SharedIndexInformer
- Lister() v1alpha1.InstanceLister
+ Lister() v1alpha1.MachineSetLister
}
-type instanceInformer struct {
+type machineSetInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
-// NewInstanceInformer constructs a new informer for Instance type.
+// NewMachineSetInformer constructs a new informer for MachineSet type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
-func NewInstanceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
- return NewFilteredInstanceInformer(client, namespace, resyncPeriod, indexers, nil)
+func NewMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil)
}
-// NewFilteredInstanceInformer constructs a new informer for Instance type.
+// NewFilteredMachineSetInformer constructs a new informer for MachineSet type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
-func NewFilteredInstanceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+func NewFilteredMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.WingV1alpha1().Instances(namespace).List(options)
+ return client.WingV1alpha1().MachineSets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.WingV1alpha1().Instances(namespace).Watch(options)
+ return client.WingV1alpha1().MachineSets(namespace).Watch(options)
},
},
- &wing_v1alpha1.Instance{},
+ &wing_v1alpha1.MachineSet{},
resyncPeriod,
indexers,
)
}
-func (f *instanceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
- return NewFilteredInstanceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+func (f *machineSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
-func (f *instanceInformer) Informer() cache.SharedIndexInformer {
- return f.factory.InformerFor(&wing_v1alpha1.Instance{}, f.defaultInformer)
+func (f *machineSetInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing_v1alpha1.MachineSet{}, f.defaultInformer)
}
-func (f *instanceInformer) Lister() v1alpha1.InstanceLister {
- return v1alpha1.NewInstanceLister(f.Informer().GetIndexer())
+func (f *machineSetInformer) Lister() v1alpha1.MachineSetLister {
+ return v1alpha1.NewMachineSetLister(f.Informer().GetIndexer())
}
diff --git a/pkg/wing/client/informers/internalversion/generic.go b/pkg/wing/client/informers/internalversion/generic.go
index bc2e902c07..f8149b568a 100644
--- a/pkg/wing/client/informers/internalversion/generic.go
+++ b/pkg/wing/client/informers/internalversion/generic.go
@@ -38,8 +38,12 @@ func (f *genericInformer) Lister() cache.GenericLister {
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=wing.tarmak.io, Version=internalVersion
- case wing.SchemeGroupVersion.WithResource("instances"):
- return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().InternalVersion().Instances().Informer()}, nil
+ case wing.SchemeGroupVersion.WithResource("machines"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().InternalVersion().Machines().Informer()}, nil
+ case wing.SchemeGroupVersion.WithResource("machinedeployments"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().InternalVersion().MachineDeployments().Informer()}, nil
+ case wing.SchemeGroupVersion.WithResource("machinesets"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Wing().InternalVersion().MachineSets().Informer()}, nil
}
diff --git a/pkg/wing/client/informers/internalversion/wing/internalversion/interface.go b/pkg/wing/client/informers/internalversion/wing/internalversion/interface.go
index 75bbce1341..adfc6e264f 100644
--- a/pkg/wing/client/informers/internalversion/wing/internalversion/interface.go
+++ b/pkg/wing/client/informers/internalversion/wing/internalversion/interface.go
@@ -10,8 +10,12 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
- // Instances returns a InstanceInformer.
- Instances() InstanceInformer
+ // Machines returns a MachineInformer.
+ Machines() MachineInformer
+ // MachineDeployments returns a MachineDeploymentInformer.
+ MachineDeployments() MachineDeploymentInformer
+ // MachineSets returns a MachineSetInformer.
+ MachineSets() MachineSetInformer
}
type version struct {
@@ -25,7 +29,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
-// Instances returns a InstanceInformer.
-func (v *version) Instances() InstanceInformer {
- return &instanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+// Machines returns a MachineInformer.
+func (v *version) Machines() MachineInformer {
+ return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineDeployments returns a MachineDeploymentInformer.
+func (v *version) MachineDeployments() MachineDeploymentInformer {
+ return &machineDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
+// MachineSets returns a MachineSetInformer.
+func (v *version) MachineSets() MachineSetInformer {
+ return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
diff --git a/pkg/wing/client/informers/internalversion/wing/internalversion/instance.go b/pkg/wing/client/informers/internalversion/wing/internalversion/machine.go
similarity index 51%
rename from pkg/wing/client/informers/internalversion/wing/internalversion/instance.go
rename to pkg/wing/client/informers/internalversion/wing/internalversion/machine.go
index a239cfd789..49e82fd796 100644
--- a/pkg/wing/client/informers/internalversion/wing/internalversion/instance.go
+++ b/pkg/wing/client/informers/internalversion/wing/internalversion/machine.go
@@ -16,59 +16,59 @@ import (
time "time"
)
-// InstanceInformer provides access to a shared informer and lister for
-// Instances.
-type InstanceInformer interface {
+// MachineInformer provides access to a shared informer and lister for
+// Machines.
+type MachineInformer interface {
Informer() cache.SharedIndexInformer
- Lister() internalversion.InstanceLister
+ Lister() internalversion.MachineLister
}
-type instanceInformer struct {
+type machineInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
-// NewInstanceInformer constructs a new informer for Instance type.
+// NewMachineInformer constructs a new informer for Machine type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
-func NewInstanceInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
- return NewFilteredInstanceInformer(client, namespace, resyncPeriod, indexers, nil)
+func NewMachineInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil)
}
-// NewFilteredInstanceInformer constructs a new informer for Instance type.
+// NewFilteredMachineInformer constructs a new informer for Machine type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
-func NewFilteredInstanceInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+func NewFilteredMachineInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.Wing().Instances(namespace).List(options)
+ return client.Wing().Machines(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
- return client.Wing().Instances(namespace).Watch(options)
+ return client.Wing().Machines(namespace).Watch(options)
},
},
- &wing.Instance{},
+ &wing.Machine{},
resyncPeriod,
indexers,
)
}
-func (f *instanceInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
- return NewFilteredInstanceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+func (f *machineInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
-func (f *instanceInformer) Informer() cache.SharedIndexInformer {
- return f.factory.InformerFor(&wing.Instance{}, f.defaultInformer)
+func (f *machineInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing.Machine{}, f.defaultInformer)
}
-func (f *instanceInformer) Lister() internalversion.InstanceLister {
- return internalversion.NewInstanceLister(f.Informer().GetIndexer())
+func (f *machineInformer) Lister() internalversion.MachineLister {
+ return internalversion.NewMachineLister(f.Informer().GetIndexer())
}
diff --git a/pkg/wing/client/informers/internalversion/wing/internalversion/machinedeployment.go b/pkg/wing/client/informers/internalversion/wing/internalversion/machinedeployment.go
new file mode 100644
index 0000000000..ed8e002ca6
--- /dev/null
+++ b/pkg/wing/client/informers/internalversion/wing/internalversion/machinedeployment.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ clientset_internalversion "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion/internalinterfaces"
+ internalversion "github.com/jetstack/tarmak/pkg/wing/client/listers/wing/internalversion"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineDeploymentInformer provides access to a shared informer and lister for
+// MachineDeployments.
+type MachineDeploymentInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() internalversion.MachineDeploymentLister
+}
+
+type machineDeploymentInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineDeploymentInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineDeploymentInformer constructs a new informer for MachineDeployment type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineDeploymentInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineDeployments(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineDeployments(namespace).Watch(options)
+ },
+ },
+ &wing.MachineDeployment{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineDeploymentInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing.MachineDeployment{}, f.defaultInformer)
+}
+
+func (f *machineDeploymentInformer) Lister() internalversion.MachineDeploymentLister {
+ return internalversion.NewMachineDeploymentLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/informers/internalversion/wing/internalversion/machineset.go b/pkg/wing/client/informers/internalversion/wing/internalversion/machineset.go
new file mode 100644
index 0000000000..6c2d7b48ce
--- /dev/null
+++ b/pkg/wing/client/informers/internalversion/wing/internalversion/machineset.go
@@ -0,0 +1,74 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by informer-gen
+
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ clientset_internalversion "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion"
+ internalinterfaces "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion/internalinterfaces"
+ internalversion "github.com/jetstack/tarmak/pkg/wing/client/listers/wing/internalversion"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+ time "time"
+)
+
+// MachineSetInformer provides access to a shared informer and lister for
+// MachineSets.
+type MachineSetInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() internalversion.MachineSetLister
+}
+
+type machineSetInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewMachineSetInformer constructs a new informer for MachineSet type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewMachineSetInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredMachineSetInformer constructs a new informer for MachineSet type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredMachineSetInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineSets(namespace).List(options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.Wing().MachineSets(namespace).Watch(options)
+ },
+ },
+ &wing.MachineSet{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *machineSetInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *machineSetInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&wing.MachineSet{}, f.defaultInformer)
+}
+
+func (f *machineSetInformer) Lister() internalversion.MachineSetLister {
+ return internalversion.NewMachineSetLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/wing/client/listers/apis/wing/expansion_generated.go b/pkg/wing/client/listers/apis/wing/expansion_generated.go
new file mode 100644
index 0000000000..f1bb16114e
--- /dev/null
+++ b/pkg/wing/client/listers/apis/wing/expansion_generated.go
@@ -0,0 +1,29 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package wing
+
+// MachineListerExpansion allows custom methods to be added to
+// MachineLister.
+type MachineListerExpansion interface{}
+
+// MachineNamespaceListerExpansion allows custom methods to be added to
+// MachineNamespaceLister.
+type MachineNamespaceListerExpansion interface{}
+
+// MachineDeploymentListerExpansion allows custom methods to be added to
+// MachineDeploymentLister.
+type MachineDeploymentListerExpansion interface{}
+
+// MachineDeploymentNamespaceListerExpansion allows custom methods to be added to
+// MachineDeploymentNamespaceLister.
+type MachineDeploymentNamespaceListerExpansion interface{}
+
+// MachineSetListerExpansion allows custom methods to be added to
+// MachineSetLister.
+type MachineSetListerExpansion interface{}
+
+// MachineSetNamespaceListerExpansion allows custom methods to be added to
+// MachineSetNamespaceLister.
+type MachineSetNamespaceListerExpansion interface{}
diff --git a/pkg/wing/client/listers/apis/wing/machine.go b/pkg/wing/client/listers/apis/wing/machine.go
new file mode 100644
index 0000000000..c3d88be0b0
--- /dev/null
+++ b/pkg/wing/client/listers/apis/wing/machine.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package wing
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineLister helps list Machines.
+type MachineLister interface {
+ // List lists all Machines in the indexer.
+ List(selector labels.Selector) (ret []*wing.Machine, err error)
+ // Machines returns an object that can list and get Machines.
+ Machines(namespace string) MachineNamespaceLister
+ MachineListerExpansion
+}
+
+// machineLister implements the MachineLister interface.
+type machineLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineLister returns a new MachineLister.
+func NewMachineLister(indexer cache.Indexer) MachineLister {
+ return &machineLister{indexer: indexer}
+}
+
+// List lists all Machines in the indexer.
+func (s *machineLister) List(selector labels.Selector) (ret []*wing.Machine, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.Machine))
+ })
+ return ret, err
+}
+
+// Machines returns an object that can list and get Machines.
+func (s *machineLister) Machines(namespace string) MachineNamespaceLister {
+ return machineNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineNamespaceLister helps list and get Machines.
+type MachineNamespaceLister interface {
+ // List lists all Machines in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.Machine, err error)
+ // Get retrieves the Machine from the indexer for a given namespace and name.
+ Get(name string) (*wing.Machine, error)
+ MachineNamespaceListerExpansion
+}
+
+// machineNamespaceLister implements the MachineNamespaceLister
+// interface.
+type machineNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all Machines in the indexer for a given namespace.
+func (s machineNamespaceLister) List(selector labels.Selector) (ret []*wing.Machine, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.Machine))
+ })
+ return ret, err
+}
+
+// Get retrieves the Machine from the indexer for a given namespace and name.
+func (s machineNamespaceLister) Get(name string) (*wing.Machine, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machine"), name)
+ }
+ return obj.(*wing.Machine), nil
+}
diff --git a/pkg/wing/client/listers/apis/wing/machinedeployment.go b/pkg/wing/client/listers/apis/wing/machinedeployment.go
new file mode 100644
index 0000000000..a704216892
--- /dev/null
+++ b/pkg/wing/client/listers/apis/wing/machinedeployment.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package wing
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineDeploymentLister helps list MachineDeployments.
+type MachineDeploymentLister interface {
+ // List lists all MachineDeployments in the indexer.
+ List(selector labels.Selector) (ret []*wing.MachineDeployment, err error)
+ // MachineDeployments returns an object that can list and get MachineDeployments.
+ MachineDeployments(namespace string) MachineDeploymentNamespaceLister
+ MachineDeploymentListerExpansion
+}
+
+// machineDeploymentLister implements the MachineDeploymentLister interface.
+type machineDeploymentLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineDeploymentLister returns a new MachineDeploymentLister.
+func NewMachineDeploymentLister(indexer cache.Indexer) MachineDeploymentLister {
+ return &machineDeploymentLister{indexer: indexer}
+}
+
+// List lists all MachineDeployments in the indexer.
+func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*wing.MachineDeployment, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineDeployment))
+ })
+ return ret, err
+}
+
+// MachineDeployments returns an object that can list and get MachineDeployments.
+func (s *machineDeploymentLister) MachineDeployments(namespace string) MachineDeploymentNamespaceLister {
+ return machineDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineDeploymentNamespaceLister helps list and get MachineDeployments.
+type MachineDeploymentNamespaceLister interface {
+ // List lists all MachineDeployments in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.MachineDeployment, err error)
+ // Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+ Get(name string) (*wing.MachineDeployment, error)
+ MachineDeploymentNamespaceListerExpansion
+}
+
+// machineDeploymentNamespaceLister implements the MachineDeploymentNamespaceLister
+// interface.
+type machineDeploymentNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineDeployments in the indexer for a given namespace.
+func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*wing.MachineDeployment, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineDeployment))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+func (s machineDeploymentNamespaceLister) Get(name string) (*wing.MachineDeployment, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machinedeployment"), name)
+ }
+ return obj.(*wing.MachineDeployment), nil
+}
diff --git a/pkg/wing/client/listers/apis/wing/machineset.go b/pkg/wing/client/listers/apis/wing/machineset.go
new file mode 100644
index 0000000000..800e5e3a5c
--- /dev/null
+++ b/pkg/wing/client/listers/apis/wing/machineset.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package wing
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineSetLister helps list MachineSets.
+type MachineSetLister interface {
+ // List lists all MachineSets in the indexer.
+ List(selector labels.Selector) (ret []*wing.MachineSet, err error)
+ // MachineSets returns an object that can list and get MachineSets.
+ MachineSets(namespace string) MachineSetNamespaceLister
+ MachineSetListerExpansion
+}
+
+// machineSetLister implements the MachineSetLister interface.
+type machineSetLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineSetLister returns a new MachineSetLister.
+func NewMachineSetLister(indexer cache.Indexer) MachineSetLister {
+ return &machineSetLister{indexer: indexer}
+}
+
+// List lists all MachineSets in the indexer.
+func (s *machineSetLister) List(selector labels.Selector) (ret []*wing.MachineSet, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineSet))
+ })
+ return ret, err
+}
+
+// MachineSets returns an object that can list and get MachineSets.
+func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister {
+ return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineSetNamespaceLister helps list and get MachineSets.
+type MachineSetNamespaceLister interface {
+ // List lists all MachineSets in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.MachineSet, err error)
+ // Get retrieves the MachineSet from the indexer for a given namespace and name.
+ Get(name string) (*wing.MachineSet, error)
+ MachineSetNamespaceListerExpansion
+}
+
+// machineSetNamespaceLister implements the MachineSetNamespaceLister
+// interface.
+type machineSetNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineSets in the indexer for a given namespace.
+func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*wing.MachineSet, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineSet))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineSet from the indexer for a given namespace and name.
+func (s machineSetNamespaceLister) Get(name string) (*wing.MachineSet, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machineset"), name)
+ }
+ return obj.(*wing.MachineSet), nil
+}
diff --git a/pkg/wing/client/listers/wing/internalversion/expansion_generated.go b/pkg/wing/client/listers/wing/internalversion/expansion_generated.go
index a74252d677..c598d24db3 100644
--- a/pkg/wing/client/listers/wing/internalversion/expansion_generated.go
+++ b/pkg/wing/client/listers/wing/internalversion/expansion_generated.go
@@ -4,10 +4,26 @@
package internalversion
-// InstanceListerExpansion allows custom methods to be added to
-// InstanceLister.
-type InstanceListerExpansion interface{}
+// MachineListerExpansion allows custom methods to be added to
+// MachineLister.
+type MachineListerExpansion interface{}
-// InstanceNamespaceListerExpansion allows custom methods to be added to
-// InstanceNamespaceLister.
-type InstanceNamespaceListerExpansion interface{}
+// MachineNamespaceListerExpansion allows custom methods to be added to
+// MachineNamespaceLister.
+type MachineNamespaceListerExpansion interface{}
+
+// MachineDeploymentListerExpansion allows custom methods to be added to
+// MachineDeploymentLister.
+type MachineDeploymentListerExpansion interface{}
+
+// MachineDeploymentNamespaceListerExpansion allows custom methods to be added to
+// MachineDeploymentNamespaceLister.
+type MachineDeploymentNamespaceListerExpansion interface{}
+
+// MachineSetListerExpansion allows custom methods to be added to
+// MachineSetLister.
+type MachineSetListerExpansion interface{}
+
+// MachineSetNamespaceListerExpansion allows custom methods to be added to
+// MachineSetNamespaceLister.
+type MachineSetNamespaceListerExpansion interface{}
diff --git a/pkg/wing/client/listers/wing/internalversion/instance.go b/pkg/wing/client/listers/wing/internalversion/instance.go
deleted file mode 100644
index bd70666501..0000000000
--- a/pkg/wing/client/listers/wing/internalversion/instance.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-
-// This file was automatically generated by lister-gen
-
-package internalversion
-
-import (
- wing "github.com/jetstack/tarmak/pkg/apis/wing"
- "k8s.io/apimachinery/pkg/api/errors"
- "k8s.io/apimachinery/pkg/labels"
- "k8s.io/client-go/tools/cache"
-)
-
-// InstanceLister helps list Instances.
-type InstanceLister interface {
- // List lists all Instances in the indexer.
- List(selector labels.Selector) (ret []*wing.Instance, err error)
- // Instances returns an object that can list and get Instances.
- Instances(namespace string) InstanceNamespaceLister
- InstanceListerExpansion
-}
-
-// instanceLister implements the InstanceLister interface.
-type instanceLister struct {
- indexer cache.Indexer
-}
-
-// NewInstanceLister returns a new InstanceLister.
-func NewInstanceLister(indexer cache.Indexer) InstanceLister {
- return &instanceLister{indexer: indexer}
-}
-
-// List lists all Instances in the indexer.
-func (s *instanceLister) List(selector labels.Selector) (ret []*wing.Instance, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*wing.Instance))
- })
- return ret, err
-}
-
-// Instances returns an object that can list and get Instances.
-func (s *instanceLister) Instances(namespace string) InstanceNamespaceLister {
- return instanceNamespaceLister{indexer: s.indexer, namespace: namespace}
-}
-
-// InstanceNamespaceLister helps list and get Instances.
-type InstanceNamespaceLister interface {
- // List lists all Instances in the indexer for a given namespace.
- List(selector labels.Selector) (ret []*wing.Instance, err error)
- // Get retrieves the Instance from the indexer for a given namespace and name.
- Get(name string) (*wing.Instance, error)
- InstanceNamespaceListerExpansion
-}
-
-// instanceNamespaceLister implements the InstanceNamespaceLister
-// interface.
-type instanceNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all Instances in the indexer for a given namespace.
-func (s instanceNamespaceLister) List(selector labels.Selector) (ret []*wing.Instance, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*wing.Instance))
- })
- return ret, err
-}
-
-// Get retrieves the Instance from the indexer for a given namespace and name.
-func (s instanceNamespaceLister) Get(name string) (*wing.Instance, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(wing.Resource("instance"), name)
- }
- return obj.(*wing.Instance), nil
-}
diff --git a/pkg/wing/client/listers/wing/internalversion/machine.go b/pkg/wing/client/listers/wing/internalversion/machine.go
new file mode 100644
index 0000000000..d8d54ab323
--- /dev/null
+++ b/pkg/wing/client/listers/wing/internalversion/machine.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineLister helps list Machines.
+type MachineLister interface {
+ // List lists all Machines in the indexer.
+ List(selector labels.Selector) (ret []*wing.Machine, err error)
+ // Machines returns an object that can list and get Machines.
+ Machines(namespace string) MachineNamespaceLister
+ MachineListerExpansion
+}
+
+// machineLister implements the MachineLister interface.
+type machineLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineLister returns a new MachineLister.
+func NewMachineLister(indexer cache.Indexer) MachineLister {
+ return &machineLister{indexer: indexer}
+}
+
+// List lists all Machines in the indexer.
+func (s *machineLister) List(selector labels.Selector) (ret []*wing.Machine, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.Machine))
+ })
+ return ret, err
+}
+
+// Machines returns an object that can list and get Machines.
+func (s *machineLister) Machines(namespace string) MachineNamespaceLister {
+ return machineNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineNamespaceLister helps list and get Machines.
+type MachineNamespaceLister interface {
+ // List lists all Machines in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.Machine, err error)
+ // Get retrieves the Machine from the indexer for a given namespace and name.
+ Get(name string) (*wing.Machine, error)
+ MachineNamespaceListerExpansion
+}
+
+// machineNamespaceLister implements the MachineNamespaceLister
+// interface.
+type machineNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all Machines in the indexer for a given namespace.
+func (s machineNamespaceLister) List(selector labels.Selector) (ret []*wing.Machine, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.Machine))
+ })
+ return ret, err
+}
+
+// Get retrieves the Machine from the indexer for a given namespace and name.
+func (s machineNamespaceLister) Get(name string) (*wing.Machine, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machine"), name)
+ }
+ return obj.(*wing.Machine), nil
+}
diff --git a/pkg/wing/client/listers/wing/internalversion/machinedeployment.go b/pkg/wing/client/listers/wing/internalversion/machinedeployment.go
new file mode 100644
index 0000000000..ca327abfdb
--- /dev/null
+++ b/pkg/wing/client/listers/wing/internalversion/machinedeployment.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineDeploymentLister helps list MachineDeployments.
+type MachineDeploymentLister interface {
+ // List lists all MachineDeployments in the indexer.
+ List(selector labels.Selector) (ret []*wing.MachineDeployment, err error)
+ // MachineDeployments returns an object that can list and get MachineDeployments.
+ MachineDeployments(namespace string) MachineDeploymentNamespaceLister
+ MachineDeploymentListerExpansion
+}
+
+// machineDeploymentLister implements the MachineDeploymentLister interface.
+type machineDeploymentLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineDeploymentLister returns a new MachineDeploymentLister.
+func NewMachineDeploymentLister(indexer cache.Indexer) MachineDeploymentLister {
+ return &machineDeploymentLister{indexer: indexer}
+}
+
+// List lists all MachineDeployments in the indexer.
+func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*wing.MachineDeployment, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineDeployment))
+ })
+ return ret, err
+}
+
+// MachineDeployments returns an object that can list and get MachineDeployments.
+func (s *machineDeploymentLister) MachineDeployments(namespace string) MachineDeploymentNamespaceLister {
+ return machineDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineDeploymentNamespaceLister helps list and get MachineDeployments.
+type MachineDeploymentNamespaceLister interface {
+ // List lists all MachineDeployments in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.MachineDeployment, err error)
+ // Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+ Get(name string) (*wing.MachineDeployment, error)
+ MachineDeploymentNamespaceListerExpansion
+}
+
+// machineDeploymentNamespaceLister implements the MachineDeploymentNamespaceLister
+// interface.
+type machineDeploymentNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineDeployments in the indexer for a given namespace.
+func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*wing.MachineDeployment, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineDeployment))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+func (s machineDeploymentNamespaceLister) Get(name string) (*wing.MachineDeployment, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machinedeployment"), name)
+ }
+ return obj.(*wing.MachineDeployment), nil
+}
diff --git a/pkg/wing/client/listers/wing/internalversion/machineset.go b/pkg/wing/client/listers/wing/internalversion/machineset.go
new file mode 100644
index 0000000000..d2b81fbc46
--- /dev/null
+++ b/pkg/wing/client/listers/wing/internalversion/machineset.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package internalversion
+
+import (
+ wing "github.com/jetstack/tarmak/pkg/apis/wing"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineSetLister helps list MachineSets.
+type MachineSetLister interface {
+ // List lists all MachineSets in the indexer.
+ List(selector labels.Selector) (ret []*wing.MachineSet, err error)
+ // MachineSets returns an object that can list and get MachineSets.
+ MachineSets(namespace string) MachineSetNamespaceLister
+ MachineSetListerExpansion
+}
+
+// machineSetLister implements the MachineSetLister interface.
+type machineSetLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineSetLister returns a new MachineSetLister.
+func NewMachineSetLister(indexer cache.Indexer) MachineSetLister {
+ return &machineSetLister{indexer: indexer}
+}
+
+// List lists all MachineSets in the indexer.
+func (s *machineSetLister) List(selector labels.Selector) (ret []*wing.MachineSet, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineSet))
+ })
+ return ret, err
+}
+
+// MachineSets returns an object that can list and get MachineSets.
+func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister {
+ return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineSetNamespaceLister helps list and get MachineSets.
+type MachineSetNamespaceLister interface {
+ // List lists all MachineSets in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*wing.MachineSet, err error)
+ // Get retrieves the MachineSet from the indexer for a given namespace and name.
+ Get(name string) (*wing.MachineSet, error)
+ MachineSetNamespaceListerExpansion
+}
+
+// machineSetNamespaceLister implements the MachineSetNamespaceLister
+// interface.
+type machineSetNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineSets in the indexer for a given namespace.
+func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*wing.MachineSet, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*wing.MachineSet))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineSet from the indexer for a given namespace and name.
+func (s machineSetNamespaceLister) Get(name string) (*wing.MachineSet, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(wing.Resource("machineset"), name)
+ }
+ return obj.(*wing.MachineSet), nil
+}
diff --git a/pkg/wing/client/listers/wing/v1alpha1/expansion_generated.go b/pkg/wing/client/listers/wing/v1alpha1/expansion_generated.go
index e3271e34c9..ff2f536863 100644
--- a/pkg/wing/client/listers/wing/v1alpha1/expansion_generated.go
+++ b/pkg/wing/client/listers/wing/v1alpha1/expansion_generated.go
@@ -4,10 +4,26 @@
package v1alpha1
-// InstanceListerExpansion allows custom methods to be added to
-// InstanceLister.
-type InstanceListerExpansion interface{}
+// MachineListerExpansion allows custom methods to be added to
+// MachineLister.
+type MachineListerExpansion interface{}
-// InstanceNamespaceListerExpansion allows custom methods to be added to
-// InstanceNamespaceLister.
-type InstanceNamespaceListerExpansion interface{}
+// MachineNamespaceListerExpansion allows custom methods to be added to
+// MachineNamespaceLister.
+type MachineNamespaceListerExpansion interface{}
+
+// MachineDeploymentListerExpansion allows custom methods to be added to
+// MachineDeploymentLister.
+type MachineDeploymentListerExpansion interface{}
+
+// MachineDeploymentNamespaceListerExpansion allows custom methods to be added to
+// MachineDeploymentNamespaceLister.
+type MachineDeploymentNamespaceListerExpansion interface{}
+
+// MachineSetListerExpansion allows custom methods to be added to
+// MachineSetLister.
+type MachineSetListerExpansion interface{}
+
+// MachineSetNamespaceListerExpansion allows custom methods to be added to
+// MachineSetNamespaceLister.
+type MachineSetNamespaceListerExpansion interface{}
diff --git a/pkg/wing/client/listers/wing/v1alpha1/instance.go b/pkg/wing/client/listers/wing/v1alpha1/instance.go
deleted file mode 100644
index 4e6533ad87..0000000000
--- a/pkg/wing/client/listers/wing/v1alpha1/instance.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-
-// This file was automatically generated by lister-gen
-
-package v1alpha1
-
-import (
- v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
- "k8s.io/apimachinery/pkg/api/errors"
- "k8s.io/apimachinery/pkg/labels"
- "k8s.io/client-go/tools/cache"
-)
-
-// InstanceLister helps list Instances.
-type InstanceLister interface {
- // List lists all Instances in the indexer.
- List(selector labels.Selector) (ret []*v1alpha1.Instance, err error)
- // Instances returns an object that can list and get Instances.
- Instances(namespace string) InstanceNamespaceLister
- InstanceListerExpansion
-}
-
-// instanceLister implements the InstanceLister interface.
-type instanceLister struct {
- indexer cache.Indexer
-}
-
-// NewInstanceLister returns a new InstanceLister.
-func NewInstanceLister(indexer cache.Indexer) InstanceLister {
- return &instanceLister{indexer: indexer}
-}
-
-// List lists all Instances in the indexer.
-func (s *instanceLister) List(selector labels.Selector) (ret []*v1alpha1.Instance, err error) {
- err = cache.ListAll(s.indexer, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.Instance))
- })
- return ret, err
-}
-
-// Instances returns an object that can list and get Instances.
-func (s *instanceLister) Instances(namespace string) InstanceNamespaceLister {
- return instanceNamespaceLister{indexer: s.indexer, namespace: namespace}
-}
-
-// InstanceNamespaceLister helps list and get Instances.
-type InstanceNamespaceLister interface {
- // List lists all Instances in the indexer for a given namespace.
- List(selector labels.Selector) (ret []*v1alpha1.Instance, err error)
- // Get retrieves the Instance from the indexer for a given namespace and name.
- Get(name string) (*v1alpha1.Instance, error)
- InstanceNamespaceListerExpansion
-}
-
-// instanceNamespaceLister implements the InstanceNamespaceLister
-// interface.
-type instanceNamespaceLister struct {
- indexer cache.Indexer
- namespace string
-}
-
-// List lists all Instances in the indexer for a given namespace.
-func (s instanceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Instance, err error) {
- err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
- ret = append(ret, m.(*v1alpha1.Instance))
- })
- return ret, err
-}
-
-// Get retrieves the Instance from the indexer for a given namespace and name.
-func (s instanceNamespaceLister) Get(name string) (*v1alpha1.Instance, error) {
- obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
- if err != nil {
- return nil, err
- }
- if !exists {
- return nil, errors.NewNotFound(v1alpha1.Resource("instance"), name)
- }
- return obj.(*v1alpha1.Instance), nil
-}
diff --git a/pkg/wing/client/listers/wing/v1alpha1/machine.go b/pkg/wing/client/listers/wing/v1alpha1/machine.go
new file mode 100644
index 0000000000..6f1bea4000
--- /dev/null
+++ b/pkg/wing/client/listers/wing/v1alpha1/machine.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineLister helps list Machines.
+type MachineLister interface {
+ // List lists all Machines in the indexer.
+ List(selector labels.Selector) (ret []*v1alpha1.Machine, err error)
+ // Machines returns an object that can list and get Machines.
+ Machines(namespace string) MachineNamespaceLister
+ MachineListerExpansion
+}
+
+// machineLister implements the MachineLister interface.
+type machineLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineLister returns a new MachineLister.
+func NewMachineLister(indexer cache.Indexer) MachineLister {
+ return &machineLister{indexer: indexer}
+}
+
+// List lists all Machines in the indexer.
+func (s *machineLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.Machine))
+ })
+ return ret, err
+}
+
+// Machines returns an object that can list and get Machines.
+func (s *machineLister) Machines(namespace string) MachineNamespaceLister {
+ return machineNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineNamespaceLister helps list and get Machines.
+type MachineNamespaceLister interface {
+ // List lists all Machines in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*v1alpha1.Machine, err error)
+ // Get retrieves the Machine from the indexer for a given namespace and name.
+ Get(name string) (*v1alpha1.Machine, error)
+ MachineNamespaceListerExpansion
+}
+
+// machineNamespaceLister implements the MachineNamespaceLister
+// interface.
+type machineNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all Machines in the indexer for a given namespace.
+func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.Machine))
+ })
+ return ret, err
+}
+
+// Get retrieves the Machine from the indexer for a given namespace and name.
+func (s machineNamespaceLister) Get(name string) (*v1alpha1.Machine, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v1alpha1.Resource("machine"), name)
+ }
+ return obj.(*v1alpha1.Machine), nil
+}
diff --git a/pkg/wing/client/listers/wing/v1alpha1/machinedeployment.go b/pkg/wing/client/listers/wing/v1alpha1/machinedeployment.go
new file mode 100644
index 0000000000..f28a244a78
--- /dev/null
+++ b/pkg/wing/client/listers/wing/v1alpha1/machinedeployment.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineDeploymentLister helps list MachineDeployments.
+type MachineDeploymentLister interface {
+ // List lists all MachineDeployments in the indexer.
+ List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error)
+ // MachineDeployments returns an object that can list and get MachineDeployments.
+ MachineDeployments(namespace string) MachineDeploymentNamespaceLister
+ MachineDeploymentListerExpansion
+}
+
+// machineDeploymentLister implements the MachineDeploymentLister interface.
+type machineDeploymentLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineDeploymentLister returns a new MachineDeploymentLister.
+func NewMachineDeploymentLister(indexer cache.Indexer) MachineDeploymentLister {
+ return &machineDeploymentLister{indexer: indexer}
+}
+
+// List lists all MachineDeployments in the indexer.
+func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.MachineDeployment))
+ })
+ return ret, err
+}
+
+// MachineDeployments returns an object that can list and get MachineDeployments.
+func (s *machineDeploymentLister) MachineDeployments(namespace string) MachineDeploymentNamespaceLister {
+ return machineDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineDeploymentNamespaceLister helps list and get MachineDeployments.
+type MachineDeploymentNamespaceLister interface {
+ // List lists all MachineDeployments in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error)
+ // Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+ Get(name string) (*v1alpha1.MachineDeployment, error)
+ MachineDeploymentNamespaceListerExpansion
+}
+
+// machineDeploymentNamespaceLister implements the MachineDeploymentNamespaceLister
+// interface.
+type machineDeploymentNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineDeployments in the indexer for a given namespace.
+func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.MachineDeployment))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineDeployment from the indexer for a given namespace and name.
+func (s machineDeploymentNamespaceLister) Get(name string) (*v1alpha1.MachineDeployment, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v1alpha1.Resource("machinedeployment"), name)
+ }
+ return obj.(*v1alpha1.MachineDeployment), nil
+}
diff --git a/pkg/wing/client/listers/wing/v1alpha1/machineset.go b/pkg/wing/client/listers/wing/v1alpha1/machineset.go
new file mode 100644
index 0000000000..6f43194960
--- /dev/null
+++ b/pkg/wing/client/listers/wing/v1alpha1/machineset.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+
+// This file was automatically generated by lister-gen
+
+package v1alpha1
+
+import (
+ v1alpha1 "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// MachineSetLister helps list MachineSets.
+type MachineSetLister interface {
+ // List lists all MachineSets in the indexer.
+ List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error)
+ // MachineSets returns an object that can list and get MachineSets.
+ MachineSets(namespace string) MachineSetNamespaceLister
+ MachineSetListerExpansion
+}
+
+// machineSetLister implements the MachineSetLister interface.
+type machineSetLister struct {
+ indexer cache.Indexer
+}
+
+// NewMachineSetLister returns a new MachineSetLister.
+func NewMachineSetLister(indexer cache.Indexer) MachineSetLister {
+ return &machineSetLister{indexer: indexer}
+}
+
+// List lists all MachineSets in the indexer.
+func (s *machineSetLister) List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.MachineSet))
+ })
+ return ret, err
+}
+
+// MachineSets returns an object that can list and get MachineSets.
+func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister {
+ return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// MachineSetNamespaceLister helps list and get MachineSets.
+type MachineSetNamespaceLister interface {
+ // List lists all MachineSets in the indexer for a given namespace.
+ List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error)
+ // Get retrieves the MachineSet from the indexer for a given namespace and name.
+ Get(name string) (*v1alpha1.MachineSet, error)
+ MachineSetNamespaceListerExpansion
+}
+
+// machineSetNamespaceLister implements the MachineSetNamespaceLister
+// interface.
+type machineSetNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all MachineSets in the indexer for a given namespace.
+func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.MachineSet))
+ })
+ return ret, err
+}
+
+// Get retrieves the MachineSet from the indexer for a given namespace and name.
+func (s machineSetNamespaceLister) Get(name string) (*v1alpha1.MachineSet, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v1alpha1.Resource("machineset"), name)
+ }
+ return obj.(*v1alpha1.MachineSet), nil
+}
diff --git a/pkg/wing/controller.go b/pkg/wing/controller/machine/controller.go
similarity index 56%
rename from pkg/wing/controller.go
rename to pkg/wing/controller/machine/controller.go
index cc3f19bb7d..fd376a2d5c 100644
--- a/pkg/wing/controller.go
+++ b/pkg/wing/controller/machine/controller.go
@@ -1,7 +1,8 @@
// Copyright Jetstack Ltd. See LICENSE for details.
-package wing
+package machine
import (
+ "errors"
"fmt"
"time"
@@ -12,7 +13,9 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "github.com/jetstack/tarmak/pkg/wing/interfaces"
)
type Controller struct {
@@ -20,15 +23,15 @@ type Controller struct {
queue workqueue.RateLimitingInterface
informer cache.Controller
log *logrus.Entry
- wing *Wing
+ wing interfaces.Wing
}
-func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller, wing *Wing) *Controller {
+func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller, wing interfaces.Wing) *Controller {
return &Controller{
informer: informer,
indexer: indexer,
queue: queue,
- log: wing.log.WithField("tier", "controller"),
+ log: wing.Log().WithField("tier", "Machine-controller"),
wing: wing,
}
}
@@ -40,7 +43,7 @@ func (c *Controller) processNextItem() bool {
return false
}
// Tell the queue that we are done with processing this key. This unblocks the key for other workers
- // This allows safe parallel processing because two instances with the same key are never processed in
+ // This allows safe parallel processing because two machines with the same key are never processed in
// parallel.
defer c.queue.Done(key)
@@ -52,12 +55,12 @@ func (c *Controller) processNextItem() bool {
}
// syncToStdout is the business logic of the controller. In this controller it simply prints
-// information about the instance to stdout. In case an error happened, it has to simply return the error.
+// information about the machine to stdout. In case an error happened, it has to simply return the error.
// The retry logic should not be part of the business logic.
func (c *Controller) syncToStdout(key string) error {
// ensure only one converge at a time
- c.wing.convergeWG.Wait()
+ c.wing.ConvergeWGWait()
obj, exists, err := c.indexer.GetByKey(key)
if err != nil {
@@ -66,47 +69,59 @@ func (c *Controller) syncToStdout(key string) error {
}
if !exists {
- // Below we will warm up our cache with a Instance, so that we will see a delete for one instance
- fmt.Printf("Instance %s does not exist anymore\n", key)
- instanceAPI := c.wing.clientset.WingV1alpha1().Instances(c.wing.flags.ClusterName)
- instance := &v1alpha1.Instance{
+ // Below we will warm up our cache with a Machine, so that we will see a delete for one machine
+ c.log.Infof("Machine %s does not exist anymore\n", key)
+ machineAPI := c.wing.Clientset().WingV1alpha1().Machines(c.wing.Flags().ClusterName)
+ machine := &v1alpha1.Machine{
ObjectMeta: metav1.ObjectMeta{
- Name: c.wing.flags.InstanceName,
+ Name: c.wing.Flags().MachineName,
+ Labels: map[string]string{
+ "pool": c.wing.Flags().Pool,
+ "cluster": c.wing.Flags().ClusterName,
+ },
},
- Status: &v1alpha1.InstanceStatus{
- Converge: &v1alpha1.InstanceStatusManifest{
- State: v1alpha1.InstanceManifestStateConverging,
+ Status: &v1alpha1.MachineStatus{
+ Converge: &v1alpha1.MachineStatusManifest{
+ State: common.MachineManifestStateConverging,
},
},
}
- _, err := instanceAPI.Create(instance)
+ _, err := machineAPI.Create(machine)
if err != nil {
- return fmt.Errorf("error creating instance: %s", err)
+ return fmt.Errorf("error creating machine: %s", err)
}
- } else {
- // Note that you also have to check the uid if you have a local controlled resource, which
- // is dependent on the actual instance, to detect that a Instance was recreated with the same name
- instance := obj.(*v1alpha1.Instance)
-
- // trigger converge if status time is older or not existing
- if instance.Spec != nil && instance.Spec.Converge != nil && !instance.Spec.Converge.RequestTimestamp.Time.IsZero() {
- if instance.Status != nil && instance.Status.Converge != nil && !instance.Status.Converge.LastUpdateTimestamp.Time.IsZero() {
- if instance.Status.Converge.LastUpdateTimestamp.Time.After(instance.Spec.Converge.RequestTimestamp.Time) {
- c.log.Debug("no converge neccessary, last update was after request")
- return nil
- }
- } else {
- c.log.Debug("no converge neccessary, no status section found or update timestamp zero")
+
+ c.log.Infof("Machine created %v", key)
+ return nil
+ }
+
+ // Note that you also have to check the uid if you have a local controlled resource, which
+ // is dependent on the actual machine, to detect that a Machine was recreated with the same name
+ machine, ok := obj.(*v1alpha1.Machine)
+ if !ok {
+ return errors.New("failed to process next item, not a machine")
+ }
+
+ // trigger converge if status time is older or not existing
+ if machine.Spec != nil && machine.Spec.Converge != nil && !machine.Spec.Converge.RequestTimestamp.Time.IsZero() {
+ if machine.Status != nil && machine.Status.Converge != nil && !machine.Status.Converge.LastUpdateTimestamp.Time.IsZero() {
+ if machine.Status.Converge.LastUpdateTimestamp.Time.After(machine.Spec.Converge.RequestTimestamp.Time) {
+ c.log.Debug("no converge neccessary, last update was after request")
return nil
}
} else {
- c.log.Debug("no converge neccessary, no spec section found or request timestamp zero")
+ c.log.Debug("no converge neccessary, no status section found or update timestamp zero")
return nil
}
+ }
+ if machine.Status != nil && machine.Status.Converge != nil &&
+ machine.Status.Converge.State != common.MachineManifestStateConverging &&
+ machine.Status.Converge.State != common.MachineManifestStateConverged {
c.log.Infof("running converge")
- c.wing.converge()
+ c.wing.Converge()
}
+
return nil
}
@@ -122,7 +137,7 @@ func (c *Controller) handleErr(err error, key interface{}) {
// This controller retries 5 times if something goes wrong. After that, it stops trying.
if c.queue.NumRequeues(key) < 5 {
- c.log.Infof("Error syncing instance %v: %v", key, err)
+ c.log.Errorf("Error syncing machine %v: %v", key, err)
// Re-enqueue the key rate limited. Based on the rate limiter on the
// queue and the re-enqueue history, the key will be processed later again.
@@ -133,7 +148,7 @@ func (c *Controller) handleErr(err error, key interface{}) {
c.queue.Forget(key)
// Report to an external entity that, even after several retries, we could not successfully process this key
runtime.HandleError(err)
- c.log.Infof("Dropping instance %q out of the queue: %v", key, err)
+ c.log.Errorf("Dropping machine %q out of the queue: %v", key, err)
}
func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
@@ -141,7 +156,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
// Let the workers stop when we are done
defer c.queue.ShutDown()
- c.log.Info("Starting Instance controller")
+ c.log.Info("Starting Machine controller")
go c.informer.Run(stopCh)
@@ -156,7 +171,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) {
}
<-stopCh
- c.log.Info("Stopping Instance controller")
+ c.log.Info("Stopping Machine controller")
}
func (c *Controller) runWorker() {
diff --git a/pkg/wing/controller/machinedeployment/controller.go b/pkg/wing/controller/machinedeployment/controller.go
new file mode 100644
index 0000000000..9d6d6e47cb
--- /dev/null
+++ b/pkg/wing/controller/machinedeployment/controller.go
@@ -0,0 +1,242 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machinedeployment
+
+import (
+ "errors"
+ "fmt"
+ "time"
+
+ "github.com/sirupsen/logrus"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/client-go/util/workqueue"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "github.com/jetstack/tarmak/pkg/tarmak/utils"
+ clientset "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+)
+
+type Controller struct {
+ queue workqueue.RateLimitingInterface
+ depInformer cache.Controller
+ setInformer cache.Controller
+ depIndexer cache.Indexer
+ setIndexer cache.Indexer
+ log *logrus.Entry
+ client *clientset.Clientset
+}
+
+func NewController(queue workqueue.RateLimitingInterface, depIndexer cache.Indexer,
+ setIndexer cache.Indexer, depInformer cache.Controller, setInformer cache.Controller, client *clientset.Clientset) *Controller {
+ return &Controller{
+ depInformer: depInformer,
+ setInformer: setInformer,
+ depIndexer: depIndexer,
+ setIndexer: setIndexer,
+ queue: queue,
+ log: logrus.NewEntry(logrus.New()).WithField("tier", "MachineDeployment-controller"),
+ client: client,
+ }
+}
+
+func (c *Controller) processNextItem() bool {
+ // Wait until there is a new item in the working queue
+ key, quit := c.queue.Get()
+ if quit {
+ return false
+ }
+ // Tell the queue that we are done with processing this key. This unblocks the key for other workers
+ // This allows safe parallel processing because two machinedeployments with the same key are never processed in
+ // parallel.
+ defer c.queue.Done(key)
+
+ // Invoke the method containing the business logic
+ err := c.sync(key.(string))
+ // Handle the error if something went wrong during the execution of the business logic
+ c.handleErr(err, key)
+ return true
+}
+
+func (c *Controller) sync(key string) error {
+
+ // see whether we have a deployment or set
+ obj, exist, err := c.depIndexer.GetByKey(key)
+ if err != nil || !exist {
+ // we should have a set
+ obj, exists, err := c.setIndexer.GetByKey(key)
+ if err != nil {
+ c.log.Errorf("Fetching object with key %s from store failed with %v", key, err)
+ return err
+ }
+
+ if !exists {
+ return nil
+ }
+
+ ms, ok := obj.(*v1alpha1.MachineSet)
+ if !ok {
+ return errors.New("failed to process next item, not a machinedeployment or machineset")
+ }
+
+ // get our deployment controlling this set
+ md, err := c.getMachineDeployment(ms)
+ if err != nil {
+ return err
+ }
+
+ // sync deployment from the set
+ return c.syncFromMachineSet(md, ms)
+ }
+
+ md, ok := obj.(*v1alpha1.MachineDeployment)
+ if !ok {
+ return errors.New("failed to process next item, not a machinedeployment")
+ }
+
+ var selectors []string
+ for k, v := range md.Spec.Selector.MatchLabels {
+ selectors = append(selectors, fmt.Sprintf("%s=%s", k, v))
+ }
+
+ // get controlled set from our deployment
+ msAPI := c.client.WingV1alpha1().MachineSets(md.Namespace)
+ ms, err := msAPI.Get(md.Name, metav1.GetOptions{})
+ if err != nil {
+ // the set doesn't exist so we need to create it
+ if kerr, ok := err.(*apierrors.StatusError); ok && kerr.ErrStatus.Reason == metav1.StatusReasonNotFound {
+ return c.createControlledMachineSet(md)
+ } else {
+ return fmt.Errorf("error get existing machineset: %s", err)
+ }
+ }
+
+ // sync deployment from the set
+ err = c.syncFromMachineSet(md, ms)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (c *Controller) createControlledMachineSet(md *v1alpha1.MachineDeployment) error {
+ var minReplicas int32 = 1
+ var maxReplicas int32 = 1
+ if md.Spec.MinReplicas != nil {
+ minReplicas = *md.Spec.MinReplicas
+ }
+ if md.Spec.MaxReplicas != nil {
+ maxReplicas = *md.Spec.MaxReplicas
+ }
+
+ c.log.Infof("Creating MachineSet from MachineDeployment %s\n", md.Name)
+ ms := &v1alpha1.MachineSet{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: md.Name,
+ Labels: utils.DuplicateMapString(md.Labels),
+ },
+ Spec: &v1alpha1.MachineSetSpec{
+ MaxReplicas: &minReplicas,
+ MinReplicas: &maxReplicas,
+ Selector: md.Spec.Selector,
+ },
+ Status: &v1alpha1.MachineSetStatus{},
+ }
+
+ msAPI := c.client.WingV1alpha1().MachineSets(md.Namespace)
+ _, err := msAPI.Create(ms)
+ if err != nil {
+ return fmt.Errorf("error creating machineset: %s", err)
+ }
+
+ return nil
+}
+
+func (c *Controller) getMachineDeployment(ms *v1alpha1.MachineSet) (*v1alpha1.MachineDeployment, error) {
+ mdAPI := c.client.WingV1alpha1().MachineDeployments(ms.Namespace)
+ md, err := mdAPI.Get(ms.Name, metav1.GetOptions{})
+ if err != nil {
+ return nil, err
+ }
+
+ return md, nil
+}
+
+func (c *Controller) syncFromMachineSet(md *v1alpha1.MachineDeployment, ms *v1alpha1.MachineSet) error {
+ status := &v1alpha1.MachineDeploymentStatus{}
+ if ms.Status != nil {
+ status.Replicas = ms.Status.Replicas
+ status.ObservedGeneration = ms.Status.ObservedGeneration + 1
+ status.ReadyReplicas = ms.Status.ReadyReplicas
+ // TODO: we may want to do something with available replicas
+ status.AvailableReplicas = ms.Status.ReadyReplicas
+ status.UnavailableReplicas = ms.Status.Replicas - ms.Status.ReadyReplicas
+ }
+
+ mdAPI := c.client.WingV1alpha1().MachineDeployments(md.Namespace)
+ md.Status = status
+ _, err := mdAPI.Update(md)
+ if err != nil {
+ return fmt.Errorf("failed to update machinedeployment: %s", err)
+ }
+
+ return nil
+}
+
+// handleErr checks if an error happened and makes sure we will retry later.
+func (c *Controller) handleErr(err error, key interface{}) {
+ if err == nil {
+ // Forget about the #AddRateLimited history of the key on every successful synchronization.
+ // This ensures that future processing of updates for this key is not delayed because of
+ // an outdated error history.
+ c.queue.Forget(key)
+ return
+ }
+
+ // This controller retries 5 times if something goes wrong. After that, it stops trying.
+ if c.queue.NumRequeues(key) < 5 {
+ c.log.Errorf("Error syncing machine deployment %v: %v", key, err)
+
+ // Re-enqueue the key rate limited. Based on the rate limiter on the
+ // queue and the re-enqueue history, the key will be processed later again.
+ c.queue.AddRateLimited(key)
+ return
+ }
+
+ c.queue.Forget(key)
+ // Report to an external entity that, even after several retries, we could not successfully process this key
+ runtime.HandleError(err)
+ c.log.Errorf("Dropping machine deployment %q out of the queue: %v", key, err)
+}
+
+func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) {
+ defer runtime.HandleCrash()
+
+ // Let the workers stop when we are done
+ defer c.queue.ShutDown()
+ c.log.Info("Starting MachineDeployment controller")
+
+ go c.depInformer.Run(stopCh)
+ go c.setInformer.Run(stopCh)
+
+ // Wait for all involved caches to be synced, before processing items from the queue is started
+ if !cache.WaitForCacheSync(stopCh, c.depInformer.HasSynced) || !cache.WaitForCacheSync(stopCh, c.setInformer.HasSynced) {
+ runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
+ return
+ }
+
+ for i := 0; i < threadiness; i++ {
+ go wait.Until(c.runWorker, time.Second, stopCh)
+ }
+
+ <-stopCh
+ c.log.Info("Stopping MachineDeployment controller")
+}
+
+func (c *Controller) runWorker() {
+ for c.processNextItem() {
+ }
+}
diff --git a/pkg/wing/controller/machineset/controller.go b/pkg/wing/controller/machineset/controller.go
new file mode 100644
index 0000000000..0802879849
--- /dev/null
+++ b/pkg/wing/controller/machineset/controller.go
@@ -0,0 +1,250 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machineset
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/sirupsen/logrus"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/wait"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/client-go/util/workqueue"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+ "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ clientset "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+)
+
+type Controller struct {
+ indexer cache.Indexer
+ queue workqueue.RateLimitingInterface
+ informer cache.Controller
+ log *logrus.Entry
+ client *clientset.Clientset
+}
+
+func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller, client *clientset.Clientset) *Controller {
+ return &Controller{
+ informer: informer,
+ indexer: indexer,
+ queue: queue,
+ log: logrus.NewEntry(logrus.New()).WithField("tier", "MachineSet-controller"),
+ client: client,
+ }
+}
+
+func (c *Controller) processNextItem() bool {
+ // Wait until there is a new item in the working queue
+ key, quit := c.queue.Get()
+ if quit {
+ return false
+ }
+ // Tell the queue that we are done with processing this key. This unblocks the key for other workers
+ // This allows safe parallel processing because two machinesets with the same key are never processed in
+ // parallel.
+ defer c.queue.Done(key)
+
+ // Invoke the method containing the business logic
+ err := c.syncToStdout(key.(string))
+ // Handle the error if something went wrong during the execution of the business logic
+ c.handleErr(err, key)
+ return true
+}
+
+func (c *Controller) syncToStdout(key string) error {
+ obj, exists, err := c.indexer.GetByKey(key)
+ if err != nil {
+ c.log.Errorf("Fetching object with key %s from store failed with %v", key, err)
+ return err
+ }
+
+ if !exists {
+ c.log.Infof("Machine %s does not exist anymore\n", key)
+ return nil
+ }
+
+ m, ok := obj.(*v1alpha1.Machine)
+ if !ok {
+ return errors.New("failed to process next item, not a machine")
+ }
+
+ ms, found, err := c.getMachineSet(m)
+ if err != nil {
+ return err
+ }
+
+ // machineset doesn't exist for this machine
+ if !found {
+ return nil
+ }
+
+ if ms.Spec == nil {
+ return fmt.Errorf("machineset spec is nil: %v", ms.Spec)
+ }
+
+ if ms.Spec.MaxReplicas == nil || ms.Spec.MinReplicas == nil {
+ return fmt.Errorf("expected machineset min and max replicas to not be nil: min=%v max=%v",
+ ms.Spec.MaxReplicas, ms.Spec.MinReplicas)
+ }
+
+ var selectors []string
+ for k, v := range ms.Spec.Selector.MatchLabels {
+ selectors = append(selectors, fmt.Sprintf("%s=%s", k, v))
+ }
+
+ // find all the machines coverged by this machien set and update status accordingly
+ mAPI := c.client.WingV1alpha1().Machines(ms.Namespace)
+ mList, err := mAPI.List(metav1.ListOptions{
+ LabelSelector: strings.Join(selectors, ","),
+ })
+ if err != nil {
+ return err
+ }
+
+ if int32(len(mList.Items)) > *ms.Spec.MaxReplicas {
+ c.log.Warnf("more machines exist then the maximum, max=%v curr=%v", *ms.Spec.MaxReplicas, len(mList.Items))
+ }
+
+ //if int32(len(mList.Items)) < *ms.Spec.MinReplicas {
+ // c.log.Warnf("less machines exist then the minimum, min=%v curr=%v", *ms.Spec.MinReplicas, len(m.Items))
+ //}
+
+ var readyMachines int32
+ var fullyLabeledMachines int32
+ for _, i := range mList.Items {
+ if c.machineConverged(i) {
+ readyMachines++
+ }
+
+ if c.fullyLabeledMachine(ms, i) {
+ fullyLabeledMachines++
+ }
+ }
+
+ var observedGeneration int64 = 0
+ if ms.Status != nil {
+ observedGeneration = ms.Status.ObservedGeneration
+ }
+
+ status := &v1alpha1.MachineSetStatus{
+ Replicas: int32(len(mList.Items)),
+ ObservedGeneration: observedGeneration + 1,
+ ReadyReplicas: readyMachines,
+ FullyLabeledReplicas: fullyLabeledMachines,
+ // we may want to do something with available replicas
+ AvailableReplicas: readyMachines,
+ }
+
+ c.log.Debugf("updating machine set status: %+v", status)
+
+ msAPI := c.client.WingV1alpha1().MachineSets(ms.Namespace)
+ ms.Status = status.DeepCopy()
+ _, err = msAPI.Update(ms)
+ if err != nil {
+ return fmt.Errorf("failed to update machineset: %s", err)
+ }
+
+ return nil
+}
+
+func (c *Controller) getMachineSet(m *v1alpha1.Machine) (*v1alpha1.MachineSet, bool, error) {
+ pool, ok := m.Labels["pool"]
+ if !ok {
+ return nil, false, nil
+ }
+
+ cluster, ok := m.Labels["cluster"]
+ if !ok {
+ return nil, false, nil
+ }
+
+ msAPI := c.client.WingV1alpha1().MachineSets(cluster)
+ ms, err := msAPI.Get(pool, metav1.GetOptions{})
+ if err != nil {
+ if kerr, ok := err.(*apierrors.StatusError); ok && kerr.ErrStatus.Reason == metav1.StatusReasonNotFound {
+ return nil, false, nil
+ } else {
+ return nil, false, err
+ }
+ }
+
+ return ms, true, nil
+}
+
+// handleErr checks if an error happened and makes sure we will retry later.
+func (c *Controller) handleErr(err error, key interface{}) {
+ if err == nil {
+ // Forget about the #AddRateLimited history of the key on every successful synchronization.
+ // This ensures that future processing of updates for this key is not delayed because of
+ // an outdated error history.
+ c.queue.Forget(key)
+ return
+ }
+
+ // This controller retries 5 times if something goes wrong. After that, it stops trying.
+ if c.queue.NumRequeues(key) < 5 {
+ c.log.Errorf("Error syncing machineset %v: %v", key, err)
+
+ // Re-enqueue the key rate limited. Based on the rate limiter on the
+ // queue and the re-enqueue history, the key will be processed later again.
+ c.queue.AddRateLimited(key)
+ return
+ }
+
+ c.queue.Forget(key)
+ // Report to an external entity that, even after several retries, we could not successfully process this key
+ runtime.HandleError(err)
+ c.log.Errorf("Dropping machineset %q out of the queue: %v", key, err)
+}
+
+func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) {
+ defer runtime.HandleCrash()
+
+ // Let the workers stop when we are done
+ defer c.queue.ShutDown()
+ c.log.Info("Starting MachineSet controller")
+
+ go c.informer.Run(stopCh)
+
+ // Wait for all involved caches to be synced, before processing items from the queue is started
+ if !cache.WaitForCacheSync(stopCh, c.informer.HasSynced) {
+ runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
+ return
+ }
+
+ for i := 0; i < threadiness; i++ {
+ go wait.Until(c.runWorker, time.Second, stopCh)
+ }
+
+ <-stopCh
+ c.log.Info("Stopping MachineSet controller")
+}
+
+func (c *Controller) runWorker() {
+ for c.processNextItem() {
+ }
+}
+
+func (c *Controller) machineConverged(machine v1alpha1.Machine) bool {
+ if machine.Status != nil && machine.Status.Converge != nil && machine.Status.Converge.State == common.MachineManifestStateConverged {
+ return true
+ }
+
+ return false
+}
+
+func (c *Controller) fullyLabeledMachine(set *v1alpha1.MachineSet, machine v1alpha1.Machine) bool {
+ for k, v := range set.Spec.Selector.MatchLabels {
+ a, ok := machine.Labels[k]
+ if !ok || a != v {
+ return false
+ }
+ }
+
+ return true
+}
diff --git a/pkg/wing/interfaces/interfaces.go b/pkg/wing/interfaces/interfaces.go
new file mode 100644
index 0000000000..73bf6fa12b
--- /dev/null
+++ b/pkg/wing/interfaces/interfaces.go
@@ -0,0 +1,17 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package interfaces
+
+import (
+ "github.com/sirupsen/logrus"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
+ client "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+)
+
+type Wing interface {
+ Log() *logrus.Entry
+ Converge()
+ ConvergeWGWait()
+ Clientset() *client.Clientset
+ Flags() common.Flags
+}
diff --git a/pkg/wing/puppet.go b/pkg/wing/puppet.go
index dacf2fd3b2..4d84252583 100644
--- a/pkg/wing/puppet.go
+++ b/pkg/wing/puppet.go
@@ -22,16 +22,17 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
"github.com/jetstack/tarmak/pkg/wing/provider"
)
// This make sure puppet is converged when neccessary
-func (w *Wing) runPuppet() (*v1alpha1.InstanceStatus, error) {
+func (w *Wing) runPuppet() (*v1alpha1.MachineStatus, error) {
// start converging mainfest
- status := &v1alpha1.InstanceStatus{
- Converge: &v1alpha1.InstanceStatusManifest{
- State: v1alpha1.InstanceManifestStateConverging,
+ status := &v1alpha1.MachineStatus{
+ Converge: &v1alpha1.MachineStatusManifest{
+ State: common.MachineManifestStateConverging,
},
}
@@ -103,9 +104,9 @@ func (w *Wing) runPuppet() (*v1alpha1.InstanceStatus, error) {
puppetRetCodes = append(puppetRetCodes, retCode)
// start converging mainfest
- status = &v1alpha1.InstanceStatus{
- Converge: &v1alpha1.InstanceStatusManifest{
- State: v1alpha1.InstanceManifestStateConverging,
+ status = &v1alpha1.MachineStatus{
+ Converge: &v1alpha1.MachineStatusManifest{
+ State: common.MachineManifestStateConverging,
Messages: puppetMessages,
ExitCodes: puppetRetCodes,
Hash: hashString,
@@ -120,8 +121,8 @@ func (w *Wing) runPuppet() (*v1alpha1.InstanceStatus, error) {
}
expBackoff := backoff.NewExponentialBackOff()
- expBackoff.InitialInterval = time.Second * 30
- expBackoff.MaxElapsedTime = time.Minute * 30
+ expBackoff.InitialInterval = time.Second * 10
+ expBackoff.MaxElapsedTime = time.Minute * 20
// add context to backoff
ctx, cancelRetries := context.WithCancel(context.Background())
@@ -152,18 +153,18 @@ func (w *Wing) runPuppet() (*v1alpha1.InstanceStatus, error) {
return status, nil
}
-func (w *Wing) converge() {
+func (w *Wing) Converge() {
w.convergeWG.Add(1)
defer w.convergeWG.Done()
// run puppet
status, err := w.runPuppet()
if err != nil {
- status.Converge.State = v1alpha1.InstanceManifestStateError
+ status.Converge.State = common.MachineManifestStateError
status.Converge.Messages = append(status.Converge.Messages, err.Error())
w.log.Error(err)
} else {
- status.Converge.State = v1alpha1.InstanceManifestStateConverged
+ status.Converge.State = common.MachineManifestStateConverged
}
// feedback puppet status to apiserver
@@ -291,33 +292,42 @@ func (w *Wing) puppetApply(dir string) (output string, retCode int, err error) {
}
// report status to the API server
-func (w *Wing) reportStatus(status *v1alpha1.InstanceStatus) error {
- instanceAPI := w.clientset.WingV1alpha1().Instances(w.flags.ClusterName)
- instance, err := instanceAPI.Get(
- w.flags.InstanceName,
+func (w *Wing) reportStatus(status *v1alpha1.MachineStatus) error {
+ labels := map[string]string{
+ "pool": w.flags.Pool,
+ "cluster": w.flags.ClusterName,
+ }
+
+ machineAPI := w.clientset.WingV1alpha1().Machines(w.flags.ClusterName)
+ machine, err := machineAPI.Get(
+ w.flags.MachineName,
metav1.GetOptions{},
)
if err != nil {
if kerr, ok := err.(*apierrors.StatusError); ok && kerr.ErrStatus.Reason == metav1.StatusReasonNotFound {
- instance = &v1alpha1.Instance{
+ machine = &v1alpha1.Machine{
ObjectMeta: metav1.ObjectMeta{
- Name: w.flags.InstanceName,
+ Name: w.flags.MachineName,
+ Labels: labels,
},
Status: status.DeepCopy(),
}
- _, err := instanceAPI.Create(instance)
+ _, err := machineAPI.Create(machine)
if err != nil {
- return fmt.Errorf("error creating instance: %s", err)
+ return fmt.Errorf("error creating machine: %s", err)
}
+
return nil
}
- return fmt.Errorf("error get existing instance: %s", err)
+
+ return fmt.Errorf("error get existing machine: %s", err)
}
- instance.Status = status.DeepCopy()
- _, err = instanceAPI.Update(instance)
+ machine.ObjectMeta.Labels = labels
+ machine.Status = status.DeepCopy()
+ _, err = machineAPI.Update(machine)
if err != nil {
- return fmt.Errorf("error updating existing instance: %s", err)
+ return fmt.Errorf("error updating existing machine: %s", err)
// TODO: handle race for update
}
diff --git a/pkg/wing/registry/wing/instance/strategy.go b/pkg/wing/registry/wing/instance/strategy.go
deleted file mode 100644
index 10154a5153..0000000000
--- a/pkg/wing/registry/wing/instance/strategy.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright Jetstack Ltd. See LICENSE for details.
-package instance
-
-import (
- "fmt"
-
- "k8s.io/apimachinery/pkg/fields"
- "k8s.io/apimachinery/pkg/labels"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/validation/field"
- "k8s.io/apiserver/pkg/registry/generic"
- "k8s.io/apiserver/pkg/storage"
- "k8s.io/apiserver/pkg/storage/names"
-
- "github.com/jetstack/tarmak/pkg/apis/wing"
- genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
-)
-
-func NewStrategy(typer runtime.ObjectTyper) instanceStrategy {
- return instanceStrategy{typer, names.SimpleNameGenerator}
-}
-
-func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
- apiserver, ok := obj.(*wing.Instance)
- if !ok {
- return nil, nil, false, fmt.Errorf("given object is not a Instance.")
- }
- return labels.Set(apiserver.ObjectMeta.Labels), InstanceToSelectableFields(apiserver), apiserver.Initializers != nil, nil
-}
-
-// MatchInstance is the filter used by the generic etcd backend to watch events
-// from etcd to clients of the apiserver only interested in specific labels/fields.
-func MatchInstance(label labels.Selector, field fields.Selector) storage.SelectionPredicate {
- return storage.SelectionPredicate{
- Label: label,
- Field: field,
- GetAttrs: GetAttrs,
- }
-}
-
-// InstanceToSelectableFields returns a field set that represents the object.
-func InstanceToSelectableFields(obj *wing.Instance) fields.Set {
- return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
-}
-
-type instanceStrategy struct {
- runtime.ObjectTyper
- names.NameGenerator
-}
-
-func (instanceStrategy) NamespaceScoped() bool {
- return true
-}
-
-func (instanceStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
- // TODO: update all none timestamp to now()
-}
-
-func (instanceStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
- // TODO: update all none timestamp to now()
-}
-
-func (instanceStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
- return field.ErrorList{}
-}
-
-func (instanceStrategy) AllowCreateOnUpdate() bool {
- return false
-}
-
-func (instanceStrategy) AllowUnconditionalUpdate() bool {
- return false
-}
-
-func (instanceStrategy) Canonicalize(obj runtime.Object) {
-}
-
-func (instanceStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
- return field.ErrorList{}
-}
diff --git a/pkg/wing/registry/wing/instance/etcd.go b/pkg/wing/registry/wing/machine/etcd.go
similarity index 86%
rename from pkg/wing/registry/wing/instance/etcd.go
rename to pkg/wing/registry/wing/machine/etcd.go
index a38b9141d9..9ec7a069d3 100644
--- a/pkg/wing/registry/wing/instance/etcd.go
+++ b/pkg/wing/registry/wing/machine/etcd.go
@@ -1,5 +1,5 @@
// Copyright Jetstack Ltd. See LICENSE for details.
-package instance
+package machine
import (
"k8s.io/apimachinery/pkg/runtime"
@@ -15,10 +15,10 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*reg
strategy := NewStrategy(scheme)
store := &genericregistry.Store{
- NewFunc: func() runtime.Object { return &wing.Instance{} },
- NewListFunc: func() runtime.Object { return &wing.InstanceList{} },
- PredicateFunc: MatchInstance,
- DefaultQualifiedResource: wing.Resource("instances"),
+ NewFunc: func() runtime.Object { return &wing.Machine{} },
+ NewListFunc: func() runtime.Object { return &wing.MachineList{} },
+ PredicateFunc: MatchMachine,
+ DefaultQualifiedResource: wing.Resource("machines"),
CreateStrategy: strategy,
UpdateStrategy: strategy,
diff --git a/pkg/wing/registry/wing/machine/strategy.go b/pkg/wing/registry/wing/machine/strategy.go
new file mode 100644
index 0000000000..8a040b869e
--- /dev/null
+++ b/pkg/wing/registry/wing/machine/strategy.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machine
+
+import (
+ "fmt"
+
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/apiserver/pkg/registry/generic"
+ "k8s.io/apiserver/pkg/storage"
+ "k8s.io/apiserver/pkg/storage/names"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+)
+
+func NewStrategy(typer runtime.ObjectTyper) machineStrategy {
+ return machineStrategy{typer, names.SimpleNameGenerator}
+}
+
+func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
+ apiserver, ok := obj.(*wing.Machine)
+ if !ok {
+ return nil, nil, false, fmt.Errorf("given object is not a Machine.")
+ }
+ return labels.Set(apiserver.ObjectMeta.Labels), MachineToSelectableFields(apiserver), apiserver.Initializers != nil, nil
+}
+
+// MatchMachine is the filter used by the generic etcd backend to watch events
+// from etcd to clients of the apiserver only interested in specific labels/fields.
+func MatchMachine(label labels.Selector, field fields.Selector) storage.SelectionPredicate {
+ return storage.SelectionPredicate{
+ Label: label,
+ Field: field,
+ GetAttrs: GetAttrs,
+ }
+}
+
+// MachineToSelectableFields returns a field set that represents the object.
+func MachineToSelectableFields(obj *wing.Machine) fields.Set {
+ return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
+}
+
+type machineStrategy struct {
+ runtime.ObjectTyper
+ names.NameGenerator
+}
+
+func (machineStrategy) NamespaceScoped() bool {
+ return true
+}
+
+func (machineStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machineStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machineStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
+
+func (machineStrategy) AllowCreateOnUpdate() bool {
+ return false
+}
+
+func (machineStrategy) AllowUnconditionalUpdate() bool {
+ return false
+}
+
+func (machineStrategy) Canonicalize(obj runtime.Object) {
+}
+
+func (machineStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
diff --git a/pkg/wing/registry/wing/machinedeployment/etcd.go b/pkg/wing/registry/wing/machinedeployment/etcd.go
new file mode 100644
index 0000000000..ffa01710bd
--- /dev/null
+++ b/pkg/wing/registry/wing/machinedeployment/etcd.go
@@ -0,0 +1,34 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machinedeployment
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/registry/generic"
+ genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ "github.com/jetstack/tarmak/pkg/wing/registry"
+)
+
+// NewREST returns a RESTStorage object that will work against API services.
+func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*registry.REST, error) {
+ strategy := NewStrategy(scheme)
+
+ store := &genericregistry.Store{
+ NewFunc: func() runtime.Object { return &wing.MachineDeployment{} },
+ NewListFunc: func() runtime.Object { return &wing.MachineDeploymentList{} },
+ PredicateFunc: MatchMachineDeployment,
+ DefaultQualifiedResource: wing.Resource("machinedeployments"),
+
+ CreateStrategy: strategy,
+ UpdateStrategy: strategy,
+ DeleteStrategy: strategy,
+ }
+ options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: GetAttrs}
+ if err := store.CompleteWithOptions(options); err != nil {
+ return nil, err
+ }
+ return ®istry.REST{
+ Store: store,
+ }, nil
+}
diff --git a/pkg/wing/registry/wing/machinedeployment/strategy.go b/pkg/wing/registry/wing/machinedeployment/strategy.go
new file mode 100644
index 0000000000..09ecbce785
--- /dev/null
+++ b/pkg/wing/registry/wing/machinedeployment/strategy.go
@@ -0,0 +1,81 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machinedeployment
+
+import (
+ "fmt"
+
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/apiserver/pkg/registry/generic"
+ "k8s.io/apiserver/pkg/storage"
+ "k8s.io/apiserver/pkg/storage/names"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ //"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+)
+
+func NewStrategy(typer runtime.ObjectTyper) machinedeploymentStrategy {
+ return machinedeploymentStrategy{typer, names.SimpleNameGenerator}
+}
+
+func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
+ apiserver, ok := obj.(*wing.MachineDeployment)
+ if !ok {
+ return nil, nil, false, fmt.Errorf("given object is not a MachineDeployment.")
+ }
+ return labels.Set(apiserver.ObjectMeta.Labels), MachineToSelectableFields(apiserver), apiserver.Initializers != nil, nil
+}
+
+// MatchMachineDeployment is the filter used by the generic etcd backend to watch events
+// from etcd to clients of the apiserver only interested in specific labels/fields.
+func MatchMachineDeployment(label labels.Selector, field fields.Selector) storage.SelectionPredicate {
+ return storage.SelectionPredicate{
+ Label: label,
+ Field: field,
+ GetAttrs: GetAttrs,
+ }
+}
+
+// MachineToSelectableFields returns a field set that represents the object.
+func MachineToSelectableFields(obj *wing.MachineDeployment) fields.Set {
+ return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
+}
+
+type machinedeploymentStrategy struct {
+ runtime.ObjectTyper
+ names.NameGenerator
+}
+
+func (machinedeploymentStrategy) NamespaceScoped() bool {
+ return true
+}
+
+func (machinedeploymentStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machinedeploymentStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machinedeploymentStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
+
+func (machinedeploymentStrategy) AllowCreateOnUpdate() bool {
+ return false
+}
+
+func (machinedeploymentStrategy) AllowUnconditionalUpdate() bool {
+ return false
+}
+
+func (machinedeploymentStrategy) Canonicalize(obj runtime.Object) {
+}
+
+func (machinedeploymentStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
diff --git a/pkg/wing/registry/wing/machineset/etcd.go b/pkg/wing/registry/wing/machineset/etcd.go
new file mode 100644
index 0000000000..01b02b46fc
--- /dev/null
+++ b/pkg/wing/registry/wing/machineset/etcd.go
@@ -0,0 +1,34 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machineset
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apiserver/pkg/registry/generic"
+ genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ "github.com/jetstack/tarmak/pkg/wing/registry"
+)
+
+// NewREST returns a RESTStorage object that will work against API services.
+func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*registry.REST, error) {
+ strategy := NewStrategy(scheme)
+
+ store := &genericregistry.Store{
+ NewFunc: func() runtime.Object { return &wing.MachineSet{} },
+ NewListFunc: func() runtime.Object { return &wing.MachineSetList{} },
+ PredicateFunc: MatchMachineSet,
+ DefaultQualifiedResource: wing.Resource("machinesetss"),
+
+ CreateStrategy: strategy,
+ UpdateStrategy: strategy,
+ DeleteStrategy: strategy,
+ }
+ options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: GetAttrs}
+ if err := store.CompleteWithOptions(options); err != nil {
+ return nil, err
+ }
+ return ®istry.REST{
+ Store: store,
+ }, nil
+}
diff --git a/pkg/wing/registry/wing/machineset/strategy.go b/pkg/wing/registry/wing/machineset/strategy.go
new file mode 100644
index 0000000000..89bdf01329
--- /dev/null
+++ b/pkg/wing/registry/wing/machineset/strategy.go
@@ -0,0 +1,80 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package machineset
+
+import (
+ "fmt"
+
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/apiserver/pkg/registry/generic"
+ "k8s.io/apiserver/pkg/storage"
+ "k8s.io/apiserver/pkg/storage/names"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing"
+ genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
+)
+
+func NewStrategy(typer runtime.ObjectTyper) machinesetStrategy {
+ return machinesetStrategy{typer, names.SimpleNameGenerator}
+}
+
+func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
+ apiserver, ok := obj.(*wing.MachineSet)
+ if !ok {
+ return nil, nil, false, fmt.Errorf("given object is not a MachineSet.")
+ }
+ return labels.Set(apiserver.ObjectMeta.Labels), MachineToSelectableFields(apiserver), apiserver.Initializers != nil, nil
+}
+
+// MatchMachineSet is the filter used by the generic etcd backend to watch events
+// from etcd to clients of the apiserver only interested in specific labels/fields.
+func MatchMachineSet(label labels.Selector, field fields.Selector) storage.SelectionPredicate {
+ return storage.SelectionPredicate{
+ Label: label,
+ Field: field,
+ GetAttrs: GetAttrs,
+ }
+}
+
+// MachineToSelectableFields returns a field set that represents the object.
+func MachineToSelectableFields(obj *wing.MachineSet) fields.Set {
+ return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
+}
+
+type machinesetStrategy struct {
+ runtime.ObjectTyper
+ names.NameGenerator
+}
+
+func (machinesetStrategy) NamespaceScoped() bool {
+ return true
+}
+
+func (machinesetStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machinesetStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
+ // TODO: update all none timestamp to now()
+}
+
+func (machinesetStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
+
+func (machinesetStrategy) AllowCreateOnUpdate() bool {
+ return false
+}
+
+func (machinesetStrategy) AllowUnconditionalUpdate() bool {
+ return false
+}
+
+func (machinesetStrategy) Canonicalize(obj runtime.Object) {
+}
+
+func (machinesetStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
+ return field.ErrorList{}
+}
diff --git a/pkg/wing/server/controller.go b/pkg/wing/server/controller.go
new file mode 100644
index 0000000000..7cc48707a8
--- /dev/null
+++ b/pkg/wing/server/controller.go
@@ -0,0 +1,61 @@
+// Copyright Jetstack Ltd. See LICENSE for details.
+package server
+
+import (
+ "time"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/fields"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/client-go/util/workqueue"
+
+ "github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
+ "github.com/jetstack/tarmak/pkg/wing/controller/machinedeployment"
+ "github.com/jetstack/tarmak/pkg/wing/controller/machineset"
+)
+
+func (o WingServerOptions) StartMachineControllers() error {
+
+ // machineset controller needs to watch for changes to machines
+ machineListWatcher := cache.NewListWatchFromClient(o.client.WingV1alpha1().RESTClient(), "machines", metav1.NamespaceAll, fields.Everything())
+ queueSet := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
+ indexerMachine, informerMachine := o.newIndexInfomer(machineListWatcher, &v1alpha1.Machine{}, queueSet)
+ machinesetController := machineset.NewController(queueSet, indexerMachine, informerMachine, o.client)
+
+ // machindeployment controller needs to watch for changes to machinedeployments and machinesets
+ machinesetListWatcher := cache.NewListWatchFromClient(o.client.WingV1alpha1().RESTClient(), "machinesets", metav1.NamespaceAll, fields.Everything())
+ machinedeploymentListWatcher := cache.NewListWatchFromClient(o.client.WingV1alpha1().RESTClient(), "machinedeployments", metav1.NamespaceAll, fields.Everything())
+ queueDeployment := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
+ indexerSet, informerSet := o.newIndexInfomer(machinesetListWatcher, &v1alpha1.MachineSet{}, queueDeployment)
+ indexerDeployment, informerDeployment := o.newIndexInfomer(machinedeploymentListWatcher, &v1alpha1.MachineDeployment{}, queueDeployment)
+ machinedeploymentController := machinedeployment.NewController(queueDeployment, indexerDeployment, indexerSet, informerDeployment, informerSet, o.client)
+
+ //// Now let's start the controllers
+ go machinesetController.Run(1, o.stopCh)
+ go machinedeploymentController.Run(1, o.stopCh)
+ return nil
+}
+
+func (o WingServerOptions) newIndexInfomer(listWatcher cache.ListerWatcher, objType runtime.Object, queue workqueue.RateLimitingInterface) (cache.Indexer, cache.Controller) {
+ return cache.NewIndexerInformer(listWatcher, objType, 0, cache.ResourceEventHandlerFuncs{
+ AddFunc: func(obj interface{}) {
+ key, err := cache.MetaNamespaceKeyFunc(obj)
+ if err == nil {
+ queue.AddAfter(key, 1*time.Second)
+ }
+ },
+ UpdateFunc: func(old interface{}, new interface{}) {
+ key, err := cache.MetaNamespaceKeyFunc(new)
+ if err == nil {
+ queue.AddAfter(key, 1*time.Second)
+ }
+ },
+ DeleteFunc: func(obj interface{}) {
+ key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj)
+ if err == nil {
+ queue.AddAfter(key, 1*time.Second)
+ }
+ },
+ }, cache.Indexers{})
+}
diff --git a/pkg/wing/server/server.go b/pkg/wing/server/server.go
index 709ad0cc3d..a161c181ad 100644
--- a/pkg/wing/server/server.go
+++ b/pkg/wing/server/server.go
@@ -1,5 +1,4 @@
// Copyright Jetstack Ltd. See LICENSE for details.
-
package server
import (
@@ -13,11 +12,13 @@ import (
genericoptions "k8s.io/apiserver/pkg/server/options"
"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
- "github.com/jetstack/tarmak/pkg/wing/admission/plugin/instanceinittime"
+ "github.com/jetstack/tarmak/pkg/wing/admission/plugin/machinedeploymentinittime"
+ "github.com/jetstack/tarmak/pkg/wing/admission/plugin/machineinittime"
+ "github.com/jetstack/tarmak/pkg/wing/admission/plugin/machinesetinittime"
"github.com/jetstack/tarmak/pkg/wing/admission/winginitializer"
"github.com/jetstack/tarmak/pkg/wing/apiserver"
- clientset "github.com/jetstack/tarmak/pkg/wing/client/clientset/internalversion"
- informers "github.com/jetstack/tarmak/pkg/wing/client/informers/internalversion"
+ clientset "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ informers "github.com/jetstack/tarmak/pkg/wing/client/informers/externalversions"
)
const defaultEtcdPathPrefix = "/registry/wing.tarmak.io"
@@ -25,12 +26,16 @@ const defaultEtcdPathPrefix = "/registry/wing.tarmak.io"
type WingServerOptions struct {
RecommendedOptions *genericoptions.RecommendedOptions
Admission *genericoptions.AdmissionOptions
+ informerFactory informers.SharedInformerFactory
StdOut io.Writer
StdErr io.Writer
+
+ stopCh <-chan struct{}
+ client *clientset.Clientset
}
-var defaultAdmissionControllers = []string{instaceinittime.PluginName}
+var defaultAdmissionControllers = []string{machineinittime.PluginName, machinesetinittime.PluginName, machinedeploymentinittime.PluginName}
func NewWingServerOptions(out, errOut io.Writer) *WingServerOptions {
o := &WingServerOptions{
@@ -47,7 +52,9 @@ func NewWingServerOptions(out, errOut io.Writer) *WingServerOptions {
// NewCommandStartMaster provides a CLI handler for 'start master' command
func NewCommandStartWingServer(out, errOut io.Writer, stopCh <-chan struct{}) *cobra.Command {
o := NewWingServerOptions(out, errOut)
- instaceinittime.Register(o.Admission.Plugins)
+ machineinittime.Register(o.Admission.Plugins)
+ machinesetinittime.Register(o.Admission.Plugins)
+ machinedeploymentinittime.Register(o.Admission.Plugins)
o.Admission.PluginNames = defaultAdmissionControllers
cmd := &cobra.Command{
@@ -104,7 +111,10 @@ func (o WingServerOptions) Config() (*apiserver.Config, error) {
if err != nil {
return nil, err
}
+ o.client = client
+
informerFactory := informers.NewSharedInformerFactory(client, serverConfig.LoopbackClientConfig.Timeout)
+ o.informerFactory = informerFactory
admissionInitializer, err := winginitializer.New(informerFactory)
if err != nil {
return nil, err
@@ -114,6 +124,11 @@ func (o WingServerOptions) Config() (*apiserver.Config, error) {
return nil, err
}
+ err = o.StartMachineControllers()
+ if err != nil {
+ return nil, err
+ }
+
config := &apiserver.Config{
GenericConfig: serverConfig,
}
diff --git a/pkg/wing/wing.go b/pkg/wing/wing.go
index 2947912baa..aa433cdf03 100644
--- a/pkg/wing/wing.go
+++ b/pkg/wing/wing.go
@@ -16,17 +16,19 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
"github.com/jetstack/tarmak/pkg/apis/wing/v1alpha1"
client "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
+ "github.com/jetstack/tarmak/pkg/wing/controller/machine"
)
const (
- DefaultInstanceName = "$(hostname)"
+ DefaultMachineName = "$(hostname)"
)
type Wing struct {
log *logrus.Entry
- flags *Flags
+ flags *common.Flags
clientset *client.Clientset
// stop channel, signals termination to all goroutines
@@ -36,20 +38,13 @@ type Wing struct {
convergeWG sync.WaitGroup // wait group for converge runs
// controller loop
- controller *Controller
+ controller *machine.Controller
// allows overriding puppet command for testing
puppetCommandOverride Command
}
-type Flags struct {
- ManifestURL string
- ServerURL string
- ClusterName string
- InstanceName string
-}
-
-func New(flags *Flags) *Wing {
+func New(flags *common.Flags) *Wing {
logger := logrus.New()
logger.Level = logrus.DebugLevel
@@ -65,17 +60,17 @@ func New(flags *Flags) *Wing {
func (w *Wing) Run(args []string) error {
var errors []error
- if w.flags.InstanceName == DefaultInstanceName {
- instanceName, err := os.Hostname()
+ if w.flags.MachineName == DefaultMachineName {
+ machineName, err := os.Hostname()
if err != nil {
return err
}
- w.flags.InstanceName = instanceName
+ w.flags.MachineName = machineName
}
- if w.flags.InstanceName == "" {
- errors = append(errors, fmt.Errorf("--instance-name flag cannot be empty"))
+ if w.flags.MachineName == "" {
+ errors = append(errors, fmt.Errorf("--machine-name flag cannot be empty"))
}
if w.flags.ManifestURL == "" {
errors = append(errors, fmt.Errorf("--manifest-url flag cannot be empty"))
@@ -103,7 +98,7 @@ func (w *Wing) Run(args []string) error {
w.signalHandler(signalCh)
// run converge loop after first start
- go w.converge()
+ go w.Converge()
// start watching for API server events that trigger applies
w.watchForNotifications()
@@ -124,8 +119,8 @@ func (w *Wing) Must(err error) *Wing {
func (w *Wing) watchForNotifications() {
- // create the instance watcher
- instanceListWatcher := cache.NewListWatchFromClient(w.clientset.WingV1alpha1().RESTClient(), "instances", w.flags.ClusterName, fields.ParseSelectorOrDie(fmt.Sprintf("metadata.name=%s", w.flags.InstanceName)))
+ // create the machine watcher
+ machineListWatcher := cache.NewListWatchFromClient(w.clientset.WingV1alpha1().RESTClient(), "machines", w.flags.ClusterName, fields.ParseSelectorOrDie(fmt.Sprintf("metadata.name=%s", w.flags.MachineName)))
// create the workqueue
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
@@ -134,17 +129,17 @@ func (w *Wing) watchForNotifications() {
// whenever the cache is updated, the pod key is added to the workqueue.
// Note that when we finally process the item from the workqueue, we might see a newer version
// of the Pod than the version which was responsible for triggering the update.
- indexer, informer := cache.NewIndexerInformer(instanceListWatcher, &v1alpha1.Instance{}, 0, cache.ResourceEventHandlerFuncs{
+ indexer, informer := cache.NewIndexerInformer(machineListWatcher, &v1alpha1.Machine{}, 0, cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
key, err := cache.MetaNamespaceKeyFunc(obj)
if err == nil {
- queue.AddAfter(key, 2*time.Second)
+ queue.AddAfter(key, 1*time.Second)
}
},
UpdateFunc: func(old interface{}, new interface{}) {
key, err := cache.MetaNamespaceKeyFunc(new)
if err == nil {
- queue.AddAfter(key, 2*time.Second)
+ queue.AddAfter(key, 1*time.Second)
}
},
DeleteFunc: func(obj interface{}) {
@@ -152,12 +147,12 @@ func (w *Wing) watchForNotifications() {
// key function.
key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj)
if err == nil {
- queue.AddAfter(key, 2*time.Second)
+ queue.AddAfter(key, 1*time.Second)
}
},
}, cache.Indexers{})
- w.controller = NewController(queue, indexer, informer, w)
+ w.controller = machine.NewController(queue, indexer, informer, w)
// Now let's start the controller
go w.controller.Run(1, w.stopCh)
@@ -181,7 +176,7 @@ func (w *Wing) signalHandler(ch chan os.Signal) {
// create new converge stop channel and run converge
w.convergeStopCh = make(chan struct{})
- w.converge()
+ w.Converge()
case syscall.SIGINT:
w.log.Infof("wing received SIGINT")
@@ -196,3 +191,22 @@ func (w *Wing) signalHandler(ch chan os.Signal) {
}
}()
}
+
+func (w *Wing) Log() *logrus.Entry {
+ return w.log
+}
+
+func (w *Wing) ConvergeWGWait() {
+ w.convergeWG.Wait()
+}
+
+func (w *Wing) Clientset() *client.Clientset {
+ return w.clientset
+}
+
+func (w *Wing) Flags() common.Flags {
+ if w.flags != nil {
+ return *w.flags
+ }
+ return common.Flags{}
+}
diff --git a/pkg/wing/wing_test.go b/pkg/wing/wing_test.go
index e6536b4f7a..b55545dfd1 100644
--- a/pkg/wing/wing_test.go
+++ b/pkg/wing/wing_test.go
@@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/rest"
+ "github.com/jetstack/tarmak/pkg/apis/wing/common"
client "github.com/jetstack/tarmak/pkg/wing/client/clientset/versioned"
"github.com/jetstack/tarmak/pkg/wing/mocks"
)
@@ -61,11 +62,11 @@ func newFakeWing(t *testing.T) *fakeWing {
ctrl: gomock.NewController(t),
Wing: &Wing{
clientset: &client.Clientset{},
- flags: &Flags{
- ManifestURL: manifestURLgz,
- ServerURL: "fakeServerURL",
- ClusterName: "fakeClusterName",
- InstanceName: "fakeInstanceName",
+ flags: &common.Flags{
+ ManifestURL: manifestURLgz,
+ ServerURL: "fakeServerURL",
+ ClusterName: "fakeClusterName",
+ MachineName: "fakeMachineName",
},
log: logrus.NewEntry(logger),
stopCh: make(chan struct{}),
@@ -141,7 +142,7 @@ func TestWing_SIGTERM_handler_first_execute(t *testing.T) {
w.fakeCommand.EXPECT().Process().AnyTimes().Return(process.Process)
// run a converge
- w.converge()
+ w.Converge()
//Ensure close from signal handlers
if _, ok := (<-w.convergeStopCh); ok {
@@ -191,7 +192,7 @@ func TestWing_SIGTERM_handler_backoff(t *testing.T) {
}()
// run a converge
- w.converge()
+ w.Converge()
//Ensure close from signal handlers
if _, ok := (<-w.convergeStopCh); ok {
@@ -257,7 +258,7 @@ func TestWing_SIGHUP_handler_first_excute(t *testing.T) {
w.fakeCommand.EXPECT().Process().AnyTimes().Return(process.Process)
// run a converge
- w.converge()
+ w.Converge()
//Ensure close from signal handlers
if _, ok := (<-w.convergeStopCh); ok {
@@ -325,7 +326,7 @@ func TestWing_SIGHUP_handler_backoff(t *testing.T) {
}()
// run a converge
- w.converge()
+ w.Converge()
//Ensure close from signal handlers
if _, ok := (<-w.convergeStopCh); ok {
@@ -368,7 +369,7 @@ func TestWing_SIGTERM_puppet_converged(t *testing.T) {
})
// run a converge
- w.converge()
+ w.Converge()
w.convergeWG.Wait()
if _, ok := (<-puppetFinished); ok {
@@ -420,7 +421,7 @@ func TestWing_SIGHUP_puppet_converged(t *testing.T) {
})
// run a converge
- w.converge()
+ w.Converge()
w.convergeWG.Wait()
if _, ok := (<-puppetFinished); ok {
diff --git a/terraform/amazon/modules/bastion/bastion.tf b/terraform/amazon/modules/bastion/bastion.tf
index 5ea49128be..4fb7cf323d 100644
--- a/terraform/amazon/modules/bastion/bastion.tf
+++ b/terraform/amazon/modules/bastion/bastion.tf
@@ -3,6 +3,9 @@ data "template_file" "bastion_user_data" {
vars {
fqdn = "bastion.${var.public_zone}"
+
+ wing_binary_path = "${var.secrets_bucket}/${data.template_file.stack_name.rendered}/${var.wing_binary_path}"
+ wing_version = "${var.wing_version}"
}
}
diff --git a/terraform/amazon/modules/bastion/bastion_iam.tf b/terraform/amazon/modules/bastion/bastion_iam.tf
index f622907eab..068b328802 100644
--- a/terraform/amazon/modules/bastion/bastion_iam.tf
+++ b/terraform/amazon/modules/bastion/bastion_iam.tf
@@ -17,3 +17,23 @@ resource "aws_iam_policy_attachment" "bastion_additional_policy" {
count = "${length(var.bastion_iam_additional_policy_arns)}"
policy_arn = "${element(var.bastion_iam_additional_policy_arns, count.index)}"
}
+
+data "template_file" "wing_binary_read" {
+ template = "${file("${path.module}/templates/wing_binary_read.json")}"
+
+ vars {
+ wing_binary_path = "${var.secrets_bucket}/${data.template_file.stack_name.rendered}/wing-*"
+ }
+}
+
+resource "aws_iam_policy" "wing_binary_read" {
+ name = "bastion.${data.template_file.stack_name.rendered}.wing_binary_read"
+ path = "/"
+ policy = "${data.template_file.wing_binary_read.rendered}"
+}
+
+resource "aws_iam_policy_attachment" "wing_binary_read" {
+ name = "${data.template_file.stack_name.rendered}-wing-binary"
+ roles = ["${aws_iam_role.bastion.name}"]
+ policy_arn = "${aws_iam_policy.wing_binary_read.arn}"
+}
diff --git a/terraform/amazon/modules/bastion/inputs.tf b/terraform/amazon/modules/bastion/inputs.tf
index 43ec1d79ec..96c8897621 100644
--- a/terraform/amazon/modules/bastion/inputs.tf
+++ b/terraform/amazon/modules/bastion/inputs.tf
@@ -36,3 +36,5 @@ variable "private_zone_id" {}
variable "bastion_iam_additional_policy_arns" {
type = "list"
}
+
+variable "secrets_bucket" {}
diff --git a/terraform/amazon/modules/bastion/templates/wing_binary_read.json b/terraform/amazon/modules/bastion/templates/wing_binary_read.json
new file mode 100644
index 0000000000..20dc764ac8
--- /dev/null
+++ b/terraform/amazon/modules/bastion/templates/wing_binary_read.json
@@ -0,0 +1,15 @@
+{
+ "Statement": [
+ {
+ "Action": [
+ "s3:GetObject",
+ "s3:HeadObjectAcl"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ "arn:aws:s3:::${wing_binary_path}"
+ ]
+ }
+ ],
+ "Version": "2012-10-17"
+}
diff --git a/terraform/amazon/modules/bastion/templates/bastion_user_data.yaml b/terraform/amazon/templates/bastion_user_data.yaml.template
similarity index 94%
rename from terraform/amazon/modules/bastion/templates/bastion_user_data.yaml
rename to terraform/amazon/templates/bastion_user_data.yaml.template
index 1885692c94..c8fa042abf 100644
--- a/terraform/amazon/modules/bastion/templates/bastion_user_data.yaml
+++ b/terraform/amazon/templates/bastion_user_data.yaml.template
@@ -56,13 +56,17 @@ write_files:
Requires=etcd.service
[Service]
- Environment=AIRWORTHY_VERSION=0.2.0
- Environment=AIRWORTHY_HASH=2d69cfe0b92f86481805c28d0b8ae47a8ffa6bb2373217e7c5215d61fc9efa1d
- Environment=WING_VERSION=0.5.3
- Environment=WING_DATA_DIR=/var/lib/wing
PermissionsStartOnly=true
Restart=on-failure
RestartSec=10
+ Environment=WING_DATA_DIR=/var/lib/wing
+{{- if .WingDevMode }}
+ Environment=WING_VERSION="${wing_version}"
+ ExecStartPre=/bin/sh -c 'aws s3 cp "s3://${wing_binary_path}" /opt/wing-$${WING_VERSION}/wing; chmod 0755 /opt/wing-$${WING_VERSION}/wing'
+{{- else }}
+ Environment=AIRWORTHY_VERSION=0.2.0
+ Environment=AIRWORTHY_HASH=2d69cfe0b92f86481805c28d0b8ae47a8ffa6bb2373217e7c5215d61fc9efa1d
+ Environment=WING_VERSION=0.5.3
ExecStartPre=/bin/sh -c '\
set -e ;\
test -x /opt/wing-$${WING_VERSION}/wing && exit 0 ;\
@@ -73,6 +77,7 @@ write_files:
chmod 755 /opt/airworthy-$${AIRWORTHY_VERSION}/airworthy ;\
fi ;\
/opt/airworthy-$${AIRWORTHY_VERSION}/airworthy download --output /opt/wing-$${WING_VERSION}/wing --sha256sums https://github.com/jetstack/tarmak/releases/download/$${WING_VERSION}/tarmak_$${WING_VERSION}_checksums.txt --signature-armored https://github.com/jetstack/tarmak/releases/download/$${WING_VERSION}/tarmak_$${WING_VERSION}_checksums.txt.asc https://github.com/jetstack/tarmak/releases/download/$${WING_VERSION}/wing_$${WING_VERSION}_linux_amd64'
+{{- end }}
ExecStartPre=/bin/sh -c '\
set -e ;\
test -d $${WING_DATA_DIR} && exit 0 ;\
diff --git a/terraform/amazon/templates/modules.tf.template b/terraform/amazon/templates/modules.tf.template
index 91acbfd66d..e422d653b9 100644
--- a/terraform/amazon/templates/modules.tf.template
+++ b/terraform/amazon/templates/modules.tf.template
@@ -68,6 +68,7 @@ module "bastion" {
bastion_admin_cidrs = ["${var.bastion_admin_cidrs}"]
public_zone_id = "${module.state.public_zone_id}"
private_zone_id = "${module.network.private_zone_id[0]}"
+ secrets_bucket = "${module.state.secrets_bucket[0]}"
bastion_min_instance_count = "${var.bastion_min_instance_count}"
bastion_iam_additional_policy_arns = ["${var.bastion_iam_additional_policy_arns}"]
@@ -183,7 +184,6 @@ module "kubernetes" {
public_zone_id = "${module.state.public_zone_id}"
vault_security_group_id = "${module.vault.vault_security_group_id}"
bastion_security_group_id = "${module.bastion.bastion_security_group_id}"
- backups_bucket = "${module.state.backups_bucket[0]}"
elb_access_logs_public_enabled = "${var.elb_access_logs_public_enabled}"
elb_access_logs_public_bucket = "${var.elb_access_logs_public_bucket}"
@@ -193,6 +193,8 @@ module "kubernetes" {
elb_access_logs_internal_bucket = "${var.elb_access_logs_internal_bucket}"
elb_access_logs_internal_bucket_prefix = "${var.elb_access_logs_internal_bucket_prefix}"
elb_access_logs_internal_bucket_interval = "${var.elb_access_logs_internal_bucket_interval}"
+
+ backups_bucket = "${module.state.backups_bucket[0]}"
}
{{- end -}}
@@ -249,7 +251,6 @@ module "kubernetes" {
vault_ca = "${data.terraform_remote_state.hub_state.vault_vault_ca}"
vault_url = "${data.terraform_remote_state.hub_state.vault_vault_url}"
vault_security_group_id = "${data.terraform_remote_state.hub_state.vault_vault_security_group_id}"
- backups_bucket = "${data.terraform_remote_state.hub_state.state_backups_bucket[0]}"
elb_access_logs_public_enabled = "${var.elb_access_logs_public_enabled}"
elb_access_logs_public_bucket = "${var.elb_access_logs_public_bucket}"
@@ -259,5 +260,7 @@ module "kubernetes" {
elb_access_logs_internal_bucket = "${var.elb_access_logs_internal_bucket}"
elb_access_logs_internal_bucket_prefix = "${var.elb_access_logs_internal_bucket_prefix}"
elb_access_logs_internal_bucket_interval = "${var.elb_access_logs_internal_bucket_interval}"
+
+ backups_bucket = "${data.terraform_remote_state.hub_state.state_backups_bucket[0]}"
}
{{- end }}
diff --git a/terraform/amazon/templates/puppet_agent_user_data.yaml.template b/terraform/amazon/templates/puppet_agent_user_data.yaml.template
index 36452555bd..a65e540e30 100644
--- a/terraform/amazon/templates/puppet_agent_user_data.yaml.template
+++ b/terraform/amazon/templates/puppet_agent_user_data.yaml.template
@@ -38,7 +38,7 @@ write_files:
{{- end }}
ExecStart=/bin/sh -c '\
set -e ;\
- exec /opt/wing-$${WING_VERSION}/wing agent --manifest-url "s3://${legacy_puppet_manifest}" --cluster-name "${tarmak_cluster}" --instance-name "$$(curl --silent --retry 5 http://169.254.169.254/latest/meta-data/instance-id || echo "unknown")" --server-url "https://bastion.${tarmak_environment}.${tarmak_dns_root}:9443"'
+ exec /opt/wing-$${WING_VERSION}/wing agent --manifest-url "s3://${legacy_puppet_manifest}" --cluster-name "${tarmak_cluster}" --instance-name "$$(curl --silent --retry 5 http://169.254.169.254/latest/meta-data/instance-id || echo "unknown")" --server-url "https://bastion.${tarmak_environment}.${tarmak_dns_root}:9443" --pool "${tarmak_instance_pool}"'
[Install]
WantedBy=multi-user.target