Unpin all the plugins, so we can test against head b4 release.

This commit is contained in:
Jeffrey Regan
2019-11-07 15:28:04 -08:00
parent e0b46acf2f
commit 2b1749778f
47 changed files with 4984 additions and 129 deletions

53
hack/unpinRepinPluginApiDep.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes Authors.
# SPDX-License-Identifier: Apache-2.0
# This script unpins or repins the Go kustomize API dependence
# for all the plugins in the repo.
# Run this from repo root, e.g.
#
# ./hack/unpinRepinPluginApiDep.sh unPin v0.1.1
#
set -o errexit
set -o nounset
set -o pipefail
operation=$1
version=$2
if [[ ("$operation" != "unPin") && ("$operation" != "rePin") ]]; then
echo "unknown operation $operation"
exit 1
fi
function addReplace {
go mod edit -replace=sigs.k8s.io/kustomize/api@${version}=$1
go mod tidy
}
function dropReplace {
go mod edit -dropreplace=sigs.k8s.io/kustomize/api@${version}
go mod tidy
}
function forEachGoMod {
for goMod in $(find $2 -name 'go.mod'); do
d=$(dirname "${goMod}")
echo $d
(cd $d; $1 $3 )
done
}
function unPin {
forEachGoMod addReplace ./plugin/builtin ../../../api
forEachGoMod addReplace ./plugin/someteam.example.com ../../../../api
}
function rePin {
forEachGoMod dropReplace ./plugin/builtin
forEachGoMod dropReplace ./plugin/someteam.example.com
}
$operation