Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #142 from danmx/deprecated
Browse files Browse the repository at this point in the history
chore: Deprecating old name tag target reference and updating to Go 1.15
  • Loading branch information
danmx authored Aug 16, 2020
2 parents 53f6ace + b674c43 commit 35c8410
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 48 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<a name="unreleased"></a>
## [Unreleased]


<a name="0.6.0"></a>
## [0.6.0] - 2020-08-16
### Aws
- customizing default retryer for AWS api calls

### Chore
- removing deprecated name tag reference
- **deps:** update Go to 1.15
- **deps:** bumping Go and tidying dependecies
- **deps:** update module aws/aws-sdk-go to v1.34.2
- **deps:** update dependency io_bazel_rules_go to v0.23.7
Expand Down Expand Up @@ -198,7 +203,8 @@
<a name="0.0.1"></a>
## 0.0.1 - 2019-03-18

[Unreleased]: https://github.com/danmx/sigil/compare/0.5.3...HEAD
[Unreleased]: https://github.com/danmx/sigil/compare/0.6.0...HEAD
[0.6.0]: https://github.com/danmx/sigil/compare/0.5.3...0.6.0
[0.5.3]: https://github.com/danmx/sigil/compare/0.5.2...0.5.3
[0.5.2]: https://github.com/danmx/sigil/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/danmx/sigil/compare/0.5.0...0.5.1
Expand Down
8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file"
# Golang
http_archive(
name = "io_bazel_rules_go",
sha256 = "0310e837aed522875791750de44408ec91046c630374990edd51827cb169f616",
sha256 = "2697f6bc7c529ee5e6a2d9799870b9ec9eaeb3ee7d70ed50b87a2c2c97e13d9e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.7/rules_go-v0.23.7.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.7/rules_go-v0.23.7.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.8/rules_go-v0.23.8.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.23.8/rules_go-v0.23.8.tar.gz",
],
)

Expand All @@ -21,7 +21,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
go_rules_dependencies()

go_register_toolchains(
go_version = "1.14.7",
go_version = "1.15",
)

# gazelle
Expand Down
2 changes: 1 addition & 1 deletion cmd/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ func init() {
rootCmd.AddCommand(sessionCmd)

sessionCmd.Flags().String("target", "", "specify the target depending on the type")
sessionCmd.Flags().String("type", aws.TargetTypeInstanceID, fmt.Sprintf("specify target type: %s/%s/%s/%s (deprecated)", aws.TargetTypeInstanceID, aws.TargetTypePrivateDNS, aws.TargetTypeName, aws.DeprecatedTargetTypeName))
sessionCmd.Flags().String("type", aws.TargetTypeInstanceID, fmt.Sprintf("specify target type: %s/%s/%s", aws.TargetTypeInstanceID, aws.TargetTypePrivateDNS, aws.TargetTypeName))
}
2 changes: 1 addition & 1 deletion cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func init() {
rootCmd.AddCommand(sshCmd)

sshCmd.Flags().String("target", "", "specify the target depending on the type")
sshCmd.Flags().String("type", aws.TargetTypeInstanceID, fmt.Sprintf("specify target type: %s/%s/%s/%s (deprecated)", aws.TargetTypeInstanceID, aws.TargetTypePrivateDNS, aws.TargetTypeName, aws.DeprecatedTargetTypeName))
sshCmd.Flags().String("type", aws.TargetTypeInstanceID, fmt.Sprintf("specify target type: %s/%s/%s", aws.TargetTypeInstanceID, aws.TargetTypePrivateDNS, aws.TargetTypeName))
sshCmd.Flags().Bool("gen-key-pair", false, fmt.Sprintf("generate a temporary key pair that will be send and used. By default use %s as an identity file", path.Join(workDir, tempKeyName)))
sshCmd.Flags().String("gen-key-dir", workDir, "the directory where temporary keys will be generated")
sshCmd.Flags().String("os-user", "ec2-user", "specify an instance OS user which will be using sent public key")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/danmx/sigil

go 1.14
go 1.15

require (
github.com/aws/aws-sdk-go v1.34.2
Expand Down
13 changes: 0 additions & 13 deletions pkg/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ const (
TargetTypePrivateDNS = "private-dns"
// TargetTypeName points to a name type
TargetTypeName = "name"
// DeprecatedTargetTypeName points to a name type
DeprecatedTargetTypeName = "name-tag"
)

// NewWithConfig will generate an AWS Provider with given configuration
Expand Down Expand Up @@ -206,17 +204,6 @@ func (p *Provider) getInstance(targetType, target string) (*ec2.Instance, error)
Values: []*string{aws.String("running")},
},
}
case DeprecatedTargetTypeName:
filters = []*ec2.Filter{
{
Name: aws.String("tag:Name"),
Values: []*string{&target},
},
{
Name: aws.String("instance-state-name"),
Values: []*string{aws.String("running")},
},
}
default:
log.WithFields(log.Fields{
"target": target,
Expand Down
12 changes: 0 additions & 12 deletions pkg/session/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,4 @@ func TestStart(t *testing.T) {
m.EXPECT().StartSession(gomock.Eq(*input.TargetType), gomock.Eq(*input.Target)).Return(nil),
)
assert.NoError(t, input.start(m))
// Deprecated Name
targetType = aws.DeprecatedTargetTypeName
gomock.InOrder(
m.EXPECT().NewWithConfig(gomock.Eq(&aws.Config{
Region: *input.Region,
Profile: *input.Profile,
MFAToken: *input.MFAToken,
Trace: *input.Trace,
})).Return(nil),
m.EXPECT().StartSession(gomock.Eq(*input.TargetType), gomock.Eq(*input.Target)).Return(nil),
)
assert.NoError(t, input.start(m))
}
15 changes: 0 additions & 15 deletions pkg/ssh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,6 @@ func TestStart(t *testing.T) {

assert.NoError(t, input.start(m))

// Deprecated Name
targetType = aws.DeprecatedTargetTypeName
input = StartInput{
MFAToken: &mfa,
Region: &region,
Profile: &profile,
Target: &target,
TargetType: &targetType,
PortNumber: &port,
PublicKey: &pubKey,
OSUser: &osUser,
GenKeyPair: &genKey,
Trace: &trace,
}

gomock.InOrder(
m.EXPECT().NewWithConfig(gomock.Eq(&aws.Config{
Region: *input.Region,
Expand Down

0 comments on commit 35c8410

Please sign in to comment.