Skip to content

Commit

Permalink
Validate _examples block and warn the user if they changed it seeming…
Browse files Browse the repository at this point in the history
…ly by accident.
  • Loading branch information
markusthoemmes committed Jun 3, 2020
1 parent 5d7e526 commit 19e9c0b
Show file tree
Hide file tree
Showing 38 changed files with 11,362 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/core/configmaps/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "b2d0685a"
data:
_example: |
################################
Expand Down
2 changes: 1 addition & 1 deletion config/core/configmaps/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "7610427c"
data:
_example: |
################################
Expand Down
3 changes: 1 addition & 2 deletions config/core/configmaps/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "cf88a4cf"
data:
# This is the Go import path for the binary that is containerized
# and substituted here.
queueSidecarImage: ko://knative.dev/serving/cmd/queue

_example: |
################################
# #
Expand Down
5 changes: 2 additions & 3 deletions config/core/configmaps/domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "327d2082"
data:
_example: |
################################
Expand Down Expand Up @@ -47,7 +47,7 @@ data:
example.org: |
selector:
app: nonprofit
# Routes having domain suffix of 'svc.cluster.local' will not be exposed
# through Ingress. You can define your own label selector to assign that
# domain suffix to your Route here, or you can set the label
Expand All @@ -57,4 +57,3 @@ data:
svc.cluster.local: |
selector:
app: secret
2 changes: 1 addition & 1 deletion config/core/configmaps/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "303e565f"
data:
_example: |
################################
Expand Down
2 changes: 1 addition & 1 deletion config/core/configmaps/gc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "7a8e5402"
data:
_example: |
################################
Expand Down
1 change: 1 addition & 0 deletions config/core/configmaps/leader-election.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel
knative.dev/example-checksum: "82c28949"
data:
_example: |
################################
Expand Down
2 changes: 1 addition & 1 deletion config/core/configmaps/logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "3199de9f"
data:
_example: |
################################
Expand Down
3 changes: 1 addition & 2 deletions config/core/configmaps/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "8b4ff3d6"
data:
_example: |
################################
Expand Down Expand Up @@ -107,4 +107,3 @@ data:
# 3. Redirected: The Knative ingress will send a 302 redirect for all
# http connections, asking the clients to use HTTPS
httpProtocol: "Enabled"
4 changes: 2 additions & 2 deletions config/core/configmaps/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "26889b7b"
data:
_example: |
################################
Expand Down Expand Up @@ -82,7 +82,7 @@ data:
# If true, this enables queue proxy writing request logs for probe requests to stdout.
# It uses the same template for user requests, i.e. logging.request-log-template.
logging.enable-probe-request-log: "false"
# metrics.backend-destination field specifies the system metrics destination.
# It supports either prometheus (the default) or stackdriver.
# Note: Using stackdriver will incur additional charges
Expand Down
2 changes: 1 addition & 1 deletion config/core/configmaps/tracing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: knative-serving
labels:
serving.knative.dev/release: devel

knative.dev/example-checksum: "e359bd08"
data:
_example: |
################################
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ require (
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
k8s.io/metrics v0.17.6
knative.dev/caching v0.0.0-20200521155757-e78d17bc250e
knative.dev/pkg v0.0.0-20200603004717-9d862737e5c1
knative.dev/test-infra v0.0.0-20200602194317-2a31597e0f46
knative.dev/pkg v0.0.0-20200603153318-b0dc3661a786
knative.dev/test-infra v0.0.0-20200603152917-f8e41454f3b3
)

