Skip to content

Commit

Permalink
Merge pull request #14 from duplocloud/release/0.5.1
Browse files Browse the repository at this point in the history
Release v0.5.1
  • Loading branch information
joek-duplo authored Feb 24, 2023
2 parents 8514ba9 + 3b6e84c commit 0c59c75
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 33 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/dev-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,35 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
-
name: Run linting
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
only-new-issues: true # Only show new issues for pull requests.
format:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.17
-
name: Run formatting
run: gofmt -s -w duplocloud cmd/duplo-aws-credential-process
-
name: Check if formatting changed
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >>$GITHUB_OUTPUT
-
name: Commit formatting changes
if: steps.git-check.outputs.modified == 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.17
-
name: Run tests
run: make test
3 changes: 3 additions & 0 deletions .github/workflows/finish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
uses: actions/checkout@v3
with:
ref: develop
fetch-depth: 0
persist-credentials: false # Needed so we can push with different credentials.
# NOTE: Pushing with different credentials allows admins to push protected branches.

# BUMP THE DEVELOPMENT VERSION
- name: Initialize mandatory git config
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
# -
# name: Run tests
# run: make test
go-version: 1.17
-
name: Run tests
run: make test
-
name: Build and draft the release
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --parallelism 2 --rm-dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/start-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
# Use the current version if it is not being overridden
if [ -z "${{ github.event.inputs.version }}" ]; then
echo "::set-output name=release::$(sed -ne 's/^VERSION=\([0-9\.]*\).*$/\1/p' <Makefile)"
echo "release=$(sed -ne 's/^VERSION=\([0-9\.]*\).*$/\1/p' <Makefile)" >>$GITHUB_OUTPUT
# Otherwise, the use the overridden version.
else
echo "::set-output name=release::${{ github.event.inputs.version }}"
echo "release=${{ github.event.inputs.version }}" >>$GITHUB_OUTPUT
fi
# START THE RELEASE
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.5.0
VERSION=0.5.1

default: all

Expand Down
8 changes: 4 additions & 4 deletions cmd/duplo-aws-credential-process/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ func main() {
if len(*tenantID) < 32 {
var err error
tenant, err := client.GetTenantByNameForUser(*tenantID)
if tenant == nil {
err = errors.New("no such tenant available to your user")
if tenant == nil || err != nil {
internal.Fatal(fmt.Sprintf("%s: tenant missing or not allowed", *tenantID), err)
} else {
tenantID = &tenant.TenantID
}
internal.DieIf(err, fmt.Sprintf("%s: tenant not found", *tenantID))
tenantID = &tenant.TenantID
}

// Tenant: Get the JIT AWS credentials
Expand Down
21 changes: 12 additions & 9 deletions cmd/duplo-jit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ func main() {
}

// Parse command-line arguments.
flag.CommandLine.Parse(os.Args[2:])
if err := flag.CommandLine.Parse(os.Args[2:]); err != nil {
fmt.Printf("%s: %s\n", os.Args[0], err.Error())
os.Exit(1)
}

// Refuse to call APIs over anything but https://
// Trim a trailing slash.
Expand Down Expand Up @@ -145,11 +148,11 @@ func main() {
if len(*tenantID) < 32 {
var err error
tenant, err := client.GetTenantByNameForUser(*tenantID)
if tenant == nil {
err = errors.New("no such tenant available to your user")
if tenant == nil || err != nil {
internal.Fatal(fmt.Sprintf("%s: tenant missing or not allowed", *tenantID), err)
} else {
tenantID = &tenant.TenantID
}
internal.DieIf(err, fmt.Sprintf("%s: tenant not found", *tenantID))
tenantID = &tenant.TenantID
}

// Tenant: Get the JIT AWS credentials
Expand Down Expand Up @@ -206,11 +209,11 @@ func main() {
if len(*tenantID) < 32 {
var err error
tenant, err := client.GetTenantByNameForUser(*tenantID)
if tenant == nil {
err = errors.New("no such tenant available to your user")
if tenant == nil || err != nil {
internal.Fatal(fmt.Sprintf("%s: tenant missing or not allowed", *tenantID), err)
} else {
tenantID = &tenant.TenantID
}
internal.DieIf(err, fmt.Sprintf("%s: tenant not found", *tenantID))
tenantID = &tenant.TenantID
}

// Tenant: Get the JIT AWS credentials
Expand Down
20 changes: 19 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
module github.com/duplocloud/duplo-jit

go 1.16
go 1.17

require (
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
k8s.io/apimachinery v0.23.16
k8s.io/client-go v0.23.16
)

require (
github.com/go-logr/logr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
golang.org/x/text v0.5.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)

0 comments on commit 0c59c75

Please sign in to comment.