Skip to content

Commit

Permalink
Merge tag 'v0.9.0' into amazonlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
alauto committed Sep 18, 2024
2 parents 369df8e + bef5bd9 commit fe0d8be
Show file tree
Hide file tree
Showing 729 changed files with 49,090 additions and 24,485 deletions.
1 change: 1 addition & 0 deletions .codebuild/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ phases:
install:
commands:
- chmod +x -R scripts
- ./scripts/container_init.sh
- ./scripts/hack/codepipeline-git-commit.sh
- ./scripts/hack/symlink-gopath-codebuild.sh
- cd /go/src/github.com/awslabs/amazon-ecr-credential-helper
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/third_party_license_usage_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 3rd Party License Request
description: File a request for usage of a 3rd party license in the Amazon ECR credential helpers project.
title: "[3rd Party License Request]: "
labels: "license-request"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this request!
- type: textarea
id: license-request
attributes:
label: License request
value: |
License: <link to license>
- type: textarea
id: use-case
attributes:
label: Use case
description: |
Briefly describe the use case the dependency would resolve.
validations:
required: true

- type: textarea
id: other-solutions
attributes:
label: Other solutions considered
24 changes: 21 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /ecr-login
# Dependencies listed in ecr-login/go.mod
- package-ecosystem: "gomod"
directory: "/ecr-login"
schedule:
interval: daily
interval: "daily"
groups:
# Group updates from github.com/aws/aws-sdk-go-v2 dependencies
aws-sdk-go-v2:
patterns:
- "github.com/aws/aws-sdk-go-v2/*"

# Dependencies listed in .github/workflows/*.yml
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

# Base image in Dockerfile
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
8 changes: 8 additions & 0 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Fail third party dependency usage if not covered by the curated set of pre-approved licenses.
#
# List was generated from guidance set forth by Amazon open source usage policies.
allow-licenses:
- 'Apache-2.0'
- 'BSD-3-Clause'
- 'ISC'
- 'MIT'
23 changes: 23 additions & 0 deletions .github/new-pull-request-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aws_partition_change:
- changed-files:
- any-glob-to-any-file: ['ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.*']

dependencies:
- changed-files:
- any-glob-to-any-file: ['**/go.mod', '**/go.sum']

documentation:
- changed-files:
- all-globs-to-all-files: ['**/*.md']

github_actions:
- changed-files:
- any-glob-to-any-file: ['.github/**', 'scripts/**']

go:
- changed-files:
- any-glob-to-any-file: ['**/*.go']

testing:
- changed-files:
- any-glob-to-any-file: ['integration/**', '**/*_test.go']
50 changes: 32 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,49 @@ on:
branches: [ main, amazonlinux ]

jobs:
build:
git-secrets:
runs-on: 'ubuntu-22.04'
steps:
- name: Pull latest awslabs/git-secrets repo
uses: actions/checkout@v4
with:
repository: awslabs/git-secrets
ref: 1.3.0
fetch-tags: true
path: git-secrets
- name: Install git secrets from source
run: sudo make install
working-directory: git-secrets
- uses: actions/checkout@v4
- name: Scan repository for git secrets
run: |
git secrets --register-aws
git secrets --scan-history
cross-compile:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
- name: Cross-compile all variants
run: make all-variants-in-docker

unit-test:
strategy:
matrix:
go: ['1.15', '1.16', '1.17', '1.18']
go: ['1.21', '1.22']

# Intentionally use specific versions instead of "latest" to
# make this build reproducible.
os: ['ubuntu-22.04', 'macos-12']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']

# Build all variants regardless of failures
fail-fast: false
name: ${{ matrix.os }} / Go ${{ matrix.go }}
name: unit-test (${{ matrix.os }} / Go ${{ matrix.go }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: make get-deps
if: ${{ matrix.go >= '1.17' }}

# Apple Silicon is not supported by Go < 1.16.
# https://go.dev/blog/go1.16
- name: Cross-compile all variants
run: make all-variants
if: ${{ matrix.go >= '1.16' }}
- name: Cross-compile all variants except for Apple Silicon
run: make linux-amd64 linux-arm64 darwin-amd64 windows-amd64
if: ${{ matrix.go < '1.16' }}

- run: make test
24 changes: 24 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check Links

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 3" # Every Wednesday at 00:00 UTC
pull_request:
paths:
- ".github/workflows/check-links.yml"

jobs:
check:
runs-on: ubuntu-22.04
if: github.repository == 'awslabs/amazon-ecr-credential-helper'
name: lychee
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: lycheeverse/[email protected]
with:
fail: true
args: --exclude-path ecr-login/vendor --timeout 30 --no-progress './**/*.md'
format: markdown
jobSummary: true
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Build
run: make build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

27 changes: 27 additions & 0 deletions .github/workflows/new-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "New Pull Requests"

on:
# It is safe to use pull_request_target here because we are not checking out
# code from the pull request branch.
#
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
pull_request_target:

permissions:
contents: read

jobs:
label:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04

permissions:
pull-requests: write

steps:
# Use label configuration from main instead of from the pull request branch
# to mitigate running untrusted workflows with write permissions.
- uses: actions/labeler@v5
with:
configuration-path: '.github/new-pull-request-labels.yml'
sync-labels: true
24 changes: 24 additions & 0 deletions .github/workflows/review-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Review dependencies

on:
pull_request:
branches: ['main', 'release/**']
paths:
- 'ecr-login/go.*'

jobs:
review:
runs-on: ubuntu-latest

permissions:
# Write permissions needed to comment review results on PR.
# Pwn request risk mitigated by using pull_request workflow trigger
# and external contributor workflow runs require maintainer approval.
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: actions/dependency-review-action@v4
with:
config-file: './.github/dependency-review-config.yml'
comment-summary-in-pr: always
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.9.0
* Enhancement - Added support for environment variable `AWS_ECR_IGNORE_CREDS_STORAGE=true` to ignore ADD and DELETE requests. This makes tools that try to `docker login` work with registries managed the amazon-ecr-credential-helper. ([#102](https://github.com/awslabs/amazon-ecr-credential-helper/issues/102) and [#847](https://github.com/awslabs/amazon-ecr-credential-helper/pull/847))
* Enhancement - Updated ECR pattern for new isolated regions. ([#850](https://github.com/awslabs/amazon-ecr-credential-helper/pull/850))
* Upgraded dependencies.

# 0.8.0
* Enhancement - Updated ECR pattern to match C2S environments. ([#433](https://github.com/awslabs/amazon-ecr-credential-helper/issues/433))
* Feature (Experimental) - Added support for building Windows ARM credential helper binaries. ([#795](https://github.com/awslabs/amazon-ecr-credential-helper/issues/795))

# 0.7.1

**Note: v0.7.1 is functionally equivalent to v0.7.0. We have decided to create a duplicate release to reflect a more accurate changelog, since our v0.7.0 release did not contain
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

FROM golang:1.15
FROM public.ecr.aws/docker/library/golang:1.23-alpine

WORKDIR /go/src/github.com/awslabs/amazon-ecr-credential-helper

COPY . .
COPY ./scripts/container_init.sh /setup/container_init.sh

RUN /setup/container_init.sh

CMD make
Loading

0 comments on commit fe0d8be

Please sign in to comment.