mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#697)
bumping knative.dev/pkg 198b463...2f19491: > 2f19491 Feature: Implement Apply codegen. (# 2624) > 6eb8f18 Update community files (# 2626) > 5cbee02 Filter reactor FieldErrors on validation to only error-level alerts. (# 2611) bumping knative.dev/hack 9d2ae47...566898d: > 566898d Update community files (# 242) Signed-off-by: Knative Automation <automation@knative.team> Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
47cdedc53c
commit
0bce38ac1c
4
go.mod
4
go.mod
|
@ -11,8 +11,8 @@ require (
|
|||
k8s.io/client-go v0.25.2
|
||||
k8s.io/code-generator v0.25.2
|
||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1
|
||||
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2
|
||||
knative.dev/pkg v0.0.0-20221027173407-198b4637065d
|
||||
knative.dev/hack v0.0.0-20221031132314-566898d800e9
|
||||
knative.dev/pkg v0.0.0-20221031202413-2f194914a4b2
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
8
go.sum
8
go.sum
|
@ -801,10 +801,10 @@ k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkI
|
|||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
|
||||
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4=
|
||||
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2 h1:DvWcy2c6wvjDo+rPRWe9Rn5QEH8fiq/j4QWOka0wMvQ=
|
||||
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||
knative.dev/pkg v0.0.0-20221027173407-198b4637065d h1:sqnBiIFVRo/TWxMNF+gNgwFM2JVdWQKtrtwidTVi5Zk=
|
||||
knative.dev/pkg v0.0.0-20221027173407-198b4637065d/go.mod h1:j5kO7gKmWGj2DJpefCEiPbItToiYf+2bCtI+A6REkQo=
|
||||
knative.dev/hack v0.0.0-20221031132314-566898d800e9 h1:TkrNe/pYuNu5PUyIfFAIUxgcmivItCspde1hCAC+fgw=
|
||||
knative.dev/hack v0.0.0-20221031132314-566898d800e9/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||
knative.dev/pkg v0.0.0-20221031202413-2f194914a4b2 h1:1nIQaBgEoDkhS/GWDqYZhMGRudn6F89HAlANTu6OoWw=
|
||||
knative.dev/pkg v0.0.0-20221031202413-2f194914a4b2/go.mod h1:j5kO7gKmWGj2DJpefCEiPbItToiYf+2bCtI+A6REkQo=
|
||||
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=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -286,6 +286,11 @@ func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io
|
|||
"Group": group,
|
||||
"VersionLower": version,
|
||||
"Kind": t.Name.Name,
|
||||
|
||||
"ptrString": c.Universe.Function(types.Name{
|
||||
Package: "knative.dev/pkg/ptr",
|
||||
Name: "String",
|
||||
}),
|
||||
}
|
||||
|
||||
for _, v := range verbs.List() {
|
||||
|
@ -575,13 +580,51 @@ func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Patch(ctx {{
|
|||
`,
|
||||
"apply": `{{if .generateApply}}
|
||||
func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) Apply(ctx {{ .contextContext|raw }}, in *{{ .ApplyType|raw }}, opts {{ .metav1ApplyOptions|raw }}) (result *{{ .ResultType|raw }}, err error) {
|
||||
panic("NYI")
|
||||
in.Kind = {{ .ptrString|raw }}("{{ .Kind }}")
|
||||
{{ if .Group }}
|
||||
in.APIVersion = {{ .ptrString|raw }}("{{ .Group }}/{{ .VersionLower }}")
|
||||
{{ else }}
|
||||
in.APIVersion = {{ .ptrString|raw }}("{{ .VersionLower }}")
|
||||
{{ end }}
|
||||
|
||||
uo := &{{ .unstructuredUnstructured|raw }}{}
|
||||
if err := convert(in, uo); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
uo, err = w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.Apply(ctx, uo.GetName(), uo, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := &{{ .ResultType|raw }}{}
|
||||
if err := convert(uo, out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
{{end}}
|
||||
`,
|
||||
"applyStatus": `{{if .generateApply}}
|
||||
func (w *wrap{{.GroupGoName}}{{.Version}}{{ .Type.Name.Name }}Impl) ApplyStatus(ctx {{ .contextContext|raw }}, in *{{ .ApplyType|raw }}, opts {{ .metav1ApplyOptions|raw }}) (result *{{ .ResultType|raw }}, err error) {
|
||||
panic("NYI")
|
||||
in.Kind = {{ .ptrString|raw }}("{{ .Kind }}")
|
||||
{{ if .Group }}
|
||||
in.APIVersion = {{ .ptrString|raw }}("{{ .Group }}/{{ .VersionLower }}")
|
||||
{{ else }}
|
||||
in.APIVersion = {{ .ptrString|raw }}("{{ .VersionLower }}")
|
||||
{{ end }}
|
||||
|
||||
uo := &{{ .unstructuredUnstructured|raw }}{}
|
||||
if err := convert(in, uo); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
uo, err = w.dyn{{if .Namespaced}}.Namespace(w.namespace){{end}}.ApplyStatus(ctx, uo.GetName(), uo, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := &{{ .ResultType|raw }}{}
|
||||
if err := convert(uo, out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
{{end}}
|
||||
`,
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
Copyright 2019 The Knative Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package ptr holds utilities for taking pointer references to values.
|
||||
package ptr
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
Copyright 2019 The Knative Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package ptr
|
||||
|
||||
import "time"
|
||||
|
||||
// Int32 is a helper for turning integers into pointers for use in
|
||||
// API types that want *int32.
|
||||
func Int32(i int32) *int32 {
|
||||
return &i
|
||||
}
|
||||
|
||||
// Int64 is a helper for turning integers into pointers for use in
|
||||
// API types that want *int64.
|
||||
func Int64(i int64) *int64 {
|
||||
return &i
|
||||
}
|
||||
|
||||
// Float32 is a helper for turning floats into pointers for use in
|
||||
// API types that want *float32.
|
||||
func Float32(f float32) *float32 {
|
||||
return &f
|
||||
}
|
||||
|
||||
// Float64 is a helper for turning floats into pointers for use in
|
||||
// API types that want *float64.
|
||||
func Float64(f float64) *float64 {
|
||||
return &f
|
||||
}
|
||||
|
||||
// Bool is a helper for turning bools into pointers for use in
|
||||
// API types that want *bool.
|
||||
func Bool(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
// String is a helper for turning strings into pointers for use in
|
||||
// API types that want *string.
|
||||
func String(s string) *string {
|
||||
return &s
|
||||
}
|
||||
|
||||
// Duration is a helper for turning time.Duration into pointers for use in
|
||||
// API types that want *time.Duration.
|
||||
func Duration(t time.Duration) *time.Duration {
|
||||
return &t
|
||||
}
|
||||
|
||||
// Time is a helper for turning a const time.Time into a pointer for use in
|
||||
// API types that want *time.Duration.
|
||||
func Time(t time.Time) *time.Time {
|
||||
return &t
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
Copyright 2021 The Knative Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package ptr
|
||||
|
||||
import "time"
|
||||
|
||||
// Int32Value is a helper for turning pointers to integers into values for use
|
||||
// in API types that want int32.
|
||||
func Int32Value(i *int32) int32 {
|
||||
if i == nil {
|
||||
return 0
|
||||
}
|
||||
return *i
|
||||
}
|
||||
|
||||
// Int64Value is a helper for turning pointers to integers into values for use
|
||||
// in API types that want int64.
|
||||
func Int64Value(i *int64) int64 {
|
||||
if i == nil {
|
||||
return 0
|
||||
}
|
||||
return *i
|
||||
}
|
||||
|
||||
// Float32Value is a helper for turning pointers to floats into values for use
|
||||
// in API types that want float32.
|
||||
func Float32Value(f *float32) float32 {
|
||||
if f == nil {
|
||||
return 0
|
||||
}
|
||||
return *f
|
||||
}
|
||||
|
||||
// Float64Value is a helper for turning pointers to floats into values for use
|
||||
// in API types that want float64.
|
||||
func Float64Value(f *float64) float64 {
|
||||
if f == nil {
|
||||
return 0
|
||||
}
|
||||
return *f
|
||||
}
|
||||
|
||||
// BoolValue is a helper for turning pointers to bools into values for use in
|
||||
// API types that want bool.
|
||||
func BoolValue(b *bool) bool {
|
||||
if b == nil {
|
||||
return false
|
||||
}
|
||||
return *b
|
||||
}
|
||||
|
||||
// StringValue is a helper for turning pointers to strings into values for use
|
||||
// in API types that want string.
|
||||
func StringValue(s *string) string {
|
||||
if s == nil {
|
||||
return ""
|
||||
}
|
||||
return *s
|
||||
}
|
||||
|
||||
// DurationValue is a helper for turning *time.Duration into values for use in
|
||||
// API types that want time.Duration.
|
||||
func DurationValue(t *time.Duration) time.Duration {
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
return *t
|
||||
}
|
||||
|
||||
// TimeValue is a helper for turning *time.Time into values for use in API
|
||||
// types that want API types that want time.Time.
|
||||
func TimeValue(t *time.Time) time.Time {
|
||||
if t == nil {
|
||||
return time.Time{}
|
||||
}
|
||||
return *t
|
||||
}
|
|
@ -687,10 +687,10 @@ k8s.io/utils/internal/third_party/forked/golang/net
|
|||
k8s.io/utils/net
|
||||
k8s.io/utils/strings/slices
|
||||
k8s.io/utils/trace
|
||||
# knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2
|
||||
# knative.dev/hack v0.0.0-20221031132314-566898d800e9
|
||||
## explicit; go 1.18
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20221027173407-198b4637065d
|
||||
# knative.dev/pkg v0.0.0-20221031202413-2f194914a4b2
|
||||
## explicit; go 1.18
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
@ -718,6 +718,7 @@ knative.dev/pkg/logging/logkey
|
|||
knative.dev/pkg/metrics
|
||||
knative.dev/pkg/metrics/metricskey
|
||||
knative.dev/pkg/network
|
||||
knative.dev/pkg/ptr
|
||||
knative.dev/pkg/reconciler
|
||||
knative.dev/pkg/signals
|
||||
knative.dev/pkg/system
|
||||
|
|
Loading…
Reference in New Issue