From ae41b8fcdd9c8f326a83154cb60e7b0bbfe733d7 Mon Sep 17 00:00:00 2001 From: Martin Taillefer Date: Fri, 6 Dec 2019 06:59:22 -0800 Subject: [PATCH] Site improvements. (#6003) - Update common files. - Switch to latest Hugo version. - Thanks to the new Hugo, retire the text_hack shortcode. The hack is no longer needed. --- Makefile | 18 +++++++-- SUPPORT.md | 2 +- common/.commonfiles.sha | 2 +- common/Makefile.common.mk | 9 +++-- common/config/.golangci.yml | 2 - common/config/license-lint.yml | 5 --- common/scripts/check_clean_repo.sh | 7 ++-- common/scripts/report_build_info.sh | 2 +- config.toml | 38 ++++++++++++++----- content/en/blog/2018/egress-mongo/index.md | 8 ++-- .../egress-gateway-tls-origination/index.md | 8 ++-- .../egress/egress-gateway/index.md | 24 ++++++------ .../egress/wildcard-egress-hosts/index.md | 8 ++-- content/en/test/tabs_and_lists/index.md | 4 +- content/zh/blog/2018/egress-mongo/index.md | 8 ++-- .../egress-gateway-tls-origination/index.md | 8 ++-- .../egress/egress-gateway/index.md | 24 ++++++------ .../egress/wildcard-egress-hosts/index.md | 8 ++-- content/zh/test/tabs_and_lists/index.md | 4 +- layouts/shortcodes/text_hack.html | 21 ---------- netlify.toml | 2 +- 21 files changed, 109 insertions(+), 103 deletions(-) delete mode 100644 layouts/shortcodes/text_hack.html diff --git a/Makefile b/Makefile index 21b173590d..9d5a1ee1b2 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ ifeq ($(LOCAL_ARCH),x86_64) TARGET_ARCH ?= amd64 else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 5),armv8) TARGET_ARCH ?= arm64 +else ifeq ($(LOCAL_ARCH),aarch64) + TARGET_ARCH ?= arm64 else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 4),armv) TARGET_ARCH ?= arm else @@ -56,7 +58,7 @@ ifeq ($(BUILD_WITH_CONTAINER),1) export TARGET_OUT = /work/out/$(TARGET_OS)_$(TARGET_ARCH) CONTAINER_CLI ?= docker DOCKER_SOCKET_MOUNT ?= -v /var/run/docker.sock:/var/run/docker.sock -IMG ?= gcr.io/istio-testing/build-tools:2019-10-24T14-05-17 +IMG ?= gcr.io/istio-testing/build-tools:master-2019-12-05T22-22-12 UID = $(shell id -u) GID = `grep docker /etc/group | cut -f3 -d:` PWD = $(shell pwd) @@ -81,14 +83,22 @@ $(info Using gcr credential directory $(HOME)/.config/gcloud.) DOCKER_CREDS_MOUNT+=--mount type=bind,source="$(HOME)/.config/gcloud",destination="/config/.config/gcloud",readonly endif +ENV_VARS:= +ifdef HUB +ENV_VARS+=-e HUB="$(HUB)" +endif +ifdef TAG +ENV_VARS+=-e TAG="$(TAG)" +endif + RUN = $(CONTAINER_CLI) run -t -i --sig-proxy=true -u $(UID):$(GID) --rm \ -e IN_BUILD_CONTAINER="$(BUILD_WITH_CONTAINER)" \ -e TZ="$(TIMEZONE)" \ -e TARGET_ARCH="$(TARGET_ARCH)" \ -e TARGET_OS="$(TARGET_OS)" \ -e TARGET_OUT="$(TARGET_OUT)" \ - -e HUB="$(HUB)" \ - -e TAG="$(TAG)" \ + -e USER="${USER}" \ + $(ENV_VARS) \ -v /etc/passwd:/etc/passwd:ro \ $(DOCKER_SOCKET_MOUNT) \ $(CONTAINER_OPTIONS) \ @@ -111,7 +121,7 @@ default: else $(info Building with your local toolchain.) -GOBIN ?= $(GOPATH)/bin +export GOBIN ?= $(GOPATH)/bin include Makefile.core.mk endif diff --git a/SUPPORT.md b/SUPPORT.md index 3b4d48a3d1..5059139296 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,6 +1,6 @@ # Support -Test of checks Here are some resources to help you understand and use Istio: +Here are some resources to help you understand and use Istio: - For in-depth information about how to use Istio, visit [istio.io](https://istio.io) - To ask questions and get assistance from our community, visit [discuss.istio.io](https://discuss.istio.io) diff --git a/common/.commonfiles.sha b/common/.commonfiles.sha index 45243c02dc..cf3b42174a 100644 --- a/common/.commonfiles.sha +++ b/common/.commonfiles.sha @@ -1 +1 @@ -5e3f91a86f114b45d26b0f4b6ab5116a6d2f87a4 +64187da83baeac0bd7413cf7dea39450c8f0ad2a diff --git a/common/Makefile.common.mk b/common/Makefile.common.mk index c2f9dadc34..61cdadcfb9 100644 --- a/common/Makefile.common.mk +++ b/common/Makefile.common.mk @@ -19,7 +19,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FINDFILES=find . \( -path ./common-protos -o -path ./.git -o -path ./.github \) -prune -o -type f +FINDFILES=find . \( -path ./common-protos -o -path ./.git -o -path ./.github -o -path ./licenses \) -prune -o -type f XARGS = xargs -0 -r lint-dockerfiles: @@ -46,6 +46,8 @@ lint-python: lint-markdown: @${FINDFILES} -name '*.md' -print0 | ${XARGS} mdl --ignore-front-matter --style common/config/mdl.rb + +lint-links: @${FINDFILES} -name '*.md' -print0 | ${XARGS} awesome_bot --skip-save-results --allow_ssl --allow-timeout --allow-dupe --allow-redirect --white-list ${MARKDOWN_LINT_WHITELIST} lint-sass: @@ -85,6 +87,7 @@ dump-licenses-csv: mirror-licenses: @go mod download + @rm -fr licenses @license-lint --mirror TMP := $(shell mktemp -d -u) @@ -95,7 +98,7 @@ update-common: @git clone -q --depth 1 --single-branch --branch $(UPDATE_BRANCH) https://github.com/istio/common-files $(TMP)/common-files @cd $(TMP)/common-files ; git rev-parse HEAD >files/common/.commonfiles.sha @rm -fr common - @cp -rT $(TMP)/common-files/files $(shell pwd) + @cp -a $(TMP)/common-files/files/* $(shell pwd) @rm -fr $(TMP)/common-files update-common-protos: @@ -103,7 +106,7 @@ update-common-protos: @git clone -q --depth 1 --single-branch --branch $(UPDATE_BRANCH) https://github.com/istio/common-files $(TMP)/common-files @cd $(TMP)/common-files ; git rev-parse HEAD > common-protos/.commonfiles.sha @rm -fr common-protos - @cp -ar $(TMP)/common-files/common-protos $(shell pwd)/common-protos + @cp -a $(TMP)/common-files/common-protos $(shell pwd) @rm -fr $(TMP)/common-files check-clean-repo: diff --git a/common/config/.golangci.yml b/common/config/.golangci.yml index d6ca38ea63..033701722a 100644 --- a/common/config/.golangci.yml +++ b/common/config/.golangci.yml @@ -39,7 +39,6 @@ linters: - funlen - gochecknoglobals - gochecknoinits - - gocognit - goconst - gocyclo - godox @@ -48,7 +47,6 @@ linters: - prealloc - scopelint - whitespace - - wsl fast: false linters-settings: diff --git a/common/config/license-lint.yml b/common/config/license-lint.yml index fbdf259624..ac893be9f4 100644 --- a/common/config/license-lint.yml +++ b/common/config/license-lint.yml @@ -71,7 +71,6 @@ whitelisted_modules: - github.com/daviddengcn/go-colortext - github.com/dchest/siphash - github.com/dnaeon/go-vcr - - github.com/docker/docker - github.com/duosecurity/duo_api_golang - github.com/dustin/go-humanize - github.com/facebookgo/stack @@ -92,9 +91,6 @@ whitelisted_modules: - github.com/JeffAshton/win_pdh - github.com/jmespath/go-jmespath - github.com/jteeuwen/go-bindata - - github.com/juju/errors - - github.com/juju/loggo - - github.com/juju/testing - github.com/julienschmidt/httprouter - github.com/koneu/natend - github.com/kr/logfmt @@ -118,7 +114,6 @@ whitelisted_modules: - github.com/russross/blackfriday - github.com/russross/blackfriday/v2 - github.com/sean-/seed - - github.com/signalfx/com_signalfx_metrics_protobuf - github.com/smartystreets/assertions - github.com/smartystreets/goconvey - github.com/storageos/go-api diff --git a/common/scripts/check_clean_repo.sh b/common/scripts/check_clean_repo.sh index 1ff704f9f6..19d1956bb3 100755 --- a/common/scripts/check_clean_repo.sh +++ b/common/scripts/check_clean_repo.sh @@ -15,7 +15,8 @@ # limitations under the License. if [[ -n $(git status --porcelain) ]]; then - git status - echo "ERROR: Some files need to be updated, please run 'make gen' and include any changed files in your PR" - exit 1 + git status + git diff + echo "ERROR: Some files need to be updated, please run 'make gen' and include any changed files in your PR" + exit 1 fi diff --git a/common/scripts/report_build_info.sh b/common/scripts/report_build_info.sh index fa2f906d7a..995228183e 100755 --- a/common/scripts/report_build_info.sh +++ b/common/scripts/report_build_info.sh @@ -43,7 +43,7 @@ if [[ -n ${ISTIO_VERSION} ]]; then fi GIT_DESCRIBE_TAG=$(git describe --tags) -HUB=${HUB:-""} +HUB=${HUB:-"docker.io/istio"} # used by common/scripts/gobuild.sh echo "istio.io/pkg/version.buildVersion=${VERSION}" diff --git a/config.toml b/config.toml index 993ad6a250..d83d4d96c5 100644 --- a/config.toml +++ b/config.toml @@ -16,15 +16,35 @@ staticDir = ["static", "generated"] # we use Netlify server-side redirects instead of generated aliases disableAliases = true -# MARKDOWN -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -[blackfriday] - plainIDAnchors = true - # See https://github.com/gohugoio/hugo/issues/2424 - hrefTargetBlank = false - angledQuotes = false - latexDashes = true - extensions = [""] +[markup] + [markup.goldmark] + [markup.goldmark.extensions] + definitionList = true + footnote = true + linkify = true + strikethrough = true + table = true + taskList = true + typographer = true + [markup.goldmark.parser] + attribute = true + autoHeadingID = true + [markup.goldmark.renderer] + hardWraps = false + unsafe = true + xHTML = false + [markup.highlight] + codeFences = true + hl_Lines = "" + lineNoStart = 1 + lineNos = false + lineNumbersInTable = true + noClasses = true + style = "monokai" + tabWidth = 4 + [markup.tableOfContents] + endLevel = 3 + startLevel = 2 [mediaTypes] [mediaTypes."text/netlify"] diff --git a/content/en/blog/2018/egress-mongo/index.md b/content/en/blog/2018/egress-mongo/index.md index 6b5920c2c8..65bb572349 100644 --- a/content/en/blog/2018/egress-mongo/index.md +++ b/content/en/blog/2018/egress-mongo/index.md @@ -612,7 +612,7 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/en/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md b/content/en/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md index 0824a4ece0..1b399bc7b6 100644 --- a/content/en/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md +++ b/content/en/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md @@ -106,7 +106,7 @@ be done by the egress gateway, as opposed to by the sidecar in the previous exam {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/en/docs/tasks/traffic-management/egress/egress-gateway/index.md b/content/en/docs/tasks/traffic-management/egress/egress-gateway/index.md index 9e54a8373c..cd8caeb4b8 100644 --- a/content/en/docs/tasks/traffic-management/egress/egress-gateway/index.md +++ b/content/en/docs/tasks/traffic-management/egress/egress-gateway/index.md @@ -122,7 +122,7 @@ First create a `ServiceEntry` to allow direct traffic to an external service. {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} @@ -330,7 +330,7 @@ You need to specify port 443 with protocol `TLS` in a corresponding `ServiceEntr {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} @@ -667,7 +667,7 @@ external service. {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -n test-egress -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -n test-egress -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/en/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md b/content/en/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md index f2de30f545..fb9386f5a9 100644 --- a/content/en/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md +++ b/content/en/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md @@ -429,7 +429,7 @@ The SNI proxy will forward the traffic to port `443`. {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/en/test/tabs_and_lists/index.md b/content/en/test/tabs_and_lists/index.md index d780078483..182a00893b 100644 --- a/content/en/test/tabs_and_lists/index.md +++ b/content/en/test/tabs_and_lists/index.md @@ -66,13 +66,13 @@ skip_sitemap: true {{< tab name="Seven" category-value="seven" >}} 1. Simple text with _markdown_ in a list in a tab - {{< text_hack bash >}} + {{< text bash >}} $ NoIndent: FourIndent: - EightIndent FourIndentAgain: - EightIndentAgain - {{< /text_hack >}} + {{< /text >}} 1. Second bullet {{< /tab >}} diff --git a/content/zh/blog/2018/egress-mongo/index.md b/content/zh/blog/2018/egress-mongo/index.md index bf67d5c30e..c7556414d9 100644 --- a/content/zh/blog/2018/egress-mongo/index.md +++ b/content/zh/blog/2018/egress-mongo/index.md @@ -612,7 +612,7 @@ to be 443. The egress gateway accepts the MongoDB traffic on the port 443, match {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/zh/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md b/content/zh/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md index 79188d486a..f93df0847d 100644 --- a/content/zh/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md +++ b/content/zh/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/index.md @@ -98,7 +98,7 @@ aliases: {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/zh/docs/tasks/traffic-management/egress/egress-gateway/index.md b/content/zh/docs/tasks/traffic-management/egress/egress-gateway/index.md index 1369c00bc3..d7969e6049 100644 --- a/content/zh/docs/tasks/traffic-management/egress/egress-gateway/index.md +++ b/content/zh/docs/tasks/traffic-management/egress/egress-gateway/index.md @@ -102,7 +102,7 @@ Ingress gateway 使您可以定义所有输入流量流经的网格的入口点 {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} @@ -305,7 +305,7 @@ $ kubectl delete destinationrule egressgateway-for-cnn {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} @@ -615,7 +615,7 @@ $ kubectl delete destinationrule egressgateway-for-cnn {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -n test-egress -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -n test-egress -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md b/content/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md index 80c0d88546..10938933db 100644 --- a/content/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md +++ b/content/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/index.md @@ -392,7 +392,7 @@ SNI 代理会将流量转发到 `443` 端口。 {{< tab name="mutual TLS enabled" category-value="enabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} {{< tab name="mutual TLS disabled" category-value="disabled" >}} - {{< text_hack bash >}} + {{< text bash >}} $ kubectl apply -f - <}} + {{< /text >}} {{< /tab >}} diff --git a/content/zh/test/tabs_and_lists/index.md b/content/zh/test/tabs_and_lists/index.md index d780078483..182a00893b 100644 --- a/content/zh/test/tabs_and_lists/index.md +++ b/content/zh/test/tabs_and_lists/index.md @@ -66,13 +66,13 @@ skip_sitemap: true {{< tab name="Seven" category-value="seven" >}} 1. Simple text with _markdown_ in a list in a tab - {{< text_hack bash >}} + {{< text bash >}} $ NoIndent: FourIndent: - EightIndent FourIndentAgain: - EightIndentAgain - {{< /text_hack >}} + {{< /text >}} 1. Second bullet {{< /tab >}} diff --git a/layouts/shortcodes/text_hack.html b/layouts/shortcodes/text_hack.html deleted file mode 100644 index 60e2625779..0000000000 --- a/layouts/shortcodes/text_hack.html +++ /dev/null @@ -1,21 +0,0 @@ -{{- /* Inserts a text block into the HTML. See https://preliminary.istio.io/about/contribute/creating-and-editing-pages/#embedding-preformatted-blocks for details -This is a special simplified version of the normal text shortcode that doesn't support any features and is designed to work around a bug in Hugo -that occurs when using a text block inside a tab inside a list. This bug causes indent to be off in that case for certain lines in the text block. -This hack works around that problem. -*/ -}} -{{- $syntax := .Get "syntax" | default (.Get 0) -}} - -{{- if not $syntax -}} - {{- errorf "Text block does not specify a syntax (%s)" .Position -}} - {{- $syntax = "plain" -}} -{{- end -}} - -{{- if eq $syntax "bash" -}} - {{- if not (hasPrefix (trim .Inner "\n ") "$") -}} - {{- errorf "Text block specifies a bash syntax, but the first line of the block does not start with $ (%s)" .Position -}} - {{- end -}} -{{- end -}} - -```{{ printf "%s" $syntax -}} -{{- .Inner -}} -``` diff --git a/netlify.toml b/netlify.toml index 9fad4534ae..8e74c76975 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,6 +2,6 @@ publish = "public" [build.environment] - HUGO_VERSION = "0.59.1" + HUGO_VERSION = "0.60.1" NODE_VERSION = "12.8.0" BUILD_WITH_CONTAINER = "0"