Skip to content

Commit 84717c0

Browse files
upgrade to latest dependencies (#852)
bumping knative.dev/pkg 1ca1f09...5fe2303: > 5fe2303 drop vendor licenses (# 3001) > f69f148 Optionally generate an init func for an informer (# 2989) > b8b7ca1 upgrade to latest dependencies (# 3000) Signed-off-by: Knative Automation <[email protected]>
1 parent 7bc8b27 commit 84717c0

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
k8s.io/code-generator v0.29.2
1212
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
1313
knative.dev/hack v0.0.0-20240327150553-47368d631660
14-
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e
14+
knative.dev/pkg v0.0.0-20240328165227-5fe230325f5a
1515
)
1616

1717
require (

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCf
674674
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
675675
knative.dev/hack v0.0.0-20240327150553-47368d631660 h1:tW6NgyjMnSXBS75+k+Xh5uNiLhJ9TFswS9hrkC3OQOc=
676676
knative.dev/hack v0.0.0-20240327150553-47368d631660/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
677-
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e h1:Cg28hbL35g5Qd3tC0PKSX2FMMD8IZnTYxRr4VLIUgd8=
678-
knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e/go.mod h1:uYSh5G3A/pFmzgowpvKeyphLbXVkY4x7zEhReKwsVeU=
677+
knative.dev/pkg v0.0.0-20240328165227-5fe230325f5a h1:HYKynG9QjRuVxrXEYnSMWBXboyOqHBgoQZt0xe4+RMA=
678+
knative.dev/pkg v0.0.0-20240328165227-5fe230325f5a/go.mod h1:LgcT4KPEcw24alWzzkFAN2acHq38au8NZqybU16TStI=
679679
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
680680
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
681681
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type CustomArgs struct {
3030
ListersPackage string
3131
ForceKinds string
3232
ListerHasPointerElem bool
33+
DisableInformerInit bool
3334
}
3435

3536
// NewDefaults returns default arguments for the generator.
@@ -49,6 +50,8 @@ func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {
4950

5051
fs.BoolVar(&ca.ListerHasPointerElem, "lister-has-pointer-elem", false, "")
5152
fs.MarkDeprecated("lister-has-pointer-elem", "this flag has no effect")
53+
54+
fs.BoolVar(&ca.DisableInformerInit, "disable-informer-init", false, "disable generating the init function for the informer")
5255
}
5356

5457
// Validate checks the given arguments.

vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type injectionGenerator struct {
3737
imports namer.ImportTracker
3838
typedInformerPackage string
3939
groupInformerFactoryPackage string
40+
disableInformerInit bool
4041
}
4142

4243
var _ generator.Generator = (*injectionGenerator)(nil)
@@ -98,6 +99,7 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w
9899
Package: "context",
99100
Name: "WithValue",
100101
}),
102+
"disableInformerInit": g.disableInformerInit,
101103
}
102104

103105
sw.Do(injectionInformer, m)
@@ -106,14 +108,16 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w
106108
}
107109

108110
var injectionInformer = `
111+
{{ if not .disableInformerInit }}
109112
func init() {
110113
{{.injectionRegisterInformer|raw}}(withInformer)
111114
}
115+
{{ end }}
112116
113117
// Key is used for associating the Informer inside the context.Context.
114118
type Key struct{}
115119
116-
func withInformer(ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, {{.controllerInformer|raw}}) {
120+
{{ if .disableInformerInit }} func WithInformer {{ else }} func withInformer {{ end }} (ctx {{.contextContext|raw}}) ({{.contextContext|raw}}, {{.controllerInformer|raw}}) {
117121
f := {{.factoryGet|raw}}(ctx)
118122
inf := f.{{.groupGoName}}().{{.versionGoName}}().{{.type|publicPlural}}()
119123
return {{ .contextWithValue|raw }}(ctx, Key{}, inf), inf.Informer()

vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go

+1
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg
412412
imports: generator.NewImportTracker(),
413413
typedInformerPackage: typedInformerPackage,
414414
groupInformerFactoryPackage: factoryPackagePath,
415+
disableInformerInit: customArgs.DisableInformerInit,
415416
})
416417
return generators
417418
},

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ k8s.io/utils/trace
695695
# knative.dev/hack v0.0.0-20240327150553-47368d631660
696696
## explicit; go 1.18
697697
knative.dev/hack
698-
# knative.dev/pkg v0.0.0-20240327140624-1ca1f09c329e
698+
# knative.dev/pkg v0.0.0-20240328165227-5fe230325f5a
699699
## explicit; go 1.21
700700
knative.dev/pkg/apis
701701
knative.dev/pkg/apis/duck

0 commit comments

Comments
 (0)