Skip to content

Commit

Permalink
Merge pull request #774 from wzshiming/clean/code
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming authored Aug 18, 2023
2 parents e8c8a1a + f2ac0f9 commit 4763343
Show file tree
Hide file tree
Showing 51 changed files with 420 additions and 278 deletions.
8 changes: 6 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ linters:
- nolintlint
- prealloc
- revive
# - rowserrcheck
- staticcheck
- stylecheck
- typecheck
Expand Down Expand Up @@ -75,6 +74,9 @@ linters-settings:
- k8s.io/klog: "please use `sigs.k8s.io/kwok/pkg/log instead"
- golang.org/x/exp/slog: "please use `sigs.k8s.io/kwok/pkg/log` instead"
- log: "please use `sigs.k8s.io/kwok/pkg/log` instead"
# Use sigs.k8s.io/kwok/pkg/utils/yaml, which is a wrapper around yaml
- k8s.io/apimachinery/pkg/util/yaml: "please use `sigs.k8s.io/kwok/pkg/utils/yaml` instead"
- sigs.k8s.io/yaml: "please use `sigs.k8s.io/kwok/pkg/utils/yaml` instead"
# Use sigs.k8s.io/kwok/pkg/utils/wait, which is a wrapper around wait
- k8s.io/apimachinery/pkg/util/wait: "please use `sigs.k8s.io/kwok/pkg/utils/wait` instead"
# Use sigs.k8s.io/kwok/pkg/utils/slices, which is a wrapper around slices
Expand Down Expand Up @@ -106,8 +108,10 @@ issues:
- revive
source: _ "embed"
run:
concurrency: 1
timeout: 10m
allow-parallel-runners: true
allow-parallel-runners: false
skip-dirs-use-default: true
skip-files:
- ".*\\.zz_generated\\..*"
go: '1.20'
10 changes: 2 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ module sigs.k8s.io/kwok
go 1.20

