Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AWS sdk, improve log in machine actuator #747

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gopkg.lock

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

10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ binaries-dev: ## Builds and installs all development binaries using go get

.PHONY: create-cluster
create-cluster: binaries-dev ## Create a development Kubernetes cluster on AWS using examples
clusterctl create cluster -v 4 \
--provider aws \
--bootstrap-type kind \
-m ./cmd/clusterctl/examples/aws/out/machines.yaml \
-c ./cmd/clusterctl/examples/aws/out/cluster.yaml \
-p ./cmd/clusterctl/examples/aws/out/provider-components.yaml \
-a ./cmd/clusterctl/examples/aws/out/addons.yaml

.PHONY: create-cluster-ha
create-cluste-ha: binaries-dev ## Create a development Kubernetes cluster on AWS using HA examples
clusterctl create cluster -v 4 \
--provider aws \
--bootstrap-type kind \
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/aws/actuators/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machi
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html
switch instance.State {
case v1alpha1.InstanceStateShuttingDown, v1alpha1.InstanceStateTerminated:
a.log.Info("Machine instance is shutting down or already terminated", "machine-name", machine.Name, "machine-namespace", machine.Namespace)
a.log.Info("Machine instance is shutting down or already terminated")
return nil
default:
a.log.Info("Terminating machine")
if err := ec2svc.TerminateInstance(instance.ID); err != nil {
return errors.Errorf("failed to terminate instance: %+v", err)
}
}

a.log.Info("Shutdown signal was sent. Shutting down machine.")
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/aws/services/ec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (

// InstanceByTags returns the existing instance or nothing if it doesn't exist.
func (s *Service) InstanceByTags(machine *actuators.MachineScope) (*v1alpha1.Instance, error) {
s.scope.V(2).Info("Looking for existing machine instance")
s.scope.V(2).Info("Looking for existing machine instance by tags")

input := &ec2.DescribeInstancesInput{
Filters: []*ec2.Filter{
Expand Down Expand Up @@ -79,7 +79,7 @@ func (s *Service) InstanceIfExists(id *string) (*v1alpha1.Instance, error) {
return nil, nil
}

s.scope.V(2).Info("Looking for instance", "instance-id", *id)
s.scope.V(2).Info("Looking for instance by id", "instance-id", *id)

input := &ec2.DescribeInstancesInput{
InstanceIds: []*string{id},
Expand Down
1,660 changes: 1,647 additions & 13 deletions pkg/cloud/aws/services/ec2/mock_ec2iface/ec2api_mock.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/github.com/aws/aws-sdk-go/NOTICE.txt

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

2 changes: 1 addition & 1 deletion vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go

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

6 changes: 6 additions & 0 deletions vendor/github.com/aws/aws-sdk-go/aws/client/logger.go

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

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

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

9 changes: 6 additions & 3 deletions vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go

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

3 changes: 3 additions & 0 deletions vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go

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

Loading