Skip to content

Commit b083920

Browse files
committed
Deprecate client-side validation in the direct applier
The kube 1.28 libraries made client-side validation much harder. We should be using server-side validation anyway.
1 parent a825280 commit b083920

File tree

1 file changed

+2
-15
lines changed
  • pkg/patterns/declarative/pkg/applier

1 file changed

+2
-15
lines changed

pkg/patterns/declarative/pkg/applier/direct.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,8 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error {
9595
}
9696

9797
if opt.Validate {
98-
// validation likely makes redundant apiserver requests and is less optimized than the non-validation case,
99-
// but validation isn't the common path
100-
101-
dynamicClient, err := f.DynamicClient()
102-
if err != nil {
103-
return err
104-
}
105-
nqpv := resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamFieldValidation)
106-
107-
v, err := d.inner.NewFactory(opt).Validator(metav1.FieldValidationStrict, nqpv)
108-
109-
if err != nil {
110-
return err
111-
}
112-
b.Schema(v)
98+
// client-side validation is no longer recommended, in favor of server-side apply/validation
99+
return fmt.Errorf("client-side validation is no longer supported")
113100
}
114101

115102
var errs []error

0 commit comments

Comments
 (0)