mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#693)
bumping knative.dev/hack 3fdc50b...9d2ae47:
> 9d2ae47 Update community files (# 241)
> cf1a127 🎁 Use Knative ls-tags tool (# 238)
bumping knative.dev/pkg 714b763...9823d96:
> 9823d96 Update community files (# 2615)
> 5dd89c6 Support istio *List types where Items is an array of pointer types (# 2613)
> b812aff Support fetching observability from ctx. (# 2610)
Signed-off-by: Knative Automation <automation@knative.team>
Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
cfbd378e49
commit
f651e0c8c1
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-20221010154335-3fdc50b9c24a
|
||||
knative.dev/pkg v0.0.0-20221011175852-714b7630a836
|
||||
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2
|
||||
knative.dev/pkg v0.0.0-20221024013716-9823d960ed40
|
||||
)
|
||||
|
||||
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-20221010154335-3fdc50b9c24a h1:yfq1OMrkyYkxDeM0pmAOeN4YF16R/WG0C+VvLBeq4uc=
|
||||
knative.dev/hack v0.0.0-20221010154335-3fdc50b9c24a/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||
knative.dev/pkg v0.0.0-20221011175852-714b7630a836 h1:0N7Zo/O+xeUUebJPm9keBaGclrUoEbljr3J1MsqtaIM=
|
||||
knative.dev/pkg v0.0.0-20221011175852-714b7630a836/go.mod h1:DMTRDJ5WRxf/DrlOPzohzfhSuJggscLZ8EavOq9O/x8=
|
||||
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-20221024013716-9823d960ed40 h1:zuRFh9ZF32nf0m4veznmh27WD/lRDQBSZIl3W4cdqUU=
|
||||
knative.dev/pkg v0.0.0-20221024013716-9823d960ed40/go.mod h1:DMTRDJ5WRxf/DrlOPzohzfhSuJggscLZ8EavOq9O/x8=
|
||||
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=
|
||||
|
|
|
@ -139,14 +139,7 @@ function __build_test_runner_for_module() {
|
|||
# Don't merge these two lines, or return code will always be 0.
|
||||
# Get all build tags in go code (ignore /vendor, /hack and /third_party)
|
||||
local tags
|
||||
tags="$(grep -I -r '// +build' . | grep -v '/vendor/' | \
|
||||
grep -v '/hack/' | \
|
||||
grep -v '/third_party' | \
|
||||
cut -f3 -d' ' | \
|
||||
tr ',' '\n' | \
|
||||
sort | uniq | \
|
||||
grep -v '^!' | \
|
||||
paste -s -d, /dev/stdin)"
|
||||
tags="$(go run knative.dev/test-infra/tools/go-ls-tags@latest --joiner=,)"
|
||||
local go_pkg_dirs
|
||||
go_pkg_dirs="$(go list -tags "${tags}" ./...)" || return $?
|
||||
if [[ -z "${go_pkg_dirs}" ]]; then
|
||||
|
|
|
@ -29,6 +29,7 @@ type CustomArgs struct {
|
|||
ExternalVersionsInformersPackage string
|
||||
ListersPackage string
|
||||
ForceKinds string
|
||||
ListerHasPointerElem bool
|
||||
}
|
||||
|
||||
// NewDefaults returns default arguments for the generator.
|
||||
|
@ -45,6 +46,7 @@ func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.StringVar(&ca.ExternalVersionsInformersPackage, "external-versions-informers-package", ca.ExternalVersionsInformersPackage, "the full package name for the external versions injection informer to use")
|
||||
fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for client listers to use")
|
||||
fs.StringVar(&ca.ForceKinds, "force-genreconciler-kinds", ca.ForceKinds, `force kinds will override the genreconciler tag setting for the given set of kinds, comma separated: "Foo,Bar,Baz"`)
|
||||
fs.BoolVar(&ca.ListerHasPointerElem, "lister-has-pointer-elem", ca.ListerHasPointerElem, "set to true if the List types have an Item array of pointer element types")
|
||||
}
|
||||
|
||||
// Validate checks the given arguments.
|
||||
|
|
|
@ -41,6 +41,7 @@ type injectionGenerator struct {
|
|||
injectionClientSetPackage string
|
||||
clientSetPackage string
|
||||
listerPkg string
|
||||
listerHasPointerElem bool
|
||||
}
|
||||
|
||||
var _ generator.Generator = (*injectionGenerator)(nil)
|
||||
|
@ -92,6 +93,7 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w
|
|||
"clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}),
|
||||
"resourceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "Lister", Package: g.listerPkg}),
|
||||
"resourceNamespaceLister": c.Universe.Type(types.Name{Name: g.typeToGenerate.Name.Name + "NamespaceLister", Package: g.listerPkg}),
|
||||
"listerHasPointerElem": g.listerHasPointerElem,
|
||||
"groupGoName": namer.IC(g.groupGoName),
|
||||
"versionGoName": namer.IC(g.groupVersion.Version.String()),
|
||||
"group": g.groupVersion.Group.String(),
|
||||
|
@ -226,7 +228,7 @@ func (w *wrapper) List(selector {{ .labelsSelector|raw }}) (ret []*{{ .type|raw
|
|||
return nil, err
|
||||
}
|
||||
for idx := range lo.Items {
|
||||
ret = append(ret, &lo.Items[idx])
|
||||
ret = append(ret, {{if not .listerHasPointerElem}}&{{end}}lo.Items[idx])
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
|
|
@ -446,6 +446,7 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg
|
|||
clientSetPackage: customArgs.VersionedClientSetPackage,
|
||||
injectionClientSetPackage: filepath.Join(basePackage, "client"),
|
||||
listerPkg: listerPackagePath,
|
||||
listerHasPointerElem: customArgs.ListerHasPointerElem,
|
||||
})
|
||||
return generators
|
||||
},
|
||||
|
|
|
@ -17,8 +17,10 @@ limitations under the License.
|
|||
package metrics
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
texttemplate "text/template"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
@ -81,6 +83,22 @@ type ObservabilityConfig struct {
|
|||
MetricsCollectorAddress string
|
||||
}
|
||||
|
||||
type ocfg struct{}
|
||||
|
||||
// WithConfig associates a observability configuration with the context.
|
||||
func WithConfig(ctx context.Context, cfg *ObservabilityConfig) context.Context {
|
||||
return context.WithValue(ctx, ocfg{}, cfg)
|
||||
}
|
||||
|
||||
// GetObservability gets the observability config from the provided context.
|
||||
func GetObservabilityConfig(ctx context.Context) *ObservabilityConfig {
|
||||
untyped := ctx.Value(ocfg{})
|
||||
if untyped == nil {
|
||||
return nil
|
||||
}
|
||||
return untyped.(*ObservabilityConfig)
|
||||
}
|
||||
|
||||
func defaultConfig() *ObservabilityConfig {
|
||||
return &ObservabilityConfig{
|
||||
LoggingURLTemplate: DefaultLogURLTemplate,
|
||||
|
@ -120,6 +138,21 @@ func NewObservabilityConfigFromConfigMap(configMap *corev1.ConfigMap) (*Observab
|
|||
return oc, nil
|
||||
}
|
||||
|
||||
func (oc *ObservabilityConfig) GetConfigMap() corev1.ConfigMap {
|
||||
return corev1.ConfigMap{
|
||||
Data: map[string]string{
|
||||
"logging.enable-var-log-collection": strconv.FormatBool(oc.EnableVarLogCollection),
|
||||
"logging.revision-url-template": oc.LoggingURLTemplate,
|
||||
ReqLogTemplateKey: oc.RequestLogTemplate,
|
||||
EnableReqLogKey: strconv.FormatBool(oc.EnableRequestLog),
|
||||
EnableProbeReqLogKey: strconv.FormatBool(oc.EnableProbeRequestLog),
|
||||
"metrics.request-metrics-backend-destination": oc.RequestMetricsBackend,
|
||||
"profiling.enable": strconv.FormatBool(oc.EnableProfiling),
|
||||
"metrics.opencensus-address": oc.MetricsCollectorAddress,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigMapName gets the name of the metrics ConfigMap
|
||||
func ConfigMapName() string {
|
||||
if cm := os.Getenv(configMapNameEnv); cm != "" {
|
||||
|
|
|
@ -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-20221010154335-3fdc50b9c24a
|
||||
# knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2
|
||||
## explicit; go 1.18
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20221011175852-714b7630a836
|
||||
# knative.dev/pkg v0.0.0-20221024013716-9823d960ed40
|
||||
## explicit; go 1.18
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue