mirror of https://github.com/knative/caching.git
Unpin deps following release (#347)
This commit is contained in:
parent
128ba664d1
commit
60d18009af
4
go.mod
4
go.mod
|
@ -16,8 +16,8 @@ require (
|
|||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||
k8s.io/code-generator v0.18.8
|
||||
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
|
||||
knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab
|
||||
knative.dev/test-infra v0.0.0-20200921012245-37f1a12adbd3
|
||||
knative.dev/pkg v0.0.0-20201001022229-7c082ac1c01d
|
||||
knative.dev/test-infra v0.0.0-20200930161929-242b7529399e
|
||||
)
|
||||
|
||||
replace (
|
||||
|
|
8
go.sum
8
go.sum
|
@ -1894,15 +1894,15 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC
|
|||
knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY=
|
||||
knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA=
|
||||
knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8=
|
||||
knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab h1:4Q+sGqdN4ecLPZnIJcLDdQArEE9oOtRYiU2J6NPCCjU=
|
||||
knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab/go.mod h1:MCyt5KqLaai6ENUitOgRAQsu7Gw7cAIIiXQ2IS+O0NI=
|
||||
knative.dev/pkg v0.0.0-20201001022229-7c082ac1c01d h1:7ZjWakTUUrpM1wtjBpAGMan1lNIv2r07sWVF8XrBGuQ=
|
||||
knative.dev/pkg v0.0.0-20201001022229-7c082ac1c01d/go.mod h1:ONz9ufOS3IdWdlIUqhd4Dd2aUdG2a29W7Cg0mCS4hcE=
|
||||
knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
|
||||
knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU=
|
||||
knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE=
|
||||
knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE=
|
||||
knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs=
|
||||
knative.dev/test-infra v0.0.0-20200921012245-37f1a12adbd3 h1:abacWewpeP9QUByQAunuOA8F9hQ6Ryr2P63r38ns5sA=
|
||||
knative.dev/test-infra v0.0.0-20200921012245-37f1a12adbd3/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc=
|
||||
knative.dev/test-infra v0.0.0-20200930161929-242b7529399e h1:z9UxB9wzoha4KlCnrcJiYv/EOpoDyclRjNf38TFFHcU=
|
||||
knative.dev/test-infra v0.0.0-20200930161929-242b7529399e/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc=
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw=
|
||||
|
|
|
@ -27,7 +27,7 @@ export GO111MODULE=on
|
|||
export GOFLAGS=-mod=vendor
|
||||
|
||||
# This controls the release branch we track.
|
||||
VERSION="release-0.18"
|
||||
VERSION="master"
|
||||
|
||||
# The list of dependencies that we track at HEAD and periodically
|
||||
# float forward in this repository.
|
||||
|
|
|
@ -234,7 +234,7 @@ func (r conditionsImpl) ClearCondition(t ConditionType) error {
|
|||
}
|
||||
// Terminal conditions are not handled as they can't be nil
|
||||
if r.isTerminal(t) {
|
||||
return fmt.Errorf("Clearing terminal conditions not implemented")
|
||||
return fmt.Errorf("clearing terminal conditions not implemented")
|
||||
}
|
||||
cond := r.GetCondition(t)
|
||||
if cond == nil {
|
||||
|
|
|
@ -35,11 +35,11 @@ type Destination struct {
|
|||
|
||||
// Validate the Destination has all the necessary fields and check the
|
||||
// Namespace matches that of the parent object (using apis.ParentMeta).
|
||||
func (dest *Destination) Validate(ctx context.Context) *apis.FieldError {
|
||||
if dest == nil {
|
||||
func (d *Destination) Validate(ctx context.Context) *apis.FieldError {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return ValidateDestination(ctx, *dest).ViaField(apis.CurrentField)
|
||||
return ValidateDestination(ctx, *d).ViaField(apis.CurrentField)
|
||||
}
|
||||
|
||||
// ValidateDestination validates Destination.
|
||||
|
@ -65,11 +65,11 @@ func ValidateDestination(ctx context.Context, dest Destination) *apis.FieldError
|
|||
|
||||
// GetRef gets the KReference from this Destination, if one is present. If no ref is present,
|
||||
// then nil is returned.
|
||||
func (dest *Destination) GetRef() *KReference {
|
||||
if dest == nil {
|
||||
func (d *Destination) GetRef() *KReference {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
return dest.Ref
|
||||
return d.Ref
|
||||
}
|
||||
|
||||
func (d *Destination) SetDefaults(ctx context.Context) {
|
||||
|
|
|
@ -89,15 +89,15 @@ func (s *Status) GetCondition(t apis.ConditionType) *apis.Condition {
|
|||
// By default apis.ConditionReady and apis.ConditionSucceeded will be copied over to the
|
||||
// sink. Other conditions types are tested against a list of predicates. If any of the predicates
|
||||
// return true the condition type will be copied to the sink
|
||||
func (source *Status) ConvertTo(ctx context.Context, sink *Status, predicates ...func(apis.ConditionType) bool) {
|
||||
sink.ObservedGeneration = source.ObservedGeneration
|
||||
if source.Annotations != nil {
|
||||
func (s *Status) ConvertTo(ctx context.Context, sink *Status, predicates ...func(apis.ConditionType) bool) {
|
||||
sink.ObservedGeneration = s.ObservedGeneration
|
||||
if s.Annotations != nil {
|
||||
// This will deep copy the map.
|
||||
sink.Annotations = kmeta.UnionMaps(source.Annotations)
|
||||
sink.Annotations = kmeta.UnionMaps(s.Annotations)
|
||||
}
|
||||
|
||||
conditions := make(apis.Conditions, 0, len(source.Conditions))
|
||||
for _, c := range source.Conditions {
|
||||
conditions := make(apis.Conditions, 0, len(s.Conditions))
|
||||
for _, c := range s.Conditions {
|
||||
|
||||
// Copy over the "happy" condition, which is the only condition that
|
||||
// we can reliably transfer.
|
||||
|
|
|
@ -60,7 +60,7 @@ func (g *clientGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"clientSetNewForConfigOrDie": c.Universe.Function(types.Name{Package: g.clientSetPackage, Name: "NewForConfigOrDie"}),
|
||||
|
|
|
@ -74,7 +74,7 @@ func (g *duckGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *duckGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"group": namer.IC(g.groupGoName),
|
||||
|
|
|
@ -61,7 +61,7 @@ func (g *factoryGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"cachingClientGet": c.Universe.Type(types.Name{Package: g.cachingClientSetPackage, Name: "Get"}),
|
||||
|
|
|
@ -62,7 +62,7 @@ func (g *fakeClientGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *fakeClientGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"clientKey": c.Universe.Type(types.Name{Package: g.clientInjectionPkg, Name: "Key"}),
|
||||
|
|
|
@ -76,7 +76,7 @@ func (g *fakeDuckGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *fakeDuckGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"withDuck": c.Universe.Type(types.Name{Package: g.duckInjectionPkg, Name: "WithDuck"}),
|
||||
|
|
|
@ -63,7 +63,7 @@ func (g *fakeFactoryGenerator) Imports(c *generator.Context) (imports []string)
|
|||
func (g *fakeFactoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"factoryKey": c.Universe.Type(types.Name{Package: g.factoryInjectionPkg, Name: "Key"}),
|
||||
|
|
|
@ -77,7 +77,7 @@ func (g *fakeInformerGenerator) Imports(c *generator.Context) (imports []string)
|
|||
func (g *fakeInformerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"informerKey": c.Universe.Type(types.Name{Package: g.informerInjectionPkg, Name: "Key"}),
|
||||
|
|
|
@ -76,7 +76,7 @@ func (g *injectionGenerator) Imports(c *generator.Context) (imports []string) {
|
|||
func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"group": namer.IC(g.groupGoName),
|
||||
|
|
|
@ -73,7 +73,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
|||
|
||||
// If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as
|
||||
// the Go group identifier in CamelCase. It defaults
|
||||
groupGoNames[groupPackageName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0])
|
||||
groupGoNames[groupPackageName] = namer.IC(strings.SplitN(gv.Group.NonEmpty(), ".", 2)[0])
|
||||
if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil {
|
||||
groupGoNames[groupPackageName] = namer.IC(override[0])
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ func typedInformerPackage(groupPkgName string, gv clientgentypes.GroupVersion, e
|
|||
func versionClientsPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs) []generator.Package {
|
||||
packagePath := filepath.Join(basePackage, "client")
|
||||
|
||||
vers := []generator.Package{
|
||||
return []generator.Package{
|
||||
// Impl
|
||||
&generator.DefaultPackage{
|
||||
PackageName: "client",
|
||||
|
@ -283,13 +283,12 @@ func versionClientsPackages(basePackage string, boilerplate []byte, customArgs *
|
|||
},
|
||||
},
|
||||
}
|
||||
return vers
|
||||
}
|
||||
|
||||
func versionFactoryPackages(basePackage string, boilerplate []byte, customArgs *informergenargs.CustomArgs) []generator.Package {
|
||||
packagePath := filepath.Join(basePackage, "informers", "factory")
|
||||
|
||||
vers := []generator.Package{
|
||||
return []generator.Package{
|
||||
// Impl
|
||||
&generator.DefaultPackage{
|
||||
PackageName: "factory",
|
||||
|
@ -338,7 +337,6 @@ func versionFactoryPackages(basePackage string, boilerplate []byte, customArgs *
|
|||
},
|
||||
},
|
||||
}
|
||||
return vers
|
||||
}
|
||||
|
||||
func versionInformerPackages(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, customArgs *informergenargs.CustomArgs) []generator.Package {
|
||||
|
|
|
@ -63,7 +63,7 @@ func (g *reconcilerControllerGenerator) Imports(c *generator.Context) (imports [
|
|||
func (g *reconcilerControllerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
|
@ -196,7 +196,7 @@ func NewImpl(ctx {{.contextContext|raw}}, r Interface{{if .hasClass}}, classValu
|
|||
|
||||
// Check the options function input. It should be 0 or 1.
|
||||
if len(optionsFns) > 1 {
|
||||
logger.Fatalf("up to one options function is supported, found %d", len(optionsFns))
|
||||
logger.Fatal("Up to one options function is supported, found: ", len(optionsFns))
|
||||
}
|
||||
|
||||
{{.type|lowercaseSingular}}Informer := {{.informerGet|raw}}(ctx)
|
||||
|
|
|
@ -60,7 +60,7 @@ func (g *reconcilerControllerStubGenerator) Imports(c *generator.Context) (impor
|
|||
func (g *reconcilerControllerStubGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
|
|
|
@ -67,7 +67,7 @@ func (g *reconcilerReconcilerGenerator) Imports(c *generator.Context) (imports [
|
|||
func (g *reconcilerReconcilerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
|
@ -306,13 +306,13 @@ var reconcilerNewReconciler = `
|
|||
func NewReconciler(ctx {{.contextContext|raw}}, logger *{{.zapSugaredLogger|raw}}, client {{.clientsetInterface|raw}}, lister {{.resourceLister|raw}}, recorder {{.recordEventRecorder|raw}}, r Interface{{if .hasClass}}, classValue string{{end}}, options ...{{.controllerOptions|raw}} ) {{.controllerReconciler|raw}} {
|
||||
// Check the options function input. It should be 0 or 1.
|
||||
if len(options) > 1 {
|
||||
logger.Fatalf("up to one options struct is supported, found %d", len(options))
|
||||
logger.Fatal("Up to one options struct is supported, found: ", len(options))
|
||||
}
|
||||
|
||||
// Fail fast when users inadvertently implement the other LeaderAware interface.
|
||||
// For the typed reconcilers, Promote shouldn't take any arguments.
|
||||
if _, ok := r.({{.reconcilerLeaderAware|raw}}); ok {
|
||||
logger.Fatalf("%T implements the incorrect LeaderAware interface. Promote() should not take an argument as genreconciler handles the enqueuing automatically.", r)
|
||||
logger.Fatalf("%T implements the incorrect LeaderAware interface. Promote() should not take an argument as genreconciler handles the enqueuing automatically.", r)
|
||||
}
|
||||
// TODO: Consider validating when folks implement ReadOnlyFinalizer, but not Finalizer.
|
||||
|
||||
|
@ -368,7 +368,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
|
|||
// by the reconciler. Returns an error is the resource key is invalid.
|
||||
s, err := newState(key, r)
|
||||
if err != nil {
|
||||
logger.Errorf("invalid resource key: %s", key)
|
||||
logger.Error("Invalid resource key: ", key)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
|
|||
|
||||
if {{.apierrsIsNotFound|raw}}(err) {
|
||||
// The resource may no longer exist, in which case we stop processing.
|
||||
logger.Debugf("resource %q no longer exists", key)
|
||||
logger.Debugf("Resource %q no longer exists", key)
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return err
|
||||
|
@ -528,7 +528,7 @@ func (r *reconcilerImpl) updateStatus(ctx {{.contextContext|raw}}, existing *{{.
|
|||
}
|
||||
|
||||
if diff, err := {{.kmpSafeDiff|raw}}(existing.Status, desired.Status); err == nil && diff != "" {
|
||||
{{.loggingFromContext|raw}}(ctx).Debugf("Updating status with: %s", diff)
|
||||
{{.loggingFromContext|raw}}(ctx).Debug("Updating status with: ", diff)
|
||||
}
|
||||
|
||||
existing.Status = desired.Status
|
||||
|
|
|
@ -57,7 +57,7 @@ func (g *reconcilerReconcilerStubGenerator) Imports(c *generator.Context) (impor
|
|||
func (g *reconcilerReconcilerStubGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
|
|
|
@ -54,7 +54,7 @@ func (g *reconcilerStateGenerator) Imports(c *generator.Context) (imports []stri
|
|||
func (g *reconcilerStateGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
|
||||
sw := generator.NewSnippetWriter(w, c, "{{", "}}")
|
||||
|
||||
klog.V(5).Infof("processing type %v", t)
|
||||
klog.V(5).Info("processing type ", t)
|
||||
|
||||
m := map[string]interface{}{
|
||||
"type": t,
|
||||
|
|
|
@ -505,7 +505,7 @@ func (c *Impl) processNextWorkItem() bool {
|
|||
|
||||
// Embed the key into the logger and attach that to the context we pass
|
||||
// to the Reconciler.
|
||||
logger := c.logger.With(zap.String(logkey.TraceId, uuid.New().String()), zap.String(logkey.Key, keyStr))
|
||||
logger := c.logger.With(zap.String(logkey.TraceID, uuid.New().String()), zap.String(logkey.Key, keyStr))
|
||||
ctx := logging.WithLogger(context.Background(), logger)
|
||||
|
||||
// Run Reconcile, passing it the namespace/name string of the
|
||||
|
|
|
@ -26,7 +26,7 @@ cd ${ROOT_DIR}
|
|||
# The list of dependencies that we track at HEAD and periodically
|
||||
# float forward in this repository.
|
||||
FLOATING_DEPS=(
|
||||
"knative.dev/test-infra@release-0.18"
|
||||
"knative.dev/test-infra@master"
|
||||
)
|
||||
|
||||
# Parse flags to determine any we should pass to dep.
|
||||
|
|
|
@ -240,6 +240,7 @@ func ConfigMapName() string {
|
|||
|
||||
// JsonToLoggingConfig converts a json string of a Config.
|
||||
// Returns a non-nil Config always.
|
||||
// nolint:stylecheck // No rename due to backwards incompatibility.
|
||||
func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
|
||||
if jsonCfg == "" {
|
||||
return nil, errEmptyJSONLogginString
|
||||
|
@ -259,6 +260,7 @@ func JsonToLoggingConfig(jsonCfg string) (*Config, error) {
|
|||
}
|
||||
|
||||
// LoggingConfigToJson converts a Config to a json string.
|
||||
// nolint:stylecheck // No rename due to backwards incompatibility.
|
||||
func LoggingConfigToJson(cfg *Config) (string, error) {
|
||||
if cfg == nil || cfg.LoggingConfig == "" {
|
||||
return "", nil
|
||||
|
|
|
@ -23,8 +23,8 @@ const (
|
|||
// Key is the key (namespace/name) being reconciled.
|
||||
Key = "knative.dev/key"
|
||||
|
||||
// TraceId is the key used to track an asynchronous or long running operation.
|
||||
TraceId = "knative.dev/traceid"
|
||||
// TraceID is the key used to track an asynchronous or long running operation.
|
||||
TraceID = "knative.dev/traceid"
|
||||
|
||||
// Namespace is the key used for namespace in structured logs
|
||||
Namespace = "knative.dev/namespace"
|
||||
|
|
|
@ -346,6 +346,7 @@ func prometheusPort() (int, error) {
|
|||
|
||||
// JsonToMetricsOptions converts a json string of a
|
||||
// ExporterOptions. Returns a non-nil ExporterOptions always.
|
||||
// nolint:stylecheck // No rename due to backwards incompatibility.
|
||||
func JsonToMetricsOptions(jsonOpts string) (*ExporterOptions, error) {
|
||||
var opts ExporterOptions
|
||||
if jsonOpts == "" {
|
||||
|
@ -360,6 +361,7 @@ func JsonToMetricsOptions(jsonOpts string) (*ExporterOptions, error) {
|
|||
}
|
||||
|
||||
// MetricsOptionsToJson converts a ExporterOptions to a json string.
|
||||
// nolint:stylecheck // No rename due to backwards incompatibility.
|
||||
func MetricsOptionsToJson(opts *ExporterOptions) (string, error) {
|
||||
if opts == nil {
|
||||
return "", nil
|
||||
|
|
|
@ -19,12 +19,12 @@ package metrics
|
|||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/stats/view"
|
||||
"go.opencensus.io/tag"
|
||||
"go.uber.org/atomic"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/client-go/tools/metrics"
|
||||
"k8s.io/client-go/util/workqueue"
|
||||
|
@ -67,22 +67,20 @@ func (m counterMetric) Inc() {
|
|||
type gaugeMetric struct {
|
||||
mutators []tag.Mutator
|
||||
measure *stats.Int64Measure
|
||||
total int64
|
||||
total atomic.Int64
|
||||
}
|
||||
|
||||
var (
|
||||
_ workqueue.GaugeMetric = (*gaugeMetric)(nil)
|
||||
)
|
||||
var _ workqueue.GaugeMetric = (*gaugeMetric)(nil)
|
||||
|
||||
// Inc implements CounterMetric
|
||||
func (m *gaugeMetric) Inc() {
|
||||
total := atomic.AddInt64(&m.total, 1)
|
||||
total := m.total.Inc()
|
||||
Record(context.Background(), m.measure.M(total), stats.WithTags(m.mutators...))
|
||||
}
|
||||
|
||||
// Dec implements GaugeMetric
|
||||
func (m *gaugeMetric) Dec() {
|
||||
total := atomic.AddInt64(&m.total, -1)
|
||||
total := m.total.Dec()
|
||||
Record(context.Background(), m.measure.M(total), stats.WithTags(m.mutators...))
|
||||
}
|
||||
|
||||
|
@ -112,9 +110,7 @@ type latencyMetric struct {
|
|||
measure *stats.Float64Measure
|
||||
}
|
||||
|
||||
var (
|
||||
_ metrics.LatencyMetric = (*latencyMetric)(nil)
|
||||
)
|
||||
var _ metrics.LatencyMetric = (*latencyMetric)(nil)
|
||||
|
||||
// Observe implements LatencyMetric
|
||||
func (m latencyMetric) Observe(verb string, u url.URL, t time.Duration) {
|
||||
|
|
|
@ -51,7 +51,7 @@ const (
|
|||
// secretDataFieldKey is the name of the k8s Secret field that contains the Secret's key.
|
||||
secretDataFieldKey = "key.json"
|
||||
// stackdriverApiTimeout is the timeout value of Stackdriver API service side.
|
||||
stackdriverApiTimeout = 12 * time.Second
|
||||
stackdriverAPITimeout = 12 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -193,14 +193,14 @@ func newStackdriverExporter(config *metricsConfig, logger *zap.SugaredLogger) (v
|
|||
GetMetricPrefix: mpf,
|
||||
ReportingInterval: config.reportingPeriod,
|
||||
DefaultMonitoringLabels: &sd.Labels{},
|
||||
Timeout: stackdriverApiTimeout,
|
||||
Timeout: stackdriverAPITimeout,
|
||||
BundleCountThreshold: TestOverrideBundleCount,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Errorw("Failed to create the Stackdriver exporter: ", zap.Error(err))
|
||||
return nil, nil, err
|
||||
}
|
||||
logger.Infof("Created Opencensus Stackdriver exporter with config %v", config)
|
||||
logger.Info("Created Opencensus Stackdriver exporter with config ", config)
|
||||
// We have to return a ResourceExporterFactory here to enable tracking resources, even though we always poll for them.
|
||||
return &pollOnlySDExporter{e},
|
||||
func(r *resource.Resource) (view.Exporter, error) { return &pollOnlySDExporter{}, nil },
|
||||
|
@ -291,7 +291,7 @@ func getStackdriverExporterClientOptions(config *metricsConfig) ([]option.Client
|
|||
// SetStackdriverSecretLocation must have been called by calling package for this to work.
|
||||
if config.stackdriverClientConfig.UseSecret {
|
||||
if config.secret == nil {
|
||||
return co, fmt.Errorf("No secret provided for component %q; cannot use stackdriver-use-secret=true", config.component)
|
||||
return co, fmt.Errorf("no secret provided for component %q; cannot use stackdriver-use-secret=true", config.component)
|
||||
}
|
||||
|
||||
if opt, err := convertSecretToExporterOption(config.secret); err == nil {
|
||||
|
@ -374,7 +374,7 @@ func convertSecretToExporterOption(secret *corev1.Secret) (option.ClientOption,
|
|||
if data, ok := secret.Data[secretDataFieldKey]; ok {
|
||||
return option.WithCredentialsJSON(data), nil
|
||||
}
|
||||
return nil, fmt.Errorf("Expected Secret to store key in data field named [%s]", secretDataFieldKey)
|
||||
return nil, fmt.Errorf("expected Secret to store key in data field named [%s]", secretDataFieldKey)
|
||||
}
|
||||
|
||||
// ensureKubeclient is the lazy initializer for kubeclient.
|
||||
|
|
|
@ -35,9 +35,7 @@ type WorkqueueProvider struct {
|
|||
WorkDuration *stats.Float64Measure
|
||||
}
|
||||
|
||||
var (
|
||||
_ workqueue.MetricsProvider = (*WorkqueueProvider)(nil)
|
||||
)
|
||||
var _ workqueue.MetricsProvider = (*WorkqueueProvider)(nil)
|
||||
|
||||
// NewAddsMetric implements MetricsProvider
|
||||
func (wp *WorkqueueProvider) NewAddsMetric(name string) workqueue.CounterMetric {
|
||||
|
|
|
@ -24,7 +24,7 @@ import (
|
|||
// Event leverages go's 1.13 error wrapping.
|
||||
type Event error
|
||||
|
||||
// Is reports whether any error in err's chain matches target.
|
||||
// EventIs reports whether any error in err's chain matches target.
|
||||
//
|
||||
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||
// repeatedly calling Unwrap.
|
||||
|
@ -34,7 +34,7 @@ type Event error
|
|||
// (text from errors/wrap.go)
|
||||
var EventIs = errors.Is
|
||||
|
||||
// As finds the first error in err's chain that matches target, and if so, sets
|
||||
// EventAs finds the first error in err's chain that matches target, and if so, sets
|
||||
// target to that error value and returns true.
|
||||
//
|
||||
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||
|
|
|
@ -85,7 +85,7 @@ function acquire_cluster_admin_role() {
|
|||
kubectl create clusterrolebinding cluster-admin-binding \
|
||||
--clusterrole=cluster-admin --user="$(gcloud config get-value core/account)"
|
||||
else
|
||||
kubectl create clusterrolebinding cluster-admin-binding-"${USER}" \
|
||||
kubectl create clusterrolebinding cluster-admin-binding \
|
||||
--clusterrole=cluster-admin --user="${USER}"
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -725,7 +725,7 @@ k8s.io/kube-openapi/pkg/util/sets
|
|||
k8s.io/utils/buffer
|
||||
k8s.io/utils/integer
|
||||
k8s.io/utils/trace
|
||||
# knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab
|
||||
# knative.dev/pkg v0.0.0-20201001022229-7c082ac1c01d
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck/ducktypes
|
||||
|
@ -749,7 +749,7 @@ knative.dev/pkg/metrics/metricskey
|
|||
knative.dev/pkg/network
|
||||
knative.dev/pkg/reconciler
|
||||
knative.dev/pkg/system
|
||||
# knative.dev/test-infra v0.0.0-20200921012245-37f1a12adbd3
|
||||
# knative.dev/test-infra v0.0.0-20200930161929-242b7529399e
|
||||
## explicit
|
||||
knative.dev/test-infra/scripts
|
||||
knative.dev/test-infra/tools/dep-collector
|
||||
|
|
Loading…
Reference in New Issue