From ba53a18dbd451ee44c9bc62b3232bd1f68c140b7 Mon Sep 17 00:00:00 2001 From: Antonin Bas Date: Fri, 8 Apr 2022 15:22:30 -0700 Subject: [PATCH] Address review comments Signed-off-by: Antonin Bas --- .github/workflows/go.yml | 9 ++++++ .github/workflows/helm_docs.yml | 31 ------------------- build/charts/antrea/README.md | 2 +- .../charts/antrea/conf/antrea-controller.conf | 2 +- .../antrea/templates/agent/daemonset.yaml | 3 -- build/charts/antrea/values.yaml | 2 +- hack/generate-manifest.sh | 2 +- hack/generate-standard-manifests.sh | 12 ++++--- hack/verify-helm.sh | 2 +- 9 files changed, 22 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/helm_docs.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3d06f76d181..d4640d0d2c4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -224,6 +224,15 @@ jobs: run: | sudo npm install -g markdownlint-cli@0.31.1 make markdownlint + - name: Checking whether autogenerated Helm chart documentation is up-to-date + working-directory: build/charts/ + run: | + make helm-docs + DIFF=$(git diff .) + if [ -n "$DIFF" ]; then + echo "The Helm chart documentation is out-of-date; please run 'make helm-docs' in 'build/charts/' and commit the changes" + exit 1 + fi benchmark: needs: check-changes diff --git a/.github/workflows/helm_docs.yml b/.github/workflows/helm_docs.yml deleted file mode 100644 index 75ccb054c50..00000000000 --- a/.github/workflows/helm_docs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Helm docs -on: - pull_request: - branches: - - main - - release-* - - feature/* - push: - branches: - - main - - release-* - - feature/* - -jobs: - check-helm-docs: - name: Check whether autogenerated Helm chart documentation is up-to-date - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - name: Run helm-docs - working-directory: build/charts/ - run: | - make helm-docs - - name: Check for changes - working-directory: build/charts/ - run: | - DIFF=$(git diff .) - if [ -n "$DIFF" ]; then - echo "The Helm chart documentation is out-of-date; please run 'make helm-docs' in 'build/charts/' and commit the changes" - exit 1 - fi diff --git a/build/charts/antrea/README.md b/build/charts/antrea/README.md index a45d80097b6..9005e7c0b0d 100644 --- a/build/charts/antrea/README.md +++ b/build/charts/antrea/README.md @@ -60,7 +60,7 @@ Kubernetes: `>= 1.16.0-0` | controller.podAnnotations | object | `{}` | Annotations to be added to antrea-controller Pod. | | controller.podLabels | object | `{}` | Labels to be added to antrea-controller Pod. | | controller.priorityClassName | string | `"system-cluster-critical"` | Prority class to use for the antrea-controller Pod. | -| controller.selfSigned | bool | `true` | Indicates whether to use auto-generated self-signed TLS certificates. If false, a Secret named "antrea-controller-tls" must be provided with the following keys: ca.crt, tls.crt, tls.key. | +| controller.selfSignedCert | bool | `true` | Indicates whether to use auto-generated self-signed TLS certificates. If false, a Secret named "antrea-controller-tls" must be provided with the following keys: ca.crt, tls.crt, tls.key. | | controller.tolerations | list | `[{"key":"CriticalAddonsOnly","operator":"Exists"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/master"}]` | Tolerations for the antrea-controller Pod. | | defaultMTU | int | `0` | Default MTU to use for the host gateway interface and the network interface of each Pod. By default, antrea-agent will discover the MTU of the Node's primary interface and adjust it to accommodate for tunnel encapsulation overhead if applicable. | | egress.exceptCIDRs | list | `[]` | CIDR ranges to which outbound Pod traffic will not be SNAT'd by Egresses. | diff --git a/build/charts/antrea/conf/antrea-controller.conf b/build/charts/antrea/conf/antrea-controller.conf index 8e3f978b835..f54bf5ce864 100644 --- a/build/charts/antrea/conf/antrea-controller.conf +++ b/build/charts/antrea/conf/antrea-controller.conf @@ -38,7 +38,7 @@ enablePrometheusMetrics: {{ .Values.controller.enablePrometheusMetrics }} # ca.crt: # tls.crt: # tls.key: -selfSignedCert: {{ .Values.controller.selfSigned }} +selfSignedCert: {{ .Values.controller.selfSignedCert }} # Comma-separated list of Cipher Suites. If omitted, the default Go Cipher Suites will be used. # https://golang.org/pkg/crypto/tls/#pkg-constants diff --git a/build/charts/antrea/templates/agent/daemonset.yaml b/build/charts/antrea/templates/agent/daemonset.yaml index fcac4639473..5292dce279f 100644 --- a/build/charts/antrea/templates/agent/daemonset.yaml +++ b/build/charts/antrea/templates/agent/daemonset.yaml @@ -244,9 +244,6 @@ spec: args: - "--log_file_max_size={{ .Values.agent.antreaOVS.logFileMaxSize }}" - "--log_file_max_num={{ .Values.agent.antreaOVS.logFileMaxNum }}" - {{- if .Values.logVerbosity }} - - "--v={{ .Values.logVerbosity }}" - {{- end }} {{- if .Values.hwOffload }} - "--hw-offload" {{- end }} diff --git a/build/charts/antrea/values.yaml b/build/charts/antrea/values.yaml index 3f9b6a242ae..8a587f202b3 100644 --- a/build/charts/antrea/values.yaml +++ b/build/charts/antrea/values.yaml @@ -194,7 +194,7 @@ controller: # -- Indicates whether to use auto-generated self-signed TLS certificates. If # false, a Secret named "antrea-controller-tls" must be provided with the # following keys: ca.crt, tls.crt, tls.key. - selfSigned: true + selfSignedCert: true # -- Tolerations for the antrea-controller Pod. tolerations: # Mark it as a critical add-on. diff --git a/hack/generate-manifest.sh b/hack/generate-manifest.sh index 6f141a77e71..9209f279dad 100755 --- a/hack/generate-manifest.sh +++ b/hack/generate-manifest.sh @@ -51,7 +51,7 @@ In 'release' mode, environment variables IMG_NAME and IMG_TAG must be set. In 'dev' mode, environment variable IMG_NAME can be set to use a custom image. -This tool uses uses Helm 3 (https://helm.sh/) to generate manifests for Antrea. You can set the HELM +This tool uses Helm 3 (https://helm.sh/) to generate manifests for Antrea. You can set the HELM environment variable to the path of the helm binary you want us to use. Otherwise we will download the appropriate version of the helm binary and use it (this is the recommended approach since different versions of helm may create different output YAMLs)." diff --git a/hack/generate-standard-manifests.sh b/hack/generate-standard-manifests.sh index 5319a0b43cb..9f29fe03bf8 100755 --- a/hack/generate-standard-manifests.sh +++ b/hack/generate-standard-manifests.sh @@ -30,10 +30,10 @@ In 'release' mode, environment variables IMG_NAME and IMG_TAG must be set. In 'dev' mode, environment variable IMG_NAME can be set to use a custom image. -This tool uses uses Helm 3 (https://helm.sh/) to generate the \"standard\" manifests for -Antrea. These are the manifests that are checked-in into the Antrea source tree, and that are -uploaded as release assets for each new Antrea release. This script looks for all the Helm values -YAML files under /build/yamls/chart-values/, and generates the corresponding manifest for each one. +This tool uses Helm 3 (https://helm.sh/) to generate the \"standard\" manifests for Antrea. These +are the manifests that are checked-in into the Antrea source tree, and that are uploaded as release +assets for each new Antrea release. This script looks for all the Helm values YAML files under +/build/yamls/chart-values/, and generates the corresponding manifest for each one. You can set the HELM environment variable to the path of the helm binary you wan t us to use. Otherwise we will download the appropriate version of the helm binary and use it (this is the @@ -100,6 +100,10 @@ fi THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +# Avoid potential Helm warnings about invalid permissions for Kubeconfig file. +# The Kubeconfig does not matter for "helm template". +unset KUBECONFIG + source $THIS_DIR/verify-helm.sh if [ -z "$HELM" ]; then diff --git a/hack/verify-helm.sh b/hack/verify-helm.sh index faaa7876761..e9a7fbe8279 100644 --- a/hack/verify-helm.sh +++ b/hack/verify-helm.sh @@ -20,7 +20,7 @@ _BINDIR="$THIS_DIR/.bin" # versions _HELM_VERSION="v3.8.1" -# Ensure the helm tool exists and is the correct version, or installs it +# Ensure the helm tool exists and is the correct version, or install it verify_helm() { # Check if there is already a helm binary in $_BINDIR and if yes, check if # the version matches the expected one.