Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

fix: update configClient call and logging #4854

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/certificate/providers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"
cmversionedclient "github.com/jetstack/cert-manager/pkg/client/clientset/versioned"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
Expand Down
4 changes: 2 additions & 2 deletions pkg/certificate/providers/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestGetCertificateManager(t *testing.T) {
},
}),
informerCollectionFunc: func(tc testCase) (*informers.InformerCollection, error) {
ic, err := informers.NewInformerCollection("osm", nil, informers.WithKubeClient(tc.kubeClient), informers.WithConfigClient(tc.configClient))
ic, err := informers.NewInformerCollection("osm", nil, informers.WithKubeClient(tc.kubeClient), informers.WithConfigClient(tc.configClient, "", "osm-system"))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestGetCertificateManager(t *testing.T) {
},
}),
informerCollectionFunc: func(tc testCase) (*informers.InformerCollection, error) {
ic, err := informers.NewInformerCollection("osm", nil, informers.WithKubeClient(tc.kubeClient), informers.WithConfigClient(tc.configClient, "", "osm-namespace"))
ic, err := informers.NewInformerCollection("osm", nil, informers.WithKubeClient(tc.kubeClient), informers.WithConfigClient(tc.configClient, "", "osm-system"))
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/certificate/providers/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"

"github.com/rs/zerolog/log"
corev1 "k8s.io/api/core/v1"

"github.com/openservicemesh/osm/pkg/apis/config/v1alpha2"
Expand Down
3 changes: 0 additions & 3 deletions pkg/certificate/providers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import (
"github.com/openservicemesh/osm/pkg/apis/config/v1alpha2"
"github.com/openservicemesh/osm/pkg/certificate"
"github.com/openservicemesh/osm/pkg/certificate/pem"
"github.com/openservicemesh/osm/pkg/logger"
)

var log = logger.New("certificate/provider")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was seeing lint errors here baff85f

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, in that case, we should remove (or alias) the import and keep this line; this assignment adds good context to the log lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Fixed!


// Kind specifies the certificate provider kind
type Kind string

Expand Down