mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Rewrite go_install_from_commit to handle pkgs that aren't in HEAD
This is brittle and really only intended to workaround the fact that gazelle has moved out of the bazelbuild/rules_go repo to its own repo. I would rather see this reverted once we move to the same version of gazelle as used by kubernetes/test-infra
This commit is contained in:
		@@ -475,10 +475,15 @@ kube::util::go_install_from_commit() {
 | 
			
		||||
 | 
			
		||||
  kube::util::ensure-temp-dir
 | 
			
		||||
  mkdir -p "${KUBE_TEMP}/go/src"
 | 
			
		||||
  GOPATH="${KUBE_TEMP}/go" go get -d -u "${pkg}"
 | 
			
		||||
  # TODO(spiffxp): remove this brittle workaround for go getting a package that doesn't exist at HEAD
 | 
			
		||||
  repo=$(echo ${pkg} | cut -d/ -f1-3)
 | 
			
		||||
  git clone "https://${repo}" "${KUBE_TEMP}/go/src/${repo}"
 | 
			
		||||
  # GOPATH="${KUBE_TEMP}/go" go get -d -u "${pkg}"
 | 
			
		||||
  (
 | 
			
		||||
    cd "${KUBE_TEMP}/go/src/${pkg}"
 | 
			
		||||
    cd "${KUBE_TEMP}/go/src/${repo}"
 | 
			
		||||
    git fetch # TODO(spiffxp): workaround
 | 
			
		||||
    git checkout -q "${commit}"
 | 
			
		||||
    GOPATH="${KUBE_TEMP}/go" go get -d "${pkg}" #TODO(spiffxp): workaround
 | 
			
		||||
    GOPATH="${KUBE_TEMP}/go" go install "${pkg}"
 | 
			
		||||
  )
 | 
			
		||||
  PATH="${KUBE_TEMP}/go/bin:${PATH}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user