Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws-controllers-k8s/code-generator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.19.3
Choose a base ref
...
head repository: aws-controllers-k8s/code-generator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.20.0
Choose a head ref
  • 3 commits
  • 6 files changed
  • 3 contributors

Commits on Jul 28, 2022

  1. Remove faulty suffix trim from Helm deployment (#357)

    Description of changes:
    Removes a suffix trim character from the Helm deployment template. This trim was causing the string to concatenate with the next line and create an error. Removing this ensures it stays as a separate line if the `priorityClassName` is specified.
    
    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
    RedbackThomson authored Jul 28, 2022
    Copy the full SHA
    fe61d04 View commit details

Commits on Aug 20, 2022

  1. Helm install check (#359)

    Issue #, if available:  aws-controllers-k8s/community#1436
    
    Description of changes:
    - Add helm version check function
    - Add helm installation helper script
    - Modify k8s_controller_gen_version_equals function and its comment
    
    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
    kskzk authored Aug 20, 2022
    Copy the full SHA
    cdb0d99 View commit details

Commits on Sep 2, 2022

  1. Upgrade ACK runtime to v0.20.0 (#360)

    Issue #, if available:
    
    Description of changes:
    - Upgrade ACK runtime to v0.20.0
    
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache 2.0 license.
    a-hilaly authored Sep 2, 2022
    Copy the full SHA
    585f06b View commit details
Showing with 52 additions and 8 deletions.
  1. +1 −1 go.mod
  2. +2 −2 go.sum
  3. +6 −0 scripts/build-controller-release.sh
  4. +21 −0 scripts/install-helm.sh
  5. +21 −4 scripts/lib/common.sh
  6. +1 −1 templates/helm/templates/deployment.yaml
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/code-generator
go 1.17

require (
github.com/aws-controllers-k8s/runtime v0.19.3
github.com/aws-controllers-k8s/runtime v0.20.0
github.com/aws/aws-sdk-go v1.42.0
github.com/dlclark/regexp2 v1.4.0
// pin to v0.1.1 due to release problem with v0.1.2
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -90,8 +90,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws-controllers-k8s/runtime v0.19.3 h1:difFG8eFrQuIZb+FGEKMLrGlhY/QwKq++W33oMg+c3Q=
github.com/aws-controllers-k8s/runtime v0.19.3/go.mod h1:oA8ML1/LL3chPn26P6SzBNu1CUI2nekB+PTqykNs0qU=
github.com/aws-controllers-k8s/runtime v0.20.0 h1:W91KYhjc+AvMhxguJTs3P5ZbkI6DUDzLdhL9pMjBxZE=
github.com/aws-controllers-k8s/runtime v0.20.0/go.mod h1:oA8ML1/LL3chPn26P6SzBNu1CUI2nekB+PTqykNs0qU=
github.com/aws/aws-sdk-go v1.42.0 h1:BMZws0t8NAhHFsfnT3B40IwD13jVDG5KerlRksctVIw=
github.com/aws/aws-sdk-go v1.42.0/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
6 changes: 6 additions & 0 deletions scripts/build-controller-release.sh
Original file line number Diff line number Diff line change
@@ -25,6 +25,12 @@ if ! k8s_controller_gen_version_equals "$CONTROLLER_TOOLS_VERSION"; then
exit 1
fi

if ! helm_version_equals_or_greater "$HELM_VERSION"; then
echo "FATAL: Existing version of helm "`helm version --template='Version: {{.Version}}'`", required version is $HELM_VERSION."
echo "FATAL: Please update helm, or uninstall helm and install the required version with scripts/install-helm.sh."
exit 1
fi

ACK_GENERATE_CACHE_DIR=${ACK_GENERATE_CACHE_DIR:-"$HOME/.cache/aws-controllers-k8s"}
# The ack-generate code generator is in a separate source code repository,
# typically at $GOPATH/src/github.com/aws-controllers-k8s/code-generator
21 changes: 21 additions & 0 deletions scripts/install-helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# ./scripts/install-helm.sh
#
# Installs the latest version helm if not installed.
#
# NOTE: helm will be installed to /usr/local/bin/helm

set -eo pipefail

SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ROOT_DIR="$SCRIPTS_DIR/.."

source "$SCRIPTS_DIR/lib/common.sh"

if ! is_installed helm ; then
__helm_url="https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3"
echo -n "installing helm from $__helm_url ... "
curl --silent "$__helm_url" | bash 1>/dev/null
echo "ok."
fi
25 changes: 21 additions & 4 deletions scripts/lib/common.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

CONTROLLER_TOOLS_VERSION="v0.7.0"
HELM_VERSION="v3.7"

# setting the -x option if debugging is true
if [[ "${DEBUG:-"false"}" = "true" ]]; then
@@ -91,25 +92,41 @@ debug_msg() {
echo "$__debug_prefix$__indent$__msg"
}

# controller_gen_version_equals accepts a string version and returns 0 if the
# k8s_controller_gen_version_equals accepts a string version and returns 0 if the
# installed version of controller-gen matches the supplied version, otherwise
# returns 1
#
# Usage:
#
# if controller_gen_version_equals "v0.4.0"; then
# if k8s_controller_gen_version_equals "v0.4.0"; then
# echo "controller-gen is at version 0.4.0"
# fi
k8s_controller_gen_version_equals() {
currentver="$(controller-gen --version | cut -d' ' -f2 | tr -d '\n')";
requiredver="$1";
local currentver="$(controller-gen --version | cut -d' ' -f2 | tr -d '\n')";
local requiredver="$1";
if [ "$currentver" = "$requiredver" ]; then
return 0
else
return 1
fi;
}

# helm_version_equals_or_greater accepts a string version and returns 0 if the
# installed version of helm matches or greater than the supplied version,
# otherwise returns 1
#
# Usage:
#
# if helm_version_equals_or_greater "v3.9.0"; then
# echo "Installed helm version is greater than or equal to version v3.9.0"
# fi
helm_version_equals_or_greater() {
local currentver="$(helm version --template='Version: {{.Version}}'| cut -d' ' -f2 | tr -d '\n')"
local requiredver="$1"
printf '%s\n%s\n' $requiredver $currentver | sort -C -V
return $?
}

# is_public_ecr_logged_in returns 0 if the Docker client is authenticated
# with ECR public and therefore can pull and push to ECR public, otherwise
# returns 1
2 changes: 1 addition & 1 deletion templates/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ spec:
affinity: {{ toYaml .Values.deployment.affinity | nindent 8 }}
{{ end -}}
{{ if .Values.deployment.priorityClassName -}}
priorityClassName: {{ .Values.deployment.priorityClassName -}}
priorityClassName: {{ .Values.deployment.priorityClassName }}
{{ end -}}
hostIPC: false
hostNetwork: false