Skip to content

Commit

Permalink
upgrade to latest dependencies (#5417)
Browse files Browse the repository at this point in the history
bumping knative.dev/reconciler-test d5adf72...8d70771:
  > 8d70771 Update actions (# 199)
  > a2bcdd8 Add Kafka projects to downstream tests (# 197)
  > 98f9e5a Update knative/community files (# 198)
bumping knative.dev/pkg 4564797...67897f4:
  > 67897f4 Replace golint with revive (# 2126)
  > 1442287 Add knative-release-leads to OWNERS (# 2125)
  > 9b837a7 Update actions (# 2123)
  > 525c625 Update actions (# 2121)
  > 620e8d2 Allow disable via regex in chaosduck (# 2117)
  > 1f5a45b Update knative/community files (# 2119)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation authored May 20, 2021
1 parent 23198cd commit cf5b0eb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ require (
k8s.io/utils v0.0.0-20200729134348-d5654de09c73
knative.dev/hack v0.0.0-20210428122153-93ad9129c268
knative.dev/hack/schema v0.0.0-20210428122153-93ad9129c268
knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7
knative.dev/reconciler-test v0.0.0-20210512062647-d5adf72546be
knative.dev/pkg v0.0.0-20210518131015-67897f4ec290
knative.dev/reconciler-test v0.0.0-20210514214942-8d70771450f1
sigs.k8s.io/yaml v1.2.0
)

Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1120,10 +1120,11 @@ knative.dev/hack v0.0.0-20210428122153-93ad9129c268 h1:lBIj9Epd9UQ55NEaHzAdY/UZb
knative.dev/hack v0.0.0-20210428122153-93ad9129c268/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20210428122153-93ad9129c268 h1:jGNg9Mi/BGsEEJ66ldekP5gkVRy+Yi5K3KTi9gLqQ4M=
knative.dev/hack/schema v0.0.0-20210428122153-93ad9129c268/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7 h1:i4P8emOPrLctmbaPHp5eRIOqz+XTOkit7KgZeS+onKs=
knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7/go.mod h1:fIl4l4OmZodkElyaHoT0LCF5wT+3+P/kinawQ4XlLtE=
knative.dev/reconciler-test v0.0.0-20210512062647-d5adf72546be h1:auIvV9JfTCZ/wROftfLy9JGOK2tyZtE9M0DR2nOFOOk=
knative.dev/reconciler-test v0.0.0-20210512062647-d5adf72546be/go.mod h1:ZHvzjwe5aUnWDx+u5y9EPaZ++5PM9Yapp/IvBDiS+Yk=
knative.dev/pkg v0.0.0-20210518131015-67897f4ec290 h1:JPptrA2SNKSAqsdzBkS+MTMYhGSOSJWPlu+cGKWNFjM=
knative.dev/pkg v0.0.0-20210518131015-67897f4ec290/go.mod h1:fIl4l4OmZodkElyaHoT0LCF5wT+3+P/kinawQ4XlLtE=
knative.dev/reconciler-test v0.0.0-20210514214942-8d70771450f1 h1:Xf/JUzEjkkmW5ppczck49Dpi828AuIdqzZFO5DwqdHs=
knative.dev/reconciler-test v0.0.0-20210514214942-8d70771450f1/go.mod h1:ZHvzjwe5aUnWDx+u5y9EPaZ++5PM9Yapp/IvBDiS+Yk=
pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
5 changes: 1 addition & 4 deletions vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ func (dest *Destination) GetRef() *corev1.ObjectReference {
if dest.Ref != nil {
return dest.Ref
}
if ref := dest.deprecatedObjectReference(); ref != nil {
return ref
}
return nil
return dest.deprecatedObjectReference()
}

func validateDestinationRef(ref corev1.ObjectReference) *apis.FieldError {
Expand Down
28 changes: 23 additions & 5 deletions vendor/knative.dev/pkg/leaderelection/chaosduck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"errors"
"flag"
"log"
"regexp"
"strings"
"time"

Expand All @@ -44,14 +45,16 @@ import (
type components map[string]sets.String

var (
disabledComponents kflag.StringSet
tributePeriod time.Duration = 20 * time.Second
tributeFactor = 2.0
disabledComponents kflag.StringSet
disabledComponentsRegex kflag.StringSet
tributePeriod = 20 * time.Second
tributeFactor = 2.0
)

func init() {
// Note that we don't explicitly call flag.Parse() because ParseAndGetConfigOrDie below does this already.
flag.Var(&disabledComponents, "disable", "A repeatable flag to disable chaos for certain components.")
flag.Var(&disabledComponentsRegex, "disableRegex", "A repeatable flag to disable chaos for components matching one of the passed regexes.")
flag.DurationVar(&tributePeriod, "period", tributePeriod, "How frequently to terminate a leader pod per component (this is the base duration used with the jitter factor from -factor).")
flag.Float64Var(&tributeFactor, "factor", tributeFactor, "The jitter factor to apply to the period.")
}
Expand Down Expand Up @@ -116,11 +119,25 @@ func quack(ctx context.Context, kc kubernetes.Interface, component string, leade
return kc.CoreV1().Pods(system.Namespace()).Delete(ctx, tribute, metav1.DeleteOptions{})
}

// matchesAny returns true if any of the given regexes matches the given string.
func matchesAny(regexes []*regexp.Regexp, str string) bool {
for _, re := range regexes {
if re.MatchString(str) {
return true
}
}
return false
}

func main() {
ctx, _ := injection.EnableInjectionOrDie(signals.NewContext(), nil)

kc := kubeclient.Get(ctx)

regexes := make([]*regexp.Regexp, 0, len(disabledComponentsRegex.Value))
for re := range disabledComponentsRegex.Value {
regexes = append(regexes, regexp.MustCompile(re))
}

// Until we are shutdown, build up an index of components and kill
// of a leader at the specified frequency.
wait.JitterUntilWithContext(ctx, func(ctx context.Context) {
Expand All @@ -132,9 +149,10 @@ func main() {

eg, ctx := errgroup.WithContext(ctx)
for name, leaders := range components {
if disabledComponents.Value.Has(name) {
if disabledComponents.Value.Has(name) || matchesAny(regexes, name) {
continue
}

name, leaders := name, leaders
eg.Go(func() error {
return quack(ctx, kc, name, leaders)
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ knative.dev/hack/schema/commands
knative.dev/hack/schema/docs
knative.dev/hack/schema/registry
knative.dev/hack/schema/schema
# knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7
# knative.dev/pkg v0.0.0-20210518131015-67897f4ec290
## explicit
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down Expand Up @@ -1113,7 +1113,7 @@ knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/conversion
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/reconciler-test v0.0.0-20210512062647-d5adf72546be
# knative.dev/reconciler-test v0.0.0-20210514214942-8d70771450f1
## explicit
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand Down

0 comments on commit cf5b0eb

Please sign in to comment.