Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Jan 16, 2023
1 parent be1f297 commit a17008e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/apply/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func handleError(eventChannel chan event.Event, err error) {
// for the passed non cluster-scoped localObjs, plus the namespace
// of the passed inventory object. This is used to skip deleting
// namespaces which have currently applied objects in them.
func localNamespaces(localInv inventory.Info, localObjs []object.ObjMetadata) sets.String {
func localNamespaces(localInv inventory.Info, localObjs []object.ObjMetadata) sets.String { // nolint:staticcheck
namespaces := sets.NewString()
for _, obj := range localObjs {
if obj.Namespace != "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/filter/current-uids-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// if an object should not be pruned (deleted) because it has recently
// been applied.
type CurrentUIDFilter struct {
CurrentUIDs sets.String
CurrentUIDs sets.String // nolint:staticcheck
}

// Name returns a filter identifier for logging.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/filter/current-uids-filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func TestCurrentUIDFilter(t *testing.T) {
tests := map[string]struct {
filterUIDs sets.String
filterUIDs sets.String // nolint:staticcheck
objUID string
expectedError error
}{
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/filter/local-namespaces-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
// that are currently in use. Used to ensure we do not delete
// namespaces with currently applied objects in them.
type LocalNamespacesFilter struct {
LocalNamespaces sets.String
LocalNamespaces sets.String // nolint:staticcheck
}

// Name returns a filter identifier for logging.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apply/filter/local-namespaces-filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var testNamespace = &unstructured.Unstructured{

func TestLocalNamespacesFilter(t *testing.T) {
tests := map[string]struct {
localNamespaces sets.String
localNamespaces sets.String // nolint:staticcheck
namespace string
expectedError error
}{
Expand Down
2 changes: 1 addition & 1 deletion pkg/inventory/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (tc *Manager) AppliedResourceUID(id object.ObjMetadata) (types.UID, bool) {

// AppliedResourceUIDs returns a set with the UIDs of all the
// successfully applied resources.
func (tc *Manager) AppliedResourceUIDs() sets.String {
func (tc *Manager) AppliedResourceUIDs() sets.String { // nolint:staticcheck
uids := sets.NewString()
for _, objStatus := range tc.inventory.Status.Objects {
if objStatus.Strategy == actuation.ActuationStrategyApply &&
Expand Down
6 changes: 5 additions & 1 deletion pkg/kstatus/watcher/object_status_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ func (w *ObjectStatusReporter) startInformerNow(
return fmt.Errorf("failed to set error handler on new informer for %v: %v", mapping.Resource, err)
}

informer.AddEventHandler(w.eventHandler(ctx, eventCh))
_, err = informer.AddEventHandler(w.eventHandler(ctx, eventCh))
if err != nil {
// Should never happen.
return fmt.Errorf("failed add event handler on new informer for %v: %v", mapping.Resource, err)
}

// Start the informer in the background.
// Informer will be stopped when the context is cancelled.
Expand Down

0 comments on commit a17008e

Please sign in to comment.