Skip to content

Commit

Permalink
Update cluster-api release-0.1 vendor
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <[email protected]>
  • Loading branch information
vincepri committed May 2, 2019
1 parent a0289c5 commit 60cc408
Show file tree
Hide file tree
Showing 66 changed files with 1,566 additions and 202 deletions.
12 changes: 10 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cmd/clusterctl/examples/aws/generate-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ MACHINES_TEMPLATE_FILE=${DIR}/machines.yaml.template
MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines.yaml
HA_MACHINES_TEMPLATE_FILE=${DIR}/machines-ha.yaml.template
HA_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines-ha.yaml
DEPLOYMENT_MACHINES_TEMPLATE_FILE=${DIR}/machine-deployment.yaml.template
DEPLOYMENT_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machine-deployment.yaml
ADDONS_FILE=${OUTPUT_DIR}/addons.yaml
PROVIDER_COMPONENTS_SRC=${DIR}/provider-components-base.yaml
PROVIDER_COMPONENTS_FILE=${OUTPUT_DIR}/provider-components.yaml
Expand Down Expand Up @@ -106,6 +108,9 @@ echo "Done generating ${MACHINES_GENERATED_FILE}"
$ENVSUBST < $HA_MACHINES_TEMPLATE_FILE > "${HA_MACHINES_GENERATED_FILE}"
echo "Done generating ${HA_MACHINES_GENERATED_FILE}"

$ENVSUBST < $DEPLOYMENT_MACHINES_TEMPLATE_FILE > "${DEPLOYMENT_MACHINES_GENERATED_FILE}"
echo "Done generating ${DEPLOYMENT_MACHINES_GENERATED_FILE}"

cp ${DIR}/addons.yaml ${ADDONS_FILE}
echo "Done copying ${ADDONS_FILE}"

Expand Down
27 changes: 27 additions & 0 deletions cmd/clusterctl/examples/aws/machine-deployment.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: "cluster.k8s.io/v1alpha1"
kind: MachineDeployment
metadata:
name: sample-machinedeployment
labels:
cluster.k8s.io/cluster-name: ${CLUSTER_NAME}
spec:
replicas: 1
selector:
matchLabels:
cluster.k8s.io/cluster-name: ${CLUSTER_NAME}
set: node
template:
metadata:
labels:
cluster.k8s.io/cluster-name: ${CLUSTER_NAME}
set: node
spec:
versions:
kubelet: v1.13.5
providerSpec:
value:
apiVersion: awsprovider/v1alpha1
kind: AWSMachineProviderSpec
instanceType: "${NODE_MACHINE_TYPE}"
iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io"
keyName: "${SSH_KEY_NAME}"
17 changes: 0 additions & 17 deletions cmd/clusterctl/examples/aws/machines-ha.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,3 @@ items:
instanceType: "${CONTROL_PLANE_MACHINE_TYPE}"
iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io"
keyName: "${SSH_KEY_NAME}"
- apiVersion: "cluster.k8s.io/v1alpha1"
kind: Machine
metadata:
generateName: node-
labels:
cluster.k8s.io/cluster-name: ${CLUSTER_NAME}
set: node
spec:
versions:
kubelet: v1.13.5
providerSpec:
value:
apiVersion: awsprovider/v1alpha1
kind: AWSMachineProviderSpec
instanceType: "${NODE_MACHINE_TYPE}"
iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io"
keyName: "${SSH_KEY_NAME}"
19 changes: 14 additions & 5 deletions pkg/cloud/aws/services/ec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package ec2
import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"strings"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
Expand Down Expand Up @@ -437,13 +439,20 @@ func (s *Service) runInstance(role string, i *v1alpha1.Instance) (*v1alpha1.Inst
return nil, errors.Errorf("no instance returned for reservation %v", out.GoString())
}

s.scope.V(2).Info("Waiting for instance to run", "instance-id", *out.Instances[0].InstanceId)
err = s.scope.EC2.WaitUntilInstanceRunningWithContext(
aws.BackgroundContext(),
waitTimeout := 1 * time.Minute
s.scope.V(2).Info("Waiting for instance to be in running state", "instance-id", *out.Instances[0].InstanceId, "timeout", waitTimeout.String())
ctx, cancel := context.WithTimeout(aws.BackgroundContext(), waitTimeout)
defer cancel()

if err := s.scope.EC2.WaitUntilInstanceRunningWithContext(
ctx,
&ec2.DescribeInstancesInput{InstanceIds: []*string{out.Instances[0].InstanceId}},
request.WithWaiterLogger(&awslog{s.scope.Logger}),
)
return converters.SDKToInstance(out.Instances[0]), err
); err != nil {
s.scope.V(2).Info("Could not determine if Machine is running. Machine state might be unavailable until next renconciliation.")
}

return converters.SDKToInstance(out.Instances[0]), nil
}

// An internal type to satisfy aws' log interface.
Expand Down
202 changes: 202 additions & 0 deletions vendor/k8s.io/component-base/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions vendor/k8s.io/component-base/cli/flag/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 60cc408

Please sign in to comment.