require (
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
github.com/blang/semver/v4 v4.0.0
github.com/client9/misspell v0.3.4
github.com/compose-spec/compose-go v1.8.2 // fixation
github.com/containerd/go-cni v1.1.9
github.com/containernetworking/plugins v1.3.0
Expand All @@ -28,7 +26,6 @@ require (
golang.org/x/sync v0.3.0
golang.org/x/sys v0.11.0
golang.org/x/term v0.11.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.28.0
k8s.io/apimachinery v0.28.0
k8s.io/apiserver v0.28.0
Expand All @@ -37,7 +34,6 @@ require (
k8s.io/cri-api v0.28.0
k8s.io/kubelet v0.28.0
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
mvdan.cc/sh/v3 v3.7.0
sigs.k8s.io/controller-runtime v0.15.1
sigs.k8s.io/controller-tools v0.12.1
sigs.k8s.io/kustomize/kustomize/v5 v5.1.1
Expand Down Expand Up @@ -66,7 +62,6 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/renameio/v2 v2.0.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
Expand All @@ -85,10 +80,10 @@ require (
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/wzshiming/trie v0.1.1 // indirect
Expand All @@ -109,12 +104,11 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.3 // indirect
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
k8s.io/klog v0.2.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
mvdan.cc/editorconfig v0.2.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.14.0 // indirect
sigs.k8s.io/kustomize/cmd/config v0.11.3 // indirect
Expand Down
20 changes: 1 addition & 19 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 h1:+XfOU14S4bGuwyvCijJwhhBIjYN+YXS18jrCY2EzJaY=
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 h1:goHVqTbFX3AIo0tzGr14pgfAW2ZfPChKO21Z9MGf/gk=
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
Expand All @@ -12,8 +10,6 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/compose-spec/compose-go v1.8.2 h1:sUQvDxnPgpcOyoxC/lz7mFTrTlHeZ6LWyuASYetkOqw=
github.com/compose-spec/compose-go v1.8.2/go.mod h1:Tb5Ae2PsYN3GTqYqzl2IRbTPiJtPZZjMw8UKUvmehFk=
github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU=
Expand All @@ -40,7 +36,6 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
Expand Down Expand Up @@ -93,8 +88,6 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd h1:r8yyd+DJDmsUhGrRBxH5Pj7KeFK5l+Y3FsgT8keqKtk=
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
Expand Down Expand Up @@ -160,9 +153,6 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -176,11 +166,10 @@ github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97 h1:3RPlVWzZ/PDqmVuf/FKHARG5EMid/tl7cv54Sw/QRVY=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down Expand Up @@ -337,11 +326,8 @@ k8s.io/code-generator v0.28.0 h1:msdkRVJNVFgdiIJ8REl/d3cZsMB9HByFcWMmn13NyuE=
k8s.io/code-generator v0.28.0/go.mod h1:ueeSJZJ61NHBa0ccWLey6mwawum25vX61nRZ6WOzN9A=
k8s.io/cri-api v0.28.0 h1:TVidtHNi425IaKF50oDD5hRvQuK7wB4NQAfTVOcr9QA=
k8s.io/cri-api v0.28.0/go.mod h1:xXygwvSOGcT/2KXg8sMYTHns2xFem3949kCQn5IS1k4=
k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08=
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c=
k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
Expand All @@ -351,10 +337,6 @@ k8s.io/kubelet v0.28.0 h1:H/3JAkLIungVF+WLpqrxhgJ4gzwsbN8VA8LOTYsEX3U=
k8s.io/kubelet v0.28.0/go.mod h1:i8jUg4ltbRusT3ExOhSAeqETuHdoHTZcTT2cPr9RTgc=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE=
mvdan.cc/editorconfig v0.2.0/go.mod h1:lvnnD3BNdBYkhq+B4uBuFFKatfp02eB6HixDvEz91C0=
mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg=
mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8=
sigs.k8s.io/controller-runtime v0.15.1 h1:9UvgKD4ZJGcj24vefUFgZFP3xej/3igL9BsOUTb/+4c=
sigs.k8s.io/controller-runtime v0.15.1/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/controller-tools v0.12.1 h1:GyQqxzH5wksa4n3YDIJdJJOopztR5VDM+7qsyg5yE4U=
Expand Down
9 changes: 0 additions & 9 deletions hack/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ import (
// controller-gen
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"

// gen-crd-api-reference-docs
_ "github.com/ahmetb/gen-crd-api-reference-docs"

// shfmt
_ "mvdan.cc/sh/v3/cmd/shfmt"

// misspell
_ "github.com/client9/misspell/cmd/misspell"

// kustomize
_ "sigs.k8s.io/kustomize/kustomize/v5"
)
5 changes: 5 additions & 0 deletions hack/update-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ if [[ "${UPDATE_GO_MOD:-true}" == "true" ]]; then
"${ROOT_DIR}"/hack/update-go-mod.sh || failed+=(go-mod)
fi

if [[ "${UPDATE_GO_LINT:-true}" == "true" ]]; then
echo "[*] Update go lint..."
"${ROOT_DIR}"/hack/update-go-lint.sh || failed+=(go-lint)
fi

if [[ "${UPDATE_ENDS_NEWLINE:-true}" == "true" ]]; then
echo "[*] Update ends newline..."
"${ROOT_DIR}"/hack/update-ends-newline.sh || failed+=(ends-newline)
Expand Down
2 changes: 1 addition & 1 deletion hack/update-api-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ROOT_DIR="$(realpath "${DIR}/..")"
function gendoc() {
local confdir="${ROOT_DIR}/hack/api_docs"

go run github.com/ahmetb/gen-crd-api-reference-docs \
go run github.com/ahmetb/gen-crd-api-reference-docs@v0.3.0 \
-template-dir "${confdir}" \
-config "${confdir}/config.json" \
"$@"
Expand Down
26 changes: 26 additions & 0 deletions hack/update-go-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.

set -o errexit
set -o nounset
set -o pipefail

DIR="$(dirname "${BASH_SOURCE[0]}")"

ROOT_DIR="$(realpath "${DIR}/..")"

COMMAND=(go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2)

cd "${ROOT_DIR}" && "${COMMAND[@]}" run -c "${ROOT_DIR}/.golangci.yaml" --fix
2 changes: 1 addition & 1 deletion hack/update-shell-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function format() {
-o -path ./demo/node_modules/\* \
-o -path ./site/themes/\* \
\))
go run mvdan.cc/sh/v3/cmd/shfmt -w -i=2 "${findfiles[@]}"
go run mvdan.cc/sh/v3/cmd/shfmt@v3.7.0 -w -i=2 "${findfiles[@]}"
}

cd "${ROOT_DIR}" && format
2 changes: 1 addition & 1 deletion hack/update-spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function update() {
-o -path ./demo/node_modules/\* \
-o -path ./site/themes/\* \
\))
go run github.com/client9/misspell/cmd/misspell \
go run github.com/client9/misspell/cmd/misspell@v0.3.4 \
-locale US -w -i "${ignore}" "${files[@]}"
}

Expand Down
5 changes: 5 additions & 0 deletions hack/verify-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ if [[ "${VERIFY_GO_FORMAT:-true}" == "true" ]]; then
"${ROOT_DIR}"/hack/verify-go-format.sh || failed+=(go-format)
fi

if [[ "${VERIFY_GO_LINT:-true}" == "true" ]]; then
echo "[*] Verifying go lint..."
"${ROOT_DIR}"/hack/verify-go-lint.sh || failed+=(go-lint)
fi

if [[ "${VERIFY_CODEGEN:-true}" == "true" ]]; then
echo "[*] Verifying codegen..."
"${ROOT_DIR}"/hack/verify-codegen.sh || failed+=(codegen)
Expand Down
26 changes: 26 additions & 0 deletions hack/verify-go-lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License 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.

set -o errexit
set -o nounset
set -o pipefail

DIR="$(dirname "${BASH_SOURCE[0]}")"

ROOT_DIR="$(realpath "${DIR}/..")"

COMMAND=(go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2)

cd "${ROOT_DIR}" && "${COMMAND[@]}" run -c "${ROOT_DIR}/.golangci.yaml"
4 changes: 0 additions & 4 deletions kustomize/crd/bases/kwok.x-k8s.io_attaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ spec:
type: array
logsFile:
description: LogsFile is the file from which the attach starts
minLength: 1
type: string
required:
- containers
- logsFile
type: object
type: array
required:
Expand Down
4 changes: 0 additions & 4 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterattaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ spec:
type: array
logsFile:
description: LogsFile is the file from which the attach starts
minLength: 1
type: string
required:
- containers
- logsFile
type: object
type: array
selector:
Expand Down
5 changes: 0 additions & 5 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterlogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ spec:
logsFile:
description: LogsFile is the file from which the log forward
starts
minLength: 1
type: string
required:
- containers
- follow
- logsFile
type: object
type: array
selector:
Expand Down
5 changes: 0 additions & 5 deletions kustomize/crd/bases/kwok.x-k8s.io_logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ spec:
logsFile:
description: LogsFile is the file from which the log forward
starts
minLength: 1
type: string
required:
- containers
- follow
- logsFile
type: object
type: array
required:
Expand Down
Loading

0 comments on commit 4763343

Please sign in to comment.