-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
pkg/webhook/config.go
Outdated
@@ -205,7 +205,10 @@ func (f *Config) CreateValidationWebhookServerConfig(ctx context.Context, webhoo | |||
} | |||
} | |||
ctxlog.Debugf(ctx, "Creating validation webhook config '%s'", config.Name) | |||
f.client.Delete(ctx, config) | |||
err := f.client.Delete(ctx, config) | |||
if err != nil && !apierrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil && !apierrors.IsNotFound(err) { | |
if err := f.client.Delete(ctx, config); err != nil && !apierrors.IsNotFound(err) { |
pkg/webhook/config.go
Outdated
@@ -251,7 +254,10 @@ func (f *Config) CreateMutationWebhookServerConfig(ctx context.Context, webhooks | |||
} | |||
|
|||
ctxlog.Debugf(ctx, "Creating mutating webhook config '%s'", config.Name) | |||
f.client.Delete(ctx, &config) | |||
err := f.client.Delete(ctx, &config) | |||
if err != nil && !apierrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil && !apierrors.IsNotFound(err) { | |
if err := f.client.Delete(ctx, &config); err != nil && !apierrors.IsNotFound(err) { |
pkg/logger/logger.go
Outdated
@@ -27,7 +27,10 @@ func newLogger(level string, options ...zap.Option) *zap.Logger { | |||
} | |||
|
|||
l := zap.DebugLevel | |||
l.Set(level) | |||
err := l.Set(level) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
if err := l.Set(level); err != nil { |
pkg/ctxlog/events.go
Outdated
@@ -112,7 +112,11 @@ func (ev Event) debugJSON(ctx context.Context, objectInfo interface{}) { | |||
|
|||
// treat JSON data as a string map and extract message | |||
var result map[string]string | |||
json.Unmarshal([]byte(jsonData), &result) | |||
err := json.Unmarshal([]byte(jsonData), &result) | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
if err := json.Unmarshal([]byte(jsonData), &result); err != nil { |
pkg/crd/crd.go
Outdated
@@ -68,7 +68,7 @@ func ApplyCRD(ctx context.Context, client extv1client.ApiextensionsV1beta1Interf | |||
} | |||
|
|||
// WaitForCRDReady blocks until the CRD is ready. | |||
func WaitForCRDReady(ctx context.Context, client extv1client.ApiextensionsV1beta1Interface, crdName string) error { | |||
func WaitForCRDReady(ctx context.Context, client extv1client.ApiextensionsV1beta1Interface, crdName string) error { // nolint:interfacer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone intend to use the output of interfacer? Maybe we drop that linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manno I had same feeling.
BTW, interface is out of maintain: https://github.com/mvdan/interfacer
Deprecated: A tool that suggests interfaces is prone to bad suggestions, so its usefulness in real code is limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, added a commit to drop it
@@ -112,7 +112,10 @@ func (ev Event) debugJSON(ctx context.Context, objectInfo interface{}) { | |||
|
|||
// treat JSON data as a string map and extract message | |||
var result map[string]string | |||
json.Unmarshal([]byte(jsonData), &result) | |||
if err := json.Unmarshal([]byte(jsonData), &result); err != nil { | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be helpful to print the error to debug if it fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it was silent for a reason, but then a few lines done it does print a debug msg. So why not here, too.
A chore.
Added TODO about errchecking on BindFlag.