upgrade to latest dependencies (#528)

bumping knative.dev/pkg 71508fc...9a4b612:
  > 9a4b612 Added invalid value field error with details (# 2246)
  > d9b35c4 Delete deprecated ObserveFinalizeKind API (# 2248)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2021-09-09 02:56:59 -04:00 committed by GitHub
parent 85a52eb578
commit e5d2243261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 73 deletions

2
go.mod
View File

@ -21,5 +21,5 @@ require (
k8s.io/code-generator v0.21.4
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
knative.dev/hack v0.0.0-20210806075220-815cd312d65c
knative.dev/pkg v0.0.0-20210908025933-71508fc69a57
knative.dev/pkg v0.0.0-20210908202858-9a4b6128207c
)

4
go.sum
View File

@ -978,8 +978,8 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/hack v0.0.0-20210806075220-815cd312d65c h1:nOXoDWAAItwr4o0dp3nHr6skgpVD4IvME/UX84YNl5k=
knative.dev/hack v0.0.0-20210806075220-815cd312d65c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/pkg v0.0.0-20210908025933-71508fc69a57 h1:du+do3to2zboxuk0Uj8Xvf2onOxthyaBSr98+hVB7z4=
knative.dev/pkg v0.0.0-20210908025933-71508fc69a57/go.mod h1:jMSqkNMsrzuy+XR4Yr/BMy7SDVbUOl3KKB6+5MR+ZU8=
knative.dev/pkg v0.0.0-20210908202858-9a4b6128207c h1:Em+aGSEisMG9my6i+arqz5GU+f9GPdbPndtyBIAlOns=
knative.dev/pkg v0.0.0-20210908202858-9a4b6128207c/go.mod h1:jMSqkNMsrzuy+XR4Yr/BMy7SDVbUOl3KKB6+5MR+ZU8=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=

View File

@ -73,20 +73,6 @@ type ReadOnlyInterface interface {
ObserveKind(ctx context.Context, o *v1alpha1.Image) reconciler.Event
}
// ReadOnlyFinalizer defines the strongly typed interfaces to be implemented by a
// controller finalizing v1alpha1.Image if they want to process tombstoned resources
// even when they are not the leader. Due to the nature of how finalizers are handled
// there are no guarantees that this will be called.
//
// Deprecated: Use reconciler.OnDeletionInterface instead.
type ReadOnlyFinalizer interface {
// ObserveFinalizeKind implements custom logic to observe the final state of v1alpha1.Image.
// This method should not write to the API.
//
// Deprecated: Use reconciler.ObserveDeletion instead.
ObserveFinalizeKind(ctx context.Context, o *v1alpha1.Image) reconciler.Event
}
type doReconcile func(ctx context.Context, o *v1alpha1.Image) reconciler.Event
// reconcilerImpl implements controller.Reconciler for v1alpha1.Image resources.
@ -265,10 +251,6 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
return fmt.Errorf("failed to clear finalizers: %w", err)
}
case reconciler.DoObserveKind, reconciler.DoObserveFinalizeKind:
// Observe any changes to this resource, since we are not the leader.
reconcileEvent = do(ctx, resource)
}
// Synchronize the status.

View File

@ -41,10 +41,6 @@ type state struct {
roi ReadOnlyInterface
// isROI (Read Only Interface) the reconciler only observes reconciliation.
isROI bool
// rof is the read only finalizer cast of the reconciler.
rof ReadOnlyFinalizer
// isROF (Read Only Finalizer) the reconciler only observes finalize.
isROF bool
// isLeader the instance of the reconciler is the elected leader.
isLeader bool
}
@ -57,7 +53,6 @@ func newState(key string, r *reconcilerImpl) (*state, error) {
}
roi, isROI := r.reconciler.(ReadOnlyInterface)
rof, isROF := r.reconciler.(ReadOnlyFinalizer)
isLeader := r.IsLeaderFor(types.NamespacedName{
Namespace: namespace,
@ -71,8 +66,6 @@ func newState(key string, r *reconcilerImpl) (*state, error) {
reconciler: r.reconciler,
roi: roi,
isROI: isROI,
rof: rof,
isROF: isROF,
isLeader: isLeader,
}, nil
}
@ -82,8 +75,8 @@ func newState(key string, r *reconcilerImpl) (*state, error) {
// isNotLeaderNorObserver returns true when there is no work possible for the
// reconciler.
func (s *state) isNotLeaderNorObserver() bool {
if !s.isLeader && !s.isROI && !s.isROF {
// If we are not the leader, and we don't implement either ReadOnly
if !s.isLeader && !s.isROI {
// If we are not the leader, and we don't implement the ReadOnly
// interface, then take a fast-path out.
return true
}
@ -99,8 +92,6 @@ func (s *state) reconcileMethodFor(o *v1alpha1.Image) (string, doReconcile) {
}
} else if fin, ok := s.reconciler.(Finalizer); s.isLeader && ok {
return reconciler.DoFinalizeKind, fin.FinalizeKind
} else if !s.isLeader && s.isROF {
return reconciler.DoObserveFinalizeKind, s.rof.ObserveFinalizeKind
}
return "unknown", nil
}

View File

@ -323,12 +323,13 @@ func ErrInvalidArrayValue(value interface{}, field string, index int) *FieldErro
return ErrInvalidValue(value, CurrentField).ViaFieldIndex(field, index)
}
// ErrInvalidValue constructs a FieldError for a field that has received an
// invalid value.
func ErrInvalidValue(value interface{}, fieldPath string) *FieldError {
// ErrInvalidValue is a variadic helper method for constructing a FieldError
// for a field that has received an invalid value.
func ErrInvalidValue(value interface{}, fieldPath string, details ...string) *FieldError {
return &FieldError{
Message: fmt.Sprint("invalid value: ", value),
Paths: []string{fieldPath},
Details: strings.Join(details, ", "),
}
}

View File

@ -206,10 +206,6 @@ func (g *reconcilerReconcilerGenerator) GenerateType(c *generator.Context, t *ty
Package: "knative.dev/pkg/reconciler",
Name: "DoFinalizeKind",
}),
"doObserveFinalizeKind": c.Universe.Type(types.Name{
Package: "knative.dev/pkg/reconciler",
Name: "DoObserveFinalizeKind",
}),
"controllerIsSkipKey": c.Universe.Function(types.Name{
Package: "knative.dev/pkg/controller",
Name: "IsSkipKey",
@ -264,20 +260,6 @@ type ReadOnlyInterface interface {
ObserveKind(ctx {{.contextContext|raw}}, o *{{.type|raw}}) {{.reconcilerEvent|raw}}
}
// ReadOnlyFinalizer defines the strongly typed interfaces to be implemented by a
// controller finalizing {{.type|raw}} if they want to process tombstoned resources
// even when they are not the leader. Due to the nature of how finalizers are handled
// there are no guarantees that this will be called.
//
// Deprecated: Use reconciler.OnDeletionInterface instead.
type ReadOnlyFinalizer interface {
// ObserveFinalizeKind implements custom logic to observe the final state of {{.type|raw}}.
// This method should not write to the API.
//
// Deprecated: Use reconciler.ObserveDeletion instead.
ObserveFinalizeKind(ctx {{.contextContext|raw}}, o *{{.type|raw}}) {{.reconcilerEvent|raw}}
}
type doReconcile func(ctx {{.contextContext|raw}}, o *{{.type|raw}}) {{.reconcilerEvent|raw}}
// reconcilerImpl implements controller.Reconciler for {{.type|raw}} resources.
@ -483,10 +465,6 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
return {{.fmtErrorf|raw}}("failed to clear finalizers: %w", err)
}
case {{.doObserveKind|raw}}, {{.doObserveFinalizeKind|raw}}:
// Observe any changes to this resource, since we are not the leader.
reconcileEvent = do(ctx, resource)
}
{{if .hasStatus}}

View File

@ -84,10 +84,6 @@ func (g *reconcilerStateGenerator) GenerateType(c *generator.Context, t *types.T
Package: "knative.dev/pkg/reconciler",
Name: "DoFinalizeKind",
}),
"doObserveFinalizeKind": c.Universe.Type(types.Name{
Package: "knative.dev/pkg/reconciler",
Name: "DoObserveFinalizeKind",
}),
}
sw.Do(reconcilerStateType, m)
@ -111,10 +107,6 @@ type state struct {
roi ReadOnlyInterface
// isROI (Read Only Interface) the reconciler only observes reconciliation.
isROI bool
// rof is the read only finalizer cast of the reconciler.
rof ReadOnlyFinalizer
// isROF (Read Only Finalizer) the reconciler only observes finalize.
isROF bool
// isLeader the instance of the reconciler is the elected leader.
isLeader bool
}
@ -127,7 +119,6 @@ func newState(key string, r *reconcilerImpl) (*state, error) {
}
roi, isROI := r.reconciler.(ReadOnlyInterface)
rof, isROF := r.reconciler.(ReadOnlyFinalizer)
isLeader := r.IsLeaderFor({{.typesNamespacedName|raw}}{
Namespace: namespace,
@ -141,8 +132,6 @@ func newState(key string, r *reconcilerImpl) (*state, error) {
reconciler: r.reconciler,
roi: roi,
isROI: isROI,
rof: rof,
isROF: isROF,
isLeader: isLeader,
}, nil
}
@ -154,8 +143,8 @@ var reconcilerStateMethods = `
// isNotLeaderNorObserver returns true when there is no work possible for the
// reconciler.
func (s *state) isNotLeaderNorObserver() bool {
if !s.isLeader && !s.isROI && !s.isROF {
// If we are not the leader, and we don't implement either ReadOnly
if !s.isLeader && !s.isROI {
// If we are not the leader, and we don't implement the ReadOnly
// interface, then take a fast-path out.
return true
}
@ -171,8 +160,6 @@ func (s *state) reconcileMethodFor(o *{{.type|raw}}) (string, doReconcile) {
}
} else if fin, ok := s.reconciler.(Finalizer); s.isLeader && ok {
return {{.doFinalizeKind|raw}}, fin.FinalizeKind
} else if !s.isLeader && s.isROF {
return {{.doObserveFinalizeKind|raw}}, s.rof.ObserveFinalizeKind
}
return "unknown", nil
}

View File

@ -38,6 +38,8 @@ const (
// DoObserveKind is the function name for observing the resource (as a non leader).
DoObserveKind = "ObserveKind"
// DoObserveFinalizeKind is the function name for observing finalization of the resource (as a non leader).
//
// Deprecated: This will be deleted soon.
DoObserveFinalizeKind = "ObserveFinalizeKind"
)

2
vendor/modules.txt vendored
View File

@ -612,7 +612,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20210806075220-815cd312d65c
## explicit
knative.dev/hack
# knative.dev/pkg v0.0.0-20210908025933-71508fc69a57
# knative.dev/pkg v0.0.0-20210908202858-9a4b6128207c
## explicit
knative.dev/pkg/apis
knative.dev/pkg/apis/duck