mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-09 07:33:52 +00:00
change update-go-mod.sh to use head of main for fosite via config file
This commit is contained in:
6
go.mod
6
go.mod
@@ -13,7 +13,6 @@ replace k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230717233707-2695361
|
||||
// https://github.com/kubernetes/apiserver/blob/v0.28.4/go.mod. Wherever they clash, replace
|
||||
// with the version which is more consistent with kubernetes/apiserver.
|
||||
replace (
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace => go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.35.0
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1
|
||||
go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.10.0
|
||||
@@ -23,12 +22,11 @@ replace (
|
||||
go.opentelemetry.io/otel/exporters/zipkin => go.opentelemetry.io/otel/exporters/zipkin v1.10.0
|
||||
go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v0.31.0
|
||||
go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.10.0
|
||||
go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.10.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/MakeNowJust/heredoc/v2 v2.0.1
|
||||
github.com/chromedp/cdproto v0.0.0-20231126232103-8e31ff06e23b
|
||||
github.com/chromedp/cdproto v0.0.0-20231205062650-00455a960d61
|
||||
github.com/chromedp/chromedp v0.9.3
|
||||
github.com/coreos/go-oidc/v3 v3.8.0
|
||||
github.com/coreos/go-semver v0.3.1
|
||||
@@ -50,7 +48,7 @@ require (
|
||||
github.com/gorilla/websocket v1.5.1
|
||||
github.com/joshlf/go-acl v0.0.0-20200411065538-eae00ae38531
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
|
||||
github.com/ory/fosite v0.0.0-20231113125121-dfa2c0a1b63c
|
||||
github.com/ory/fosite v0.44.1-0.20231113125121-dfa2c0a1b63c
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/sclevine/spec v1.4.0
|
||||
|
||||
12
go.sum
12
go.sum
@@ -67,8 +67,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chromedp/cdproto v0.0.0-20231011050154-1d073bb38998/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
|
||||
github.com/chromedp/cdproto v0.0.0-20231126232103-8e31ff06e23b h1:SywfM3985mh0PaXhiZbgR+VQFSfFXJSNLX2p+3vBvOc=
|
||||
github.com/chromedp/cdproto v0.0.0-20231126232103-8e31ff06e23b/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
|
||||
github.com/chromedp/cdproto v0.0.0-20231205062650-00455a960d61 h1:XD280QPATe9jaz20dylKe3vBsNcH1w3mkssGY0lidn8=
|
||||
github.com/chromedp/cdproto v0.0.0-20231205062650-00455a960d61/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
|
||||
github.com/chromedp/chromedp v0.9.3 h1:Wq58e0dZOdHsxaj9Owmfcf+ibtpYN1N0FWVbaxa/esg=
|
||||
github.com/chromedp/chromedp v0.9.3/go.mod h1:NipeUkUcuzIdFbBP8eNNvl9upcceOfWzoJn6cRe4ksA=
|
||||
github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=
|
||||
@@ -429,8 +429,8 @@ github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfP
|
||||
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
|
||||
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde h1:x0TT0RDC7UhAVbbWWBzr41ElhJx5tXPWkIHA2HWPRuw=
|
||||
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
|
||||
github.com/ory/fosite v0.0.0-20231113125121-dfa2c0a1b63c h1:6uLFYRLJINWw1NzUJUxrSihHBs/2l2U0FFZjhBH2WsI=
|
||||
github.com/ory/fosite v0.0.0-20231113125121-dfa2c0a1b63c/go.mod h1:fkMPsnm/UjiefE9dE9CdZQGOH48TWJLIzUcdGIXg8Kk=
|
||||
github.com/ory/fosite v0.44.1-0.20231113125121-dfa2c0a1b63c h1:F44CFBukG42RKXwuBLmbADDQI9rFhTZJQEsedOmuYaA=
|
||||
github.com/ory/fosite v0.44.1-0.20231113125121-dfa2c0a1b63c/go.mod h1:fkMPsnm/UjiefE9dE9CdZQGOH48TWJLIzUcdGIXg8Kk=
|
||||
github.com/ory/go-acc v0.2.9-0.20230103102148-6b1c9a70dbbe h1:rvu4obdvqR0fkSIJ8IfgzKOWwZ5kOT2UNfLq81Qk7rc=
|
||||
github.com/ory/go-acc v0.2.9-0.20230103102148-6b1c9a70dbbe/go.mod h1:z4n3u6as84LbV4YmgjHhnwtccQqzf4cZlSk9f1FhygI=
|
||||
github.com/ory/go-convenience v0.1.0 h1:zouLKfF2GoSGnJwGq+PE/nJAE6dj2Zj5QlTgmMTsTS8=
|
||||
@@ -585,8 +585,8 @@ go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9s
|
||||
go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A=
|
||||
go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
|
||||
go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
|
||||
go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
|
||||
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
|
||||
go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs=
|
||||
go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0=
|
||||
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
|
||||
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
|
||||
@@ -8,21 +8,37 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/mod/modfile"
|
||||
)
|
||||
|
||||
func main() {
|
||||
goModFilepath := filepath.Clean(os.Args[1])
|
||||
overridesFilepath := filepath.Clean(os.Args[2])
|
||||
|
||||
if _, err := os.Stat(goModFilepath); err != nil {
|
||||
log.Fatalf("File '%s' does not exist\n", goModFilepath)
|
||||
}
|
||||
|
||||
if _, err := os.Stat(overridesFilepath); err != nil {
|
||||
log.Fatalf("File '%s' does not exist\n", overridesFilepath)
|
||||
}
|
||||
|
||||
var (
|
||||
bytes []byte
|
||||
err error
|
||||
bytes []byte
|
||||
overrides map[string]string
|
||||
err error
|
||||
)
|
||||
|
||||
if bytes, err = os.ReadFile(overridesFilepath); err != nil {
|
||||
log.Fatalf("Unable to read file '%s'\n", overridesFilepath)
|
||||
}
|
||||
|
||||
if overrides, err = parseOverrides(string(bytes)); err != nil {
|
||||
log.Fatalf("Parse error in file '%s': %s\n", overridesFilepath, err.Error())
|
||||
}
|
||||
|
||||
if bytes, err = os.ReadFile(goModFilepath); err != nil {
|
||||
log.Fatalf("Unable to read file '%s'\n", goModFilepath)
|
||||
}
|
||||
@@ -34,9 +50,41 @@ func main() {
|
||||
|
||||
for _, require := range file.Require {
|
||||
if !require.Indirect {
|
||||
fmt.Printf("go get %s &&\n", require.Mod.Path)
|
||||
mod := require.Mod.Path
|
||||
overrideMod, hasOverride := overrides[mod]
|
||||
if hasOverride {
|
||||
mod = overrideMod
|
||||
}
|
||||
fmt.Printf("go get %s &&\n", mod)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("./hack/module.sh tidy\n")
|
||||
}
|
||||
|
||||
func parseOverrides(overridesText string) (map[string]string, error) {
|
||||
overridesMap := map[string]string{}
|
||||
|
||||
lines := strings.Split(overridesText, "\n")
|
||||
|
||||
for i, line := range lines {
|
||||
trimmedLine := strings.TrimSpace(line)
|
||||
|
||||
if strings.HasPrefix(trimmedLine, "#") || len(trimmedLine) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
splitLine := strings.Split(trimmedLine, " ")
|
||||
|
||||
if len(splitLine) != 2 {
|
||||
return nil, fmt.Errorf(
|
||||
"error on line %d: found %d tokens instead of 2 tokens",
|
||||
i+1, len(splitLine),
|
||||
)
|
||||
}
|
||||
|
||||
overridesMap[splitLine[0]] = splitLine[1]
|
||||
}
|
||||
|
||||
return overridesMap, nil
|
||||
}
|
||||
|
||||
5
hack/update-go-mod/overrides.conf
Normal file
5
hack/update-go-mod/overrides.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
# Format:
|
||||
# package_name_as_it_appears_in_go_mod package_name_as_it_should_be_used_with_go_get
|
||||
|
||||
# Fosite has not had a release for a long time, so use the head of their main branch.
|
||||
github.com/ory/fosite github.com/ory/fosite@master
|
||||
@@ -11,9 +11,12 @@ ROOT_DIR="$SCRIPT_DIR/../.."
|
||||
GO_MOD="${ROOT_DIR}/go.mod"
|
||||
|
||||
pushd "${SCRIPT_DIR}" > /dev/null
|
||||
script=$(go run . "${GO_MOD}")
|
||||
script=$(go run . "${GO_MOD}" overrides.conf)
|
||||
popd > /dev/null
|
||||
|
||||
# Print to screen for debugging purposes.
|
||||
echo "$script"
|
||||
|
||||
pushd "${ROOT_DIR}" > /dev/null
|
||||
eval "$script"
|
||||
popd > /dev/null
|
||||
|
||||
Reference in New Issue
Block a user