From f9b233c6fd24e99a941ad1a71309dea0f36850a3 Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Thu, 20 Jun 2024 13:45:07 +0000 Subject: [PATCH] upgrade to latest dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bumping golang.org/x/term 46c790f...5f0bb72: > 5f0bb72 go.mod: update golang.org/x dependencies bumping golang.org/x/tools cc29c91...bc6931d: > bc6931d go.mod: update golang.org/x dependencies > 1767b14 go/ssa: remove code with no effect > 2088083 internal/gocommand: add more debug info for hanging go commands > f1a3b12 internal/imports: FixImports should be cancellable > 4478db0 go/analysis/passes/copylock: suppress error in ill-typed code > 018d3b2 gopls: warn about Go 1.19 and Go 1.20 > 58cc8a4 gopls/internal/filecache: suppress gc in tests > b623539 gopls/internal/cache: suppress "internal" import check on Bazel > 1e9d12d go/packages: pass -overlay to all 'go list' invocations > 3c293ad internal/cache: invalidate broken imports when package files change > 5eff1ee gopls/internal/cache: check viewMap before altering views > da9cad4 go/packages: avoid unnecessary "realpath" on pwd > 71b7fa9 go/callgraph/vta: save some heap allocations in the trie implementation > 2f8e378 go/callgraph/vta: remove graph successors method > 624dbd0 go/analysis/passes/stringintconv: post gotypesalias=1 tweak > 4669dc7 gopls/internal/test/marker: simplify seedCache file > 6887e99 gopls/internal/cache: use a better view in viewOfLocked > bd624fd gopls: make tests tolerant of new go/types error format > 2e977dd internal/drivertest: evaluate symlink before calling packages.Load > 8d54ca1 gopls/internal/test/marker: seed the cache before running tests > 01018ba Revert "gopls/internal/settings: enable semantic tokens by default" > 019da39 gopls/internal/golang: OutgoingCalls: fix crash on unsafe.Slice > 30c880d gopls/internal/cache: improve missing import error message > d017f4a go/packages/internal/drivertest: a package for a fake go/packages driver > e229045 go/callgraph/vta: avoid some temporary data structures using callbacks > 0215a5b go/packages: document fields that are part of JSON schema > f10a0f1 gopls/internal/golang: skip TestFreeRefs on js > d940b33 gopls/internal/server: support InsertReplaceEdit completion > e635bfa gopls/internal/golang: unexport more declarations > 7045d2e go/analysis/passes/nilness: fix bug with MakeInterface(TypeParam) > e1b14a1 gopls/internal/server: avoid VS Code lightbulb > 34db5bc gopls: initial support for godebug directive in go.mod and go.work > 56f50e3 gopls/doc: split codelenses out of settings > 3629652 gopls/internal/analysis/simplifyrange: suppress on range-over-func > fb52877 all: sync golang.org/x/telemetry@bda5523 > 4646dbf gopls/internal/protocol: customize InsertReplaceEdit JSON unmarshal > bc5e086 gopls/internal/golang: unexport several functions > 32cec11 gopls/internal/test/integration: fix race in TestGCDetails_Toggle > c3aae99 gopls/doc: tidy up analyzer documentation > 41211c8 gopls/internal/golang: fix bug in freeRefs algorithm > 788d39e gopls/internal/golang: "Show free symbols" code action > f73683e gopls/internal/golang: remove test debugging aix-ppc64 issue > 0b4dca1 gopls/internal/protocol: separate CodeLens from Command; document > 8cf8c6f internal/test/integration: materialize startedWork and completedWork > de1032b gopls: remove dead code > 499663e all: fix function names in comment > c184dd7 internal/test/marker: skip basiclit.txt on ppc64 > 1f300c9 gopls: upgrade x/telemetry to pick up CL 586195 > fd7deae gopls/internal/test/marker: fix analyzers.txt test that requires cgo > af36634 gopls/internal/protocol: rename DocumentChange{s,} > 42d564a gopls: support four kinds of DocumentChanges > b92578a x/tools: update to x/telemetry@9ff3ad9 > 987af8b x/tools: update to x/telemetry@ac8fed8 > 069435c gopls/internal/cache: use 1 not 0 for missing line/col info > 528484d gopls/internal/cache: support overlays > 2e17129 gopls/doc/generate: add link anchors to each setting > ab7bc6c gopls: further minor generator simplifications > d40dfd5 gopls: upload from telemetry.Start, rather than upload.Run > e8808ed gopls: upgrade x/telemetry to latest > 0006edc go/ssa: support range-over-func > 59d9797 gopls/internal/settings: annotate TestVetSuite with NeedsTool("go") > 487737a gopls/internal/golang: fix another crash in RenderPackageDoc > 4cfd180 gopls/internal/golang: RenderPackageDoc: fix param truncation crash > 3e9beb6 gopls/doc/release: add release notes for struct tag hover info > 24f3b32 gopls/internal/golang: show struct tag when hovering over fields > 9795fac gopls/internal/server: discard non-file scheme workspace folder URIs > 3b13d03 gopls/internal/cache: fix bug.Report converting Diagnostic positions > 7f3a258 gopls/internal/test/integration/misc: disable another staticcheck test > 8483344 gopls/internal/settings: add framepointer,sigchanyzer analyzers > 8f9d159 gopls/internal/test/integration/misc: disable staticcheck test > f38ac9b gopls/internal/test: avoid std assumptions in range-over-func test > e35e4cc go/ssa: compile range-over-func to panic > e149e84 gopls: rationalize code generation > ff28778 gopls/internal/protocol: rationalize edit helpers > 5daf157 gopls/internal/golang: simplify "rewrite" code actions > 1718e2d gopls/internal/cache: simplify Snapshot Go commands > a432b16 gopls/internal/analysis: disable ssa/ir analyzers on range-over-func > b426bc7 go/packages/packagestest: reflect new modules.txt requirements > a943a14 go/analysis/passes/directive: do not report adjoining //go:debug > b020bdb go/callgraph/vta: add type alias test bumping google.golang.org/genproto/googleapis/rpc 0867130...5315273: > 5315273 chore(all): update all (# 1131) > a332354 chore(all): auto-regenerate .pb.go files (# 1130) > d264139 chore(all): update all (# 1128) > dc85e6b chore(all): auto-regenerate .pb.go files (# 1129) > fc5f0ca chore: min Go version to 1.20 (# 1127) bumping golang.org/x/text 8d533a0...9c2f3a2: > 9c2f3a2 cmd/gotext: fix segfault in extract & rewrite commands > 59e1219 message: optimize lookupAndFormat function for better performance > a20a3e2 x/text: update x/tools for go/ssa range-over-func fix bumping github.com/prometheus/client_model d56cd79...571429e: > 571429e Merge pull request # 86 from prometheus/repo_sync > 6fe5007 Merge pull request # 85 from prometheus/repo_sync > cc727ab Update common Prometheus files > 64c33c9 Merge pull request # 84 from prometheus/dependabot/go_modules/google.golang.org/protobuf-1.33.0 > bce87c1 Update common Prometheus files > 5c25993 Merge pull request # 82 from prometheus/repo_sync > d954a8a Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 > 01ca24c Merge pull request # 81 from prometheus/repo_sync > bb45f95 Update common Prometheus files > ccd6823 Update common Prometheus files bumping google.golang.org/genproto/googleapis/api b8a5c65...d264139: > d264139 chore(all): update all (# 1128) > dc85e6b chore(all): auto-regenerate .pb.go files (# 1129) > fc5f0ca chore: min Go version to 1.20 (# 1127) > 0867130 chore(all): auto-regenerate .pb.go files (# 1125) > 024948a chore(all): update all (# 1126) > 6275950 chore(all): auto-regenerate .pb.go files (# 1124) bumping golang.org/x/oauth2 84cb9f7...5fd4241: > 5fd4241 google: update compute token refresh bumping golang.org/x/mod aa51b25...c0bdc7b: > c0bdc7b modfile: add API for godebug lines > 6686f41 module: add COM0 and LPT0 to badWindowsNames bumping golang.org/x/sys 7d69d98...673e0f9: > 673e0f9 unix: skip ethtool driver test for busy interface > 6943ab6 unix/linux: update glibc to 2.39 > 92f3ad6 unix: update to Linux kernel 6.9 > f34bb9f windows: add net user enum > 6dfb94e unix: add types for SOCK_DIAG bumping knative.dev/reconciler-test 1351b60...5bf0b86: > 5bf0b86 upgrade to latest dependencies (# 738) > 199a526 upgrade to latest dependencies (# 736) > 2023469 Update community files (# 735) > c3147c1 upgrade to latest dependencies (# 734) > 1f340aa Fix `nil` pointer error in forwarder from file (# 733) > 2723f53 Allow forwarder to forward events from files (# 732) > fe1acf2 feat: eventshub sender can send to resources in other namespaces (# 731) > c8f73e2 upgrade to latest dependencies (# 729) > 5c0e9f6 Update community files (# 728) bumping github.com/prometheus/common e54e4df...789222a: > 789222a Merge pull request # 627 from freak12techno/add-time-template-helpers > 6846990 Bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1 in /sigv4 (# 639) > b2fc541 Merge branch 'main' into add-time-template-helpers > f93a89e Bump github.com/aws/aws-sdk-go from 1.51.32 to 1.53.14 in /sigv4 (# 638) > 9f1953b chore: review fixes > 3ddc148 Merge pull request # 636 from prometheus/repo_sync > 4f7cf6e Update helpers/templates/convert_to_float.go > 6b9921f Refactored oauth2RoundTripper.RoundTrip (# 634) > 2b9d805 Update common Prometheus files > b9d8f7c Update helpers/templates/humanize_duration.go > a7407da Add support for secret refs (# 572) > 80e630e Update helpers/templates/humamize_duration_test.go > 260bf03 Add common interface to fetch secrets in HTTP client config (# 538) > 270171b chore: fixed go.mod again > 58f58f8 Bump google.golang.org/protobuf from 1.33.0 to 1.34.0 (# 629) > c5c1b1d chore: revert gitignore > 20d77e7 Bump github.com/prometheus/client_model from 0.6.0 to 0.6.1 (# 631) > 5bde41a chore: probably fixed CI > b2390e6 Bump golang.org/x/net from 0.23.0 to 0.24.0 (# 630) > 9248aab feat: add time template helpers > d725e1b Bump golang.org/x/oauth2 from 0.18.0 to 0.19.0 (# 628) > befd598 Bump github.com/aws/aws-sdk-go from 1.51.11 to 1.51.32 in /sigv4 (# 632) > 54517e0 Update common Prometheus files (# 633) > 36303a8 Merge pull request # 416 from roidelapluie/headers > 5c108f8 Bump golang.org/x/net from 0.22.0 to 0.23.0 (# 623) > aeb616a Add HTTP headers support to common HTTP client. > 2cd1b1a Bump golang.org/x/net from 0.22.0 to 0.23.0 in /sigv4 (# 624) bumping google.golang.org/api 4b79cc4...c642c84: > c642c84 chore(main): release 0.183.0 (# 2615) > 305d137 chore(all): update all (# 2618) > 0077748 feat(all): auto-regenerate discovery clients (# 2622) > c7f1614 feat(all): auto-regenerate discovery clients (# 2619) > 08fdd71 feat(all): auto-regenerate discovery clients (# 2617) > 5f21214 feat(all): auto-regenerate discovery clients (# 2616) > 1de148b feat(all): auto-regenerate discovery clients (# 2611) > 4f98211 fix: add another temporary dep on genproto (# 2614) > b49e3b9 chore(main): release 0.182.0 (# 2591) > b6f615b chore(all): update all (# 2607) > c4c51ce feat(all): auto-regenerate discovery clients (# 2609) > 0e58f74 feat(all): auto-regenerate discovery clients (# 2608) > ceaeabf feat(all): auto-regenerate discovery clients (# 2606) > f474c8f feat(all): auto-regenerate discovery clients (# 2604) > ece7727 feat(all): auto-regenerate discovery clients (# 2603) > a86c4b6 feat(all): auto-regenerate discovery clients (# 2602) > 2e7cc39 feat(all): auto-regenerate discovery clients (# 2600) > 677f53d feat(all): auto-regenerate discovery clients (# 2599) > 7d46b4d feat(all): auto-regenerate discovery clients (# 2597) > 07e7104 feat(all): auto-regenerate discovery clients (# 2595) > 21295a5 feat(all): auto-regenerate discovery clients (# 2594) > e95bd57 feat(all): auto-regenerate discovery clients (# 2590) bumping knative.dev/hack 68e3bfb...0914314: > 0914314 Update community files (# 384) > 3b6d644 Update community files (# 383) bumping knative.dev/pkg 99e1685...339c22b: > 339c22b Add AuthenticatableType duck type (# 3056) > 15e6cdf Bump golang.org/x/tools from 0.21.0 to 0.22.0 (# 3053) > 543dda5 Bump google.golang.org/api from 0.182.0 to 0.183.0 (# 3054) > 9b7c2c5 Bump github.com/prometheus/common from 0.53.0 to 0.54.0 (# 3052) > 8119179 Update community files (# 3050) > 58135c2 Extra logging for leases (# 3049) > fce44ea Maybe fix controller ha (# 3046) > 1709961 Bump google.golang.org/api from 0.181.0 to 0.182.0 (# 3048) > 229e527 fix: downstream tests assume release branch was cut (# 3047) > 7d52a43 drop special logic when handling kubelet probe header for istio mTLS (# 2997) > ff4756a Update community files (# 3044) > 5eeb7ec Skip lease with empty holder (# 3042) bumping knative.dev/eventing 74253dd...18dfe3c: > 18dfe3c JobSink: Test OIDC support (# 8000) > e298f32 Add authz library (# 8002) > 1a21fee Add all JobSink symlinks in config/ (# 8007) > 2157639 Add validation for EventPolicy sub suffix matching (# 8008) > 0eee301 Propagate read error correctly in event-dispatcher (# 8005) > 43cf75a [main] Upgrade to latest dependencies (# 8004) > ea8f0fd Add `AppliedEventPoliciesStatus` type (# 7999) > 8da4543 Add `default-authorization-mode` feature flag (# 7996) > 7f37d64 Add EventPolicy types (# 7995) > 6259113 Fix possible nil pointer dereference in event-dispatcher (# 7994) > 67ceb9e Move job sink certificate out of config core (# 7993) > b18b1b1 JobSink: add webhook validation for spec.job (# 7962) > 0bce743 Support arbitrary data for rekt configmap package (# 7991) > 834d833 Add JobSink data plane symlink in config/ (# 7990) > c60bcd0 fix: add comments and improve regex for attribute filter transform function (# 7967) > d60149d [main] Upgrade to latest dependencies (# 7987) > 3af0fac Exclude core deployments from SinkBinding webhook injection (# 7986) > 8c4cd2e Fix: Parallels updates subscription where possible, instead of recrea… (# 7965) > 844dcbf Adding mount path as env variable in container (# 7968) > b8623b2 [main] Update community files (# 7969) > 9d11598 fix: eventing clusterrole has correct knsubscribe permissions (# 7943) > f9156c8 JobSink: don't start informers twice (# 7964) > bff65d2 Triggering long running background jobs when events occurs (# 7954) > 3ee2400 fix: sequence updates subscription where possible, instead of recreating it (# 7948) > 96e0f09 Bump rekt to main (# 7958) > e3604b8 [main] Upgrade to latest dependencies (# 7957) > 08b0813 [main] Upgrade to latest dependencies (# 7956) > c53b44d [main] Format Go code (# 7953) > a58c135 Prototype a MQTT Source (# 7919) > 39d2723 [main] Upgrade to latest dependencies (# 7950) > b9cba87 Add EventType v1beta3 conversion (# 7938) > 2a11bb8 [main] Update community files (# 7949) > 746dc52 fix: no more panic in the execute request method (# 7947) > abdbf14 Remove rekt test from GH actions e2e test run (# 7941) > a3a2ac0 Enable `eventtype-auto-create` feature flag for e2e tests (# 7940) bumping golang.org/x/net d27919b...66e838c: > 66e838c go.mod: update golang.org/x dependencies > 6249541 http2: avoid race in server handler SetReadDeadine/SetWriteDeadline > 603e3e6 quic: disable X25519Kyber768Draft00 in tests > 67e8d0c http2: report an error if goroutines outlive serverTester tests > 5608279 http2: avoid corruption in priority write scheduler > 0d515a5 http2: factor out frame read/write test functions > 9f5b79b http2: drop unused retry function > 03c24c2 http2: use synthetic time in server tests > 022530c http2: add a more full-featured test net.Conn > 410d19e http2: avoid racy access to clientStream.requestedGzip > 332fe23 http2: remove spec coverage test > c1f5833 all: replace deprecated io/ioutil calls > 9545aea http2: clearer distinction between test server types > b1ec120 http2: use implicit synchronization in tests > 49bf2d7 proxy: use strings.TrimSuffix > c87a5b6 http2: set up the timer of closing idle connection after the initialization > 8aa6dbf http2: cancel handler context on stream errors > 2c14f51 http2: drop the gate type > ac99879 webdav: return 409 for PUT without parent collection > 7fa635b http2: avoid panic on h2c upgrade failure bumping golang.org/x/crypto 905d78a...332fd65: > 332fd65 go.mod: update golang.org/x dependencies > 0b431c7 x509roots/fallback: update bundle > 349231f ssh: implement CryptoPublicKey on sk keys > 44c9b0f ssh: allow server auth callbacks to send additional banners > 67b1361 sha3: reenable s390x assembly > 477a5b4 sha3: make APIs usable with zero allocations > 59b5a86 sha3: disable s390x assembly > 10f366e sha3: simplify XOR functions Signed-off-by: Knative Automation --- go.mod | 35 +- go.sum | 70 ++-- vendor/golang.org/x/mod/module/module.go | 2 + vendor/golang.org/x/net/http2/http2.go | 19 +- vendor/golang.org/x/net/http2/server.go | 94 +++-- vendor/golang.org/x/net/http2/testsync.go | 331 ------------------ vendor/golang.org/x/net/http2/timer.go | 20 ++ vendor/golang.org/x/net/http2/transport.go | 310 ++++++---------- .../x/net/http2/writesched_priority.go | 4 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 2 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 20 +- .../x/sys/unix/zerrors_linux_386.go | 1 + .../x/sys/unix/zerrors_linux_amd64.go | 1 + .../x/sys/unix/zerrors_linux_arm64.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 37 +- .../x/sys/windows/security_windows.go | 1 + .../x/sys/windows/zsyscall_windows.go | 9 + .../x/tools/internal/gocommand/invoke.go | 96 ++++- .../x/tools/internal/imports/fix.go | 28 +- .../googleapis/api/httpbody/httpbody.pb.go | 4 +- .../k8s.io/apimachinery/pkg/util/rand/rand.go | 127 +++++++ vendor/k8s.io/apiserver/LICENSE | 202 +++++++++++ .../apiserver/pkg/storage/names/generate.go | 54 +++ .../apis/duck/v1/eventpoliciesstatus_type.go | 35 ++ .../pkg/apis/duck/v1/zz_generated.deepcopy.go | 37 ++ .../pkg/apis/eventing/v1/broker_types.go | 4 + .../apis/eventing/v1/zz_generated.deepcopy.go | 1 + .../pkg/apis/eventing/v1alpha1/doc.go | 20 ++ .../v1alpha1/eventpolicy_conversion.go | 34 ++ .../eventing/v1alpha1/eventpolicy_defaults.go | 31 ++ .../v1alpha1/eventpolicy_lifecycle.go | 52 +++ .../eventing/v1alpha1/eventpolicy_types.go | 168 +++++++++ .../v1alpha1/eventpolicy_validation.go | 102 ++++++ .../pkg/apis/eventing/v1alpha1/register.go | 53 +++ .../v1alpha1/zz_generated.deepcopy.go | 250 +++++++++++++ .../eventing/v1beta2/eventtype_conversion.go | 77 +++- .../eventing/pkg/apis/feature/features.go | 59 +++- .../eventing/pkg/apis/feature/flag_names.go | 1 + .../eventing/pkg/apis/feature/store.go | 4 +- .../pkg/apis/flows/v1/parallel_types.go | 5 +- .../pkg/apis/flows/v1/sequence_types.go | 5 +- .../apis/flows/v1/zz_generated.deepcopy.go | 2 + .../messaging/v1/in_memory_channel_types.go | 4 + .../messaging/v1/zz_generated.deepcopy.go | 1 + .../eventing/pkg/apis/sinks/constants.go | 23 ++ .../eventing/pkg/apis/sinks/register.go | 54 +++ .../eventing/pkg/apis/sinks/v1alpha1/doc.go | 20 ++ .../sinks/v1alpha1/job_sink_conversion.go | 36 ++ .../apis/sinks/v1alpha1/job_sink_defaults.go | 24 ++ .../apis/sinks/v1alpha1/job_sink_lifecycle.go | 78 +++++ .../pkg/apis/sinks/v1alpha1/job_sink_types.go | 89 +++++ .../sinks/v1alpha1/job_sink_validation.go | 57 +++ .../pkg/apis/sinks/v1alpha1/register.go | 53 +++ .../sinks/v1alpha1/zz_generated.deepcopy.go | 144 ++++++++ .../knative.dev/eventing/pkg/auth/audience.go | 7 + .../eventing/pkg/auth/event_policy.go | 147 ++++++++ .../client/clientset/versioned/clientset.go | 42 ++- .../versioned/fake/clientset_generated.go | 14 + .../clientset/versioned/fake/register.go | 4 + .../clientset/versioned/scheme/register.go | 4 + .../versioned/typed/eventing/v1alpha1/doc.go | 20 ++ .../eventing/v1alpha1/eventing_client.go | 107 ++++++ .../typed/eventing/v1alpha1/eventpolicy.go | 195 +++++++++++ .../typed/eventing/v1alpha1/fake/doc.go | 20 ++ .../v1alpha1/fake/fake_eventing_client.go | 40 +++ .../v1alpha1/fake/fake_eventpolicy.go | 141 ++++++++ .../eventing/v1alpha1/generated_expansion.go | 21 ++ .../versioned/typed/sinks/v1alpha1/doc.go | 20 ++ .../typed/sinks/v1alpha1/fake/doc.go | 20 ++ .../typed/sinks/v1alpha1/fake/fake_jobsink.go | 141 ++++++++ .../sinks/v1alpha1/fake/fake_sinks_client.go | 40 +++ .../sinks/v1alpha1/generated_expansion.go | 21 ++ .../versioned/typed/sinks/v1alpha1/jobsink.go | 195 +++++++++++ .../typed/sinks/v1alpha1/sinks_client.go | 107 ++++++ .../externalversions/eventing/interface.go | 8 + .../eventing/v1alpha1/eventpolicy.go | 90 +++++ .../eventing/v1alpha1/interface.go | 45 +++ .../informers/externalversions/factory.go | 6 + .../informers/externalversions/generic.go | 10 + .../externalversions/sinks/interface.go | 46 +++ .../sinks/v1alpha1/interface.go | 45 +++ .../sinks/v1alpha1/jobsink.go | 90 +++++ .../listers/eventing/v1alpha1/eventpolicy.go | 99 ++++++ .../eventing/v1alpha1/expansion_generated.go | 27 ++ .../sinks/v1alpha1/expansion_generated.go | 27 ++ .../client/listers/sinks/v1alpha1/jobsink.go | 99 ++++++ .../eventing/pkg/eventingtls/eventingtls.go | 2 + .../pkg/kncloudevents/event_dispatcher.go | 16 +- .../pkg/apis/duck/v1/auth_types.go | 93 +++++ .../pkg/apis/duck/v1/zz_generated.deepcopy.go | 81 +++++ .../ducks/duck/v1/authstatus/authstatus.go | 60 ++++ vendor/knative.dev/pkg/network/network.go | 5 +- .../pkg/resolver/authenticatable_resolver.go | 117 +++++++ .../pkg/eventshub/forwarder/forwarder.go | 77 ++++ .../reconciler-test/pkg/eventshub/options.go | 23 +- .../reconciler-test/pkg/k8s/steps.go | 9 +- vendor/modules.txt | 55 ++- 97 files changed, 4725 insertions(+), 702 deletions(-) delete mode 100644 vendor/golang.org/x/net/http2/testsync.go create mode 100644 vendor/golang.org/x/net/http2/timer.go create mode 100644 vendor/k8s.io/apimachinery/pkg/util/rand/rand.go create mode 100644 vendor/k8s.io/apiserver/LICENSE create mode 100644 vendor/k8s.io/apiserver/pkg/storage/names/generate.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/duck/v1/eventpoliciesstatus_type.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_conversion.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_defaults.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_types.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_validation.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/constants.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/register.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/knative.dev/eventing/pkg/auth/event_policy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventpolicy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventpolicy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go create mode 100644 vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/eventpolicy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/interface.go create mode 100644 vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/interface.go create mode 100644 vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/interface.go create mode 100644 vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/jobsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/eventpolicy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go create mode 100644 vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/expansion_generated.go create mode 100644 vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/jobsink.go create mode 100644 vendor/knative.dev/pkg/client/injection/ducks/duck/v1/authstatus/authstatus.go create mode 100644 vendor/knative.dev/pkg/resolver/authenticatable_resolver.go diff --git a/go.mod b/go.mod index 792a796091..15373d2559 100644 --- a/go.mod +++ b/go.mod @@ -21,10 +21,10 @@ require ( k8s.io/client-go v0.29.2 k8s.io/code-generator v0.29.2 k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 - knative.dev/eventing v0.41.1-0.20240523103154-74253dd1c57a - knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 - knative.dev/pkg v0.0.0-20240521083825-99e1685a7997 - knative.dev/reconciler-test v0.0.0-20240523103149-1351b601972d + knative.dev/eventing v0.41.1-0.20240620085917-18dfe3c0ac90 + knative.dev/hack v0.0.0-20240607132042-09143140a254 + knative.dev/pkg v0.0.0-20240614135239-339c22b8218c + knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8 sigs.k8s.io/controller-runtime v0.15.2 ) @@ -84,8 +84,8 @@ require ( github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rickb777/plural v1.2.1 // indirect @@ -100,27 +100,28 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.21.0 // indirect + golang.org/x/tools v0.22.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/api v0.181.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect + google.golang.org/api v0.183.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apiserver v0.29.2 // indirect k8s.io/component-base v0.29.2 // indirect k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect k8s.io/klog/v2 v2.120.1 // indirect diff --git a/go.sum b/go.sum index 3328d3314d..378601cb7e 100644 --- a/go.sum +++ b/go.sum @@ -351,16 +351,16 @@ github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= +github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -467,8 +467,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -504,8 +504,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -546,8 +546,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -555,8 +555,8 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -621,15 +621,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -640,8 +640,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -694,8 +694,8 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -723,8 +723,8 @@ google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.181.0 h1:rPdjwnWgiPPOJx3IcSAQ2III5aX5tCer6wMpa/xmZi4= -google.golang.org/api v0.181.0/go.mod h1:MnQ+M0CFsfUwA5beZ+g/vCBCPXvtmZwRz2qzZk8ih1k= +google.golang.org/api v0.183.0 h1:PNMeRDwo1pJdgNcFQ9GstuLe/noWKIc89pRWRLMvLwE= +google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -762,10 +762,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae h1:AH34z6WAGVNkllnKs5raNq3yRq93VnjBG6rpfub/jYk= -google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae/go.mod h1:FfiGhwUm6CJviekPrc0oJ+7h29e+DmWU6UtjX0ZvI7Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1:mxSlqyb8ZAHsYDCfiXN1EDdNTdvjUJSLY+OnAUtYNYA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= +google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= +google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -834,6 +834,8 @@ k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2I k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/apiserver v0.29.2 h1:+Z9S0dSNr+CjnVXQePG8TcBWHr3Q7BmAr7NraHvsMiQ= +k8s.io/apiserver v0.29.2/go.mod h1:B0LieKVoyU7ykQvPFm7XSdIHaCHSzCzQWPFa5bqbeMQ= k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/code-generator v0.29.2 h1:c9/iw2KnNpw2IRV+wwuG/Wns2TjPSgjWzbbjTevyiHI= @@ -849,14 +851,14 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.41.1-0.20240523103154-74253dd1c57a h1:FTDl2yRQgnp/ZmBmU66igmMspkoN7Lf2WxDijIWyOqs= -knative.dev/eventing v0.41.1-0.20240523103154-74253dd1c57a/go.mod h1:IUBpMsDIfyV5836R9PN0/VyADgoDa9ykgz7gpvTseLw= -knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 h1:CYoD72R8/R35REjeY2nnWfBak+Q3f+NxXwEfwcID1eU= -knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= -knative.dev/pkg v0.0.0-20240521083825-99e1685a7997 h1:MN/u8ivos957WdihUjKfFw1Qv9HZ3+pe4TOwdYQiB2Q= -knative.dev/pkg v0.0.0-20240521083825-99e1685a7997/go.mod h1:GHFUP1wtD/bR/c02QADqaAK3odDJh1ddBMvXhq/goy8= -knative.dev/reconciler-test v0.0.0-20240523103149-1351b601972d h1:MhO1bvabteY0VjkS2MR0S6+VHCT+DByTIGTLodRBV48= -knative.dev/reconciler-test v0.0.0-20240523103149-1351b601972d/go.mod h1:IhLACQFqZDDTj34bY3Nte9tWWqc8KyahohdRGyeayRM= +knative.dev/eventing v0.41.1-0.20240620085917-18dfe3c0ac90 h1:rieOHfbsEveC/30tfSCf3g7Ocu9mJ+w4Dv22FBMC5lY= +knative.dev/eventing v0.41.1-0.20240620085917-18dfe3c0ac90/go.mod h1:Ja5ThoaajtwMAb7pHhG3t0WRul5oSZPalfP5R/0YP80= +knative.dev/hack v0.0.0-20240607132042-09143140a254 h1:1YFnu3U6dWZg0oxm6GU8kEdA9A+BvSWKJO7sg3N0kq8= +knative.dev/hack v0.0.0-20240607132042-09143140a254/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/pkg v0.0.0-20240614135239-339c22b8218c h1:OaKrY7L6rzWTvs51JlieJajL40F6CpBbvO1aZspg2EA= +knative.dev/pkg v0.0.0-20240614135239-339c22b8218c/go.mod h1:l7R8/SteYph0mZDsVgq3fVs4mWp1DaYx9BJJX68U6ik= +knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8 h1:A+rsitEiTX3GudM51g7zUMza+Ripj+boncmlJ2jZp50= +knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8/go.mod h1:2uUx3U6kdIzgJgMGgrGmdDdcFrFiex/DjuI2gM7Tte8= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go index 2a364b229b..cac1a899e9 100644 --- a/vendor/golang.org/x/mod/module/module.go +++ b/vendor/golang.org/x/mod/module/module.go @@ -506,6 +506,7 @@ var badWindowsNames = []string{ "PRN", "AUX", "NUL", + "COM0", "COM1", "COM2", "COM3", @@ -515,6 +516,7 @@ var badWindowsNames = []string{ "COM7", "COM8", "COM9", + "LPT0", "LPT1", "LPT2", "LPT3", diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index 6f2df28187..003e649f30 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -17,6 +17,7 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" + "context" "crypto/tls" "fmt" "io" @@ -26,6 +27,7 @@ import ( "strconv" "strings" "sync" + "time" "golang.org/x/net/http/httpguts" ) @@ -210,12 +212,6 @@ type stringWriter interface { WriteString(s string) (n int, err error) } -// A gate lets two goroutines coordinate their activities. -type gate chan struct{} - -func (g gate) Done() { g <- struct{}{} } -func (g gate) Wait() { <-g } - // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} @@ -383,3 +379,14 @@ func validPseudoPath(v string) bool { // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func() + +// synctestGroupInterface is the methods of synctestGroup used by Server and Transport. +// It's defined as an interface here to let us keep synctestGroup entirely test-only +// and not a part of non-test builds. +type synctestGroupInterface interface { + Join() + Now() time.Time + NewTimer(d time.Duration) timer + AfterFunc(d time.Duration, f func()) timer + ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) +} diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index c5d0810813..6c349f3ec6 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -154,6 +154,39 @@ type Server struct { // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState + + // Synchronization group used for testing. + // Outside of tests, this is nil. + group synctestGroupInterface +} + +func (s *Server) markNewGoroutine() { + if s.group != nil { + s.group.Join() + } +} + +func (s *Server) now() time.Time { + if s.group != nil { + return s.group.Now() + } + return time.Now() +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (s *Server) newTimer(d time.Duration) timer { + if s.group != nil { + return s.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (s *Server) afterFunc(d time.Duration, f func()) timer { + if s.group != nil { + return s.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} } func (s *Server) initialConnRecvWindowSize() int32 { @@ -400,6 +433,10 @@ func (o *ServeConnOpts) handler() http.Handler { // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { + s.serveConn(c, opts, nil) +} + +func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) { baseCtx, cancel := serverConnBaseContext(c, opts) defer cancel() @@ -426,6 +463,9 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { pushEnabled: true, sawClientPreface: opts.SawClientPreface, } + if newf != nil { + newf(sc) + } s.state.registerConn(sc) defer s.state.unregisterConn(sc) @@ -599,8 +639,8 @@ type serverConn struct { inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop needToSendGoAway bool // we need to schedule a GOAWAY frame write goAwayCode ErrCode - shutdownTimer *time.Timer // nil until used - idleTimer *time.Timer // nil if unused + shutdownTimer timer // nil until used + idleTimer timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer @@ -649,12 +689,12 @@ type stream struct { flow outflow // limits writing from Handler to client inflow inflow // what the client is allowed to POST/etc to us state streamState - resetQueued bool // RST_STREAM queued for write; set by sc.resetStream - gotTrailerHeader bool // HEADER frame for trailers was seen - wroteHeaders bool // whether we wrote headers (not status 100) - readDeadline *time.Timer // nil if unused - writeDeadline *time.Timer // nil if unused - closeErr error // set before cw is closed + resetQueued bool // RST_STREAM queued for write; set by sc.resetStream + gotTrailerHeader bool // HEADER frame for trailers was seen + wroteHeaders bool // whether we wrote headers (not status 100) + readDeadline timer // nil if unused + writeDeadline timer // nil if unused + closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer @@ -811,8 +851,9 @@ type readFrameResult struct { // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { - gate := make(gate) - gateDone := gate.Done + sc.srv.markNewGoroutine() + gate := make(chan struct{}) + gateDone := func() { gate <- struct{}{} } for { f, err := sc.framer.ReadFrame() select { @@ -843,6 +884,7 @@ type frameWriteResult struct { // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { + sc.srv.markNewGoroutine() var err error if wd == nil { err = wr.write.writeFrame(sc) @@ -922,13 +964,13 @@ func (sc *serverConn) serve() { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { - sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above - settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) + settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() loopNum := 0 @@ -1057,10 +1099,10 @@ func (sc *serverConn) readPreface() error { errc <- nil } }() - timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? + timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { - case <-timer.C: + case <-timer.C(): return errPrefaceTimeout case err := <-errc: if err == nil { @@ -1425,7 +1467,7 @@ func (sc *serverConn) goAway(code ErrCode) { func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() - sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) + sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { @@ -1639,7 +1681,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { delete(sc.streams, st.id) if len(sc.streams) == 0 { sc.setConnState(http.StateIdle) - if sc.srv.IdleTimeout > 0 { + if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { @@ -1661,6 +1703,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { } } st.closeErr = err + st.cancelCtx() st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc sc.writeSched.CloseStream(st.id) } @@ -2021,7 +2064,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) - st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) @@ -2119,7 +2162,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.srv.initialStreamRecvWindowSize()) if sc.hs.WriteTimeout > 0 { - st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st @@ -2343,6 +2386,7 @@ func (sc *serverConn) handlerDone() { // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { + sc.srv.markNewGoroutine() defer sc.sendServeMsg(handlerDoneMsg) didPanic := true defer func() { @@ -2639,7 +2683,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. - date = time.Now().UTC().Format(http.TimeFormat) + date = rws.conn.srv.now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { @@ -2761,7 +2805,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() { func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() @@ -2777,9 +2821,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { - st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) } else { - st.readDeadline.Reset(deadline.Sub(time.Now())) + st.readDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil @@ -2787,7 +2831,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() @@ -2803,9 +2847,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { - st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) } else { - st.writeDeadline.Reset(deadline.Sub(time.Now())) + st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil diff --git a/vendor/golang.org/x/net/http2/testsync.go b/vendor/golang.org/x/net/http2/testsync.go deleted file mode 100644 index 61075bd16d..0000000000 --- a/vendor/golang.org/x/net/http2/testsync.go +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -package http2 - -import ( - "context" - "sync" - "time" -) - -// testSyncHooks coordinates goroutines in tests. -// -// For example, a call to ClientConn.RoundTrip involves several goroutines, including: -// - the goroutine running RoundTrip; -// - the clientStream.doRequest goroutine, which writes the request; and -// - the clientStream.readLoop goroutine, which reads the response. -// -// Using testSyncHooks, a test can start a RoundTrip and identify when all these goroutines -// are blocked waiting for some condition such as reading the Request.Body or waiting for -// flow control to become available. -// -// The testSyncHooks also manage timers and synthetic time in tests. -// This permits us to, for example, start a request and cause it to time out waiting for -// response headers without resorting to time.Sleep calls. -type testSyncHooks struct { - // active/inactive act as a mutex and condition variable. - // - // - neither chan contains a value: testSyncHooks is locked. - // - active contains a value: unlocked, and at least one goroutine is not blocked - // - inactive contains a value: unlocked, and all goroutines are blocked - active chan struct{} - inactive chan struct{} - - // goroutine counts - total int // total goroutines - condwait map[*sync.Cond]int // blocked in sync.Cond.Wait - blocked []*testBlockedGoroutine // otherwise blocked - - // fake time - now time.Time - timers []*fakeTimer - - // Transport testing: Report various events. - newclientconn func(*ClientConn) - newstream func(*clientStream) -} - -// testBlockedGoroutine is a blocked goroutine. -type testBlockedGoroutine struct { - f func() bool // blocked until f returns true - ch chan struct{} // closed when unblocked -} - -func newTestSyncHooks() *testSyncHooks { - h := &testSyncHooks{ - active: make(chan struct{}, 1), - inactive: make(chan struct{}, 1), - condwait: map[*sync.Cond]int{}, - } - h.inactive <- struct{}{} - h.now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) - return h -} - -// lock acquires the testSyncHooks mutex. -func (h *testSyncHooks) lock() { - select { - case <-h.active: - case <-h.inactive: - } -} - -// waitInactive waits for all goroutines to become inactive. -func (h *testSyncHooks) waitInactive() { - for { - <-h.inactive - if !h.unlock() { - break - } - } -} - -// unlock releases the testSyncHooks mutex. -// It reports whether any goroutines are active. -func (h *testSyncHooks) unlock() (active bool) { - // Look for a blocked goroutine which can be unblocked. - blocked := h.blocked[:0] - unblocked := false - for _, b := range h.blocked { - if !unblocked && b.f() { - unblocked = true - close(b.ch) - } else { - blocked = append(blocked, b) - } - } - h.blocked = blocked - - // Count goroutines blocked on condition variables. - condwait := 0 - for _, count := range h.condwait { - condwait += count - } - - if h.total > condwait+len(blocked) { - h.active <- struct{}{} - return true - } else { - h.inactive <- struct{}{} - return false - } -} - -// goRun starts a new goroutine. -func (h *testSyncHooks) goRun(f func()) { - h.lock() - h.total++ - h.unlock() - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - f() - }() -} - -// blockUntil indicates that a goroutine is blocked waiting for some condition to become true. -// It waits until f returns true before proceeding. -// -// Example usage: -// -// h.blockUntil(func() bool { -// // Is the context done yet? -// select { -// case <-ctx.Done(): -// default: -// return false -// } -// return true -// }) -// // Wait for the context to become done. -// <-ctx.Done() -// -// The function f passed to blockUntil must be non-blocking and idempotent. -func (h *testSyncHooks) blockUntil(f func() bool) { - if f() { - return - } - ch := make(chan struct{}) - h.lock() - h.blocked = append(h.blocked, &testBlockedGoroutine{ - f: f, - ch: ch, - }) - h.unlock() - <-ch -} - -// broadcast is sync.Cond.Broadcast. -func (h *testSyncHooks) condBroadcast(cond *sync.Cond) { - h.lock() - delete(h.condwait, cond) - h.unlock() - cond.Broadcast() -} - -// broadcast is sync.Cond.Wait. -func (h *testSyncHooks) condWait(cond *sync.Cond) { - h.lock() - h.condwait[cond]++ - h.unlock() -} - -// newTimer creates a new fake timer. -func (h *testSyncHooks) newTimer(d time.Duration) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - c: make(chan time.Time), - } - h.timers = append(h.timers, t) - return t -} - -// afterFunc creates a new fake AfterFunc timer. -func (h *testSyncHooks) afterFunc(d time.Duration, f func()) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - f: f, - } - h.timers = append(h.timers, t) - return t -} - -func (h *testSyncHooks) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - ctx, cancel := context.WithCancel(ctx) - t := h.afterFunc(d, cancel) - return ctx, func() { - t.Stop() - cancel() - } -} - -func (h *testSyncHooks) timeUntilEvent() time.Duration { - h.lock() - defer h.unlock() - var next time.Time - for _, t := range h.timers { - if next.IsZero() || t.when.Before(next) { - next = t.when - } - } - if d := next.Sub(h.now); d > 0 { - return d - } - return 0 -} - -// advance advances time and causes synthetic timers to fire. -func (h *testSyncHooks) advance(d time.Duration) { - h.lock() - defer h.unlock() - h.now = h.now.Add(d) - timers := h.timers[:0] - for _, t := range h.timers { - t := t // remove after go.mod depends on go1.22 - t.mu.Lock() - switch { - case t.when.After(h.now): - timers = append(timers, t) - case t.when.IsZero(): - // stopped timer - default: - t.when = time.Time{} - if t.c != nil { - close(t.c) - } - if t.f != nil { - h.total++ - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - t.f() - }() - } - } - t.mu.Unlock() - } - h.timers = timers -} - -// A timer wraps a time.Timer, or a synthetic equivalent in tests. -// Unlike time.Timer, timer is single-use: The timer channel is closed when the timer expires. -type timer interface { - C() <-chan time.Time - Stop() bool - Reset(d time.Duration) bool -} - -// timeTimer implements timer using real time. -type timeTimer struct { - t *time.Timer - c chan time.Time -} - -// newTimeTimer creates a new timer using real time. -func newTimeTimer(d time.Duration) timer { - ch := make(chan time.Time) - t := time.AfterFunc(d, func() { - close(ch) - }) - return &timeTimer{t, ch} -} - -// newTimeAfterFunc creates an AfterFunc timer using real time. -func newTimeAfterFunc(d time.Duration, f func()) timer { - return &timeTimer{ - t: time.AfterFunc(d, f), - } -} - -func (t timeTimer) C() <-chan time.Time { return t.c } -func (t timeTimer) Stop() bool { return t.t.Stop() } -func (t timeTimer) Reset(d time.Duration) bool { return t.t.Reset(d) } - -// fakeTimer implements timer using fake time. -type fakeTimer struct { - hooks *testSyncHooks - - mu sync.Mutex - when time.Time // when the timer will fire - c chan time.Time // closed when the timer fires; mutually exclusive with f - f func() // called when the timer fires; mutually exclusive with c -} - -func (t *fakeTimer) C() <-chan time.Time { return t.c } - -func (t *fakeTimer) Stop() bool { - t.mu.Lock() - defer t.mu.Unlock() - stopped := t.when.IsZero() - t.when = time.Time{} - return stopped -} - -func (t *fakeTimer) Reset(d time.Duration) bool { - if t.c != nil || t.f == nil { - panic("fakeTimer only supports Reset on AfterFunc timers") - } - t.mu.Lock() - defer t.mu.Unlock() - t.hooks.lock() - defer t.hooks.unlock() - active := !t.when.IsZero() - t.when = t.hooks.now.Add(d) - if !active { - t.hooks.timers = append(t.hooks.timers, t) - } - return active -} diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go new file mode 100644 index 0000000000..0b1c17b812 --- /dev/null +++ b/vendor/golang.org/x/net/http2/timer.go @@ -0,0 +1,20 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +package http2 + +import "time" + +// A timer is a time.Timer, as an interface which can be replaced in tests. +type timer = interface { + C() <-chan time.Time + Reset(d time.Duration) bool + Stop() bool +} + +// timeTimer adapts a time.Timer to the timer interface. +type timeTimer struct { + *time.Timer +} + +func (t timeTimer) C() <-chan time.Time { return t.Timer.C } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 2fa49490c9..98a49c6b6e 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -185,7 +185,45 @@ type Transport struct { connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool - syncHooks *testSyncHooks + *transportTestHooks +} + +// Hook points used for testing. +// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations. +// Inside tests, see the testSyncHooks function docs. + +type transportTestHooks struct { + newclientconn func(*ClientConn) + group synctestGroupInterface +} + +func (t *Transport) markNewGoroutine() { + if t != nil && t.transportTestHooks != nil { + t.transportTestHooks.group.Join() + } +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (t *Transport) newTimer(d time.Duration) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (t *Transport) afterFunc(d time.Duration, f func()) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} +} + +func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.ContextWithTimeout(ctx, d) + } + return context.WithTimeout(ctx, d) } func (t *Transport) maxHeaderListSize() uint32 { @@ -352,60 +390,6 @@ type ClientConn struct { werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder - - syncHooks *testSyncHooks // can be nil -} - -// Hook points used for testing. -// Outside of tests, cc.syncHooks is nil and these all have minimal implementations. -// Inside tests, see the testSyncHooks function docs. - -// goRun starts a new goroutine. -func (cc *ClientConn) goRun(f func()) { - if cc.syncHooks != nil { - cc.syncHooks.goRun(f) - return - } - go f() -} - -// condBroadcast is cc.cond.Broadcast. -func (cc *ClientConn) condBroadcast() { - if cc.syncHooks != nil { - cc.syncHooks.condBroadcast(cc.cond) - } - cc.cond.Broadcast() -} - -// condWait is cc.cond.Wait. -func (cc *ClientConn) condWait() { - if cc.syncHooks != nil { - cc.syncHooks.condWait(cc.cond) - } - cc.cond.Wait() -} - -// newTimer creates a new time.Timer, or a synthetic timer in tests. -func (cc *ClientConn) newTimer(d time.Duration) timer { - if cc.syncHooks != nil { - return cc.syncHooks.newTimer(d) - } - return newTimeTimer(d) -} - -// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. -func (cc *ClientConn) afterFunc(d time.Duration, f func()) timer { - if cc.syncHooks != nil { - return cc.syncHooks.afterFunc(d, f) - } - return newTimeAfterFunc(d, f) -} - -func (cc *ClientConn) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - if cc.syncHooks != nil { - return cc.syncHooks.contextWithTimeout(ctx, d) - } - return context.WithTimeout(ctx, d) } // clientStream is the state for a single HTTP/2 stream. One of these @@ -487,7 +471,7 @@ func (cs *clientStream) abortStreamLocked(err error) { // TODO(dneil): Clean up tests where cs.cc.cond is nil. if cs.cc.cond != nil { // Wake up writeRequestBody if it is waiting on flow control. - cs.cc.condBroadcast() + cs.cc.cond.Broadcast() } } @@ -497,7 +481,7 @@ func (cs *clientStream) abortRequestBodyWrite() { defer cc.mu.Unlock() if cs.reqBody != nil && cs.reqBodyClosed == nil { cs.closeReqBodyLocked() - cc.condBroadcast() + cc.cond.Broadcast() } } @@ -507,10 +491,11 @@ func (cs *clientStream) closeReqBodyLocked() { } cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed - cs.cc.goRun(func() { + go func() { + cs.cc.t.markNewGoroutine() cs.reqBody.Close() close(reqBodyClosed) - }) + }() } type stickyErrWriter struct { @@ -626,21 +611,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) d := time.Second * time.Duration(backoff) - var tm timer - if t.syncHooks != nil { - tm = t.syncHooks.newTimer(d) - t.syncHooks.blockUntil(func() bool { - select { - case <-tm.C(): - case <-req.Context().Done(): - default: - return false - } - return true - }) - } else { - tm = newTimeTimer(d) - } + tm := t.newTimer(d) select { case <-tm.C(): t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) @@ -725,8 +696,8 @@ func canRetryError(err error) bool { } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.syncHooks != nil { - return t.newClientConn(nil, singleUse, t.syncHooks) + if t.transportTestHooks != nil { + return t.newClientConn(nil, singleUse) } host, _, err := net.SplitHostPort(addr) if err != nil { @@ -736,7 +707,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b if err != nil { return nil, err } - return t.newClientConn(tconn, singleUse, nil) + return t.newClientConn(tconn, singleUse) } func (t *Transport) newTLSConfig(host string) *tls.Config { @@ -802,10 +773,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, t.disableKeepAlives(), nil) + return t.newClientConn(c, t.disableKeepAlives()) } -func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) { +func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { cc := &ClientConn{ t: t, tconn: c, @@ -820,16 +791,12 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), - syncHooks: hooks, } - if hooks != nil { - hooks.newclientconn(cc) + if t.transportTestHooks != nil { + t.markNewGoroutine() + t.transportTestHooks.newclientconn(cc) c = cc.tconn } - if d := t.idleConnTimeout(); d != 0 { - cc.idleTimeout = d - cc.idleTimer = cc.afterFunc(d, cc.onIdleTimeout) - } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) } @@ -893,7 +860,13 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo return nil, cc.werr } - cc.goRun(cc.readLoop) + // Start the idle timer after the connection is fully initialized. + if d := t.idleConnTimeout(); d != 0 { + cc.idleTimeout = d + cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout) + } + + go cc.readLoop() return cc, nil } @@ -901,7 +874,7 @@ func (cc *ClientConn) healthCheck() { pingTimeout := cc.t.pingTimeout() // We don't need to periodically ping in the health check, because the readLoop of ClientConn will // trigger the healthCheck again if there is no frame received. - ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout) + ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) @@ -1144,7 +1117,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { // Wait for all in-flight streams to complete or connection to close done := make(chan struct{}) cancelled := false // guarded by cc.mu - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.mu.Lock() defer cc.mu.Unlock() for { @@ -1156,9 +1130,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { if cancelled { break } - cc.condWait() + cc.cond.Wait() } - }) + }() shutdownEnterWaitStateHook() select { case <-done: @@ -1168,7 +1142,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { cc.mu.Lock() // Free the goroutine above cancelled = true - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() return ctx.Err() } @@ -1206,7 +1180,7 @@ func (cc *ClientConn) closeForError(err error) { for _, cs := range cc.streams { cs.abortStreamLocked(err) } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() cc.closeConn() } @@ -1321,23 +1295,30 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) respHeaderRecv: make(chan struct{}), donec: make(chan struct{}), } - cc.goRun(func() { - cs.doRequest(req) - }) + + // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? + if !cc.t.disableCompression() && + req.Header.Get("Accept-Encoding") == "" && + req.Header.Get("Range") == "" && + !cs.isHead { + // Request gzip only, not deflate. Deflate is ambiguous and + // not as universally supported anyway. + // See: https://zlib.net/zlib_faq.html#faq39 + // + // Note that we don't request this for HEAD requests, + // due to a bug in nginx: + // http://trac.nginx.org/nginx/ticket/358 + // https://golang.org/issue/5522 + // + // We don't request gzip if the request is for a range, since + // auto-decoding a portion of a gzipped document will just fail + // anyway. See https://golang.org/issue/8923 + cs.requestedGzip = true + } + + go cs.doRequest(req, streamf) waitDone := func() error { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.donec: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.donec: return nil @@ -1398,24 +1379,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) return err } - if streamf != nil { - streamf(cs) - } - for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.respHeaderRecv: return handleResponseHeaders() @@ -1445,8 +1409,9 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) // doRequest runs for the duration of the request lifetime. // // It sends the request and performs post-request cleanup (closing Request.Body, etc.). -func (cs *clientStream) doRequest(req *http.Request) { - err := cs.writeRequest(req) +func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { + cs.cc.t.markNewGoroutine() + err := cs.writeRequest(req, streamf) cs.cleanupWriteRequest(err) } @@ -1457,7 +1422,7 @@ func (cs *clientStream) doRequest(req *http.Request) { // // It returns non-nil if the request ends otherwise. // If the returned error is StreamError, the error Code may be used in resetting the stream. -func (cs *clientStream) writeRequest(req *http.Request) (err error) { +func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) { cc := cs.cc ctx := cs.ctx @@ -1471,21 +1436,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { if cc.reqHeaderMu == nil { panic("RoundTrip on uninitialized ClientConn") // for tests } - var newStreamHook func(*clientStream) - if cc.syncHooks != nil { - newStreamHook = cc.syncHooks.newstream - cc.syncHooks.blockUntil(func() bool { - select { - case cc.reqHeaderMu <- struct{}{}: - <-cc.reqHeaderMu - case <-cs.reqCancel: - case <-ctx.Done(): - default: - return false - } - return true - }) - } select { case cc.reqHeaderMu <- struct{}{}: case <-cs.reqCancel: @@ -1510,28 +1460,8 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { } cc.mu.Unlock() - if newStreamHook != nil { - newStreamHook(cs) - } - - // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? - if !cc.t.disableCompression() && - req.Header.Get("Accept-Encoding") == "" && - req.Header.Get("Range") == "" && - !cs.isHead { - // Request gzip only, not deflate. Deflate is ambiguous and - // not as universally supported anyway. - // See: https://zlib.net/zlib_faq.html#faq39 - // - // Note that we don't request this for HEAD requests, - // due to a bug in nginx: - // http://trac.nginx.org/nginx/ticket/358 - // https://golang.org/issue/5522 - // - // We don't request gzip if the request is for a range, since - // auto-decoding a portion of a gzipped document will just fail - // anyway. See https://golang.org/issue/8923 - cs.requestedGzip = true + if streamf != nil { + streamf(cs) } continueTimeout := cc.t.expectContinueTimeout() @@ -1594,7 +1524,7 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { - timer := cc.newTimer(d) + timer := cc.t.newTimer(d) defer timer.Stop() respHeaderTimer = timer.C() respHeaderRecv = cs.respHeaderRecv @@ -1603,21 +1533,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { // or until the request is aborted (via context, error, or otherwise), // whichever comes first. for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.peerClosed: - case <-respHeaderTimer: - case <-respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.peerClosed: return nil @@ -1766,7 +1681,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { return nil } cc.pendingRequests++ - cc.condWait() + cc.cond.Wait() cc.pendingRequests-- select { case <-cs.abort: @@ -2028,7 +1943,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) cs.flow.take(take) return take, nil } - cc.condWait() + cc.cond.Wait() } } @@ -2311,7 +2226,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) { } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. - cc.condBroadcast() + cc.cond.Broadcast() closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { @@ -2333,6 +2248,7 @@ type clientConnReadLoop struct { // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { + cc.t.markNewGoroutine() rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() @@ -2399,7 +2315,7 @@ func (rl *clientConnReadLoop) cleanup() { cs.abortStreamLocked(err) } } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() } @@ -2436,7 +2352,7 @@ func (rl *clientConnReadLoop) run() error { readIdleTimeout := cc.t.ReadIdleTimeout var t timer if readIdleTimeout != 0 { - t = cc.afterFunc(readIdleTimeout, cc.healthCheck) + t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() @@ -3034,7 +2950,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { for _, cs := range cc.streams { cs.flow.add(delta) } - cc.condBroadcast() + cc.cond.Broadcast() cc.initialWindowSize = s.Val case SettingHeaderTableSize: @@ -3089,7 +3005,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { return ConnectionError(ErrCodeFlowControl) } - cc.condBroadcast() + cc.cond.Broadcast() return nil } @@ -3133,7 +3049,8 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } var pingError error errc := make(chan struct{}) - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { @@ -3144,20 +3061,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error { close(errc) return } - }) - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-c: - case <-errc: - case <-ctx.Done(): - case <-cc.readerDone: - default: - return false - } - return true - }) - } + }() select { case <-c: return nil diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go index 0a242c669e..f6783339d1 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority.go +++ b/vendor/golang.org/x/net/http2/writesched_priority.go @@ -443,8 +443,8 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max } func (ws *priorityWriteScheduler) removeNode(n *priorityNode) { - for k := n.kids; k != nil; k = k.next { - k.setParent(n.parent) + for n.kids != nil { + n.kids.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fdcaa974d2..4ed2e488b6 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -263,6 +263,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -549,6 +550,7 @@ ccflags="$@" $2 !~ "NLA_TYPE_MASK" && $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || + $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 93a38a97d9..877a62b479 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -502,6 +502,7 @@ const ( BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 + BPF_JCOND = 0xe0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 @@ -657,6 +658,9 @@ const ( CAN_NPROTO = 0x8 CAN_RAW = 0x1 CAN_RAW_FILTER_MAX = 0x200 + CAN_RAW_XL_VCID_RX_FILTER = 0x4 + CAN_RAW_XL_VCID_TX_PASS = 0x2 + CAN_RAW_XL_VCID_TX_SET = 0x1 CAN_RTR_FLAG = 0x40000000 CAN_SFF_ID_BITS = 0xb CAN_SFF_MASK = 0x7ff @@ -1339,6 +1343,7 @@ const ( F_OFD_SETLK = 0x25 F_OFD_SETLKW = 0x26 F_OK = 0x0 + F_SEAL_EXEC = 0x20 F_SEAL_FUTURE_WRITE = 0x10 F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 @@ -1627,6 +1632,7 @@ const ( IP_FREEBIND = 0xf IP_HDRINCL = 0x3 IP_IPSEC_POLICY = 0x10 + IP_LOCAL_PORT_RANGE = 0x33 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 @@ -1653,6 +1659,7 @@ const ( IP_PMTUDISC_OMIT = 0x5 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 + IP_PROTOCOL = 0x34 IP_RECVERR = 0xb IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 @@ -2169,7 +2176,7 @@ const ( NFT_SECMARK_CTX_MAXLEN = 0x100 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 - NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_F_MASK = 0x7 NFT_TABLE_MAXNAMELEN = 0x100 NFT_TRACETYPE_MAX = 0x3 NFT_TUNNEL_F_MASK = 0x7 @@ -2403,6 +2410,7 @@ const ( PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 + PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c PPPIOCNEWUNIT = 0xc004743e @@ -2896,8 +2904,9 @@ const ( RWF_APPEND = 0x10 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 + RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x1f + RWF_SUPPORTED = 0x3f RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -2918,7 +2927,9 @@ const ( SCHED_RESET_ON_FORK = 0x40000000 SCHED_RR = 0x2 SCM_CREDENTIALS = 0x2 + SCM_PIDFD = 0x4 SCM_RIGHTS = 0x1 + SCM_SECURITY = 0x3 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 SECCOMP_ADDFD_FLAG_SEND = 0x2 @@ -3051,6 +3062,8 @@ const ( SIOCSMIIREG = 0x8949 SIOCSRARP = 0x8962 SIOCWANDEV = 0x894a + SK_DIAG_BPF_STORAGE_MAX = 0x3 + SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1 SMACK_MAGIC = 0x43415d53 SMART_AUTOSAVE = 0xd2 SMART_AUTO_OFFLINE = 0xdb @@ -3071,6 +3084,8 @@ const ( SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 + SOCK_DESTROY = 0x15 + SOCK_DIAG_BY_FAMILY = 0x14 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 @@ -3260,6 +3275,7 @@ const ( TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_EXT = 0x20 + TCP_MD5SIG_FLAG_IFINDEX = 0x2 TCP_MD5SIG_FLAG_PREFIX = 0x1 TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 42ff8c3c1b..e4bc0bd57c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -118,6 +118,7 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index dca436004f..689317afdb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -118,6 +118,7 @@ const ( IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index d8cae6d153..14270508b0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -87,6 +87,7 @@ const ( FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 + FPMR_MAGIC = 0x46504d52 FPSIMD_MAGIC = 0x46508001 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 0036746ea1..4740b83485 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -4605,7 +4605,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x149 + NL80211_ATTR_MAX = 0x14a NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -5209,7 +5209,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x1f + NL80211_FREQUENCY_ATTR_MAX = 0x20 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5703,7 +5703,7 @@ const ( NL80211_STA_FLAG_ASSOCIATED = 0x7 NL80211_STA_FLAG_AUTHENTICATED = 0x5 NL80211_STA_FLAG_AUTHORIZED = 0x1 - NL80211_STA_FLAG_MAX = 0x7 + NL80211_STA_FLAG_MAX = 0x8 NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 @@ -6001,3 +6001,34 @@ type CachestatRange struct { Off uint64 Len uint64 } + +const ( + SK_MEMINFO_RMEM_ALLOC = 0x0 + SK_MEMINFO_RCVBUF = 0x1 + SK_MEMINFO_WMEM_ALLOC = 0x2 + SK_MEMINFO_SNDBUF = 0x3 + SK_MEMINFO_FWD_ALLOC = 0x4 + SK_MEMINFO_WMEM_QUEUED = 0x5 + SK_MEMINFO_OPTMEM = 0x6 + SK_MEMINFO_BACKLOG = 0x7 + SK_MEMINFO_DROPS = 0x8 + SK_MEMINFO_VARS = 0x9 + SKNLGRP_NONE = 0x0 + SKNLGRP_INET_TCP_DESTROY = 0x1 + SKNLGRP_INET_UDP_DESTROY = 0x2 + SKNLGRP_INET6_TCP_DESTROY = 0x3 + SKNLGRP_INET6_UDP_DESTROY = 0x4 + SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0 + SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1 + SK_DIAG_BPF_STORAGE_REP_NONE = 0x0 + SK_DIAG_BPF_STORAGE = 0x1 + SK_DIAG_BPF_STORAGE_NONE = 0x0 + SK_DIAG_BPF_STORAGE_PAD = 0x1 + SK_DIAG_BPF_STORAGE_MAP_ID = 0x2 + SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3 +) + +type SockDiagReq struct { + Family uint8 + Protocol uint8 +} diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 26be94a8a7..6f7d2ac70a 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -68,6 +68,7 @@ type UserInfo10 struct { //sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo //sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation //sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree +//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum const ( // do not reorder diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 5c6035ddfa..9f73df75b5 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -401,6 +401,7 @@ var ( procTransmitFile = modmswsock.NewProc("TransmitFile") procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") + procNetUserEnum = modnetapi32.NewProc("NetUserEnum") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") @@ -3486,6 +3487,14 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete return } +func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { + r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) + if r0 != 0 { + neterr = syscall.Errno(r0) + } + return +} + func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) if r0 != 0 { diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go index eb7a8282f9..af0ee6c614 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -8,12 +8,14 @@ package gocommand import ( "bytes" "context" + "encoding/json" "errors" "fmt" "io" "log" "os" "os/exec" + "path/filepath" "reflect" "regexp" "runtime" @@ -167,7 +169,9 @@ type Invocation struct { // TODO(rfindley): remove, in favor of Args. ModFile string - // If Overlay is set, the go command is invoked with -overlay=Overlay. + // Overlay is the name of the JSON overlay file that describes + // unsaved editor buffers; see [WriteOverlays]. + // If set, the go command is invoked with -overlay=Overlay. // TODO(rfindley): remove, in favor of Args. Overlay string @@ -255,12 +259,15 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { waitDelay.Set(reflect.ValueOf(30 * time.Second)) } - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the + // The cwd gets resolved to the real path. On Darwin, where + // /tmp is a symlink, this breaks anything that expects the + // working directory to keep the original path, including the // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. + // + // os.Getwd has a special feature where if the cwd and the PWD + // are the same node then it trusts the PWD, so by setting it + // in the env for the child process we fix up all the paths + // returned by the go command. if !i.CleanEnv { cmd.Env = os.Environ() } @@ -351,6 +358,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { } } + startTime := time.Now() err = cmd.Start() if stdoutW != nil { // The child process has inherited the pipe file, @@ -377,7 +385,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { case err := <-resChan: return err case <-timer.C: - HandleHangingGoCommand(cmd.Process) + HandleHangingGoCommand(startTime, cmd) case <-ctx.Done(): } } else { @@ -411,7 +419,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { return <-resChan } -func HandleHangingGoCommand(proc *os.Process) { +func HandleHangingGoCommand(start time.Time, cmd *exec.Cmd) { switch runtime.GOOS { case "linux", "darwin", "freebsd", "netbsd": fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND @@ -444,7 +452,7 @@ See golang/go#54461 for more details.`) panic(fmt.Sprintf("running %s: %v", listFiles, err)) } } - panic(fmt.Sprintf("detected hanging go command (pid %d): see golang/go#54461 for more details", proc.Pid)) + panic(fmt.Sprintf("detected hanging go command (golang/go#54461); waited %s\n\tcommand:%s\n\tpid:%d", time.Since(start), cmd, cmd.Process.Pid)) } func cmdDebugStr(cmd *exec.Cmd) string { @@ -468,3 +476,73 @@ func cmdDebugStr(cmd *exec.Cmd) string { } return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) } + +// WriteOverlays writes each value in the overlay (see the Overlay +// field of go/packages.Config) to a temporary file and returns the name +// of a JSON file describing the mapping that is suitable for the "go +// list -overlay" flag. +// +// On success, the caller must call the cleanup function exactly once +// when the files are no longer needed. +func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(overlay) == 0 { + return "", func() {}, nil + } + + dir, err := os.MkdirTemp("", "gocommand-*") + if err != nil { + return "", nil, err + } + + // The caller must clean up this directory, + // unless this function returns an error. + // (The cleanup operand of each return + // statement below is ignored.) + defer func() { + cleanup = func() { + os.RemoveAll(dir) + } + if err != nil { + cleanup() + cleanup = nil + } + }() + + // Write each map entry to a temporary file. + overlays := make(map[string]string) + for k, v := range overlay { + // Use a unique basename for each file (001-foo.go), + // to avoid creating nested directories. + base := fmt.Sprintf("%d-%s.go", 1+len(overlays), filepath.Base(k)) + filename := filepath.Join(dir, base) + err := os.WriteFile(filename, v, 0666) + if err != nil { + return "", nil, err + } + overlays[k] = filename + } + + // Write the JSON overlay file that maps logical file names to temp files. + // + // OverlayJSON is the format overlay files are expected to be in. + // The Replace map maps from overlaid paths to replacement paths: + // the Go command will forward all reads trying to open + // each overlaid path to its replacement path, or consider the overlaid + // path not to exist if the replacement path is empty. + // + // From golang/go#39958. + type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", nil, err + } + filename = filepath.Join(dir, "overlay.json") + if err := os.WriteFile(filename, b, 0666); err != nil { + return "", nil, err + } + + return filename, nil, nil +} diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go index 93d49a6efd..4569313a08 100644 --- a/vendor/golang.org/x/tools/internal/imports/fix.go +++ b/vendor/golang.org/x/tools/internal/imports/fix.go @@ -104,7 +104,10 @@ type packageInfo struct { // parseOtherFiles parses all the Go files in srcDir except filename, including // test files if filename looks like a test. -func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { +// +// It returns an error only if ctx is cancelled. Files with parse errors are +// ignored. +func parseOtherFiles(ctx context.Context, fset *token.FileSet, srcDir, filename string) ([]*ast.File, error) { // This could use go/packages but it doesn't buy much, and it fails // with https://golang.org/issue/26296 in LoadFiles mode in some cases. considerTests := strings.HasSuffix(filename, "_test.go") @@ -112,11 +115,14 @@ func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { fileBase := filepath.Base(filename) packageFileInfos, err := os.ReadDir(srcDir) if err != nil { - return nil + return nil, ctx.Err() } var files []*ast.File for _, fi := range packageFileInfos { + if ctx.Err() != nil { + return nil, ctx.Err() + } if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { continue } @@ -132,7 +138,7 @@ func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { files = append(files, f) } - return files + return files, ctx.Err() } // addGlobals puts the names of package vars into the provided map. @@ -557,12 +563,7 @@ func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { // fixImports adds and removes imports from f so that all its references are // satisfied and there are no unused imports. -// -// This is declared as a variable rather than a function so goimports can -// easily be extended by adding a file with an init function. -var fixImports = fixImportsDefault - -func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { +func fixImports(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { fixes, err := getFixes(context.Background(), fset, f, filename, env) if err != nil { return err @@ -592,7 +593,10 @@ func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename st return fixes, nil } - otherFiles := parseOtherFiles(fset, srcDir, filename) + otherFiles, err := parseOtherFiles(ctx, fset, srcDir, filename) + if err != nil { + return nil, err + } // Second pass: add information from other files in the same package, // like their package vars and imports. @@ -1192,7 +1196,7 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil if err != nil { return err } - if err = resolver.scan(context.Background(), callback); err != nil { + if err = resolver.scan(ctx, callback); err != nil { return err } @@ -1203,7 +1207,7 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil } results := make(chan result, len(refs)) - ctx, cancel := context.WithCancel(context.TODO()) + ctx, cancel := context.WithCancel(ctx) var wg sync.WaitGroup defer func() { cancel() diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go index 3543268f84..e7d3805e36 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go @@ -1,4 +1,4 @@ -// Copyright 2023 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.21.9 +// protoc v4.24.4 // source: google/api/httpbody.proto package httpbody diff --git a/vendor/k8s.io/apimachinery/pkg/util/rand/rand.go b/vendor/k8s.io/apimachinery/pkg/util/rand/rand.go new file mode 100644 index 0000000000..82a473bb14 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/rand/rand.go @@ -0,0 +1,127 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package rand provides utilities related to randomization. +package rand + +import ( + "math/rand" + "sync" + "time" +) + +var rng = struct { + sync.Mutex + rand *rand.Rand +}{ + rand: rand.New(rand.NewSource(time.Now().UnixNano())), +} + +// Int returns a non-negative pseudo-random int. +func Int() int { + rng.Lock() + defer rng.Unlock() + return rng.rand.Int() +} + +// Intn generates an integer in range [0,max). +// By design this should panic if input is invalid, <= 0. +func Intn(max int) int { + rng.Lock() + defer rng.Unlock() + return rng.rand.Intn(max) +} + +// IntnRange generates an integer in range [min,max). +// By design this should panic if input is invalid, <= 0. +func IntnRange(min, max int) int { + rng.Lock() + defer rng.Unlock() + return rng.rand.Intn(max-min) + min +} + +// IntnRange generates an int64 integer in range [min,max). +// By design this should panic if input is invalid, <= 0. +func Int63nRange(min, max int64) int64 { + rng.Lock() + defer rng.Unlock() + return rng.rand.Int63n(max-min) + min +} + +// Seed seeds the rng with the provided seed. +func Seed(seed int64) { + rng.Lock() + defer rng.Unlock() + + rng.rand = rand.New(rand.NewSource(seed)) +} + +// Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n) +// from the default Source. +func Perm(n int) []int { + rng.Lock() + defer rng.Unlock() + return rng.rand.Perm(n) +} + +const ( + // We omit vowels from the set of available characters to reduce the chances + // of "bad words" being formed. + alphanums = "bcdfghjklmnpqrstvwxz2456789" + // No. of bits required to index into alphanums string. + alphanumsIdxBits = 5 + // Mask used to extract last alphanumsIdxBits of an int. + alphanumsIdxMask = 1<>= alphanumsIdxBits + remaining-- + } + return string(b) +} + +// SafeEncodeString encodes s using the same characters as rand.String. This reduces the chances of bad words and +// ensures that strings generated from hash functions appear consistent throughout the API. +func SafeEncodeString(s string) string { + r := make([]byte, len(s)) + for i, b := range []rune(s) { + r[i] = alphanums[(int(b) % len(alphanums))] + } + return string(r) +} diff --git a/vendor/k8s.io/apiserver/LICENSE b/vendor/k8s.io/apiserver/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/k8s.io/apiserver/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/k8s.io/apiserver/pkg/storage/names/generate.go b/vendor/k8s.io/apiserver/pkg/storage/names/generate.go new file mode 100644 index 0000000000..0b8afff0e9 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/storage/names/generate.go @@ -0,0 +1,54 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package names + +import ( + "fmt" + + utilrand "k8s.io/apimachinery/pkg/util/rand" +) + +// NameGenerator generates names for objects. Some backends may have more information +// available to guide selection of new names and this interface hides those details. +type NameGenerator interface { + // GenerateName generates a valid name from the base name, adding a random suffix to + // the base. If base is valid, the returned name must also be valid. The generator is + // responsible for knowing the maximum valid name length. + GenerateName(base string) string +} + +// simpleNameGenerator generates random names. +type simpleNameGenerator struct{} + +// SimpleNameGenerator is a generator that returns the name plus a random suffix of five alphanumerics +// when a name is requested. The string is guaranteed to not exceed the length of a standard Kubernetes +// name (63 characters) +var SimpleNameGenerator NameGenerator = simpleNameGenerator{} + +const ( + // TODO: make this flexible for non-core resources with alternate naming rules. + maxNameLength = 63 + randomLength = 5 + MaxGeneratedNameLength = maxNameLength - randomLength +) + +func (simpleNameGenerator) GenerateName(base string) string { + if len(base) > MaxGeneratedNameLength { + base = base[:MaxGeneratedNameLength] + } + return fmt.Sprintf("%s%s", base, utilrand.String(randomLength)) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/eventpoliciesstatus_type.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/eventpoliciesstatus_type.go new file mode 100644 index 0000000000..d895e075eb --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/eventpoliciesstatus_type.go @@ -0,0 +1,35 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +// AppliedEventPoliciesStatus contains the list of policies which apply to a resource. +// This type is intended to be embedded into a status struct. +type AppliedEventPoliciesStatus struct { + // Policies holds the list of applied EventPolicies + // +optional + Policies []AppliedEventPolicyRef `json:"policies,omitempty"` +} + +// AppliedEventPolicyRef is the reference to an EventPolicy +type AppliedEventPolicyRef struct { + // APIVersion of the applied EventPolicy. + // This indicates, which version of EventPolicy is supported by the resource. + APIVersion string `json:"apiVersion"` + + // Name of the applied EventPolicy + Name string `json:"name"` +} diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go index 0dcd45cf78..609c7f6f6e 100644 --- a/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go @@ -27,6 +27,43 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppliedEventPoliciesStatus) DeepCopyInto(out *AppliedEventPoliciesStatus) { + *out = *in + if in.Policies != nil { + in, out := &in.Policies, &out.Policies + *out = make([]AppliedEventPolicyRef, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedEventPoliciesStatus. +func (in *AppliedEventPoliciesStatus) DeepCopy() *AppliedEventPoliciesStatus { + if in == nil { + return nil + } + out := new(AppliedEventPoliciesStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppliedEventPolicyRef) DeepCopyInto(out *AppliedEventPolicyRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedEventPolicyRef. +func (in *AppliedEventPolicyRef) DeepCopy() *AppliedEventPolicyRef { + if in == nil { + return nil + } + out := new(AppliedEventPolicyRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Channelable) DeepCopyInto(out *Channelable) { *out = *in diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go index e86ffad7cc..f536a879b2 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go @@ -96,6 +96,10 @@ type BrokerStatus struct { // DeliveryStatus contains a resolved URL to the dead letter sink address, and any other // resolved delivery options. eventingduckv1.DeliveryStatus `json:",inline"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go index 41765815e9..b873f4032a 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go @@ -121,6 +121,7 @@ func (in *BrokerStatus) DeepCopyInto(out *BrokerStatus) { in.Status.DeepCopyInto(&out.Status) in.AddressStatus.DeepCopyInto(&out.AddressStatus) in.DeliveryStatus.DeepCopyInto(&out.DeliveryStatus) + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) return } diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/doc.go new file mode 100644 index 0000000000..1f22224630 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 is the v1alpha1 version of the API. +// +k8s:deepcopy-gen=package +// +groupName=eventing.knative.dev +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_conversion.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_conversion.go new file mode 100644 index 0000000000..ed74482e2d --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_conversion.go @@ -0,0 +1,34 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + "fmt" + + "knative.dev/pkg/apis" +) + +// ConvertTo implements apis.Convertible +func (ep *EventPolicy) ConvertTo(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", obj) +} + +// ConvertFrom implements apis.Convertible +func (ep *EventPolicy) ConvertFrom(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", obj) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_defaults.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_defaults.go new file mode 100644 index 0000000000..3e52f5bd48 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_defaults.go @@ -0,0 +1,31 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + + "knative.dev/pkg/apis" +) + +func (ep *EventPolicy) SetDefaults(ctx context.Context) { + ctx = apis.WithinParent(ctx, ep.ObjectMeta) + ep.Spec.SetDefaults(ctx) +} + +func (ets *EventPolicySpec) SetDefaults(ctx context.Context) { +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go new file mode 100644 index 0000000000..30c8575eac --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_lifecycle.go @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "knative.dev/pkg/apis" +) + +var eventPolicyCondSet = apis.NewLivingConditionSet() + +const ( + EventPolicyConditionReady = apis.ConditionReady +) + +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*EventPolicy) GetConditionSet() apis.ConditionSet { + return eventPolicyCondSet +} + +// GetCondition returns the condition currently associated with the given type, or nil. +func (et *EventPolicyStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return eventPolicyCondSet.Manage(et).GetCondition(t) +} + +// IsReady returns true if the resource is ready overall. +func (et *EventPolicyStatus) IsReady() bool { + return et.GetTopLevelCondition().IsTrue() +} + +// GetTopLevelCondition returns the top level Condition. +func (et *EventPolicyStatus) GetTopLevelCondition() *apis.Condition { + return eventPolicyCondSet.Manage(et).GetTopLevelCondition() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (et *EventPolicyStatus) InitializeConditions() { + eventPolicyCondSet.Manage(et).InitializeConditions() +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_types.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_types.go new file mode 100644 index 0000000000..53d6265344 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_types.go @@ -0,0 +1,168 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/kmeta" +) + +// +genclient +// +genreconciler +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EventPolicy represents a policy for addressable resources (Broker, Channel, sinks). +type EventPolicy struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of the EventPolicy. + Spec EventPolicySpec `json:"spec,omitempty"` + + // Status represents the current state of the EventPolicy. + // This data may be out of date. + // +optional + Status EventPolicyStatus `json:"status,omitempty"` +} + +var ( + // Check that EventPolicy can be validated, can be defaulted, and has immutable fields. + _ apis.Validatable = (*EventPolicy)(nil) + _ apis.Defaultable = (*EventPolicy)(nil) + + // Check that EventPolicy can return its spec untyped. + _ apis.HasSpec = (*EventPolicy)(nil) + + _ runtime.Object = (*EventPolicy)(nil) + + // Check that we can create OwnerReferences to an EventPolicy. + _ kmeta.OwnerRefable = (*EventPolicy)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*EventPolicy)(nil) +) + +type EventPolicySpec struct { + // To lists all resources for which this policy applies. + // Resources in this list must act like an ingress and have an audience. + // The resources are part of the same namespace as the EventPolicy. + // An empty list means it applies to all resources in the EventPolicies namespace + // +optional + To []EventPolicySpecTo `json:"to,omitempty"` + + // From is the list of sources or oidc identities, which are allowed to send events to the targets (.spec.to). + From []EventPolicySpecFrom `json:"from,omitempty"` +} + +type EventPolicySpecTo struct { + // Ref contains the direct reference to a target + // +optional + Ref *EventPolicyToReference `json:"ref,omitempty"` + + // Selector contains a selector to group targets + // +optional + Selector *EventPolicySelector `json:"selector,omitempty"` +} + +type EventPolicySpecFrom struct { + // Ref contains a direct reference to a resource which is allowed to send events to the target. + // +optional + Ref *EventPolicyFromReference `json:"ref,omitempty"` + + // Sub sets the OIDC identity name to be allowed to send events to the target. + // It is also possible to set a glob-like pattern to match any suffix. + // +optional + Sub *string `json:"sub,omitempty"` +} + +type EventPolicyToReference struct { + // API version of the referent. + APIVersion string `json:"apiVersion,omitempty"` + + // Kind of the referent. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + Kind string `json:"kind"` + + // Name of the referent. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + Name string `json:"name"` +} + +type EventPolicyFromReference struct { + // API version of the referent. + APIVersion string `json:"apiVersion,omitempty"` + + // Kind of the referent. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + Kind string `json:"kind"` + + // Name of the referent. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + Name string `json:"name"` + + // Namespace of the referent. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + // This is optional field, it gets defaulted to the object holding it if left out. + // +optional + Namespace string `json:"namespace,omitempty"` +} + +type EventPolicySelector struct { + *metav1.LabelSelector `json:",inline"` + *metav1.TypeMeta `json:",inline"` +} + +// EventPolicyStatus represents the current state of a EventPolicy. +type EventPolicyStatus struct { + // inherits duck/v1 Status, which currently provides: + // * ObservedGeneration - the 'Generation' of the Service that was last processed by the controller. + // * Conditions - the latest available observations of a resource's current state. + duckv1.Status `json:",inline"` + + // From is the list of resolved oidc identities from .spec.from + From []string `json:"from,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EventPolicyList is a collection of EventPolicy. +type EventPolicyList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + Items []EventPolicy `json:"items"` +} + +// GetGroupVersionKind returns GroupVersionKind for EventPolicy +func (ep *EventPolicy) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("EventPolicy") +} + +// GetUntypedSpec returns the spec of the EventPolicy. +func (ep *EventPolicy) GetUntypedSpec() interface{} { + return ep.Spec +} + +// GetStatus retrieves the status of the EventPolicy. Implements the KRShaped interface. +func (ep *EventPolicy) GetStatus() *duckv1.Status { + return &ep.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_validation.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_validation.go new file mode 100644 index 0000000000..0c267b3196 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/eventpolicy_validation.go @@ -0,0 +1,102 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + "strings" + + "knative.dev/pkg/apis" +) + +func (ep *EventPolicy) Validate(ctx context.Context) *apis.FieldError { + return ep.Spec.Validate(ctx).ViaField("spec") +} + +func (ets *EventPolicySpec) Validate(ctx context.Context) *apis.FieldError { + var err *apis.FieldError + for i, f := range ets.From { + if f.Ref == nil && (f.Sub == nil || *f.Sub == "") { + err = err.Also(apis.ErrMissingOneOf("ref", "sub").ViaFieldIndex("from", i)) + } + if f.Ref != nil && f.Sub != nil { + err = err.Also(apis.ErrMultipleOneOf("ref", "sub").ViaFieldIndex("from", i)) + } + err = err.Also(f.Ref.Validate().ViaField("ref").ViaFieldIndex("from", i)) + err = err.Also(validateSub(f.Sub).ViaField("sub").ViaFieldIndex("from", i)) + } + + for i, t := range ets.To { + if t.Ref == nil && t.Selector == nil { + err = err.Also(apis.ErrMissingOneOf("ref", "selector").ViaFieldIndex("to", i)) + } + if t.Ref != nil && t.Selector != nil { + err = err.Also(apis.ErrMultipleOneOf("ref", "selector").ViaFieldIndex("to", i)) + } + if t.Ref != nil { + err = err.Also(t.Ref.Validate().ViaField("ref").ViaFieldIndex("to", i)) + } + } + + return err +} + +func validateSub(sub *string) *apis.FieldError { + if sub == nil || len(*sub) <= 1 { + return nil + } + + lastInvalidIdx := len(*sub) - 2 + firstInvalidIdx := 0 + if idx := strings.IndexRune(*sub, '*'); idx >= firstInvalidIdx && idx <= lastInvalidIdx { + return apis.ErrInvalidValue(*sub, "", "'*' is only allowed as suffix") + } + + return nil +} + +func (r *EventPolicyFromReference) Validate() *apis.FieldError { + if r == nil { + return nil + } + + var err *apis.FieldError + if r.Kind == "" { + err = err.Also(apis.ErrMissingField("kind")) + } + if r.APIVersion == "" { + err = err.Also(apis.ErrMissingField("apiVersion")) + } + if r.Name == "" { + err = err.Also(apis.ErrMissingField("name")) + } + return err +} + +func (r *EventPolicyToReference) Validate() *apis.FieldError { + var err *apis.FieldError + if r.Kind == "" { + err = err.Also(apis.ErrMissingField("kind")) + } + if r.APIVersion == "" { + err = err.Also(apis.ErrMissingField("apiVersion")) + } + if r.Name == "" { + err = err.Also(apis.ErrMissingField("name")) + } + return err +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go new file mode 100644 index 0000000000..c6f3e98cd0 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/register.go @@ -0,0 +1,53 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "knative.dev/eventing/pkg/apis/eventing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: eventing.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &EventPolicy{}, + &EventPolicyList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..998b577cad --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,250 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicy) DeepCopyInto(out *EventPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicy. +func (in *EventPolicy) DeepCopy() *EventPolicy { + if in == nil { + return nil + } + out := new(EventPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicyFromReference) DeepCopyInto(out *EventPolicyFromReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicyFromReference. +func (in *EventPolicyFromReference) DeepCopy() *EventPolicyFromReference { + if in == nil { + return nil + } + out := new(EventPolicyFromReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicyList) DeepCopyInto(out *EventPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EventPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicyList. +func (in *EventPolicyList) DeepCopy() *EventPolicyList { + if in == nil { + return nil + } + out := new(EventPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicySelector) DeepCopyInto(out *EventPolicySelector) { + *out = *in + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.TypeMeta != nil { + in, out := &in.TypeMeta, &out.TypeMeta + *out = new(v1.TypeMeta) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicySelector. +func (in *EventPolicySelector) DeepCopy() *EventPolicySelector { + if in == nil { + return nil + } + out := new(EventPolicySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicySpec) DeepCopyInto(out *EventPolicySpec) { + *out = *in + if in.To != nil { + in, out := &in.To, &out.To + *out = make([]EventPolicySpecTo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.From != nil { + in, out := &in.From, &out.From + *out = make([]EventPolicySpecFrom, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicySpec. +func (in *EventPolicySpec) DeepCopy() *EventPolicySpec { + if in == nil { + return nil + } + out := new(EventPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicySpecFrom) DeepCopyInto(out *EventPolicySpecFrom) { + *out = *in + if in.Ref != nil { + in, out := &in.Ref, &out.Ref + *out = new(EventPolicyFromReference) + **out = **in + } + if in.Sub != nil { + in, out := &in.Sub, &out.Sub + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicySpecFrom. +func (in *EventPolicySpecFrom) DeepCopy() *EventPolicySpecFrom { + if in == nil { + return nil + } + out := new(EventPolicySpecFrom) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicySpecTo) DeepCopyInto(out *EventPolicySpecTo) { + *out = *in + if in.Ref != nil { + in, out := &in.Ref, &out.Ref + *out = new(EventPolicyToReference) + **out = **in + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(EventPolicySelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicySpecTo. +func (in *EventPolicySpecTo) DeepCopy() *EventPolicySpecTo { + if in == nil { + return nil + } + out := new(EventPolicySpecTo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicyStatus) DeepCopyInto(out *EventPolicyStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + if in.From != nil { + in, out := &in.From, &out.From + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicyStatus. +func (in *EventPolicyStatus) DeepCopy() *EventPolicyStatus { + if in == nil { + return nil + } + out := new(EventPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventPolicyToReference) DeepCopyInto(out *EventPolicyToReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventPolicyToReference. +func (in *EventPolicyToReference) DeepCopy() *EventPolicyToReference { + if in == nil { + return nil + } + out := new(EventPolicyToReference) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go index 2bdd421a5c..6212e245df 100644 --- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go +++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1beta2/eventtype_conversion.go @@ -18,17 +18,86 @@ package v1beta2 import ( "context" - "fmt" "knative.dev/pkg/apis" + duckv1 "knative.dev/pkg/apis/duck/v1" + + eventing "knative.dev/eventing/pkg/apis/eventing/v1" + "knative.dev/eventing/pkg/apis/eventing/v1beta3" ) -// ConvertTo implements apis.Convertible +// ConvertTo converts the receiver into `to`. func (source *EventType) ConvertTo(ctx context.Context, to apis.Convertible) error { - return fmt.Errorf("v1beta2 is the highest known version, got: %T", to) + switch sink := to.(type) { + case *v1beta3.EventType: + + source.ObjectMeta.DeepCopyInto(&sink.ObjectMeta) + source.Status.Status.DeepCopyInto(&sink.Status.Status) + + sink.Spec.Reference = source.Spec.Reference.DeepCopy() + sink.Spec.Description = source.Spec.Description + + if source.Spec.Reference == nil && source.Spec.Broker != "" { + source.Spec.Reference = &duckv1.KReference{ + Kind: "Broker", + Name: source.Spec.Broker, + APIVersion: eventing.SchemeGroupVersion.String(), + } + } + + sink.Spec.Attributes = []v1beta3.EventAttributeDefinition{} + if source.Spec.Type != "" { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "type", + Required: true, + Value: source.Spec.Type, + }) + } + if source.Spec.Schema != nil { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "schemadata", + Required: false, + Value: source.Spec.Schema.String(), + }) + } + if source.Spec.Source != nil { + sink.Spec.Attributes = append(sink.Spec.Attributes, v1beta3.EventAttributeDefinition{ + Name: "source", + Required: true, + Value: source.Spec.Source.String(), + }) + } + return nil + default: + return apis.ConvertToViaProxy(ctx, source, &v1beta3.EventType{}, to) + } + } // ConvertFrom implements apis.Convertible func (sink *EventType) ConvertFrom(ctx context.Context, from apis.Convertible) error { - return fmt.Errorf("v1beta2 is the highest known version, got: %T", from) + switch source := from.(type) { + case *v1beta3.EventType: + + source.ObjectMeta.DeepCopyInto(&sink.ObjectMeta) + source.Status.Status.DeepCopyInto(&sink.Status.Status) + + sink.Spec.Reference = source.Spec.Reference.DeepCopy() + sink.Spec.Description = source.Spec.Description + + for _, at := range source.Spec.Attributes { + switch at.Name { + case "source": + sink.Spec.Source, _ = apis.ParseURL(at.Value) + case "type": + sink.Spec.Type = at.Value + case "schemadata": + sink.Spec.Schema, _ = apis.ParseURL(at.Value) + } + } + + return nil + default: + return apis.ConvertFromViaProxy(ctx, from, &v1beta3.EventType{}, sink) + } } diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/features.go b/vendor/knative.dev/eventing/pkg/apis/feature/features.go index e01195bb5f..982ca8c67e 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/features.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/features.go @@ -45,6 +45,24 @@ const ( // - Addressables should advertise both HTTP and HTTPS endpoints // - Producers should prefer to send events to HTTPS endpoints, if available Permissive Flag = "Permissive" + + // AuthorizationAllowAll is a value for AuthorizationDefaultMode that indicates to allow all + // OIDC subjects by default. + // This configuration is applied when there is no EventPolicy with a "to" referencing a given + // resource. + AuthorizationAllowAll Flag = "Allow-All" + + // AuthorizationDenyAll is a value for AuthorizationDefaultMode that indicates to deny all + // OIDC subjects by default. + // This configuration is applied when there is no EventPolicy with a "to" referencing a given + // resource. + AuthorizationDenyAll Flag = "Deny-All" + + // AuthorizationAllowSameNamespace is a value for AuthorizationDefaultMode that indicates to allow + // OIDC subjects with the same namespace as a given resource. + // This configuration is applied when there is no EventPolicy with a "to" referencing a given + // resource. + AuthorizationAllowSameNamespace Flag = "Allow-Same-Namespace" ) // Flags is a map containing all the enabled/disabled flags for the experimental features. @@ -53,15 +71,16 @@ type Flags map[string]Flag func newDefaults() Flags { return map[string]Flag{ - KReferenceGroup: Disabled, - DeliveryRetryAfter: Disabled, - DeliveryTimeout: Enabled, - KReferenceMapping: Disabled, - NewTriggerFilters: Enabled, - TransportEncryption: Disabled, - OIDCAuthentication: Disabled, - EvenTypeAutoCreate: Disabled, - NewAPIServerFilters: Disabled, + KReferenceGroup: Disabled, + DeliveryRetryAfter: Disabled, + DeliveryTimeout: Enabled, + KReferenceMapping: Disabled, + NewTriggerFilters: Enabled, + TransportEncryption: Disabled, + OIDCAuthentication: Disabled, + EvenTypeAutoCreate: Disabled, + NewAPIServerFilters: Disabled, + AuthorizationDefaultMode: AuthorizationAllowSameNamespace, } } @@ -103,6 +122,18 @@ func (e Flags) IsCrossNamespaceEventLinks() bool { return e != nil && e[CrossNamespaceEventLinks] == Enabled } +func (e Flags) IsAuthorizationDefaultModeAllowAll() bool { + return e != nil && e[AuthorizationDefaultMode] == AuthorizationAllowAll +} + +func (e Flags) IsAuthorizationDefaultModeDenyAll() bool { + return e != nil && e[AuthorizationDefaultMode] == AuthorizationDenyAll +} + +func (e Flags) IsAuthorizationDefaultModeSameNamespace() bool { + return e != nil && e[AuthorizationDefaultMode] == AuthorizationAllowSameNamespace +} + func (e Flags) String() string { return fmt.Sprintf("%+v", map[string]Flag(e)) } @@ -142,10 +173,16 @@ func NewFlagsConfigFromMap(data map[string]string) (Flags, error) { flags[sanitizedKey] = Disabled } else if strings.EqualFold(v, string(Enabled)) { flags[sanitizedKey] = Enabled - } else if k == TransportEncryption && strings.EqualFold(v, string(Permissive)) { + } else if sanitizedKey == TransportEncryption && strings.EqualFold(v, string(Permissive)) { flags[sanitizedKey] = Permissive - } else if k == TransportEncryption && strings.EqualFold(v, string(Strict)) { + } else if sanitizedKey == TransportEncryption && strings.EqualFold(v, string(Strict)) { flags[sanitizedKey] = Strict + } else if sanitizedKey == AuthorizationDefaultMode && strings.EqualFold(v, string(AuthorizationAllowAll)) { + flags[sanitizedKey] = AuthorizationAllowAll + } else if sanitizedKey == AuthorizationDefaultMode && strings.EqualFold(v, string(AuthorizationDenyAll)) { + flags[sanitizedKey] = AuthorizationDenyAll + } else if sanitizedKey == AuthorizationDefaultMode && strings.EqualFold(v, string(AuthorizationAllowSameNamespace)) { + flags[sanitizedKey] = AuthorizationAllowSameNamespace } else if strings.Contains(k, NodeSelectorLabel) { flags[sanitizedKey] = Flag(v) } else { diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go b/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go index cd937554c4..99abc20769 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/flag_names.go @@ -28,4 +28,5 @@ const ( NodeSelectorLabel = "apiserversources-nodeselector-" CrossNamespaceEventLinks = "cross-namespace-event-links" NewAPIServerFilters = "new-apiserversource-filters" + AuthorizationDefaultMode = "default-authorization-mode" ) diff --git a/vendor/knative.dev/eventing/pkg/apis/feature/store.go b/vendor/knative.dev/eventing/pkg/apis/feature/store.go index a22f313c23..8285f78629 100644 --- a/vendor/knative.dev/eventing/pkg/apis/feature/store.go +++ b/vendor/knative.dev/eventing/pkg/apis/feature/store.go @@ -40,12 +40,12 @@ func FromContext(ctx context.Context) Flags { } // FromContextOrDefaults is like FromContext, but when no Flags is attached it -// returns an empty Flags. +// returns default Flags. func FromContextOrDefaults(ctx context.Context) Flags { if cfg := FromContext(ctx); cfg != nil { return cfg } - return Flags{} + return newDefaults() } // ToContext attaches the provided Flags to the provided context, returning the diff --git a/vendor/knative.dev/eventing/pkg/apis/flows/v1/parallel_types.go b/vendor/knative.dev/eventing/pkg/apis/flows/v1/parallel_types.go index cf9d6d6eae..2740a72f01 100644 --- a/vendor/knative.dev/eventing/pkg/apis/flows/v1/parallel_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/flows/v1/parallel_types.go @@ -20,7 +20,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" "knative.dev/pkg/apis" @@ -123,6 +122,10 @@ type ParallelStatus struct { // Auth provides the relevant information for OIDC authentication. // +optional Auth *duckv1.AuthStatus `json:"auth,omitempty"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` } // ParallelBranchStatus represents the current state of a Parallel branch diff --git a/vendor/knative.dev/eventing/pkg/apis/flows/v1/sequence_types.go b/vendor/knative.dev/eventing/pkg/apis/flows/v1/sequence_types.go index e02af40b7e..88461b092c 100644 --- a/vendor/knative.dev/eventing/pkg/apis/flows/v1/sequence_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/flows/v1/sequence_types.go @@ -20,7 +20,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" "knative.dev/pkg/kmeta" @@ -135,6 +134,10 @@ type SequenceStatus struct { // Auth provides the relevant information for OIDC authentication. // +optional Auth *duckv1.AuthStatus `json:"auth,omitempty"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/knative.dev/eventing/pkg/apis/flows/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/flows/v1/zz_generated.deepcopy.go index 64a7474117..03008035d8 100644 --- a/vendor/knative.dev/eventing/pkg/apis/flows/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/flows/v1/zz_generated.deepcopy.go @@ -209,6 +209,7 @@ func (in *ParallelStatus) DeepCopyInto(out *ParallelStatus) { *out = new(duckv1.AuthStatus) (*in).DeepCopyInto(*out) } + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) return } @@ -376,6 +377,7 @@ func (in *SequenceStatus) DeepCopyInto(out *SequenceStatus) { *out = new(duckv1.AuthStatus) (*in).DeepCopyInto(*out) } + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) return } diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_types.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_types.go index 5b0c971b54..cdf0f6075b 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_types.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_types.go @@ -73,6 +73,10 @@ type InMemoryChannelSpec struct { type InMemoryChannelStatus struct { // Channel conforms to Duck type ChannelableStatus. eventingduckv1.ChannelableStatus `json:",inline"` + + // AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this Broker + // +optional + eventingduckv1.AppliedEventPoliciesStatus `json:",inline"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go index fff2d237b4..f0e08f87f5 100644 --- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go @@ -245,6 +245,7 @@ func (in *InMemoryChannelSpec) DeepCopy() *InMemoryChannelSpec { func (in *InMemoryChannelStatus) DeepCopyInto(out *InMemoryChannelStatus) { *out = *in in.ChannelableStatus.DeepCopyInto(&out.ChannelableStatus) + in.AppliedEventPoliciesStatus.DeepCopyInto(&out.AppliedEventPoliciesStatus) return } diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go b/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go new file mode 100644 index 0000000000..20aff4446b --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go @@ -0,0 +1,23 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sinks + +const ( + JobSinkJobsLabelSelector = "sinks.knative.dev/job-sink=true" + JobSinkNameLabel = "sinks.knative.dev/job-sink-name" + JobSinkIDLabel = "sinks.knative.dev/job-sink-id" +) diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go new file mode 100644 index 0000000000..676fa75e84 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go @@ -0,0 +1,54 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sinks + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/kubernetes" +) + +const ( + GroupName = "sinks.knative.dev" +) + +var ( + // JobSinkResource respresents a Knative Eventing sink JobSink + JobSinkResource = schema.GroupResource{ + Group: GroupName, + Resource: "jobsinks", + } +) + +type Config struct { + KubeClient kubernetes.Interface +} + +type configKey struct{} + +func WithConfig(ctx context.Context, cfg *Config) context.Context { + return context.WithValue(ctx, configKey{}, cfg) +} + +func GetConfig(ctx context.Context) *Config { + v := ctx.Value(configKey{}) + if v == nil { + panic("Missing value for config") + } + return v.(*Config) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go new file mode 100644 index 0000000000..23def349db --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group. +// +k8s:deepcopy-gen=package +// +groupName=sinks.knative.dev +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go new file mode 100644 index 0000000000..3944fd1715 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go @@ -0,0 +1,36 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + "fmt" + + "knative.dev/pkg/apis" +) + +// ConvertTo implements apis.Convertible +// Converts source from v1alpha1.JobSink into a higher version. +func (sink *JobSink) ConvertTo(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} + +// ConvertFrom implements apis.Convertible +// Converts source from a higher version into v1beta2.JobSink +func (sink *JobSink) ConvertFrom(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go new file mode 100644 index 0000000000..13f62e868b --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go @@ -0,0 +1,24 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" +) + +func (sink *JobSink) SetDefaults(ctx context.Context) { +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go new file mode 100644 index 0000000000..b0cdea2161 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + "knative.dev/pkg/apis" + + "knative.dev/eventing/pkg/apis/sinks" +) + +const ( + // JobSinkConditionReady has status True when the JobSink is ready to send events. + JobSinkConditionReady = apis.ConditionReady + + JobSinkConditionAddressable apis.ConditionType = "Addressable" +) + +var JobSinkCondSet = apis.NewLivingConditionSet( + JobSinkConditionAddressable, +) + +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*JobSink) GetConditionSet() apis.ConditionSet { + return JobSinkCondSet +} + +// GetUntypedSpec returns the spec of the JobSink. +func (sink *JobSink) GetUntypedSpec() interface{} { + return sink.Spec +} + +// GetGroupVersionKind returns the GroupVersionKind. +func (sink *JobSink) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("JobSink") +} + +// GetCondition returns the condition currently associated with the given type, or nil. +func (s *JobSinkStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return JobSinkCondSet.Manage(s).GetCondition(t) +} + +// GetTopLevelCondition returns the top level Condition. +func (ps *JobSinkStatus) GetTopLevelCondition() *apis.Condition { + return JobSinkCondSet.Manage(ps).GetTopLevelCondition() +} + +// IsReady returns true if the resource is ready overall. +func (s *JobSinkStatus) IsReady() bool { + return JobSinkCondSet.Manage(s).IsHappy() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (s *JobSinkStatus) InitializeConditions() { + JobSinkCondSet.Manage(s).InitializeConditions() +} + +func (e *JobSink) SetJobStatusSelector() { + if e.Spec.Job != nil { + e.Status.JobStatus.Selector = fmt.Sprintf("%s=%s", sinks.JobSinkNameLabel, e.GetName()) + } +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go new file mode 100644 index 0000000000..501dfdf659 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go @@ -0,0 +1,89 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + batchv1 "k8s.io/api/batch/v1" + "knative.dev/pkg/apis" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/kmeta" +) + +// +genclient +// +genreconciler +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// JobSink is the Schema for the JobSink API. +type JobSink struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec JobSinkSpec `json:"spec,omitempty"` + Status JobSinkStatus `json:"status,omitempty"` +} + +// Check the interfaces that JobSink should be implementing. +var ( + _ runtime.Object = (*JobSink)(nil) + _ kmeta.OwnerRefable = (*JobSink)(nil) + _ apis.Validatable = (*JobSink)(nil) + _ apis.Defaultable = (*JobSink)(nil) + _ apis.HasSpec = (*JobSink)(nil) + _ duckv1.KRShaped = (*JobSink)(nil) +) + +// JobSinkSpec defines the desired state of the JobSink. +type JobSinkSpec struct { + // Job to run when an event occur. + // +optional + Job *batchv1.Job `json:"job,omitempty"` +} + +// JobSinkStatus defines the observed state of JobSink. +type JobSinkStatus struct { + duckv1.Status `json:",inline"` + + // AddressStatus is the part where the JobSink fulfills the Addressable contract. + // It exposes the endpoint as an URI to get events delivered. + // +optional + duckv1.AddressStatus `json:",inline"` + + // +optional + JobStatus JobStatus `json:"job,omitempty"` +} + +type JobStatus struct { + Selector string `json:"selector,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// JobSinkList contains a list of JobSink. +type JobSinkList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []JobSink `json:"items"` +} + +// GetStatus retrieves the status of the JobSink. Implements the KRShaped interface. +func (sink *JobSink) GetStatus() *duckv1.Status { + return &sink.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go new file mode 100644 index 0000000000..7ed631ba3c --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go @@ -0,0 +1,57 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apiserver/pkg/storage/names" + "knative.dev/pkg/apis" + + "knative.dev/eventing/pkg/apis/sinks" +) + +func (sink *JobSink) Validate(ctx context.Context) *apis.FieldError { + ctx = apis.WithinParent(ctx, sink.ObjectMeta) + return sink.Spec.Validate(ctx).ViaField("spec") +} + +func (sink *JobSinkSpec) Validate(ctx context.Context) *apis.FieldError { + var errs *apis.FieldError + + if sink.Job == nil { + return errs.Also(apis.ErrMissingOneOf("job")) + } + + if sink.Job != nil { + job := sink.Job.DeepCopy() + job.Name = names.SimpleNameGenerator.GenerateName(apis.ParentMeta(ctx).Name) + _, err := sinks.GetConfig(ctx).KubeClient. + BatchV1(). + Jobs(apis.ParentMeta(ctx).Namespace). + Create(ctx, job, metav1.CreateOptions{ + DryRun: []string{metav1.DryRunAll}, + FieldValidation: metav1.FieldValidationStrict, + }) + if err != nil { + return apis.ErrGeneric(err.Error(), "job") + } + } + + return errs +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go new file mode 100644 index 0000000000..827ebc28b4 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go @@ -0,0 +1,53 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "knative.dev/eventing/pkg/apis/sinks" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: sinks.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &JobSink{}, + &JobSinkList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..8aefd015fc --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,144 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/batch/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSink) DeepCopyInto(out *JobSink) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSink. +func (in *JobSink) DeepCopy() *JobSink { + if in == nil { + return nil + } + out := new(JobSink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobSink) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkList) DeepCopyInto(out *JobSinkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobSink, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkList. +func (in *JobSinkList) DeepCopy() *JobSinkList { + if in == nil { + return nil + } + out := new(JobSinkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobSinkList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkSpec) DeepCopyInto(out *JobSinkSpec) { + *out = *in + if in.Job != nil { + in, out := &in.Job, &out.Job + *out = new(v1.Job) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkSpec. +func (in *JobSinkSpec) DeepCopy() *JobSinkSpec { + if in == nil { + return nil + } + out := new(JobSinkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkStatus) DeepCopyInto(out *JobSinkStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.AddressStatus.DeepCopyInto(&out.AddressStatus) + out.JobStatus = in.JobStatus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkStatus. +func (in *JobSinkStatus) DeepCopy() *JobSinkStatus { + if in == nil { + return nil + } + out := new(JobSinkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobStatus) DeepCopyInto(out *JobStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus. +func (in *JobStatus) DeepCopy() *JobStatus { + if in == nil { + return nil + } + out := new(JobStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/knative.dev/eventing/pkg/auth/audience.go b/vendor/knative.dev/eventing/pkg/auth/audience.go index 2147ff0f64..352418650e 100644 --- a/vendor/knative.dev/eventing/pkg/auth/audience.go +++ b/vendor/knative.dev/eventing/pkg/auth/audience.go @@ -30,3 +30,10 @@ func GetAudience(gvk schema.GroupVersionKind, objectMeta metav1.ObjectMeta) stri return strings.ToLower(aud) } + +// GetAudienceDirect returns the audience string for the given object in the format /// +func GetAudienceDirect(gvk schema.GroupVersionKind, ns, name string) string { + aud := fmt.Sprintf("%s/%s/%s/%s", gvk.Group, gvk.Kind, ns, name) + + return strings.ToLower(aud) +} diff --git a/vendor/knative.dev/eventing/pkg/auth/event_policy.go b/vendor/knative.dev/eventing/pkg/auth/event_policy.go new file mode 100644 index 0000000000..26efd16340 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/auth/event_policy.go @@ -0,0 +1,147 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package auth + +import ( + "fmt" + "strings" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime/schema" + "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + listerseventingv1alpha1 "knative.dev/eventing/pkg/client/listers/eventing/v1alpha1" + "knative.dev/pkg/resolver" +) + +// GetEventPoliciesForResource returns the applying EventPolicies for a given resource +func GetEventPoliciesForResource(lister listerseventingv1alpha1.EventPolicyLister, resourceGVK schema.GroupVersionKind, resourceObjectMeta metav1.ObjectMeta) ([]*v1alpha1.EventPolicy, error) { + policies, err := lister.EventPolicies(resourceObjectMeta.GetNamespace()).List(labels.Everything()) + if err != nil { + return nil, fmt.Errorf("failed to list eventpolicies: %w", err) + } + + relevantPolicies := []*v1alpha1.EventPolicy{} + + for _, policy := range policies { + if len(policy.Spec.To) == 0 { + // policy applies to all resources in namespace + relevantPolicies = append(relevantPolicies, policy) + } + + for _, to := range policy.Spec.To { + if to.Ref != nil { + refGV, err := schema.ParseGroupVersion(to.Ref.APIVersion) + if err != nil { + return nil, fmt.Errorf("cannot split apiVersion into group and version: %s", to.Ref.APIVersion) + } + + if strings.EqualFold(to.Ref.Name, resourceObjectMeta.GetName()) && + strings.EqualFold(refGV.Group, resourceGVK.Group) && + strings.EqualFold(to.Ref.Kind, resourceGVK.Kind) { + + relevantPolicies = append(relevantPolicies, policy) + break // no need to check the other .spec.to's from this policy + } + } + + if to.Selector != nil { + selectorGV, err := schema.ParseGroupVersion(to.Selector.APIVersion) + if err != nil { + return nil, fmt.Errorf("cannot split apiVersion into group and version: %s", to.Selector.APIVersion) + } + + if strings.EqualFold(selectorGV.Group, resourceGVK.Group) && + strings.EqualFold(to.Selector.Kind, resourceGVK.Kind) { + + selector, err := metav1.LabelSelectorAsSelector(to.Selector.LabelSelector) + if err != nil { + return nil, fmt.Errorf("failed to parse selector: %w", err) + } + + if selector.Matches(labels.Set(resourceObjectMeta.Labels)) { + relevantPolicies = append(relevantPolicies, policy) + break // no need to check the other .spec.to's from this policy + } + } + } + } + } + + return relevantPolicies, nil +} + +// ResolveSubjects returns the OIDC service accounts names for the objects referenced in the EventPolicySpecFrom. +func ResolveSubjects(resolver *resolver.AuthenticatableResolver, eventPolicy *v1alpha1.EventPolicy) ([]string, error) { + allSAs := []string{} + for _, from := range eventPolicy.Spec.From { + if from.Ref != nil { + sas, err := resolveSubjectsFromReference(resolver, *from.Ref, eventPolicy) + if err != nil { + return nil, fmt.Errorf("could not resolve subjects from reference: %w", err) + } + allSAs = append(allSAs, sas...) + } else if from.Sub != nil { + allSAs = append(allSAs, *from.Sub) + } + } + + return allSAs, nil +} + +func resolveSubjectsFromReference(resolver *resolver.AuthenticatableResolver, reference v1alpha1.EventPolicyFromReference, trackingEventPolicy *v1alpha1.EventPolicy) ([]string, error) { + authStatus, err := resolver.AuthStatusFromObjectReference(&corev1.ObjectReference{ + APIVersion: reference.APIVersion, + Kind: reference.Kind, + Namespace: reference.Namespace, + Name: reference.Name, + }, trackingEventPolicy) + + if err != nil { + return nil, fmt.Errorf("could not resolve auth status: %w", err) + } + + objSAs := authStatus.ServiceAccountNames + if authStatus.ServiceAccountName != nil { + objSAs = append(objSAs, *authStatus.ServiceAccountName) + } + + objFullSANames := make([]string, 0, len(objSAs)) + for _, sa := range objSAs { + objFullSANames = append(objFullSANames, fmt.Sprintf("system:serviceaccount:%s:%s", reference.Namespace, sa)) + } + + return objFullSANames, nil +} + +// SubjectContained checks if the given sub is contained in the list of allowedSubs +// or if it matches a prefix pattern in subs (e.g. system:serviceaccounts:my-ns:*) +func SubjectContained(sub string, allowedSubs []string) bool { + for _, s := range allowedSubs { + if strings.EqualFold(s, sub) { + return true + } + + if strings.HasSuffix(s, "*") && + strings.HasPrefix(sub, strings.TrimSuffix(s, "*")) { + return true + } + } + + return false +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go index 19f04e8bfa..0ca8d7350b 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go @@ -26,23 +26,27 @@ import ( rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" eventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1" + eventingv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1" eventingv1beta1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1" eventingv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta2" eventingv1beta3 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1" messagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2" ) type Interface interface { Discovery() discovery.DiscoveryInterface + EventingV1alpha1() eventingv1alpha1.EventingV1alpha1Interface EventingV1beta1() eventingv1beta1.EventingV1beta1Interface EventingV1beta2() eventingv1beta2.EventingV1beta2Interface EventingV1beta3() eventingv1beta3.EventingV1beta3Interface EventingV1() eventingv1.EventingV1Interface FlowsV1() flowsv1.FlowsV1Interface MessagingV1() messagingv1.MessagingV1Interface + SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface SourcesV1() sourcesv1.SourcesV1Interface } @@ -50,14 +54,21 @@ type Interface interface { // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient - eventingV1beta1 *eventingv1beta1.EventingV1beta1Client - eventingV1beta2 *eventingv1beta2.EventingV1beta2Client - eventingV1beta3 *eventingv1beta3.EventingV1beta3Client - eventingV1 *eventingv1.EventingV1Client - flowsV1 *flowsv1.FlowsV1Client - messagingV1 *messagingv1.MessagingV1Client - sourcesV1beta2 *sourcesv1beta2.SourcesV1beta2Client - sourcesV1 *sourcesv1.SourcesV1Client + eventingV1alpha1 *eventingv1alpha1.EventingV1alpha1Client + eventingV1beta1 *eventingv1beta1.EventingV1beta1Client + eventingV1beta2 *eventingv1beta2.EventingV1beta2Client + eventingV1beta3 *eventingv1beta3.EventingV1beta3Client + eventingV1 *eventingv1.EventingV1Client + flowsV1 *flowsv1.FlowsV1Client + messagingV1 *messagingv1.MessagingV1Client + sinksV1alpha1 *sinksv1alpha1.SinksV1alpha1Client + sourcesV1beta2 *sourcesv1beta2.SourcesV1beta2Client + sourcesV1 *sourcesv1.SourcesV1Client +} + +// EventingV1alpha1 retrieves the EventingV1alpha1Client +func (c *Clientset) EventingV1alpha1() eventingv1alpha1.EventingV1alpha1Interface { + return c.eventingV1alpha1 } // EventingV1beta1 retrieves the EventingV1beta1Client @@ -90,6 +101,11 @@ func (c *Clientset) MessagingV1() messagingv1.MessagingV1Interface { return c.messagingV1 } +// SinksV1alpha1 retrieves the SinksV1alpha1Client +func (c *Clientset) SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface { + return c.sinksV1alpha1 +} + // SourcesV1beta2 retrieves the SourcesV1beta2Client func (c *Clientset) SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface { return c.sourcesV1beta2 @@ -144,6 +160,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error + cs.eventingV1alpha1, err = eventingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.eventingV1beta1, err = eventingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -168,6 +188,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.sinksV1alpha1, err = sinksv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.sourcesV1beta2, err = sourcesv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -197,12 +221,14 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.eventingV1alpha1 = eventingv1alpha1.New(c) cs.eventingV1beta1 = eventingv1beta1.New(c) cs.eventingV1beta2 = eventingv1beta2.New(c) cs.eventingV1beta3 = eventingv1beta3.New(c) cs.eventingV1 = eventingv1.New(c) cs.flowsV1 = flowsv1.New(c) cs.messagingV1 = messagingv1.New(c) + cs.sinksV1alpha1 = sinksv1alpha1.New(c) cs.sourcesV1beta2 = sourcesv1beta2.New(c) cs.sourcesV1 = sourcesv1.New(c) diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go index df4eaacca2..ce9c364948 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -27,6 +27,8 @@ import ( clientset "knative.dev/eventing/pkg/client/clientset/versioned" eventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1" fakeeventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1/fake" + eventingv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1" + fakeeventingv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake" eventingv1beta1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1" fakeeventingv1beta1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1/fake" eventingv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta2" @@ -37,6 +39,8 @@ import ( fakeflowsv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1/fake" messagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1" fakemessagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1/fake" + sinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" + fakesinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake" sourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1" fakesourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake" sourcesv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2" @@ -93,6 +97,11 @@ var ( _ testing.FakeClient = &Clientset{} ) +// EventingV1alpha1 retrieves the EventingV1alpha1Client +func (c *Clientset) EventingV1alpha1() eventingv1alpha1.EventingV1alpha1Interface { + return &fakeeventingv1alpha1.FakeEventingV1alpha1{Fake: &c.Fake} +} + // EventingV1beta1 retrieves the EventingV1beta1Client func (c *Clientset) EventingV1beta1() eventingv1beta1.EventingV1beta1Interface { return &fakeeventingv1beta1.FakeEventingV1beta1{Fake: &c.Fake} @@ -123,6 +132,11 @@ func (c *Clientset) MessagingV1() messagingv1.MessagingV1Interface { return &fakemessagingv1.FakeMessagingV1{Fake: &c.Fake} } +// SinksV1alpha1 retrieves the SinksV1alpha1Client +func (c *Clientset) SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface { + return &fakesinksv1alpha1.FakeSinksV1alpha1{Fake: &c.Fake} +} + // SourcesV1beta2 retrieves the SourcesV1beta2Client func (c *Clientset) SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface { return &fakesourcesv1beta2.FakeSourcesV1beta2{Fake: &c.Fake} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go index c9ce45387c..69946bd6e5 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go @@ -25,11 +25,13 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" + eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1" eventingv1beta2 "knative.dev/eventing/pkg/apis/eventing/v1beta2" eventingv1beta3 "knative.dev/eventing/pkg/apis/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/apis/flows/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" ) @@ -38,12 +40,14 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + eventingv1alpha1.AddToScheme, eventingv1beta1.AddToScheme, eventingv1beta2.AddToScheme, eventingv1beta3.AddToScheme, eventingv1.AddToScheme, flowsv1.AddToScheme, messagingv1.AddToScheme, + sinksv1alpha1.AddToScheme, sourcesv1beta2.AddToScheme, sourcesv1.AddToScheme, } diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go index bcfb2759d6..e037c6c174 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go @@ -25,11 +25,13 @@ import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" + eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1" eventingv1beta2 "knative.dev/eventing/pkg/apis/eventing/v1beta2" eventingv1beta3 "knative.dev/eventing/pkg/apis/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/apis/flows/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" ) @@ -38,12 +40,14 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + eventingv1alpha1.AddToScheme, eventingv1beta1.AddToScheme, eventingv1beta2.AddToScheme, eventingv1beta3.AddToScheme, eventingv1.AddToScheme, flowsv1.AddToScheme, messagingv1.AddToScheme, + sinksv1alpha1.AddToScheme, sourcesv1beta2.AddToScheme, sourcesv1.AddToScheme, } diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/doc.go new file mode 100644 index 0000000000..0b13fd8e00 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go new file mode 100644 index 0000000000..e901caf43a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventing_client.go @@ -0,0 +1,107 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +type EventingV1alpha1Interface interface { + RESTClient() rest.Interface + EventPoliciesGetter +} + +// EventingV1alpha1Client is used to interact with features provided by the eventing.knative.dev group. +type EventingV1alpha1Client struct { + restClient rest.Interface +} + +func (c *EventingV1alpha1Client) EventPolicies(namespace string) EventPolicyInterface { + return newEventPolicies(c, namespace) +} + +// NewForConfig creates a new EventingV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*EventingV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new EventingV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventingV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &EventingV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new EventingV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *EventingV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new EventingV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *EventingV1alpha1Client { + return &EventingV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *EventingV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventpolicy.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventpolicy.go new file mode 100644 index 0000000000..bb510ab6ee --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/eventpolicy.go @@ -0,0 +1,195 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + scheme "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +// EventPoliciesGetter has a method to return a EventPolicyInterface. +// A group's client should implement this interface. +type EventPoliciesGetter interface { + EventPolicies(namespace string) EventPolicyInterface +} + +// EventPolicyInterface has methods to work with EventPolicy resources. +type EventPolicyInterface interface { + Create(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.CreateOptions) (*v1alpha1.EventPolicy, error) + Update(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (*v1alpha1.EventPolicy, error) + UpdateStatus(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (*v1alpha1.EventPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.EventPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EventPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EventPolicy, err error) + EventPolicyExpansion +} + +// eventPolicies implements EventPolicyInterface +type eventPolicies struct { + client rest.Interface + ns string +} + +// newEventPolicies returns a EventPolicies +func newEventPolicies(c *EventingV1alpha1Client, namespace string) *eventPolicies { + return &eventPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the eventPolicy, and returns the corresponding eventPolicy object, and an error if there is any. +func (c *eventPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EventPolicy, err error) { + result = &v1alpha1.EventPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("eventpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EventPolicies that match those selectors. +func (c *eventPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EventPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.EventPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("eventpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested eventPolicies. +func (c *eventPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("eventpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a eventPolicy and creates it. Returns the server's representation of the eventPolicy, and an error, if there is any. +func (c *eventPolicies) Create(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.CreateOptions) (result *v1alpha1.EventPolicy, err error) { + result = &v1alpha1.EventPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("eventpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(eventPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a eventPolicy and updates it. Returns the server's representation of the eventPolicy, and an error, if there is any. +func (c *eventPolicies) Update(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (result *v1alpha1.EventPolicy, err error) { + result = &v1alpha1.EventPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("eventpolicies"). + Name(eventPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(eventPolicy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *eventPolicies) UpdateStatus(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (result *v1alpha1.EventPolicy, err error) { + result = &v1alpha1.EventPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("eventpolicies"). + Name(eventPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(eventPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the eventPolicy and deletes it. Returns an error if one occurs. +func (c *eventPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("eventpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *eventPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("eventpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched eventPolicy. +func (c *eventPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EventPolicy, err error) { + result = &v1alpha1.EventPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("eventpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..40528db3a5 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go new file mode 100644 index 0000000000..958cd86614 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventing_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1" +) + +type FakeEventingV1alpha1 struct { + *testing.Fake +} + +func (c *FakeEventingV1alpha1) EventPolicies(namespace string) v1alpha1.EventPolicyInterface { + return &FakeEventPolicies{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeEventingV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventpolicy.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventpolicy.go new file mode 100644 index 0000000000..a31bc82003 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake/fake_eventpolicy.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" +) + +// FakeEventPolicies implements EventPolicyInterface +type FakeEventPolicies struct { + Fake *FakeEventingV1alpha1 + ns string +} + +var eventpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("eventpolicies") + +var eventpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("EventPolicy") + +// Get takes name of the eventPolicy, and returns the corresponding eventPolicy object, and an error if there is any. +func (c *FakeEventPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EventPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(eventpoliciesResource, c.ns, name), &v1alpha1.EventPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.EventPolicy), err +} + +// List takes label and field selectors, and returns the list of EventPolicies that match those selectors. +func (c *FakeEventPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EventPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(eventpoliciesResource, eventpoliciesKind, c.ns, opts), &v1alpha1.EventPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.EventPolicyList{ListMeta: obj.(*v1alpha1.EventPolicyList).ListMeta} + for _, item := range obj.(*v1alpha1.EventPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested eventPolicies. +func (c *FakeEventPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(eventpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a eventPolicy and creates it. Returns the server's representation of the eventPolicy, and an error, if there is any. +func (c *FakeEventPolicies) Create(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.CreateOptions) (result *v1alpha1.EventPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(eventpoliciesResource, c.ns, eventPolicy), &v1alpha1.EventPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.EventPolicy), err +} + +// Update takes the representation of a eventPolicy and updates it. Returns the server's representation of the eventPolicy, and an error, if there is any. +func (c *FakeEventPolicies) Update(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (result *v1alpha1.EventPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(eventpoliciesResource, c.ns, eventPolicy), &v1alpha1.EventPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.EventPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeEventPolicies) UpdateStatus(ctx context.Context, eventPolicy *v1alpha1.EventPolicy, opts v1.UpdateOptions) (*v1alpha1.EventPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(eventpoliciesResource, "status", c.ns, eventPolicy), &v1alpha1.EventPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.EventPolicy), err +} + +// Delete takes name of the eventPolicy and deletes it. Returns an error if one occurs. +func (c *FakeEventPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(eventpoliciesResource, c.ns, name, opts), &v1alpha1.EventPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEventPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(eventpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.EventPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched eventPolicy. +func (c *FakeEventPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EventPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(eventpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.EventPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.EventPolicy), err +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..d5bd1a045d --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type EventPolicyExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go new file mode 100644 index 0000000000..0b13fd8e00 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..40528db3a5 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go new file mode 100644 index 0000000000..596004b3a4 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" +) + +// FakeJobSinks implements JobSinkInterface +type FakeJobSinks struct { + Fake *FakeSinksV1alpha1 + ns string +} + +var jobsinksResource = v1alpha1.SchemeGroupVersion.WithResource("jobsinks") + +var jobsinksKind = v1alpha1.SchemeGroupVersion.WithKind("JobSink") + +// Get takes name of the jobSink, and returns the corresponding jobSink object, and an error if there is any. +func (c *FakeJobSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobsinksResource, c.ns, name), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// List takes label and field selectors, and returns the list of JobSinks that match those selectors. +func (c *FakeJobSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobSinkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobsinksResource, jobsinksKind, c.ns, opts), &v1alpha1.JobSinkList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.JobSinkList{ListMeta: obj.(*v1alpha1.JobSinkList).ListMeta} + for _, item := range obj.(*v1alpha1.JobSinkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested jobSinks. +func (c *FakeJobSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobsinksResource, c.ns, opts)) + +} + +// Create takes the representation of a jobSink and creates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *FakeJobSinks) Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobsinksResource, c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// Update takes the representation of a jobSink and updates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *FakeJobSinks) Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobsinksResource, c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeJobSinks) UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(jobsinksResource, "status", c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// Delete takes name of the jobSink and deletes it. Returns an error if one occurs. +func (c *FakeJobSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(jobsinksResource, c.ns, name, opts), &v1alpha1.JobSink{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobsinksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.JobSinkList{}) + return err +} + +// Patch applies the patch and returns the patched jobSink. +func (c *FakeJobSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobsinksResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go new file mode 100644 index 0000000000..f64a39a5c9 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" +) + +type FakeSinksV1alpha1 struct { + *testing.Fake +} + +func (c *FakeSinksV1alpha1) JobSinks(namespace string) v1alpha1.JobSinkInterface { + return &FakeJobSinks{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSinksV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..029b7bee81 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type JobSinkExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go new file mode 100644 index 0000000000..71851300af --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go @@ -0,0 +1,195 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" + scheme "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +// JobSinksGetter has a method to return a JobSinkInterface. +// A group's client should implement this interface. +type JobSinksGetter interface { + JobSinks(namespace string) JobSinkInterface +} + +// JobSinkInterface has methods to work with JobSink resources. +type JobSinkInterface interface { + Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (*v1alpha1.JobSink, error) + Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, error) + UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.JobSink, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.JobSinkList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobSink, err error) + JobSinkExpansion +} + +// jobSinks implements JobSinkInterface +type jobSinks struct { + client rest.Interface + ns string +} + +// newJobSinks returns a JobSinks +func newJobSinks(c *SinksV1alpha1Client, namespace string) *jobSinks { + return &jobSinks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the jobSink, and returns the corresponding jobSink object, and an error if there is any. +func (c *jobSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobSinks that match those selectors. +func (c *jobSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobSinkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.JobSinkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobSinks. +func (c *jobSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobSink and creates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *jobSinks) Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobSink and updates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *jobSinks) Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobsinks"). + Name(jobSink.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *jobSinks) UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobsinks"). + Name(jobSink.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobSink and deletes it. Returns an error if one occurs. +func (c *jobSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobSink. +func (c *jobSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go new file mode 100644 index 0000000000..2012a8f57a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go @@ -0,0 +1,107 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" + "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +type SinksV1alpha1Interface interface { + RESTClient() rest.Interface + JobSinksGetter +} + +// SinksV1alpha1Client is used to interact with features provided by the sinks.knative.dev group. +type SinksV1alpha1Client struct { + restClient rest.Interface +} + +func (c *SinksV1alpha1Client) JobSinks(namespace string) JobSinkInterface { + return newJobSinks(c, namespace) +} + +// NewForConfig creates a new SinksV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*SinksV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new SinksV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SinksV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &SinksV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new SinksV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SinksV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SinksV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *SinksV1alpha1Client { + return &SinksV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *SinksV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/interface.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/interface.go index e77e6ae25d..ccfc67a42a 100644 --- a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/interface.go +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/interface.go @@ -20,6 +20,7 @@ package eventing import ( v1 "knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1" + v1alpha1 "knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1" v1beta1 "knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta1" v1beta2 "knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta2" v1beta3 "knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta3" @@ -28,6 +29,8 @@ import ( // Interface provides access to each of this group's versions. type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface // V1beta2 provides access to shared informers for resources in V1beta2. @@ -49,6 +52,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/eventpolicy.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/eventpolicy.go new file mode 100644 index 0000000000..df3b47e267 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/eventpolicy.go @@ -0,0 +1,90 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + versioned "knative.dev/eventing/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "knative.dev/eventing/pkg/client/listers/eventing/v1alpha1" +) + +// EventPolicyInformer provides access to a shared informer and lister for +// EventPolicies. +type EventPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.EventPolicyLister +} + +type eventPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEventPolicyInformer constructs a new informer for EventPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEventPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEventPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredEventPolicyInformer constructs a new informer for EventPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEventPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventingV1alpha1().EventPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EventingV1alpha1().EventPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &eventingv1alpha1.EventPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *eventPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEventPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *eventPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&eventingv1alpha1.EventPolicy{}, f.defaultInformer) +} + +func (f *eventPolicyInformer) Lister() v1alpha1.EventPolicyLister { + return v1alpha1.NewEventPolicyLister(f.Informer().GetIndexer()) +} diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/interface.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/interface.go new file mode 100644 index 0000000000..89263c2585 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // EventPolicies returns a EventPolicyInformer. + EventPolicies() EventPolicyInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// EventPolicies returns a EventPolicyInformer. +func (v *version) EventPolicies() EventPolicyInformer { + return &eventPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/factory.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/factory.go index 2eefd9ddb9..634f7f6a39 100644 --- a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/factory.go +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/factory.go @@ -32,6 +32,7 @@ import ( flows "knative.dev/eventing/pkg/client/informers/externalversions/flows" internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" messaging "knative.dev/eventing/pkg/client/informers/externalversions/messaging" + sinks "knative.dev/eventing/pkg/client/informers/externalversions/sinks" sources "knative.dev/eventing/pkg/client/informers/externalversions/sources" ) @@ -259,6 +260,7 @@ type SharedInformerFactory interface { Eventing() eventing.Interface Flows() flows.Interface Messaging() messaging.Interface + Sinks() sinks.Interface Sources() sources.Interface } @@ -274,6 +276,10 @@ func (f *sharedInformerFactory) Messaging() messaging.Interface { return messaging.New(f, f.namespace, f.tweakListOptions) } +func (f *sharedInformerFactory) Sinks() sinks.Interface { + return sinks.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Sources() sources.Interface { return sources.New(f, f.namespace, f.tweakListOptions) } diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/generic.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/generic.go index b4e9c86ae8..41c490e06c 100644 --- a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/generic.go +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/generic.go @@ -24,11 +24,13 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "knative.dev/eventing/pkg/apis/eventing/v1" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" v1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1" v1beta2 "knative.dev/eventing/pkg/apis/eventing/v1beta2" v1beta3 "knative.dev/eventing/pkg/apis/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/apis/flows/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" ) @@ -65,6 +67,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1.SchemeGroupVersion.WithResource("triggers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Eventing().V1().Triggers().Informer()}, nil + // Group=eventing.knative.dev, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("eventpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Eventing().V1alpha1().EventPolicies().Informer()}, nil + // Group=eventing.knative.dev, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("eventtypes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Eventing().V1beta1().EventTypes().Informer()}, nil @@ -91,6 +97,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case messagingv1.SchemeGroupVersion.WithResource("subscriptions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Messaging().V1().Subscriptions().Informer()}, nil + // Group=sinks.knative.dev, Version=v1alpha1 + case sinksv1alpha1.SchemeGroupVersion.WithResource("jobsinks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sinks().V1alpha1().JobSinks().Informer()}, nil + // Group=sources.knative.dev, Version=v1 case sourcesv1.SchemeGroupVersion.WithResource("apiserversources"): return &genericInformer{resource: resource.GroupResource(), informer: f.Sources().V1().ApiServerSources().Informer()}, nil diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/interface.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/interface.go new file mode 100644 index 0000000000..f09f6846bf --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/interface.go @@ -0,0 +1,46 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package sinks + +import ( + internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/interface.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/interface.go new file mode 100644 index 0000000000..68ed173ac5 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // JobSinks returns a JobSinkInformer. + JobSinks() JobSinkInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// JobSinks returns a JobSinkInformer. +func (v *version) JobSinks() JobSinkInformer { + return &jobSinkInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/jobsink.go b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/jobsink.go new file mode 100644 index 0000000000..5278c858b5 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1/jobsink.go @@ -0,0 +1,90 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" + versioned "knative.dev/eventing/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "knative.dev/eventing/pkg/client/listers/sinks/v1alpha1" +) + +// JobSinkInformer provides access to a shared informer and lister for +// JobSinks. +type JobSinkInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.JobSinkLister +} + +type jobSinkInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewJobSinkInformer constructs a new informer for JobSink type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobSinkInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobSinkInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredJobSinkInformer constructs a new informer for JobSink type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobSinkInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SinksV1alpha1().JobSinks(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SinksV1alpha1().JobSinks(namespace).Watch(context.TODO(), options) + }, + }, + &sinksv1alpha1.JobSink{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobSinkInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobSinkInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobSinkInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&sinksv1alpha1.JobSink{}, f.defaultInformer) +} + +func (f *jobSinkInformer) Lister() v1alpha1.JobSinkLister { + return v1alpha1.NewJobSinkLister(f.Informer().GetIndexer()) +} diff --git a/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/eventpolicy.go b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/eventpolicy.go new file mode 100644 index 0000000000..4601f8069e --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/eventpolicy.go @@ -0,0 +1,99 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" +) + +// EventPolicyLister helps list EventPolicies. +// All objects returned here must be treated as read-only. +type EventPolicyLister interface { + // List lists all EventPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.EventPolicy, err error) + // EventPolicies returns an object that can list and get EventPolicies. + EventPolicies(namespace string) EventPolicyNamespaceLister + EventPolicyListerExpansion +} + +// eventPolicyLister implements the EventPolicyLister interface. +type eventPolicyLister struct { + indexer cache.Indexer +} + +// NewEventPolicyLister returns a new EventPolicyLister. +func NewEventPolicyLister(indexer cache.Indexer) EventPolicyLister { + return &eventPolicyLister{indexer: indexer} +} + +// List lists all EventPolicies in the indexer. +func (s *eventPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.EventPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.EventPolicy)) + }) + return ret, err +} + +// EventPolicies returns an object that can list and get EventPolicies. +func (s *eventPolicyLister) EventPolicies(namespace string) EventPolicyNamespaceLister { + return eventPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// EventPolicyNamespaceLister helps list and get EventPolicies. +// All objects returned here must be treated as read-only. +type EventPolicyNamespaceLister interface { + // List lists all EventPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.EventPolicy, err error) + // Get retrieves the EventPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.EventPolicy, error) + EventPolicyNamespaceListerExpansion +} + +// eventPolicyNamespaceLister implements the EventPolicyNamespaceLister +// interface. +type eventPolicyNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all EventPolicies in the indexer for a given namespace. +func (s eventPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.EventPolicy, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.EventPolicy)) + }) + return ret, err +} + +// Get retrieves the EventPolicy from the indexer for a given namespace and name. +func (s eventPolicyNamespaceLister) Get(name string) (*v1alpha1.EventPolicy, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("eventpolicy"), name) + } + return obj.(*v1alpha1.EventPolicy), nil +} diff --git a/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..e3f601930d --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/listers/eventing/v1alpha1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// EventPolicyListerExpansion allows custom methods to be added to +// EventPolicyLister. +type EventPolicyListerExpansion interface{} + +// EventPolicyNamespaceListerExpansion allows custom methods to be added to +// EventPolicyNamespaceLister. +type EventPolicyNamespaceListerExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/expansion_generated.go b/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..48dbd03263 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// JobSinkListerExpansion allows custom methods to be added to +// JobSinkLister. +type JobSinkListerExpansion interface{} + +// JobSinkNamespaceListerExpansion allows custom methods to be added to +// JobSinkNamespaceLister. +type JobSinkNamespaceListerExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/jobsink.go b/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/jobsink.go new file mode 100644 index 0000000000..4dcd9c82cd --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/listers/sinks/v1alpha1/jobsink.go @@ -0,0 +1,99 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" +) + +// JobSinkLister helps list JobSinks. +// All objects returned here must be treated as read-only. +type JobSinkLister interface { + // List lists all JobSinks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobSink, err error) + // JobSinks returns an object that can list and get JobSinks. + JobSinks(namespace string) JobSinkNamespaceLister + JobSinkListerExpansion +} + +// jobSinkLister implements the JobSinkLister interface. +type jobSinkLister struct { + indexer cache.Indexer +} + +// NewJobSinkLister returns a new JobSinkLister. +func NewJobSinkLister(indexer cache.Indexer) JobSinkLister { + return &jobSinkLister{indexer: indexer} +} + +// List lists all JobSinks in the indexer. +func (s *jobSinkLister) List(selector labels.Selector) (ret []*v1alpha1.JobSink, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobSink)) + }) + return ret, err +} + +// JobSinks returns an object that can list and get JobSinks. +func (s *jobSinkLister) JobSinks(namespace string) JobSinkNamespaceLister { + return jobSinkNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// JobSinkNamespaceLister helps list and get JobSinks. +// All objects returned here must be treated as read-only. +type JobSinkNamespaceLister interface { + // List lists all JobSinks in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobSink, err error) + // Get retrieves the JobSink from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.JobSink, error) + JobSinkNamespaceListerExpansion +} + +// jobSinkNamespaceLister implements the JobSinkNamespaceLister +// interface. +type jobSinkNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all JobSinks in the indexer for a given namespace. +func (s jobSinkNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JobSink, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobSink)) + }) + return ret, err +} + +// Get retrieves the JobSink from the indexer for a given namespace and name. +func (s jobSinkNamespaceLister) Get(name string) (*v1alpha1.JobSink, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("jobsink"), name) + } + return obj.(*v1alpha1.JobSink), nil +} diff --git a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go index 642c97b5b9..718a744c19 100644 --- a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go +++ b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go @@ -51,6 +51,8 @@ const ( SecretCACert = "ca.crt" // IMCDispatcherServerTLSSecretName is the name of the tls secret for the imc dispatcher server IMCDispatcherServerTLSSecretName = "imc-dispatcher-server-tls" //nolint:gosec // This is not a hardcoded credential + // JobSinkDispatcherServerTLSSecretName is the name of the tls secret for the job sink dispatcher server + JobSinkDispatcherServerTLSSecretName = "job-sink-server-tls" //nolint:gosec // This is not a hardcoded credential // BrokerFilterServerTLSSecretName is the name of the tls secret for the broker filter server BrokerFilterServerTLSSecretName = "mt-broker-filter-server-tls" //nolint:gosec // This is not a hardcoded credential // BrokerIngressServerTLSSecretName is the name of the tls secret for the broker ingress server diff --git a/vendor/knative.dev/eventing/pkg/kncloudevents/event_dispatcher.go b/vendor/knative.dev/eventing/pkg/kncloudevents/event_dispatcher.go index 877a206757..8a0176238a 100644 --- a/vendor/knative.dev/eventing/pkg/kncloudevents/event_dispatcher.go +++ b/vendor/knative.dev/eventing/pkg/kncloudevents/event_dispatcher.go @@ -289,11 +289,18 @@ func (d *Dispatcher) send(ctx context.Context, message binding.Message, destinat } func (d *Dispatcher) executeRequest(ctx context.Context, target duckv1.Addressable, message cloudevents.Message, additionalHeaders http.Header, retryConfig *RetryConfig, oidcServiceAccount *types.NamespacedName, transformers ...binding.Transformer) (context.Context, cloudevents.Message, *DispatchInfo, error) { + var scheme string + if target.URL != nil { + scheme = target.URL.Scheme + } else { + // assume that the scheme is http by default + scheme = "http" + } dispatchInfo := DispatchInfo{ Duration: NoDuration, ResponseCode: NoResponse, ResponseHeader: make(http.Header), - Scheme: target.URL.Scheme, + Scheme: scheme, } ctx, span := trace.StartSpan(ctx, "knative.dev", trace.WithSpanKind(trace.SpanKindClient)) @@ -327,11 +334,11 @@ func (d *Dispatcher) executeRequest(ctx context.Context, target duckv1.Addressab dispatchInfo.ResponseHeader = response.Header body := new(bytes.Buffer) - _, readErr := body.ReadFrom(response.Body) + _, err = body.ReadFrom(response.Body) if isFailure(response.StatusCode) { // Read response body into dispatchInfo for failures - if readErr != nil && readErr != io.EOF { + if err != nil && err != io.EOF { dispatchInfo.ResponseBody = []byte(fmt.Sprintf("dispatch resulted in status \"%s\". Could not read response body: error: %s", response.Status, err.Error())) } else { dispatchInfo.ResponseBody = body.Bytes() @@ -343,8 +350,9 @@ func (d *Dispatcher) executeRequest(ctx context.Context, target duckv1.Addressab } var responseMessageBody []byte - if readErr != nil && readErr != io.EOF { + if err != nil && err != io.EOF { responseMessageBody = []byte(fmt.Sprintf("Failed to read response body: %s", err.Error())) + dispatchInfo.ResponseCode = http.StatusInternalServerError } else { responseMessageBody = body.Bytes() dispatchInfo.ResponseBody = responseMessageBody diff --git a/vendor/knative.dev/pkg/apis/duck/v1/auth_types.go b/vendor/knative.dev/pkg/apis/duck/v1/auth_types.go index 5d76a7b422..dfb81cbe62 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/auth_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/auth_types.go @@ -16,6 +16,21 @@ limitations under the License. package v1 +import ( + "context" + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck/ducktypes" + "knative.dev/pkg/kmeta" + "knative.dev/pkg/ptr" +) + +// +genduck + // AuthStatus is meant to provide the generated service account name // in the resource status. type AuthStatus struct { @@ -28,3 +43,81 @@ type AuthStatus struct { // when the component uses multiple identities (e.g. in case of a Parallel). ServiceAccountNames []string `json:"serviceAccountNames,omitempty"` } + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AuthenticatableType is a skeleton type wrapping AuthStatus in the manner we expect +// resource writers defining compatible resources to embed it. We will +// typically use this type to deserialize AuthenticatableType ObjectReferences and +// access the AuthenticatableType data. This is not a real resource. +type AuthenticatableType struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status AuthenticatableStatus `json:"status"` +} + +type AuthenticatableStatus struct { + // Auth contains the service account name for the subscription + // +optional + Auth *AuthStatus `json:"auth,omitempty"` +} + +var ( + // AuthStatus is a Convertible type. + _ apis.Convertible = (*AuthStatus)(nil) + + // Verify AuthenticatableType resources meet duck contracts. + _ apis.Listable = (*AuthenticatableType)(nil) + _ ducktypes.Populatable = (*AuthenticatableType)(nil) + _ kmeta.OwnerRefable = (*AuthenticatableType)(nil) +) + +// GetFullType implements duck.Implementable +func (*AuthStatus) GetFullType() ducktypes.Populatable { + return &AuthenticatableType{} +} + +// ConvertTo implements apis.Convertible +func (a *AuthStatus) ConvertTo(_ context.Context, to apis.Convertible) error { + return fmt.Errorf("v1 is the highest known version, got: %T", to) +} + +// ConvertFrom implements apis.Convertible +func (a *AuthStatus) ConvertFrom(_ context.Context, from apis.Convertible) error { + return fmt.Errorf("v1 is the highest known version, got: %T", from) +} + +// Populate implements duck.Populatable +func (t *AuthenticatableType) Populate() { + t.Status = AuthenticatableStatus{ + Auth: &AuthStatus{ + // Populate ALL fields + ServiceAccountName: ptr.String("foo"), + ServiceAccountNames: []string{ + "bar", + "baz", + }, + }, + } +} + +// GetGroupVersionKind implements kmeta.OwnerRefable +func (t *AuthenticatableType) GetGroupVersionKind() schema.GroupVersionKind { + return t.GroupVersionKind() +} + +// GetListType implements apis.Listable +func (*AuthenticatableType) GetListType() runtime.Object { + return &AuthenticatableTypeList{} +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AuthenticatableTypeList is a list of AuthenticatableType resources +type AuthenticatableTypeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []AuthenticatableType `json:"items"` +} diff --git a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go index 9dab1a912c..bc263edfd6 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/zz_generated.deepcopy.go @@ -176,6 +176,87 @@ func (in *AuthStatus) DeepCopy() *AuthStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticatableStatus) DeepCopyInto(out *AuthenticatableStatus) { + *out = *in + if in.Auth != nil { + in, out := &in.Auth, &out.Auth + *out = new(AuthStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticatableStatus. +func (in *AuthenticatableStatus) DeepCopy() *AuthenticatableStatus { + if in == nil { + return nil + } + out := new(AuthenticatableStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticatableType) DeepCopyInto(out *AuthenticatableType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticatableType. +func (in *AuthenticatableType) DeepCopy() *AuthenticatableType { + if in == nil { + return nil + } + out := new(AuthenticatableType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthenticatableType) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticatableTypeList) DeepCopyInto(out *AuthenticatableTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AuthenticatableType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticatableTypeList. +func (in *AuthenticatableTypeList) DeepCopy() *AuthenticatableTypeList { + if in == nil { + return nil + } + out := new(AuthenticatableTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthenticatableTypeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Binding) DeepCopyInto(out *Binding) { *out = *in diff --git a/vendor/knative.dev/pkg/client/injection/ducks/duck/v1/authstatus/authstatus.go b/vendor/knative.dev/pkg/client/injection/ducks/duck/v1/authstatus/authstatus.go new file mode 100644 index 0000000000..8f2a26501c --- /dev/null +++ b/vendor/knative.dev/pkg/client/injection/ducks/duck/v1/authstatus/authstatus.go @@ -0,0 +1,60 @@ +/* +Copyright 2022 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package authstatus + +import ( + context "context" + + duck "knative.dev/pkg/apis/duck" + v1 "knative.dev/pkg/apis/duck/v1" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + dynamicclient "knative.dev/pkg/injection/clients/dynamicclient" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterDuck(WithDuck) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func WithDuck(ctx context.Context) context.Context { + dc := dynamicclient.Get(ctx) + dif := &duck.CachedInformerFactory{ + Delegate: &duck.TypedInformerFactory{ + Client: dc, + Type: (&v1.AuthStatus{}).GetFullType(), + ResyncPeriod: controller.GetResyncPeriod(ctx), + StopChannel: ctx.Done(), + }, + } + return context.WithValue(ctx, Key{}, dif) +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) duck.InformerFactory { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/pkg/apis/duck.InformerFactory from context.") + } + return untyped.(duck.InformerFactory) +} diff --git a/vendor/knative.dev/pkg/network/network.go b/vendor/knative.dev/pkg/network/network.go index cf5feaa8fa..87b2b7acd8 100644 --- a/vendor/knative.dev/pkg/network/network.go +++ b/vendor/knative.dev/pkg/network/network.go @@ -59,11 +59,12 @@ const ( // KubeletProbeHeaderName is the header name to augment the probes, because // Istio with mTLS rewrites probes, but their probes pass a different // user-agent. + // + // Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey KubeletProbeHeaderName = "K-Kubelet-Probe" ) // IsKubeletProbe returns true if the request is a Kubernetes probe. func IsKubeletProbe(r *http.Request) bool { - return strings.HasPrefix(r.Header.Get(UserAgentKey), KubeProbeUAPrefix) || - r.Header.Get(KubeletProbeHeaderName) != "" + return strings.HasPrefix(r.Header.Get(UserAgentKey), KubeProbeUAPrefix) } diff --git a/vendor/knative.dev/pkg/resolver/authenticatable_resolver.go b/vendor/knative.dev/pkg/resolver/authenticatable_resolver.go new file mode 100644 index 0000000000..78dd69bddb --- /dev/null +++ b/vendor/knative.dev/pkg/resolver/authenticatable_resolver.go @@ -0,0 +1,117 @@ +/* +Copyright 2024 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resolver + +import ( + "context" + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/tools/cache" + + corev1 "k8s.io/api/core/v1" + apierrs "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + "knative.dev/pkg/client/injection/ducks/duck/v1/authstatus" + "knative.dev/pkg/controller" + + pkgapisduck "knative.dev/pkg/apis/duck" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/tracker" +) + +// AuthenticatableResolver resolves ObjectReferences into a AuthenticatableType. +type AuthenticatableResolver struct { + tracker tracker.Interface + listerFactory func(schema.GroupVersionResource) (cache.GenericLister, error) +} + +// NewAuthenticatableResolverFromTracker constructs a new AuthenticatableResolver with context and a tracker. +func NewAuthenticatableResolverFromTracker(ctx context.Context, t tracker.Interface) *AuthenticatableResolver { + ret := &AuthenticatableResolver{ + tracker: t, + } + + informerFactory := &pkgapisduck.CachedInformerFactory{ + Delegate: &pkgapisduck.EnqueueInformerFactory{ + Delegate: authstatus.Get(ctx), + EventHandler: controller.HandleAll(ret.tracker.OnChanged), + }, + } + + ret.listerFactory = func(gvr schema.GroupVersionResource) (cache.GenericLister, error) { + _, l, err := informerFactory.Get(ctx, gvr) + return l, err + } + + return ret +} + +// AuthStatusFromObjectReference returns the AuthStatus from an object +func (r *AuthenticatableResolver) AuthStatusFromObjectReference(ref *corev1.ObjectReference, parent interface{}) (*duckv1.AuthStatus, error) { + if ref == nil { + return nil, apierrs.NewBadRequest("ref is nil") + } + + authenticatable, err := r.authenticatableFromObjectReference(ref, parent) + if err != nil { + return nil, fmt.Errorf("failed to get authenticatable %s/%s: %w", ref.Namespace, ref.Name, err) + } + + if authenticatable.Status.Auth == nil { + return nil, fmt.Errorf(".status.auth is missing in object %s/%s", ref.Namespace, ref.Name) + } + + return authenticatable.Status.Auth, nil +} + +// authenticatableFromObjectReference resolves an object reference into an AuthenticatableType +func (r *AuthenticatableResolver) authenticatableFromObjectReference(ref *corev1.ObjectReference, parent interface{}) (*duckv1.AuthenticatableType, error) { + if ref == nil { + return nil, apierrs.NewBadRequest("ref is nil") + } + + gvr, _ := meta.UnsafeGuessKindToResource(ref.GroupVersionKind()) + if err := r.tracker.TrackReference(tracker.Reference{ + APIVersion: ref.APIVersion, + Kind: ref.Kind, + Namespace: ref.Namespace, + Name: ref.Name, + }, parent); err != nil { + return nil, fmt.Errorf("failed to track reference %s %s/%s: %w", gvr.String(), ref.Namespace, ref.Name, err) + } + + lister, err := r.listerFactory(gvr) + if err != nil { + return nil, fmt.Errorf("failed to get lister for %s: %w", gvr.String(), err) + } + + obj, err := lister.ByNamespace(ref.Namespace).Get(ref.Name) + if err != nil { + return nil, fmt.Errorf("failed to get object %s/%s: %w", ref.Namespace, ref.Name, err) + } + + authenticatable, ok := obj.(*duckv1.AuthenticatableType) + if !ok { + return nil, apierrs.NewBadRequest(fmt.Sprintf("%s(%T) is not an AuthenticatableType", ref, ref)) + } + + // Do not modify informer copy. + authenticatable = authenticatable.DeepCopy() + + return authenticatable, nil +} diff --git a/vendor/knative.dev/reconciler-test/pkg/eventshub/forwarder/forwarder.go b/vendor/knative.dev/reconciler-test/pkg/eventshub/forwarder/forwarder.go index 3c0cfc5b96..99ae2a383b 100644 --- a/vendor/knative.dev/reconciler-test/pkg/eventshub/forwarder/forwarder.go +++ b/vendor/knative.dev/reconciler-test/pkg/eventshub/forwarder/forwarder.go @@ -19,11 +19,13 @@ package forwarder import ( "bytes" "context" + "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" + "os" "strings" "time" @@ -51,6 +53,9 @@ type Forwarder struct { // Sink Sink string + // FromFiles allows forwarding JSON-formatted events that are present on specified files (comma separated list of file paths) + FromFiles string + // EventLogs is the list of EventLogger implementors to vent observed events. EventLogs *eventshub.EventLogs @@ -69,6 +74,9 @@ type envConfig struct { // Sink url for the message destination Sink string `envconfig:"SINK" required:"true"` + + // FromFiles allows forwarding JSON-formatted events that are present on specified files (comma separated list of file paths) + FromFiles string `envconfig:"FROM_FILES" required:"false"` } func NewFromEnv(ctx context.Context, eventLogs *eventshub.EventLogs, handlerFuncs []eventshub.HandlerFunc, clientOpts []eventshub.ClientOption) *Forwarder { @@ -83,6 +91,7 @@ func NewFromEnv(ctx context.Context, eventLogs *eventshub.EventLogs, handlerFunc Name: env.Name, Namespace: env.Namespace, Sink: env.Sink, + FromFiles: env.FromFiles, EventLogs: eventLogs, ctx: ctx, handlerFuncs: handlerFuncs, @@ -106,6 +115,11 @@ func (o *Forwarder) Start(ctx context.Context) error { handler = dec(handler) } + if o.FromFiles != "" { + o.forwardFromFiles() + return nil + } + server := &http.Server{Addr: ":8080", Handler: handler} var err error @@ -277,3 +291,66 @@ func (o *Forwarder) responseInfo(res *http.Response, event *cloudevents.Event) e } return responseInfo } + +func (o *Forwarder) forwardFromFile(f string) { + b, err := os.ReadFile(f) + if err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to read the file", + zap.String("file", f), + zap.Error(err)) + } + + event := &cloudevents.Event{} + if err := json.Unmarshal(b, event); err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to unmarshal the event", + zap.String("file", f), + zap.Error(err)) + } + + eventInfo := eventshub.EventInfo{ + Event: event, + Observer: o.Name, + Origin: f, + Time: time.Now(), + Kind: eventshub.EventSent, + } + + // Log the event that is being forwarded + if err := o.EventLogs.Vent(eventInfo); err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to vent the event", + zap.String("file", f), + zap.Error(err)) + } + + req, err := http.NewRequest("POST", o.Sink, nil) + if err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to create the client request", + zap.String("file", f), + zap.Error(err)) + } + if err := cehttp.WriteRequest(context.Background(), cloudevents.ToMessage(event), req); err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to write the client request", + zap.String("file", f), + zap.Error(err)) + } + + res, err := o.httpClient.Do(req) + if err != nil { + logging.FromContext(o.ctx).Fatalw("Failed to forward the event", + zap.String("file", f), + zap.Error(err)) + } + + // Vent the response info + if err := o.EventLogs.Vent(o.responseInfo(res, event)); err != nil { + logging.FromContext(o.ctx).Errorw("Failed to log response for forwarded event", + zap.String("file", f), + zap.Error(err)) + } +} + +func (o *Forwarder) forwardFromFiles() { + for _, f := range strings.Split(o.FromFiles, ",") { + o.forwardFromFile(f) + } +} diff --git a/vendor/knative.dev/reconciler-test/pkg/eventshub/options.go b/vendor/knative.dev/reconciler-test/pkg/eventshub/options.go index 6693aa0ea5..ec641f7403 100644 --- a/vendor/knative.dev/reconciler-test/pkg/eventshub/options.go +++ b/vendor/knative.dev/reconciler-test/pkg/eventshub/options.go @@ -81,7 +81,16 @@ func StartSenderTLS(sinkSvc string, caCerts *string) EventsHubOption { // This can be used together with InputEvent, AddTracing, EnableIncrementalId, InputEncoding and InputHeader options func StartSenderToResource(gvr schema.GroupVersionResource, name string) EventsHubOption { return func(ctx context.Context, envs map[string]string) error { - u, err := k8s.Address(ctx, gvr, name) + env := environment.FromContext(ctx) + return StartSenderToNamespacedResource(gvr, name, env.Namespace())(ctx, envs) + } +} + +// StartSenderToNamespacedResource starts the sender in the eventshub pointing to the provided resource +// This can be used together with InputEvent, AddTracing, EnableIncrementalId, InputEncoding and InputHeader options +func StartSenderToNamespacedResource(gvr schema.GroupVersionResource, name, namespace string) EventsHubOption { + return func(ctx context.Context, envs map[string]string) error { + u, err := k8s.NamespacedAddress(ctx, gvr, name, namespace) if err != nil { return err } @@ -102,7 +111,17 @@ func StartSenderToResource(gvr schema.GroupVersionResource, name string) EventsH // This can be used together with InputEvent, AddTracing, EnableIncrementalId, InputEncoding and InputHeader options func StartSenderToResourceTLS(gvr schema.GroupVersionResource, name string, caCerts *string) EventsHubOption { return func(ctx context.Context, m map[string]string) error { - u, err := k8s.Address(ctx, gvr, name) + env := environment.FromContext(ctx) + return StartSenderToNamespacedResourceTLS(gvr, name, env.Namespace(), caCerts)(ctx, m) + } +} + +// StartSenderToNamespacedResourceTLS starts the sender in the eventshub pointing to the provided namespaced resource. +// `caCerts` parameter is optional, if nil, it will fall back to use the addressable CA certs. +// This can be used together with InputEvent, AddTracing, EnableIncrementalId, InputEncoding and InputHeader options +func StartSenderToNamespacedResourceTLS(gvr schema.GroupVersionResource, name, namespace string, caCerts *string) EventsHubOption { + return func(ctx context.Context, m map[string]string) error { + u, err := k8s.NamespacedAddress(ctx, gvr, name, namespace) if err != nil { return err } diff --git a/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go b/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go index 86d27ed065..42f1f776c1 100644 --- a/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go +++ b/vendor/knative.dev/reconciler-test/pkg/k8s/steps.go @@ -95,16 +95,21 @@ func IsAddressable(gvr schema.GroupVersionResource, name string, timing ...time. // resource is found but not Addressable, Address will return (nil, nil). func Address(ctx context.Context, gvr schema.GroupVersionResource, name string) (*duckv1.Addressable, error) { env := environment.FromContext(ctx) + return NamespacedAddress(ctx, gvr, name, env.Namespace()) +} +// NamespacedAddress attempts to resolve an Addressable address in a specific namespace into a URL. If the +// resource is found but not Addressable, Address will return (nil, nil). +func NamespacedAddress(ctx context.Context, gvr schema.GroupVersionResource, name, namespace string) (*duckv1.Addressable, error) { // Special case Service. if gvr.Group == "" && gvr.Version == "v1" && gvr.Resource == "services" { - u := "http://" + network.GetServiceHostname(name, env.Namespace()) + u := "http://" + network.GetServiceHostname(name, namespace) url, err := apis.ParseURL(u) return &duckv1.Addressable{URL: url}, err } like := &duckv1.AddressableType{} - us, err := dynamicclient.Get(ctx).Resource(gvr).Namespace(env.Namespace()).Get(ctx, name, metav1.GetOptions{}) + us, err := dynamicclient.Get(ctx).Resource(gvr).Namespace(namespace).Get(ctx, name, metav1.GetOptions{}) if err != nil { return nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index a97b6e0c60..e743159f69 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -249,10 +249,10 @@ github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/collectors github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp -# github.com/prometheus/client_model v0.6.0 +# github.com/prometheus/client_model v0.6.1 ## explicit; go 1.19 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.53.0 +# github.com/prometheus/common v0.54.0 ## explicit; go 1.20 github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg @@ -368,7 +368,7 @@ go.uber.org/zap/internal/stacktrace go.uber.org/zap/internal/ztest go.uber.org/zap/zapcore go.uber.org/zap/zaptest -# golang.org/x/crypto v0.23.0 +# golang.org/x/crypto v0.24.0 ## explicit; go 1.18 golang.org/x/crypto/cast5 golang.org/x/crypto/openpgp @@ -380,12 +380,12 @@ golang.org/x/crypto/openpgp/s2k golang.org/x/crypto/pbkdf2 # golang.org/x/exp v0.0.0-20231006140011-7918f672742d ## explicit; go 1.20 -# golang.org/x/mod v0.17.0 +# golang.org/x/mod v0.18.0 ## explicit; go 1.18 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.25.0 +# golang.org/x/net v0.26.0 ## explicit; go 1.18 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -394,7 +394,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.20.0 +# golang.org/x/oauth2 v0.21.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal @@ -403,15 +403,15 @@ golang.org/x/oauth2/internal golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.20.0 +# golang.org/x/sys v0.21.0 ## explicit; go 1.18 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.20.0 +# golang.org/x/term v0.21.0 ## explicit; go 1.18 golang.org/x/term -# golang.org/x/text v0.15.0 +# golang.org/x/text v0.16.0 ## explicit; go 1.18 golang.org/x/text/secure/bidirule golang.org/x/text/transform @@ -420,7 +420,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.5.0 ## explicit; go 1.18 golang.org/x/time/rate -# golang.org/x/tools v0.21.0 +# golang.org/x/tools v0.22.0 ## explicit; go 1.19 golang.org/x/tools/go/ast/astutil golang.org/x/tools/imports @@ -437,14 +437,14 @@ golang.org/x/tools/internal/stdlib gomodules.xyz/jsonpatch/v2 # gonum.org/v1/gonum v0.11.0 ## explicit; go 1.17 -# google.golang.org/api v0.181.0 +# google.golang.org/api v0.183.0 ## explicit; go 1.20 google.golang.org/api/support/bundler -# google.golang.org/genproto/googleapis/api v0.0.0-20240506185236-b8a5c65736ae -## explicit; go 1.19 +# google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e +## explicit; go 1.20 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 -## explicit; go 1.19 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 +## explicit; go 1.20 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.64.0 ## explicit; go 1.19 @@ -661,6 +661,7 @@ k8s.io/apimachinery/pkg/util/managedfields/internal k8s.io/apimachinery/pkg/util/mergepatch k8s.io/apimachinery/pkg/util/naming k8s.io/apimachinery/pkg/util/net +k8s.io/apimachinery/pkg/util/rand k8s.io/apimachinery/pkg/util/runtime k8s.io/apimachinery/pkg/util/sets k8s.io/apimachinery/pkg/util/strategicpatch @@ -673,6 +674,9 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect +# k8s.io/apiserver v0.29.2 +## explicit; go 1.21 +k8s.io/apiserver/pkg/storage/names # k8s.io/client-go v0.29.2 ## explicit; go 1.21 k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -1073,7 +1077,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.41.1-0.20240523103154-74253dd1c57a +# knative.dev/eventing v0.41.1-0.20240620085917-18dfe3c0ac90 ## explicit; go 1.21 knative.dev/eventing/cmd/heartbeats knative.dev/eventing/pkg/adapter/v2 @@ -1084,6 +1088,7 @@ knative.dev/eventing/pkg/apis/duck knative.dev/eventing/pkg/apis/duck/v1 knative.dev/eventing/pkg/apis/eventing knative.dev/eventing/pkg/apis/eventing/v1 +knative.dev/eventing/pkg/apis/eventing/v1alpha1 knative.dev/eventing/pkg/apis/eventing/v1beta1 knative.dev/eventing/pkg/apis/eventing/v1beta2 knative.dev/eventing/pkg/apis/eventing/v1beta3 @@ -1093,6 +1098,8 @@ knative.dev/eventing/pkg/apis/flows/v1 knative.dev/eventing/pkg/apis/messaging knative.dev/eventing/pkg/apis/messaging/config knative.dev/eventing/pkg/apis/messaging/v1 +knative.dev/eventing/pkg/apis/sinks +knative.dev/eventing/pkg/apis/sinks/v1alpha1 knative.dev/eventing/pkg/apis/sources knative.dev/eventing/pkg/apis/sources/config knative.dev/eventing/pkg/apis/sources/v1 @@ -1104,6 +1111,8 @@ knative.dev/eventing/pkg/client/clientset/versioned/fake knative.dev/eventing/pkg/client/clientset/versioned/scheme knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1/fake +knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1 +knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1 knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta2 @@ -1114,6 +1123,8 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1/fake +knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1 +knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2 @@ -1121,6 +1132,7 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake knative.dev/eventing/pkg/client/informers/externalversions knative.dev/eventing/pkg/client/informers/externalversions/eventing knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1 +knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1alpha1 knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta1 knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta2 knative.dev/eventing/pkg/client/informers/externalversions/eventing/v1beta3 @@ -1129,6 +1141,8 @@ knative.dev/eventing/pkg/client/informers/externalversions/flows/v1 knative.dev/eventing/pkg/client/informers/externalversions/internalinterfaces knative.dev/eventing/pkg/client/informers/externalversions/messaging knative.dev/eventing/pkg/client/informers/externalversions/messaging/v1 +knative.dev/eventing/pkg/client/informers/externalversions/sinks +knative.dev/eventing/pkg/client/informers/externalversions/sinks/v1alpha1 knative.dev/eventing/pkg/client/informers/externalversions/sources knative.dev/eventing/pkg/client/informers/externalversions/sources/v1 knative.dev/eventing/pkg/client/informers/externalversions/sources/v1beta2 @@ -1143,11 +1157,13 @@ knative.dev/eventing/pkg/client/injection/informers/factory/fake knative.dev/eventing/pkg/client/injection/reconciler/eventing/v1/broker knative.dev/eventing/pkg/client/injection/reconciler/eventing/v1/trigger knative.dev/eventing/pkg/client/listers/eventing/v1 +knative.dev/eventing/pkg/client/listers/eventing/v1alpha1 knative.dev/eventing/pkg/client/listers/eventing/v1beta1 knative.dev/eventing/pkg/client/listers/eventing/v1beta2 knative.dev/eventing/pkg/client/listers/eventing/v1beta3 knative.dev/eventing/pkg/client/listers/flows/v1 knative.dev/eventing/pkg/client/listers/messaging/v1 +knative.dev/eventing/pkg/client/listers/sinks/v1alpha1 knative.dev/eventing/pkg/client/listers/sources/v1 knative.dev/eventing/pkg/client/listers/sources/v1beta2 knative.dev/eventing/pkg/crossnamespace @@ -1192,10 +1208,10 @@ knative.dev/eventing/test/test_images knative.dev/eventing/test/test_images/event-sender knative.dev/eventing/test/test_images/performance knative.dev/eventing/test/test_images/print -# knative.dev/hack v0.0.0-20240507013718-68e3bfb39d11 +# knative.dev/hack v0.0.0-20240607132042-09143140a254 ## explicit; go 1.18 knative.dev/hack -# knative.dev/pkg v0.0.0-20240521083825-99e1685a7997 +# knative.dev/pkg v0.0.0-20240614135239-339c22b8218c ## explicit; go 1.21 knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -1208,6 +1224,7 @@ knative.dev/pkg/client/injection/apiextensions/client knative.dev/pkg/client/injection/apiextensions/client/fake knative.dev/pkg/client/injection/ducks/duck/v1/addressable knative.dev/pkg/client/injection/ducks/duck/v1/addressable/fake +knative.dev/pkg/client/injection/ducks/duck/v1/authstatus knative.dev/pkg/client/injection/ducks/duck/v1/conditions knative.dev/pkg/client/injection/ducks/duck/v1/conditions/fake knative.dev/pkg/client/injection/ducks/duck/v1/source @@ -1302,7 +1319,7 @@ knative.dev/pkg/webhook/json knative.dev/pkg/webhook/resourcesemantics knative.dev/pkg/webhook/resourcesemantics/defaulting knative.dev/pkg/webhook/resourcesemantics/validation -# knative.dev/reconciler-test v0.0.0-20240523103149-1351b601972d +# knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8 ## explicit; go 1.21 knative.dev/reconciler-test/cmd/eventshub knative.dev/reconciler-test/pkg/environment