Skip to content

Commit dc58814

Browse files
author
Per Goncalves da Silva
committed
update golagci-lint
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 1b5e500 commit dc58814

File tree

105 files changed

+3530
-1334
lines changed

Some content is hidden

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

105 files changed

+3530
-1334
lines changed

.github/workflows/sanity.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424
with:
2525
go-version-file: "go.mod"
2626
- name: Run linting checks
27-
uses: "golangci/golangci-lint-action@v6"
27+
uses: golangci/golangci-lint-action@v6
2828
with:
29-
version: "v1.55.2"
30-
skip-pkg-cache: true
29+
version: v1.57.2
3130

.golangci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
run:
22
timeout: 8m
3-
skip-dirs:
4-
- pkg/lib
5-
- pkg/api
6-
- pkg/fakes
7-
- pkg/package-server/apis
8-
- test/e2e
93

104
linters:
115
enable:
@@ -41,7 +35,13 @@ linters-settings:
4135
issues:
4236
max-issues-per-linter: 0
4337
max-same-issues: 0
38+
exclude-dirs:
39+
- pkg/lib
40+
- pkg/api
41+
- pkg/fakes
42+
- pkg/package-server/apis
43+
- test/e2e
4444

4545
output:
46-
format: tab
46+
formats: tab
4747
sort-results: true

go.mod

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/operator-framework/operator-lifecycle-manager
22

33
go 1.22.0
44

5-
toolchain go1.22.2
5+
toolchain go1.22.3
66

77
require (
88
github.com/blang/semver/v4 v4.0.0
@@ -31,7 +31,7 @@ require (
3131
github.com/otiai10/copy v1.14.0
3232
github.com/pkg/errors v0.9.1
3333
github.com/prometheus/client_golang v1.19.0
34-
github.com/prometheus/client_model v0.6.0
34+
github.com/prometheus/client_model v0.6.1
3535
github.com/prometheus/common v0.51.1
3636
github.com/sirupsen/logrus v1.9.3
3737
github.com/spf13/cobra v1.8.0
@@ -62,10 +62,8 @@ require (
6262

6363
// todo: remove this once k8s.io/component-base is updated to use the new prometheus/client_model
6464
replace (
65-
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.16.0
66-
github.com/prometheus/client_model => github.com/prometheus/client_model v0.4.0
67-
github.com/prometheus/common => github.com/prometheus/common v0.44.0
68-
github.com/prometheus/procfs => github.com/prometheus/procfs v0.10.1
65+
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0
66+
github.com/prometheus/common => github.com/prometheus/common v0.47.0
6967
)
7068

7169
require (
@@ -170,7 +168,6 @@ require (
170168
github.com/mattn/go-isatty v0.0.20 // indirect
171169
github.com/mattn/go-runewidth v0.0.15 // indirect
172170
github.com/mattn/go-sqlite3 v1.14.22 // indirect
173-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
174171
github.com/mitchellh/copystructure v1.2.0 // indirect
175172
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
176173
github.com/mitchellh/reflectwalk v1.0.2 // indirect

go.sum

Lines changed: 1074 additions & 11 deletions
Large diffs are not rendered by default.

pkg/controller/registry/grpc/source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ func (s *SourceStore) Add(key registry.CatalogKey, address string) (*SourceConn,
174174
return nil, err
175175
}
176176

177+
// non-blocking call to start exercising the connection
178+
conn.Connect()
179+
177180
ctx, cancel := context.WithCancel(context.Background())
178181
source := SourceConn{
179182
SourceMeta: SourceMeta{
@@ -233,6 +236,11 @@ func (s *SourceStore) watch(ctx context.Context, key registry.CatalogKey, source
233236
// This function is non-blocking. Therefore, when it returns we'll still return IDLE
234237
// as the state (we'll see further state changes in subsequent iterations of the loop).
235238
source.Conn.Connect()
239+
regitryClient := registry.NewClientFromConn(source.Conn)
240+
241+
// Let's force a health check to make sure the connection is healthy
242+
c, err := regitryClient.HealthCheck(ctx, 10*time.Second)
243+
s.logger.WithError(err).WithField("address", source.Address).Debugf("gRPC health check: %v", c)
236244

237245
// notify subscriber
238246
s.notify <- SourceState{Key: key, State: newState}

test/e2e/magic_catalog.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const (
2121
catalogMountPath string = "/opt/olm"
2222
catalogServicePort int32 = 50051
2323
catalogReadyState string = "READY"
24+
catalogIdleState string = "IDLE"
2425
)
2526

2627
type MagicCatalog struct {
@@ -147,7 +148,7 @@ func (c *MagicCatalog) catalogSourceIsReady(ctx context.Context) error {
147148
return false, err
148149
}
149150
state := catalogSource.Status.GRPCConnectionState.LastObservedState
150-
if state != catalogReadyState {
151+
if state != catalogReadyState && state != catalogIdleState {
151152
return false, nil
152153
}
153154
return true, nil

test/e2e/subscription_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3607,7 +3607,7 @@ func updateInternalCatalog(t GinkgoTInterface, c operatorclient.ClientInterface,
36073607
before := fetchedInitialCatalog.Status.ConfigMapResource
36083608
after := catalog.Status.ConfigMapResource
36093609
if after != nil && after.LastUpdateTime.After(before.LastUpdateTime.Time) && after.ResourceVersion != before.ResourceVersion &&
3610-
catalog.Status.GRPCConnectionState.LastConnectTime.After(after.LastUpdateTime.Time) && catalog.Status.GRPCConnectionState.LastObservedState == "READY" {
3610+
catalog.Status.GRPCConnectionState.LastConnectTime.After(after.LastUpdateTime.Time) && (catalog.Status.GRPCConnectionState.LastObservedState == "READY" || catalog.Status.GRPCConnectionState.LastObservedState == "IDLE") {
36113611
fmt.Println("catalog updated")
36123612
return true
36133613
}

test/e2e/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func catalogSourceRegistryPodSynced() func(catalog *operatorsv1alpha1.CatalogSou
364364
lastState = state
365365
lastTime = time.Now()
366366
}
367-
if registry != nil && connState != nil && !connState.LastConnectTime.IsZero() && connState.LastObservedState == "READY" {
367+
if registry != nil && connState != nil && !connState.LastConnectTime.IsZero() && (connState.LastObservedState == "READY" || connState.LastObservedState == "IDLE") {
368368
fmt.Printf("probing catalog %s pod with address %s\n", catalog.GetName(), registry.Address())
369369
return registryPodHealthy(registry.Address())
370370
}

vendor/github.com/matttproud/golang_protobuf_extensions/LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)