mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Remove references to "GO111MODULE"
This commit is contained in:
		@@ -597,7 +597,7 @@ kube::golang::setup_gomaxprocs() {
 | 
			
		||||
    if ! command -v ncpu >/dev/null 2>&1; then
 | 
			
		||||
      # shellcheck disable=SC2164
 | 
			
		||||
      pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
      GO111MODULE=on go install ./ncpu || echo "Will not automatically set GOMAXPROCS"
 | 
			
		||||
      go install ./ncpu || echo "Will not automatically set GOMAXPROCS"
 | 
			
		||||
      # shellcheck disable=SC2164
 | 
			
		||||
      popd >/dev/null
 | 
			
		||||
    fi
 | 
			
		||||
 
 | 
			
		||||
@@ -25,12 +25,6 @@ set -o pipefail
 | 
			
		||||
# https://github.com/kubernetes/kubernetes/issues/52255
 | 
			
		||||
unset CDPATH
 | 
			
		||||
 | 
			
		||||
# Until all GOPATH references are removed from all build scripts as well,
 | 
			
		||||
# explicitly disable module mode to avoid picking up user-set GO111MODULE preferences.
 | 
			
		||||
# As individual scripts (like hack/update-vendor.sh) make use of go modules,
 | 
			
		||||
# they can explicitly set GO111MODULE=on
 | 
			
		||||
export GO111MODULE=off
 | 
			
		||||
 | 
			
		||||
# FIXME(dims): Note that here we assume that if GOFLAGS are already set we
 | 
			
		||||
# leave them as-is and not try to add providerless to it. So if you
 | 
			
		||||
# really need to set your own GOFLAGS, ensure you add "providerless" explicitly
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ unused=$(comm -23 \
 | 
			
		||||
if [[ -n "${unused}" ]]; then
 | 
			
		||||
  echo ""
 | 
			
		||||
  echo "Use the given commands to remove pinned module versions that aren't actually used:"
 | 
			
		||||
  echo "${unused}" | xargs -L 1 echo 'GO111MODULE=on go mod edit -dropreplace'
 | 
			
		||||
  echo "${unused}" | xargs -L 1 echo 'go mod edit -dropreplace'
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [[ -n "${unused}${outdated}${noncanonical}" ]]; then
 | 
			
		||||
 
 | 
			
		||||
@@ -192,7 +192,7 @@ produceJUnitXMLReport() {
 | 
			
		||||
  if ! command -v gotestsum >/dev/null 2>&1; then
 | 
			
		||||
    kube::log::status "gotestsum not found; installing from hack/tools"
 | 
			
		||||
    pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
      GO111MODULE=on go install gotest.tools/gotestsum
 | 
			
		||||
      go install gotest.tools/gotestsum
 | 
			
		||||
    popd >/dev/null
 | 
			
		||||
  fi
 | 
			
		||||
  gotestsum --junitfile "${junit_xml_filename}" --raw-command cat "${junit_filename_prefix}"*.stdout
 | 
			
		||||
@@ -203,7 +203,7 @@ produceJUnitXMLReport() {
 | 
			
		||||
  if ! command -v prune-junit-xml >/dev/null 2>&1; then
 | 
			
		||||
    kube::log::status "prune-junit-xml not found; installing from hack/tools"
 | 
			
		||||
    pushd "${KUBE_ROOT}/cmd/prune-junit-xml" >/dev/null
 | 
			
		||||
      GO111MODULE=on go install .
 | 
			
		||||
      go install .
 | 
			
		||||
    popd >/dev/null
 | 
			
		||||
  fi
 | 
			
		||||
  prune-junit-xml "${junit_xml_filename}"
 | 
			
		||||
 
 | 
			
		||||
@@ -29,15 +29,13 @@ MODULES=(
 | 
			
		||||
    staging/src/k8s.io/kms/internal/plugins/_mock
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Explicitly opt into go modules
 | 
			
		||||
export GO111MODULE=on
 | 
			
		||||
 | 
			
		||||
# Detect problematic GOPROXY settings that prevent lookup of dependencies
 | 
			
		||||
if [[ "${GOPROXY:-}" == "off" ]]; then
 | 
			
		||||
  kube::log::error "Cannot run hack/update-internal-modules.sh with \$GOPROXY=off"
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
kube::golang::setup_env
 | 
			
		||||
kube::golang::verify_go_version
 | 
			
		||||
 | 
			
		||||
for mod in "${MODULES[@]}"; do
 | 
			
		||||
 
 | 
			
		||||
@@ -35,9 +35,6 @@ kube::golang::verify_go_version
 | 
			
		||||
export GOBIN="${KUBE_OUTPUT_BIN}"
 | 
			
		||||
PATH="${GOBIN}:${PATH}"
 | 
			
		||||
 | 
			
		||||
# Explicitly opt into go modules
 | 
			
		||||
export GO111MODULE=on
 | 
			
		||||
 | 
			
		||||
# Install golangci-lint
 | 
			
		||||
echo 'installing net parser converter'
 | 
			
		||||
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
 | 
			
		||||
kube::golang::verify_go_version
 | 
			
		||||
 | 
			
		||||
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
    GO111MODULE=on go install github.com/jcchavezs/porto/cmd/porto
 | 
			
		||||
    go install github.com/jcchavezs/porto/cmd/porto
 | 
			
		||||
popd >/dev/null
 | 
			
		||||
 | 
			
		||||
porto --restrict-to-dirs="staging" --restrict-to-files="doc\\.go$" -w "${KUBE_ROOT}"
 | 
			
		||||
 
 | 
			
		||||
@@ -38,5 +38,4 @@ find_files() {
 | 
			
		||||
    \) -name 'OWNERS*'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export GO111MODULE=on
 | 
			
		||||
find_files | xargs go run cmd/yamlfmt/yamlfmt.go
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ export GOBIN="${KUBE_OUTPUT_BIN}"
 | 
			
		||||
PATH="${GOBIN}:${PATH}"
 | 
			
		||||
 | 
			
		||||
# Install zeitgeist
 | 
			
		||||
GO111MODULE=on go install sigs.k8s.io/zeitgeist@v0.2.0
 | 
			
		||||
go install sigs.k8s.io/zeitgeist@v0.2.0
 | 
			
		||||
 | 
			
		||||
# Prefer full path for running zeitgeist
 | 
			
		||||
ZEITGEIST_BIN="$(which zeitgeist)"
 | 
			
		||||
 
 | 
			
		||||
@@ -27,5 +27,4 @@ set -o pipefail
 | 
			
		||||
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
 | 
			
		||||
source "${KUBE_ROOT}/hack/lib/verify-generated.sh"
 | 
			
		||||
 | 
			
		||||
export GO111MODULE=on # TODO(thockin): remove this when init.sh stops disabling it
 | 
			
		||||
kube::verify::generated "Go workspace files need to be updated" "Please run 'hack/update-go-workspace.sh'" hack/update-go-workspace.sh
 | 
			
		||||
 
 | 
			
		||||
@@ -126,9 +126,6 @@ for arg; do
 | 
			
		||||
  fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
# Explicitly opt into go modules
 | 
			
		||||
export GO111MODULE=on
 | 
			
		||||
 | 
			
		||||
# Install golangci-lint
 | 
			
		||||
echo "installing golangci-lint and logcheck plugin from hack/tools into ${GOBIN}"
 | 
			
		||||
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ PATH="${GOBIN}:${PATH}"
 | 
			
		||||
 | 
			
		||||
# Install tools we need
 | 
			
		||||
pushd "${KUBE_ROOT}/hack/tools" >/dev/null
 | 
			
		||||
  GO111MODULE=on go install github.com/client9/misspell/cmd/misspell
 | 
			
		||||
  go install github.com/client9/misspell/cmd/misspell
 | 
			
		||||
popd >/dev/null
 | 
			
		||||
 | 
			
		||||
# Spell checking
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ This is an example of how to build a kubectl plugin using the same set of tools
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
# assumes you have a working KUBECONFIG
 | 
			
		||||
$ GO111MODULE="on" go build cmd/kubectl-ns.go
 | 
			
		||||
$ go build cmd/kubectl-ns.go
 | 
			
		||||
# place the built binary somewhere in your PATH
 | 
			
		||||
$ cp ./kubectl-ns /usr/local/bin
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user