mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 10:15:22 +00:00
Unpin all the plugins, so we can test against head b4 release.
This commit is contained in:
53
hack/unpinRepinPluginApiDep.sh
Executable file
53
hack/unpinRepinPluginApiDep.sh
Executable 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
|
||||
Reference in New Issue
Block a user