Skip to content

Commit

Permalink
chore: reset RESTMapper with MaybeResetRESTMapper (#2844)
Browse files Browse the repository at this point in the history
- Use new method from apimachinery 0.23.0
- Remove local cli-utils pkg modification
  • Loading branch information
karlkfi authored Mar 2, 2022
1 parent 3140574 commit 6cc2d38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
10 changes: 2 additions & 8 deletions pkg/live/inventoryrg.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"time"

"github.com/GoogleContainerTools/kpt/pkg/status"
"github.com/GoogleContainerTools/kpt/thirdparty/cli-utils/pkg/apply/taskrunner"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -377,14 +376,9 @@ func (rgi *ResourceGroupInstaller) InstallRG(ctx context.Context) error {
return e.Error
case pollevent.ResourceUpdateEvent:
if e.Resource.Status == kstatus.CurrentStatus {
// TODO: Replace this with a call to meta.MaybeResetRESTMapper
// once we update the k8s libraries.
m, err := taskrunner.ExtractDeferredDiscoveryRESTMapper(mapper)
if err != nil {
return err
if !meta.MaybeResetRESTMapper(mapper) {
return fmt.Errorf("failed to reset RESTMapper: %T", mapper)
}
m.Reset()
return nil
}
}
}
Expand Down
29 changes: 0 additions & 29 deletions thirdparty/cli-utils/pkg/apply/taskrunner/task.go

This file was deleted.

0 comments on commit 6cc2d38

Please sign in to comment.