diff --git a/go.mod b/go.mod index ff2689e7b..39ec5472d 100644 --- a/go.mod +++ b/go.mod @@ -19,8 +19,8 @@ require ( k8s.io/client-go v0.27.6 k8s.io/code-generator v0.27.6 k8s.io/utils v0.0.0-20230209194617-a36077c30491 - knative.dev/hack v0.0.0-20231025074238-d4af42e9b222 - knative.dev/pkg v0.0.0-20231101193506-b09d4f2a2845 + knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63 + knative.dev/pkg v0.0.0-20231102200604-fac3a4ffbc74 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index 7fcc58c2c..3fd48f80e 100644 --- a/go.sum +++ b/go.sum @@ -672,10 +672,10 @@ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5F k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/hack v0.0.0-20231025074238-d4af42e9b222 h1:xjfhm3OayDP+7n8cWnETiwG/TXsAeyKFQQsbxPlZ0WQ= -knative.dev/hack v0.0.0-20231025074238-d4af42e9b222/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= -knative.dev/pkg v0.0.0-20231101193506-b09d4f2a2845 h1:NJm46LR4AeO03E0H7B+TYTkelTSnsswktpIAaK1pkTg= -knative.dev/pkg v0.0.0-20231101193506-b09d4f2a2845/go.mod h1:9UXGl+Sue7Am1/mbvLimpPZwQlOkbjAMMIenH60pVJ4= +knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63 h1:QNbIbsep8jreNCXj3EFrsw0RtsrmMZw7yxYyUG5AILs= +knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/pkg v0.0.0-20231102200604-fac3a4ffbc74 h1:phT8Z3zNyL0OPh9z0EpTJdDMT9sn2x9wtFB5IqI4vJA= +knative.dev/pkg v0.0.0-20231102200604-fac3a4ffbc74/go.mod h1:i7ifWvAVgStXzSwZcfwA3T6D00IPJrqu3XRKKSiYZvw= 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= diff --git a/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go b/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go index 364c0a3a0..f298a0aa7 100644 --- a/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go +++ b/pkg/client/injection/informers/factory/filtered/fake/fake_filtered_factory.go @@ -45,14 +45,15 @@ func withInformerFactory(ctx context.Context) context.Context { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []externalversions.SharedInformerOption{} if injection.HasNamespaceScope(ctx) { opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) } opts = append(opts, externalversions.WithTweakListOptions(func(l *v1.ListOptions) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, + ctx = context.WithValue(ctx, filtered.Key{Selector: selectorVal}, externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) } return ctx diff --git a/pkg/client/injection/informers/factory/filtered/filtered_factory.go b/pkg/client/injection/informers/factory/filtered/filtered_factory.go index 488b6a67f..e16667803 100644 --- a/pkg/client/injection/informers/factory/filtered/filtered_factory.go +++ b/pkg/client/injection/informers/factory/filtered/filtered_factory.go @@ -53,14 +53,15 @@ func withInformerFactory(ctx context.Context) context.Context { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []externalversions.SharedInformerOption{} if injection.HasNamespaceScope(ctx) { opts = append(opts, externalversions.WithNamespace(injection.GetNamespaceScope(ctx))) } opts = append(opts, externalversions.WithTweakListOptions(func(l *v1.ListOptions) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, Key{Selector: selector}, + ctx = context.WithValue(ctx, Key{Selector: selectorVal}, externalversions.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) } return ctx diff --git a/vendor/knative.dev/hack/release.sh b/vendor/knative.dev/hack/release.sh index 5d4f09a89..e6e386bba 100644 --- a/vendor/knative.dev/hack/release.sh +++ b/vendor/knative.dev/hack/release.sh @@ -655,6 +655,24 @@ function publish_artifacts() { banner "New release published successfully" } +# Sets the github release with the highest semver to 'latest' +function set_latest_to_highest_semver() { + local last_version # don't combine with the line below, or $? will be 0 + last_version="$(hub_tool -p release | cut -d'-' -f2 | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$'| sort -r -V | head -1)" + if ! [[ $? -eq 0 ]]; then + abort "cannot list releases" + fi + + local release_id # don't combine with the line below, or $? will be 0 + release_id="$(hub_tool api /repos/${ORG_NAME}/${REPO_NAME}/releases/tags/knative-${last_version} | jq .id)" + if [[ $? -ne 0 ]]; then + abort "cannot get relase id from github" + fi + + hub_tool api --method PATCH /repos/knative/serving/releases/$release_id -F make_latest=true > /dev/null || abort "error settomg $last_version to 'latest'" + echo "Github release ${last_version} set as 'latest'" +} + # Entry point for a release script. function main() { parse_flags "$@" @@ -727,6 +745,7 @@ function main() { done echo "New release built successfully" publish_artifacts + set_latest_to_highest_semver } # Publishes a new release on GitHub, also git tagging it (unless this is not a versioned release). diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go index 79713fe4b..b5bb695d2 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake/fake_filtered_factory.go @@ -45,14 +45,15 @@ func withInformerFactory(ctx context.Context) context.Context { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []informers.SharedInformerOption{} if injection.HasNamespaceScope(ctx) { opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx))) } opts = append(opts, informers.WithTweakListOptions(func(l *v1.ListOptions) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, + ctx = context.WithValue(ctx, filtered.Key{Selector: selectorVal}, informers.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) } return ctx diff --git a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go index 101263662..621a20053 100644 --- a/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go +++ b/vendor/knative.dev/pkg/client/injection/kube/informers/factory/filtered/filtered_factory.go @@ -53,14 +53,15 @@ func withInformerFactory(ctx context.Context) context.Context { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []informers.SharedInformerOption{} if injection.HasNamespaceScope(ctx) { opts = append(opts, informers.WithNamespace(injection.GetNamespaceScope(ctx))) } opts = append(opts, informers.WithTweakListOptions(func(l *v1.ListOptions) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, Key{Selector: selector}, + ctx = context.WithValue(ctx, Key{Selector: selectorVal}, informers.NewSharedInformerFactoryWithOptions(c, controller.GetResyncPeriod(ctx), opts...)) } return ctx diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fake_filtered_factory.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fake_filtered_factory.go index c5a9f9728..1d099f2da 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fake_filtered_factory.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fake_filtered_factory.go @@ -116,14 +116,15 @@ func withInformerFactory(ctx {{.contextContext|raw}}) {{.contextContext|raw}} { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []{{.informersSharedInformerOption|raw}}{} if {{.injectionHasNamespace|raw}}(ctx) { opts = append(opts, {{.informersWithNamespace|raw}}({{.injectionGetNamespace|raw}}(ctx))) } opts = append(opts, {{.informersWithTweakListOptions|raw}}(func(l *{{.metav1ListOptions|raw}}) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, {{.factoryKey|raw}}{Selector: selector}, + ctx = context.WithValue(ctx, {{.factoryKey|raw}}{Selector: selectorVal}, {{.informersNewSharedInformerFactoryWithOptions|raw}}(c, {{.controllerGetResyncPeriod|raw}}(ctx), opts...)) } return ctx diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_factory.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_factory.go index f82923062..d26fa16d6 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_factory.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/filtered_factory.go @@ -117,14 +117,15 @@ func withInformerFactory(ctx {{.contextContext|raw}}) {{.contextContext|raw}} { } labelSelectors := untyped.([]string) for _, selector := range labelSelectors { + selectorVal := selector opts := []{{.informersSharedInformerOption|raw}}{} if {{.injectionHasNamespace|raw}}(ctx) { opts = append(opts, {{.informersWithNamespace|raw}}({{.injectionGetNamespace|raw}}(ctx))) } opts = append(opts, {{.informersWithTweakListOptions|raw}}(func(l *{{.metav1ListOptions|raw}}) { - l.LabelSelector = selector + l.LabelSelector = selectorVal })) - ctx = context.WithValue(ctx, Key{Selector: selector}, + ctx = context.WithValue(ctx, Key{Selector: selectorVal}, {{.informersNewSharedInformerFactoryWithOptions|raw}}(c, {{.controllerGetResyncPeriod|raw}}(ctx), opts...)) } return ctx diff --git a/vendor/modules.txt b/vendor/modules.txt index 65d223c21..66001e4eb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -890,10 +890,10 @@ k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/hack v0.0.0-20231025074238-d4af42e9b222 +# knative.dev/hack v0.0.0-20231102183416-0d99b7ee9d63 ## explicit; go 1.18 knative.dev/hack -# knative.dev/pkg v0.0.0-20231101193506-b09d4f2a2845 +# knative.dev/pkg v0.0.0-20231102200604-fac3a4ffbc74 ## explicit; go 1.18 knative.dev/pkg/apis knative.dev/pkg/apis/duck