Merge pull request #580 from crossplane/renovate/golangci-golangci-lint-1.x

Update dependency golangci/golangci-lint to v1.55.2
This commit is contained in:
Philippe Scorsolini 2023-11-16 13:48:32 +01:00 committed by GitHub
commit e258edd7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 11 deletions

View File

@ -11,7 +11,7 @@ on:
env:
# Common versions
GO_VERSION: '1.21.4'
GOLANGCI_VERSION: 'v1.54.2'
GOLANGCI_VERSION: 'v1.55.2'
jobs:
check-diff:

View File

@ -34,7 +34,7 @@ GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))
GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION)
GO_SUBDIRS += pkg apis
GO111MODULE = on
GOLANGCILINT_VERSION = 1.54.2
GOLANGCILINT_VERSION = 1.55.2
-include build/makelib/golang.mk
# ====================================================================================

View File

@ -74,14 +74,23 @@ func (ss *SecretStore) ReadKeyValues(ctx context.Context, n store.ScopedName, s
}
s.ScopedName = n
s.Data = make(map[string][]byte, len(resp.Secret.Data))
for d := range resp.Secret.Data {
s.Data[d] = resp.Secret.Data[d]
respSecret := resp.GetSecret()
if respSecret == nil {
return nil
}
if resp.Secret != nil && len(resp.Secret.Metadata) != 0 {
respSecretData := respSecret.GetData()
s.Data = make(map[string][]byte, len(respSecretData))
for d := range respSecretData {
s.Data[d] = respSecretData[d]
}
respSecretMetadata := respSecret.GetMetadata()
if len(respSecretMetadata) != 0 {
s.Metadata = new(v1.ConnectionSecretMetadata)
s.Metadata.Labels = make(map[string]string, len(resp.Secret.Metadata))
for k, v := range resp.Secret.Metadata {
s.Metadata.Labels = make(map[string]string, len(respSecretMetadata))
for k, v := range respSecretMetadata {
s.Metadata.Labels[k] = v
}
}
@ -110,7 +119,7 @@ func (ss *SecretStore) WriteKeyValues(ctx context.Context, s *store.Secret, _ ..
return false, errors.Wrap(err, errApply)
}
return resp.Changed, nil
return resp.GetChanged(), nil
}
// DeleteKeyValues delete key value pairs from a given Secret.

View File

@ -78,11 +78,11 @@ func TestReadKeyValues(t *testing.T) {
},
client: &fake.ExternalSecretStorePluginServiceClient{
GetSecretFn: func(ctx context.Context, req *ess.GetSecretRequest, opts ...grpc.CallOption) (*ess.GetSecretResponse, error) {
if diff := cmp.Diff(filepath.Join(parentPath, secretName), req.Secret.ScopedName); diff != "" {
if diff := cmp.Diff(filepath.Join(parentPath, secretName), req.GetSecret().GetScopedName()); diff != "" {
t.Errorf("r: -want, +got:\n%s", diff)
}
sec := &ess.Secret{
ScopedName: req.Secret.ScopedName,
ScopedName: req.GetSecret().GetScopedName(),
Data: map[string][]byte{
"data1": []byte("val1"),
"data2": []byte("val2"),