// pin the older grpc - see: https://github.com/grpc/grpc-go/issues/3180
Expand Down
8 changes: 5 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 h1:0efs3hwEZhFKsCoP8l6dDB1AZWMgnEl3yWXWRZTOaEA=
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
Expand Down Expand Up @@ -1319,9 +1320,10 @@ knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV
knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7 h1:9S2r59HZJF9nKvoRLg5zJzx6XpVlVyvVRqz/C/h6h2s=
knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA=
knative.dev/pkg v0.0.0-20200520073958-94316e20e860/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA=
knative.dev/pkg v0.0.0-20200601184204-18c577c87d4f/go.mod h1:ywZfX/0D8hoOf4uJVgeEvJpSmsOauQvr1IuAWld9UjM=
knative.dev/pkg v0.0.0-20200603004717-9d862737e5c1 h1:RdPH0bgm61DQ/azXkQq04pwFnaHH9xSL5yJ9+X2nuiQ=
knative.dev/pkg v0.0.0-20200603004717-9d862737e5c1/go.mod h1:8IfPj/lpuKHHg82xZCl2wuFZ3BM96To72sN1W8T9wjQ=
knative.dev/pkg v0.0.0-20200603153318-b0dc3661a786 h1:ays1oY2AlTS4ZUS/59SGc3GH3W1IWs4jZaU69Wdy2xU=
knative.dev/pkg v0.0.0-20200603153318-b0dc3661a786/go.mod h1:8IfPj/lpuKHHg82xZCl2wuFZ3BM96To72sN1W8T9wjQ=
knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU=
knative.dev/test-infra v0.0.0-20200513011557-d03429a76034 h1:JxqONCZVS7or+Fv3ebVQoipuIBH7Ig3Qbx170hgIF+A=
Expand All @@ -1332,8 +1334,8 @@ knative.dev/test-infra v0.0.0-20200519161858-554a95a37986 h1:ZDy43jkWPQ75d4l4DGy
knative.dev/test-infra v0.0.0-20200519161858-554a95a37986/go.mod h1:LeNa1Wvn47efeQUkpkn3XG7Fx9Ga+rhAP13SZyjaEGg=
knative.dev/test-infra v0.0.0-20200522180958-6a0a9b9d893a h1:c0qTABRcNoxZVu5gsryLWPZtGa/s4zsvovz0nGefuzg=
knative.dev/test-infra v0.0.0-20200522180958-6a0a9b9d893a/go.mod h1:n9eQkzmSNj8BiqNFl1lzoz68D09uMeJfyOjc132Gbik=
knative.dev/test-infra v0.0.0-20200602194317-2a31597e0f46 h1:xXewx8AeTeNKIsqUwUJ24RF0xOVm3EQ0t7vBmM+RgB4=
knative.dev/test-infra v0.0.0-20200602194317-2a31597e0f46/go.mod h1:JV4E61erdHLn4jT0X+svUP7lZYggJyXMCGDewTSQuO8=
knative.dev/test-infra v0.0.0-20200603152917-f8e41454f3b3 h1:IiBd//yCwgDwRfLuyhWcwdWmNkBrwZJ/UB8YLL0fnZ4=
knative.dev/test-infra v0.0.0-20200603152917-f8e41454f3b3/go.mod h1:Iyv1UFMGA1K/qRXYLQPwx1Rm/UIFo0RcaKAjGKdSe8c=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
Expand Down
1 change: 1 addition & 0 deletions hack/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package tools

import (
_ "k8s.io/code-generator"
_ "knative.dev/pkg/configmap/hash-gen"
_ "knative.dev/test-infra/scripts"

// codegen: hack/generate-knative.sh
Expand Down
6 changes: 6 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ fi

source $(dirname $0)/../vendor/knative.dev/test-infra/scripts/library.sh

# Compute _example checksum for all configmaps.
for file in "${REPO_ROOT_DIR}"/config/core/configmaps/*.yaml
do
go run "${REPO_ROOT_DIR}/vendor/knative.dev/pkg/configmap/hash-gen" "$file"
done

CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 $(dirname $0)/../vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 $(dirname $0)/../vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)}
Expand Down
15 changes: 15 additions & 0 deletions vendor/gopkg.in/yaml.v3/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions vendor/gopkg.in/yaml.v3/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/gopkg.in/yaml.v3/NOTICE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 19e9c0b

Please sign in to comment.