Skip to content

Commit 3bb267d

Browse files
Merge pull request #15024 from logonoff/OCPBUGS-55629-go-mod-tidy
OCPBUGS-55629: get `go mod tidy` to pass
2 parents f31dbdb + ce80857 commit 3bb267d

File tree

1,378 files changed

+79068
-82081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,378 files changed

+79068
-82081
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.env
22
.idea
33
.vscode
4+
!/vendor/**
45
!.vscode/settings.json
56
.DS_Store
67
cypress-a11y-report.json

go.mod

+97-101
Large diffs are not rendered by default.

go.sum

+305-1,375
Large diffs are not rendered by default.

pkg/serverconfig/validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func validateControlPlaneTopology(value string) (string, error) {
138138
if !(value == string(configv1.SingleReplicaTopologyMode) ||
139139
value == string(configv1.HighlyAvailableTopologyMode) ||
140140
value == string(configv1.HighlyAvailableArbiterMode) ||
141-
value == "DualReplica" || // TODO: Replace with string(configv1.DualReplicaTopologyMode) when openshift/api is updated
141+
value == string(configv1.DualReplicaTopologyMode) ||
142142
value == string(configv1.ExternalTopologyMode)) {
143143
return value, fmt.Errorf("ControlPlaneTopologyMode %s is not valid; valid options are External, HighlyAvailable, HighlyAvailableArbiter, DualReplica or SingleReplica", value)
144144
}

test-backend.sh

+11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ OPENSHIFT_CI=${OPENSHIFT_CI:=false}
2828
TESTABLE="./..."
2929
FORMATTABLE=(cmd pkg)
3030

31+
# ensure console can be built with konflux
32+
echo "Verifying go deps..."
33+
go mod tidy
34+
go mod vendor
35+
CHANGES=$(git status --porcelain --ignored)
36+
if [ -n "$CHANGES" ] ; then
37+
echo "ERROR: detected vendor inconsistency after 'go mod tidy; go mod vendor':"
38+
echo "$CHANGES"
39+
exit 1
40+
fi
41+
3142
# user has not provided PKG override
3243
if [ -z "${PKG}" ]; then
3344
TEST=${TESTABLE}

vendor/dario.cat/mergo/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# Output of the go coverage tool, specifically when used with LiteIDE
1414
*.out
1515

16+
# Golang/Intellij
17+
.idea
18+
1619
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
1720
.glide/
1821

vendor/dario.cat/mergo/README.md

+56-46
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,21 @@ Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the
4444

4545
## Status
4646

47-
It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, Microsoft, etc](https://github.com/imdario/mergo#mergo-in-the-wild).
47+
Mergo is stable and frozen, ready for production. Check a short list of the projects using at large scale it [here](https://github.com/imdario/mergo#mergo-in-the-wild).
48+
49+
No new features are accepted. They will be considered for a future v2 that improves the implementation and fixes bugs for corner cases.
4850

4951
### Important notes
5052

5153
#### 1.0.0
5254

53-
In [1.0.0](//github.com/imdario/mergo/releases/tag/1.0.0) Mergo moves to a vanity URL `dario.cat/mergo`.
55+
In [1.0.0](//github.com/imdario/mergo/releases/tag/1.0.0) Mergo moves to a vanity URL `dario.cat/mergo`. No more v1 versions will be released.
56+
57+
If the vanity URL is causing issues in your project due to a dependency pulling Mergo - it isn't a direct dependency in your project - it is recommended to use [replace](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) to pin the version to the last one with the old import URL:
58+
59+
```
60+
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
61+
```
5462

5563
#### 0.3.9
5664

@@ -64,55 +72,24 @@ If you were using Mergo before April 6th, 2015, please check your project works
6472

6573
If Mergo is useful to you, consider buying me a coffee, a beer, or making a monthly donation to allow me to keep building great free software. :heart_eyes:
6674

67-
<a href='https://ko-fi.com/B0B58839' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
6875
<a href="https://liberapay.com/dario/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
6976
<a href='https://github.com/sponsors/imdario' target='_blank'><img alt="Become my sponsor" src="https://img.shields.io/github/sponsors/imdario?style=for-the-badge" /></a>
7077

7178
### Mergo in the wild
7279

73-
- [moby/moby](https://github.com/moby/moby)
74-
- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes)
75-
- [vmware/dispatch](https://github.com/vmware/dispatch)
76-
- [Shopify/themekit](https://github.com/Shopify/themekit)
77-
- [imdario/zas](https://github.com/imdario/zas)
78-
- [matcornic/hermes](https://github.com/matcornic/hermes)
79-
- [OpenBazaar/openbazaar-go](https://github.com/OpenBazaar/openbazaar-go)
80-
- [kataras/iris](https://github.com/kataras/iris)
81-
- [michaelsauter/crane](https://github.com/michaelsauter/crane)
82-
- [go-task/task](https://github.com/go-task/task)
83-
- [sensu/uchiwa](https://github.com/sensu/uchiwa)
84-
- [ory/hydra](https://github.com/ory/hydra)
85-
- [sisatech/vcli](https://github.com/sisatech/vcli)
86-
- [dairycart/dairycart](https://github.com/dairycart/dairycart)
87-
- [projectcalico/felix](https://github.com/projectcalico/felix)
88-
- [resin-os/balena](https://github.com/resin-os/balena)
89-
- [go-kivik/kivik](https://github.com/go-kivik/kivik)
90-
- [Telefonica/govice](https://github.com/Telefonica/govice)
91-
- [supergiant/supergiant](supergiant/supergiant)
92-
- [SergeyTsalkov/brooce](https://github.com/SergeyTsalkov/brooce)
93-
- [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy)
94-
- [ohsu-comp-bio/funnel](https://github.com/ohsu-comp-bio/funnel)
95-
- [EagerIO/Stout](https://github.com/EagerIO/Stout)
96-
- [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api)
97-
- [russross/canvasassignments](https://github.com/russross/canvasassignments)
98-
- [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api)
99-
- [casualjim/exeggutor](https://github.com/casualjim/exeggutor)
100-
- [divshot/gitling](https://github.com/divshot/gitling)
101-
- [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl)
102-
- [andrerocker/deploy42](https://github.com/andrerocker/deploy42)
103-
- [elwinar/rambler](https://github.com/elwinar/rambler)
104-
- [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman)
105-
- [jfbus/impressionist](https://github.com/jfbus/impressionist)
106-
- [Jmeyering/zealot](https://github.com/Jmeyering/zealot)
107-
- [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host)
108-
- [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go)
109-
- [thoas/picfit](https://github.com/thoas/picfit)
110-
- [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server)
111-
- [jnuthong/item_search](https://github.com/jnuthong/item_search)
112-
- [bukalapak/snowboard](https://github.com/bukalapak/snowboard)
113-
- [containerssh/containerssh](https://github.com/containerssh/containerssh)
114-
- [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser)
115-
- [tjpnz/structbot](https://github.com/tjpnz/structbot)
80+
Mergo is used by [thousands](https://deps.dev/go/dario.cat%2Fmergo/v1.0.0/dependents) [of](https://deps.dev/go/github.com%2Fimdario%2Fmergo/v0.3.16/dependents) [projects](https://deps.dev/go/github.com%2Fimdario%2Fmergo/v0.3.12), including:
81+
82+
* [containerd/containerd](https://github.com/containerd/containerd)
83+
* [datadog/datadog-agent](https://github.com/datadog/datadog-agent)
84+
* [docker/cli/](https://github.com/docker/cli/)
85+
* [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser)
86+
* [go-micro/go-micro](https://github.com/go-micro/go-micro)
87+
* [grafana/loki](https://github.com/grafana/loki)
88+
* [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes)
89+
* [masterminds/sprig](github.com/Masterminds/sprig)
90+
* [moby/moby](https://github.com/moby/moby)
91+
* [slackhq/nebula](https://github.com/slackhq/nebula)
92+
* [volcano-sh/volcano](https://github.com/volcano-sh/volcano)
11693

11794
## Install
11895

@@ -141,6 +118,39 @@ if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil {
141118
}
142119
```
143120

121+
If you need to override pointers, so the source pointer's value is assigned to the destination's pointer, you must use `WithoutDereference`:
122+
123+
```go
124+
package main
125+
126+
import (
127+
"fmt"
128+
129+
"dario.cat/mergo"
130+
)
131+
132+
type Foo struct {
133+
A *string
134+
B int64
135+
}
136+
137+
func main() {
138+
first := "first"
139+
second := "second"
140+
src := Foo{
141+
A: &first,
142+
B: 2,
143+
}
144+
145+
dest := Foo{
146+
A: &second,
147+
B: 1,
148+
}
149+
150+
mergo.Merge(&dest, src, mergo.WithOverride, mergo.WithoutDereference)
151+
}
152+
```
153+
144154
Additionally, you can map a `map[string]interface{}` to a struct (and otherwise, from struct to map), following the same restrictions as in `Merge()`. Keys are capitalized to find each corresponding exported field.
145155

146156
```go

vendor/dario.cat/mergo/map.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
5858
}
5959
fieldName := field.Name
6060
fieldName = changeInitialCase(fieldName, unicode.ToLower)
61-
if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v), !config.ShouldNotDereference) || overwrite) {
61+
if _, ok := dstMap[fieldName]; !ok || (!isEmptyValue(reflect.ValueOf(src.Field(i).Interface()), !config.ShouldNotDereference) && overwrite) || config.overwriteWithEmptyValue {
6262
dstMap[fieldName] = src.Field(i).Interface()
6363
}
6464
}

vendor/dario.cat/mergo/merge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
269269
if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
270270
return
271271
}
272-
} else {
272+
} else if src.Elem().Kind() != reflect.Struct {
273273
if overwriteWithEmptySrc || (overwrite && !src.IsNil()) || dst.IsNil() {
274274
dst.Set(src)
275275
}

vendor/github.com/BurntSushi/toml/README.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)