From c2d43cc41b0a0f5ba71ba7cbb2da6de4b8770254 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 01:51:19 +0000 Subject: [PATCH 1/2] chore(deps): Bump google.golang.org/api Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.257.0 to 0.259.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.257.0...v0.259.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.259.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ci/resources/stemcell-version-bump/go.mod | 30 +- ci/resources/stemcell-version-bump/go.sum | 68 +-- .../cloud.google.com/go/auth/CHANGES.md | 12 +- .../go/auth/credentials/detect.go | 165 ++++- .../go/auth/credentials/filetypes.go | 35 +- .../go/auth/internal/credsfile/credsfile.go | 44 -- .../go/auth/internal/credsfile/filetype.go | 1 + .../go/auth/internal/credsfile/parse.go | 7 +- .../go/auth/internal/internal.go | 13 +- .../go/auth/internal/version.go | 2 +- .../apiv3/v2/alert_policy_client.go | 2 +- .../go/monitoring/apiv3/v2/group_client.go | 2 +- .../go/monitoring/apiv3/v2/helpers.go | 4 + .../go/monitoring/apiv3/v2/metric_client.go | 2 +- .../apiv3/v2/monitoringpb/alert.pb.go | 7 +- .../apiv3/v2/monitoringpb/alert_service.pb.go | 275 +-------- .../v2/monitoringpb/alert_service_grpc.pb.go | 310 ++++++++++ .../apiv3/v2/monitoringpb/common.pb.go | 7 +- .../v2/monitoringpb/dropped_labels.pb.go | 7 +- .../apiv3/v2/monitoringpb/group.pb.go | 7 +- .../apiv3/v2/monitoringpb/group_service.pb.go | 285 +-------- .../v2/monitoringpb/group_service_grpc.pb.go | 321 ++++++++++ .../apiv3/v2/monitoringpb/metric.pb.go | 7 +- .../v2/monitoringpb/metric_service.pb.go | 439 +------------- .../v2/monitoringpb/metric_service_grpc.pb.go | 480 +++++++++++++++ .../v2/monitoringpb/mutation_record.pb.go | 7 +- .../apiv3/v2/monitoringpb/notification.pb.go | 7 +- .../monitoringpb/notification_service.pb.go | 531 +--------------- .../notification_service_grpc.pb.go | 571 ++++++++++++++++++ .../apiv3/v2/monitoringpb/query_service.pb.go | 100 +-- .../v2/monitoringpb/query_service_grpc.pb.go | 132 ++++ .../apiv3/v2/monitoringpb/service.pb.go | 7 +- .../v2/monitoringpb/service_service.pb.go | 435 +------------ .../monitoringpb/service_service_grpc.pb.go | 475 +++++++++++++++ .../apiv3/v2/monitoringpb/snooze.pb.go | 7 +- .../v2/monitoringpb/snooze_service.pb.go | 215 +------ .../v2/monitoringpb/snooze_service_grpc.pb.go | 248 ++++++++ .../apiv3/v2/monitoringpb/span_context.pb.go | 7 +- .../apiv3/v2/monitoringpb/uptime.pb.go | 7 +- .../v2/monitoringpb/uptime_service.pb.go | 295 +-------- .../v2/monitoringpb/uptime_service_grpc.pb.go | 331 ++++++++++ .../apiv3/v2/notification_channel_client.go | 2 +- .../go/monitoring/apiv3/v2/query_client.go | 2 +- .../apiv3/v2/service_monitoring_client.go | 2 +- .../go/monitoring/apiv3/v2/snooze_client.go | 2 +- .../apiv3/v2/uptime_check_client.go | 2 +- .../go/monitoring/internal/version.go | 2 +- .../googleapis/gax-go/v2/CHANGES.md | 8 +- .../googleapis/gax-go/v2/feature.go | 75 +++ .../googleapis/gax-go/v2/internal/version.go | 39 +- .../golang.org/x/net/http2/transport.go | 160 ++++- .../vendor/golang.org/x/net/trace/events.go | 2 +- .../vendor/golang.org/x/sys/cpu/cpu.go | 3 - .../vendor/golang.org/x/sys/cpu/cpu_arm64.go | 20 +- .../vendor/golang.org/x/sys/cpu/cpu_arm64.s | 7 - .../golang.org/x/sys/cpu/cpu_gc_arm64.go | 1 - .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 1 - .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 2 +- .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 2 +- .../vendor/golang.org/x/sys/unix/mkerrors.sh | 3 +- .../golang.org/x/sys/unix/zerrors_linux.go | 2 + .../x/sys/unix/zerrors_linux_386.go | 2 + .../x/sys/unix/zerrors_linux_amd64.go | 2 + .../x/sys/unix/zerrors_linux_arm.go | 2 + .../x/sys/unix/zerrors_linux_arm64.go | 2 + .../x/sys/unix/zerrors_linux_loong64.go | 2 + .../x/sys/unix/zerrors_linux_mips.go | 2 + .../x/sys/unix/zerrors_linux_mips64.go | 2 + .../x/sys/unix/zerrors_linux_mips64le.go | 2 + .../x/sys/unix/zerrors_linux_mipsle.go | 2 + .../x/sys/unix/zerrors_linux_ppc.go | 2 + .../x/sys/unix/zerrors_linux_ppc64.go | 2 + .../x/sys/unix/zerrors_linux_ppc64le.go | 2 + .../x/sys/unix/zerrors_linux_riscv64.go | 2 + .../x/sys/unix/zerrors_linux_s390x.go | 2 + .../x/sys/unix/zerrors_linux_sparc64.go | 2 + .../x/sys/unix/ztypes_netbsd_arm.go | 2 +- .../api/googleapi/googleapi.go | 15 + .../iamcredentials/v1/iamcredentials-gen.go | 2 +- .../credentialstype/credentialstype.go | 113 ++++ .../google.golang.org/api/internal/creds.go | 26 +- .../api/internal/gensupport/buffer.go | 13 + .../api/internal/gensupport/media.go | 5 +- .../api/internal/gensupport/resumable.go | 19 + .../api/internal/settings.go | 67 +- .../google.golang.org/api/internal/version.go | 2 +- .../option/internaloption/internaloption.go | 4 +- .../google.golang.org/api/option/option.go | 141 ++++- .../api/storage/v1/storage-api.json | 8 +- .../api/storage/v1/storage-gen.go | 12 +- .../api/transport/grpc/dial.go | 30 +- .../api/transport/http/dial.go | 6 +- .../grpc_lb_v1/load_balancer_grpc.pb.go | 2 +- .../balancer/weightedroundrobin/balancer.go | 39 +- .../balancer/weightedroundrobin/scheduler.go | 4 +- .../google.golang.org/grpc/clientconn.go | 144 ++++- .../proto/grpc_gcp/handshaker_grpc.pb.go | 2 +- .../grpc/experimental/stats/metricregistry.go | 39 ++ .../grpc/experimental/stats/metrics.go | 7 + .../balancer/gracefulswitch/gracefulswitch.go | 12 + .../grpc/internal/envconfig/envconfig.go | 5 + .../grpc/internal/experimental.go | 4 + .../grpc/internal/idle/idle.go | 77 +-- .../grpc/internal/internal.go | 4 + .../proto/grpc_lookup_v1/rls_grpc.pb.go | 2 +- .../grpc/internal/transport/http2_client.go | 13 +- .../grpc/internal/transport/http_util.go | 6 - .../grpc/internal/transport/transport.go | 11 +- .../xds/balancer/cdsbalancer/cdsbalancer.go | 4 +- .../balancer/cdsbalancer/cluster_watcher.go | 5 +- .../xds/balancer/clusterimpl/clusterimpl.go | 3 +- .../xds/balancer/clusterimpl/picker.go | 22 + .../clusterresolver/resource_resolver_eds.go | 4 +- .../grpc/internal/xds/bootstrap/bootstrap.go | 13 + .../xds/clients/internal/buffer/unbounded.go | 1 + .../xds/clients/xdsclient/ads_stream.go | 216 +++---- .../xds/clients/xdsclient/authority.go | 2 +- .../internal/xds/clients/xdsclient/channel.go | 2 +- .../clients/xdsclient/clientimpl_watchers.go | 19 +- .../xds/clients/xdsclient/resource_watcher.go | 3 + .../xds/clients/xdsclient/xdsconfig.go | 34 +- .../internal/xds/matcher/string_matcher.go | 119 ++-- .../internal/xds/resolver/serviceconfig.go | 84 ++- .../internal/xds/resolver/watch_service.go | 92 --- .../internal/xds/resolver/xds_resolver.go | 370 ++++-------- .../internal/xds/server/listener_wrapper.go | 3 +- .../grpc/internal/xds/server/rds_handler.go | 6 +- .../grpc/internal/xds/xds.go | 16 + .../grpc/internal/xds/xdsclient/client.go | 8 +- .../grpc/internal/xds/xdsclient/clientimpl.go | 54 +- .../xds/xdsclient/clientimpl_watchers.go | 36 -- .../internal/xds/xdsclient/resource_types.go | 6 +- .../xdsresource/cluster_resource_type.go | 110 ++-- .../xdsresource/endpoints_resource_type.go | 103 ++-- .../xds/xdsclient/xdsresource/filter_chain.go | 2 +- .../xdsresource/listener_resource_type.go | 8 +- .../xdsclient/xdsresource/resource_type.go | 146 +---- .../xdsresource/route_config_resource_type.go | 104 ++-- .../xds/xdsclient/xdsresource/type_eds.go | 1 + .../xds/xdsclient/xdsresource/type_rds.go | 3 + .../xdsclient/xdsresource/unmarshal_eds.go | 1 + .../xdsclient/xdsresource/unmarshal_lds.go | 13 +- .../xdsclient/xdsresource/unmarshal_rds.go | 22 +- .../xds/xdsclient/xdsresource/xdsconfig.go | 114 ++++ .../internal/xds/xdsdepmgr/watch_service.go | 83 +++ .../xds/xdsdepmgr/xds_dependency_manager.go | 279 +++++++++ .../google.golang.org/grpc/mem/buffer_pool.go | 13 +- .../grpc/resolver_wrapper.go | 1 + .../vendor/google.golang.org/grpc/rpc_util.go | 93 ++- .../vendor/google.golang.org/grpc/stream.go | 68 ++- .../vendor/google.golang.org/grpc/version.go | 2 +- .../protobuf/internal/encoding/tag/tag.go | 11 +- .../protobuf/internal/encoding/text/decode.go | 115 ++-- .../protobuf/internal/filedesc/desc.go | 1 + .../protobuf/internal/filedesc/desc_lazy.go | 22 - .../protobuf/internal/genid/descriptor_gen.go | 1 + .../protobuf/internal/impl/codec_map.go | 6 + .../protobuf/internal/impl/decode.go | 3 +- .../protobuf/internal/impl/validate.go | 26 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 10 +- .../types/descriptorpb/descriptor.pb.go | 13 +- .../types/known/timestamppb/timestamp.pb.go | 13 +- .../stemcell-version-bump/vendor/modules.txt | 36 +- 164 files changed, 5528 insertions(+), 4129 deletions(-) create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go create mode 100644 ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/feature.go create mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/credentialstype/credentialstype.go delete mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/watch_service.go delete mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl_watchers.go create mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/xdsconfig.go create mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/watch_service.go create mode 100644 ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go diff --git a/ci/resources/stemcell-version-bump/go.mod b/ci/resources/stemcell-version-bump/go.mod index 397da198..9530abb4 100644 --- a/ci/resources/stemcell-version-bump/go.mod +++ b/ci/resources/stemcell-version-bump/go.mod @@ -7,17 +7,17 @@ toolchain go1.24.1 require ( cloud.google.com/go/storage v1.58.0 github.com/stretchr/testify v1.11.1 - google.golang.org/api v0.257.0 + google.golang.org/api v0.259.0 ) require ( cel.dev/expr v0.24.0 // indirect cloud.google.com/go v0.123.0 // indirect - cloud.google.com/go/auth v0.17.0 // indirect + cloud.google.com/go/auth v0.18.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/iam v1.5.3 // indirect - cloud.google.com/go/monitoring v1.24.2 // indirect + cloud.google.com/go/monitoring v1.24.3 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 // indirect @@ -33,7 +33,7 @@ require ( github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.7 // indirect - github.com/googleapis/gax-go/v2 v2.15.0 // indirect + github.com/googleapis/gax-go/v2 v2.16.0 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect @@ -46,17 +46,17 @@ require ( go.opentelemetry.io/otel/sdk v1.38.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/oauth2 v0.33.0 // indirect - golang.org/x/sync v0.18.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.46.0 // indirect + golang.org/x/net v0.48.0 // indirect + golang.org/x/oauth2 v0.34.0 // indirect + golang.org/x/sync v0.19.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/text v0.32.0 // indirect golang.org/x/time v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20250922171735-9219d122eba9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 // indirect - google.golang.org/grpc v1.77.0 // indirect - google.golang.org/protobuf v1.36.10 // indirect + google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/grpc v1.78.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/ci/resources/stemcell-version-bump/go.sum b/ci/resources/stemcell-version-bump/go.sum index 2893ad8c..10e619fd 100644 --- a/ci/resources/stemcell-version-bump/go.sum +++ b/ci/resources/stemcell-version-bump/go.sum @@ -2,24 +2,24 @@ cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= -cloud.google.com/go/auth v0.17.0 h1:74yCm7hCj2rUyyAocqnFzsAYXgJhrG26XCFimrc/Kz4= -cloud.google.com/go/auth v0.17.0/go.mod h1:6wv/t5/6rOPAX4fJiRjKkJCvswLwdet7G8+UGXt7nCQ= +cloud.google.com/go/auth v0.18.0 h1:wnqy5hrv7p3k7cShwAU/Br3nzod7fxoqG+k0VZ+/Pk0= +cloud.google.com/go/auth v0.18.0/go.mod h1:wwkPM1AgE1f2u6dG443MiWoD8C3BtOywNsUMcUTVDRo= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc= cloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU= -cloud.google.com/go/logging v1.13.0 h1:7j0HgAp0B94o1YRDqiqm26w4q1rDMH7XNRU34lJXHYc= -cloud.google.com/go/logging v1.13.0/go.mod h1:36CoKh6KA/M0PbhPKMq6/qety2DCAErbhXT62TuXALA= +cloud.google.com/go/logging v1.13.1 h1:O7LvmO0kGLaHY/gq8cV7T0dyp6zJhYAOtZPX4TF3QtY= +cloud.google.com/go/logging v1.13.1/go.mod h1:XAQkfkMBxQRjQek96WLPNze7vsOmay9H5PqfsNYDqvw= cloud.google.com/go/longrunning v0.7.0 h1:FV0+SYF1RIj59gyoWDRi45GiYUMM3K1qO51qoboQT1E= cloud.google.com/go/longrunning v0.7.0/go.mod h1:ySn2yXmjbK9Ba0zsQqunhDkYi0+9rlXIwnoAf+h+TPY= -cloud.google.com/go/monitoring v1.24.2 h1:5OTsoJ1dXYIiMiuL+sYscLc9BumrL3CarVLL7dd7lHM= -cloud.google.com/go/monitoring v1.24.2/go.mod h1:x7yzPWcgDRnPEv3sI+jJGBkwl5qINf+6qY4eq0I9B4U= +cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE= +cloud.google.com/go/monitoring v1.24.3/go.mod h1:nYP6W0tm3N9H/bOw8am7t62YTzZY+zUeQ+Bi6+2eonI= cloud.google.com/go/storage v1.58.0 h1:PflFXlmFJjG/nBeR9B7pKddLQWaFaRWx4uUi/LyNxxo= cloud.google.com/go/storage v1.58.0/go.mod h1:cMWbtM+anpC74gn6qjLh+exqYcfmB9Hqe5z6adx+CLI= -cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4= -cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= +cloud.google.com/go/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U= +cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 h1:lhhYARPUu3LmHysQ/igznQphfzynnqI3D75oUyw1HXk= @@ -63,8 +63,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.7 h1:zrn2Ee/nWmHulBx5sAVrGgAa0f2/R35S4DJwfFaUPFQ= github.com/googleapis/enterprise-certificate-proxy v0.3.7/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= -github.com/googleapis/gax-go/v2 v2.15.0 h1:SyjDc1mGgZU5LncH8gimWo9lW1DtIfPibOG81vgd/bo= -github.com/googleapis/gax-go/v2 v2.15.0/go.mod h1:zVVkkxAQHa1RQpg9z2AUCMnKhi0Qld9rcmyfL1OZhoc= +github.com/googleapis/gax-go/v2 v2.16.0 h1:iHbQmKLLZrexmb0OSsNGTeSTS0HO4YvFOG8g5E4Zd0Y= +github.com/googleapis/gax-go/v2 v2.16.0/go.mod h1:o1vfQjjNZn4+dPnRdl/4ZD7S9414Y4xA+a/6Icj6l14= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -99,34 +99,34 @@ go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6 go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= -golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= +golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= +golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= +golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= +golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/api v0.257.0 h1:8Y0lzvHlZps53PEaw+G29SsQIkuKrumGWs9puiexNAA= -google.golang.org/api v0.257.0/go.mod h1:4eJrr+vbVaZSqs7vovFd1Jb/A6ml6iw2e6FBYf3GAO4= -google.golang.org/genproto v0.0.0-20250922171735-9219d122eba9 h1:LvZVVaPE0JSqL+ZWb6ErZfnEOKIqqFWUJE2D0fObSmc= -google.golang.org/genproto v0.0.0-20250922171735-9219d122eba9/go.mod h1:QFOrLhdAe2PsTp3vQY4quuLKTi9j3XG3r6JPPaw7MSc= -google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba h1:B14OtaXuMaCQsl2deSvNkyPKIzq3BjfxQp8d00QyWx4= -google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba/go.mod h1:G5IanEx8/PgI9w6CFcYQf7jMtHQhZruvfM1i3qOqk5U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 h1:Wgl1rcDNThT+Zn47YyCXOXyX/COgMTIdhJ717F0l4xk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= -google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= -google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= -google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/api v0.259.0 h1:90TaGVIxScrh1Vn/XI2426kRpBqHwWIzVBzJsVZ5XrQ= +google.golang.org/api v0.259.0/go.mod h1:LC2ISWGWbRoyQVpxGntWwLWN/vLNxxKBK9KuJRI8Te4= +google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 h1:GvESR9BIyHUahIb0NcTum6itIWtdoglGX+rnGxm2934= +google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:yJ2HH4EHEDTd3JiLmhds6NkJ17ITVYOdV3m3VKOnws0= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md index 4deca443..36c7db49 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,3 +1,13 @@ +# Changes + +## [0.18.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.18.0) (2025-12-15) + +### Features + +* Support scopes field from impersonated credential json (#13308) ([e3f62e1](https://github.com/googleapis/google-cloud-go/commit/e3f62e102840127a0058f5cced4c9738f2bf45f2)) +* add support for parsing EC private key (#13317) ([ea6bc62](https://github.com/googleapis/google-cloud-go/commit/ea6bc62ffe2cc0a6d607d698a181b37fa46c340d)) +* deprecate unsafe credentials JSON loading options (#13397) ([0dd2a3b](https://github.com/googleapis/google-cloud-go/commit/0dd2a3bdece9a85ee7216a737559fa9f5a869545)) + ## [0.17.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.17.0) (2025-10-02) ### Features @@ -5,8 +15,6 @@ * Add trust boundary support for service accounts and impersonation (HTTP/gRPC) (#11870) ([5c2b665](https://github.com/googleapis/google-cloud-go/commit/5c2b665f392e6dd90192f107188720aa1357e7da)) * add trust boundary support for external accounts (#12864) ([a67a146](https://github.com/googleapis/google-cloud-go/commit/a67a146a6a88a6f1ba10c409dfce8015ecd60a64)) -# Changelog - ## [0.16.5](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.4...auth/v0.16.5) (2025-08-14) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go index 6700e33e..c9d7600e 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go @@ -52,6 +52,44 @@ var ( allowOnGCECheck = true ) +// CredType specifies the type of JSON credentials being provided +// to a loading function such as [NewCredentialsFromFile] or +// [NewCredentialsFromJSON]. +type CredType string + +const ( + // ServiceAccount represents a service account file type. + ServiceAccount CredType = "service_account" + // AuthorizedUser represents a user credentials file type. + AuthorizedUser CredType = "authorized_user" + // ExternalAccount represents an external account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ExternalAccount CredType = "external_account" + // ImpersonatedServiceAccount represents an impersonated service account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ImpersonatedServiceAccount CredType = "impersonated_service_account" + // GDCHServiceAccount represents a GDCH service account credentials. + GDCHServiceAccount CredType = "gdch_service_account" + // ExternalAccountAuthorizedUser represents an external account authorized user credentials. + ExternalAccountAuthorizedUser CredType = "external_account_authorized_user" +) + // TokenBindingType specifies the type of binding used when requesting a token // whether to request a hard-bound token using mTLS or an instance identity // bound token using ALTS. @@ -92,6 +130,14 @@ func OnGCE() bool { // - On Google Compute Engine, Google App Engine standard second generation // runtimes, and Google App Engine flexible environment, it fetches // credentials from the metadata server. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) { if err := opts.validate(); err != nil { return nil, err @@ -189,25 +235,61 @@ type DetectOptions struct { // from the provided filepath. If provided, CredentialsJSON must not be. // Optional. // - // Important: If you accept a credential configuration (credential - // JSON/File/Stream) from an external source for authentication to Google - // Cloud Platform, you must validate it before providing it to any Google - // API or library. Providing an unvalidated credential configuration to - // Google APIs can compromise the security of your systems and data. For - // more information, refer to [Validate credential configurations from - // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromFile method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := credentials.NewCredentialsFromFile(ctx, credentials.ServiceAccount, filename, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials CredentialsFile string // CredentialsJSON overrides detection logic and uses the JSON bytes as the // source for the credential. If provided, CredentialsFile must not be. // Optional. // - // Important: If you accept a credential configuration (credential - // JSON/File/Stream) from an external source for authentication to Google - // Cloud Platform, you must validate it before providing it to any Google - // API or library. Providing an unvalidated credential configuration to - // Google APIs can compromise the security of your systems and data. For - // more information, refer to [Validate credential configurations from - // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromJSON method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := credentials.NewCredentialsFromJSON(ctx, credentials.ServiceAccount, json, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials CredentialsJSON []byte // UseSelfSignedJWT directs service account based credentials to create a // self-signed JWT with the private key found in the file, skipping any @@ -227,6 +309,61 @@ type DetectOptions struct { Logger *slog.Logger } +// NewCredentialsFromFile creates a [cloud.google.com/go/auth.Credentials] from +// the provided file. The credType argument specifies the expected credential +// type. If the file content does not match the expected type, an error is +// returned. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromFile(credType CredType, filename string, opts *DetectOptions) (*auth.Credentials, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + return NewCredentialsFromJSON(credType, b, opts) +} + +// NewCredentialsFromJSON creates a [cloud.google.com/go/auth.Credentials] from +// the provided JSON bytes. The credType argument specifies the expected +// credential type. If the JSON does not match the expected type, an error is +// returned. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromJSON(credType CredType, b []byte, opts *DetectOptions) (*auth.Credentials, error) { + if err := checkCredentialType(b, credType); err != nil { + return nil, err + } + // We can't use readCredentialsFileJSON because it does auto-detection + // for client_credentials.json which we don't support here (no type field). + // Instead, we call fileCredentials just as readCredentialsFileJSON does + // when it doesn't detect client_credentials.json. + return fileCredentials(b, opts) +} + +func checkCredentialType(b []byte, expected CredType) error { + + fileType, err := credsfile.ParseFileType(b) + if err != nil { + return err + } + if CredType(fileType) != expected { + return fmt.Errorf("credentials: expected type %q, found %q", expected, fileType) + } + return nil +} + func (o *DetectOptions) validate() error { if o == nil { return errors.New("credentials: options must be provided") diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go index d2a04247..f3737a5e 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go @@ -28,18 +28,21 @@ import ( "cloud.google.com/go/auth/internal/trustboundary" ) +const cloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { fileType, err := credsfile.ParseFileType(b) if err != nil { return nil, err } + if fileType == "" { + return nil, errors.New("credentials: unsupported unidentified file type") + } var projectID, universeDomain string var tp auth.TokenProvider - switch fileType { - case credsfile.UnknownCredType: - return nil, errors.New("credentials: unsupported unidentified file type") - case credsfile.ServiceAccountKey: + switch CredType(fileType) { + case ServiceAccount: f, err := credsfile.ParseServiceAccount(b) if err != nil { return nil, err @@ -50,7 +53,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { } projectID = f.ProjectID universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.UserCredentialsKey: + case AuthorizedUser: f, err := credsfile.ParseUserCredentials(b) if err != nil { return nil, err @@ -60,7 +63,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = f.UniverseDomain - case credsfile.ExternalAccountKey: + case ExternalAccount: f, err := credsfile.ParseExternalAccount(b) if err != nil { return nil, err @@ -70,7 +73,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.ExternalAccountAuthorizedUserKey: + case ExternalAccountAuthorizedUser: f, err := credsfile.ParseExternalAccountAuthorizedUser(b) if err != nil { return nil, err @@ -80,7 +83,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = f.UniverseDomain - case credsfile.ImpersonatedServiceAccountKey: + case ImpersonatedServiceAccount: f, err := credsfile.ParseImpersonatedServiceAccount(b) if err != nil { return nil, err @@ -90,7 +93,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.GDCHServiceAccountKey: + case GDCHServiceAccount: f, err := credsfile.ParseGDCHServiceAccount(b) if err != nil { return nil, err @@ -275,14 +278,24 @@ func handleImpersonatedServiceAccount(f *credsfile.ImpersonatedServiceAccountFil return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials") } - sourceTP, err := fileCredentials(f.CredSource, opts) + sourceOpts := *opts + + // Source credential needs IAM or Cloud Platform scope to call the + // iamcredentials endpoint. The scopes provided by the user are for the + // impersonated credentials. + sourceOpts.Scopes = []string{cloudPlatformScope} + sourceTP, err := fileCredentials(f.CredSource, &sourceOpts) if err != nil { return nil, err } ud := resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) + scopes := opts.scopes() + if len(scopes) == 0 { + scopes = f.Scopes + } impOpts := &impersonate.Options{ URL: f.ServiceAccountImpersonationURL, - Scopes: opts.scopes(), + Scopes: scopes, Tp: sourceTP, Delegates: f.Delegates, Client: opts.client(), diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go index 9cd4bed6..84aab847 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go @@ -32,50 +32,6 @@ const ( userCredsFilename = "application_default_credentials.json" ) -// CredentialType represents different credential filetypes Google credentials -// can be. -type CredentialType int - -const ( - // UnknownCredType is an unidentified file type. - UnknownCredType CredentialType = iota - // UserCredentialsKey represents a user creds file type. - UserCredentialsKey - // ServiceAccountKey represents a service account file type. - ServiceAccountKey - // ImpersonatedServiceAccountKey represents a impersonated service account - // file type. - ImpersonatedServiceAccountKey - // ExternalAccountKey represents a external account file type. - ExternalAccountKey - // GDCHServiceAccountKey represents a GDCH file type. - GDCHServiceAccountKey - // ExternalAccountAuthorizedUserKey represents a external account authorized - // user file type. - ExternalAccountAuthorizedUserKey -) - -// parseCredentialType returns the associated filetype based on the parsed -// typeString provided. -func parseCredentialType(typeString string) CredentialType { - switch typeString { - case "service_account": - return ServiceAccountKey - case "authorized_user": - return UserCredentialsKey - case "impersonated_service_account": - return ImpersonatedServiceAccountKey - case "external_account": - return ExternalAccountKey - case "external_account_authorized_user": - return ExternalAccountAuthorizedUserKey - case "gdch_service_account": - return GDCHServiceAccountKey - default: - return UnknownCredType - } -} - // GetFileNameFromEnv returns the override if provided or detects a filename // from the environment. func GetFileNameFromEnv(override string) string { diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go index 60634730..cbba2eb9 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go @@ -140,6 +140,7 @@ type ImpersonatedServiceAccountFile struct { Type string `json:"type"` ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"` Delegates []string `json:"delegates"` + Scopes []string `json:"scopes"` CredSource json.RawMessage `json:"source_credentials"` UniverseDomain string `json:"universe_domain"` } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go index a02b9f5d..f2cedb73 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go @@ -89,10 +89,11 @@ type fileTypeChecker struct { } // ParseFileType determines the [CredentialType] based on bytes provided. -func ParseFileType(b []byte) (CredentialType, error) { +// Only returns error for json.Unmarshal. +func ParseFileType(b []byte) (string, error) { var f fileTypeChecker if err := json.Unmarshal(b, &f); err != nil { - return 0, err + return "", err } - return parseCredentialType(f.Type), nil + return f.Type, nil } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/internal.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/internal.go index 72a8a6b7..48e9bd9e 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/internal.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/internal.go @@ -88,12 +88,13 @@ func ParseKey(key []byte) (crypto.Signer, error) { key = block.Bytes } var parsedKey crypto.PrivateKey - var err error - parsedKey, err = x509.ParsePKCS8PrivateKey(key) - if err != nil { - parsedKey, err = x509.ParsePKCS1PrivateKey(key) - if err != nil { - return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8: %w", err) + + var errPKCS8, errPKCS1, errEC error + if parsedKey, errPKCS8 = x509.ParsePKCS8PrivateKey(key); errPKCS8 != nil { + if parsedKey, errPKCS1 = x509.ParsePKCS1PrivateKey(key); errPKCS1 != nil { + if parsedKey, errEC = x509.ParseECPrivateKey(key); errEC != nil { + return nil, fmt.Errorf("failed to parse private key. Tried PKCS8, PKCS1, and EC formats. Errors: [PKCS8: %v], [PKCS1: %v], [EC: %v]", errPKCS8, errPKCS1, errEC) + } } } parsed, ok := parsedKey.(crypto.Signer) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go index e2f56cf4..702a6840 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.17.0" +const Version = "0.18.0" diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go index 9a9408f1..cc8c69c2 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go @@ -276,7 +276,7 @@ func (c *alertPolicyGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *alertPolicyGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go index a45e1aec..7a9e0760 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go @@ -297,7 +297,7 @@ func (c *groupGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *groupGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go index 6719cac8..b97da685 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go @@ -18,16 +18,20 @@ package monitoring import ( "context" + "fmt" "log/slog" "github.com/googleapis/gax-go/v2/internallog/grpclog" "google.golang.org/api/option" "google.golang.org/grpc" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoimpl" ) const serviceName = "monitoring.googleapis.com" +var protoVersion = fmt.Sprintf("1.%d", protoimpl.MaxVersion) + // For more information on implementing a client constructor hook, see // https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. type clientHookParams struct{} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go index 29eb4849..2ed8ccc1 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go @@ -335,7 +335,7 @@ func (c *metricGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *metricGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go index 24ca1414..f735f032 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go @@ -15,15 +15,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/alert.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" timeofday "google.golang.org/genproto/googleapis/type/timeofday" @@ -31,6 +28,8 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go index ba0c4f65..5edc4a06 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/alert_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -695,267 +690,3 @@ func file_google_monitoring_v3_alert_service_proto_init() { file_google_monitoring_v3_alert_service_proto_goTypes = nil file_google_monitoring_v3_alert_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AlertPolicyServiceClient is the client API for AlertPolicyService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AlertPolicyServiceClient interface { - // Lists the existing alerting policies for the workspace. - ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) - // Gets a single alerting policy. - GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) - // Creates a new alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) - // Deletes an alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Updates an alerting policy. You can either replace the entire policy with - // a new one or replace only certain fields in the current alerting policy by - // specifying the fields to be updated via `updateMask`. Returns the - // updated alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) -} - -type alertPolicyServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAlertPolicyServiceClient(cc grpc.ClientConnInterface) AlertPolicyServiceClient { - return &alertPolicyServiceClient{cc} -} - -func (c *alertPolicyServiceClient) ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) { - out := new(ListAlertPoliciesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AlertPolicyServiceServer is the server API for AlertPolicyService service. -type AlertPolicyServiceServer interface { - // Lists the existing alerting policies for the workspace. - ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) - // Gets a single alerting policy. - GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) - // Creates a new alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) - // Deletes an alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) - // Updates an alerting policy. You can either replace the entire policy with - // a new one or replace only certain fields in the current alerting policy by - // specifying the fields to be updated via `updateMask`. Returns the - // updated alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) -} - -// UnimplementedAlertPolicyServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAlertPolicyServiceServer struct { -} - -func (*UnimplementedAlertPolicyServiceServer) ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAlertPolicies not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAlertPolicy not implemented") -} - -func RegisterAlertPolicyServiceServer(s *grpc.Server, srv AlertPolicyServiceServer) { - s.RegisterService(&_AlertPolicyService_serviceDesc, srv) -} - -func _AlertPolicyService_ListAlertPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAlertPoliciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, req.(*ListAlertPoliciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_GetAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, req.(*GetAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_CreateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, req.(*CreateAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_DeleteAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, req.(*DeleteAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_UpdateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, req.(*UpdateAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AlertPolicyService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.AlertPolicyService", - HandlerType: (*AlertPolicyServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAlertPolicies", - Handler: _AlertPolicyService_ListAlertPolicies_Handler, - }, - { - MethodName: "GetAlertPolicy", - Handler: _AlertPolicyService_GetAlertPolicy_Handler, - }, - { - MethodName: "CreateAlertPolicy", - Handler: _AlertPolicyService_CreateAlertPolicy_Handler, - }, - { - MethodName: "DeleteAlertPolicy", - Handler: _AlertPolicyService_DeleteAlertPolicy_Handler, - }, - { - MethodName: "UpdateAlertPolicy", - Handler: _AlertPolicyService_UpdateAlertPolicy_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/alert_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go new file mode 100644 index 00000000..ff3412fb --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go @@ -0,0 +1,310 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/alert_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AlertPolicyService_ListAlertPolicies_FullMethodName = "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies" + AlertPolicyService_GetAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy" + AlertPolicyService_CreateAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy" + AlertPolicyService_DeleteAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy" + AlertPolicyService_UpdateAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy" +) + +// AlertPolicyServiceClient is the client API for AlertPolicyService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AlertPolicyServiceClient interface { + // Lists the existing alerting policies for the workspace. + ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) + // Gets a single alerting policy. + GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) + // Creates a new alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) + // Deletes an alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Updates an alerting policy. You can either replace the entire policy with + // a new one or replace only certain fields in the current alerting policy by + // specifying the fields to be updated via `updateMask`. Returns the + // updated alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) +} + +type alertPolicyServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAlertPolicyServiceClient(cc grpc.ClientConnInterface) AlertPolicyServiceClient { + return &alertPolicyServiceClient{cc} +} + +func (c *alertPolicyServiceClient) ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) { + out := new(ListAlertPoliciesResponse) + err := c.cc.Invoke(ctx, AlertPolicyService_ListAlertPolicies_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_GetAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_CreateAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AlertPolicyService_DeleteAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_UpdateAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AlertPolicyServiceServer is the server API for AlertPolicyService service. +// All implementations should embed UnimplementedAlertPolicyServiceServer +// for forward compatibility +type AlertPolicyServiceServer interface { + // Lists the existing alerting policies for the workspace. + ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) + // Gets a single alerting policy. + GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) + // Creates a new alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) + // Deletes an alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) + // Updates an alerting policy. You can either replace the entire policy with + // a new one or replace only certain fields in the current alerting policy by + // specifying the fields to be updated via `updateMask`. Returns the + // updated alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) +} + +// UnimplementedAlertPolicyServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAlertPolicyServiceServer struct { +} + +func (UnimplementedAlertPolicyServiceServer) ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAlertPolicies not implemented") +} +func (UnimplementedAlertPolicyServiceServer) GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAlertPolicy not implemented") +} + +// UnsafeAlertPolicyServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AlertPolicyServiceServer will +// result in compilation errors. +type UnsafeAlertPolicyServiceServer interface { + mustEmbedUnimplementedAlertPolicyServiceServer() +} + +func RegisterAlertPolicyServiceServer(s grpc.ServiceRegistrar, srv AlertPolicyServiceServer) { + s.RegisterService(&AlertPolicyService_ServiceDesc, srv) +} + +func _AlertPolicyService_ListAlertPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAlertPoliciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_ListAlertPolicies_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, req.(*ListAlertPoliciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_GetAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_GetAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, req.(*GetAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_CreateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_CreateAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, req.(*CreateAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_DeleteAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_DeleteAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, req.(*DeleteAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_UpdateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_UpdateAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, req.(*UpdateAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AlertPolicyService_ServiceDesc is the grpc.ServiceDesc for AlertPolicyService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AlertPolicyService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.AlertPolicyService", + HandlerType: (*AlertPolicyServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAlertPolicies", + Handler: _AlertPolicyService_ListAlertPolicies_Handler, + }, + { + MethodName: "GetAlertPolicy", + Handler: _AlertPolicyService_GetAlertPolicy_Handler, + }, + { + MethodName: "CreateAlertPolicy", + Handler: _AlertPolicyService_CreateAlertPolicy_Handler, + }, + { + MethodName: "DeleteAlertPolicy", + Handler: _AlertPolicyService_DeleteAlertPolicy_Handler, + }, + { + MethodName: "UpdateAlertPolicy", + Handler: _AlertPolicyService_UpdateAlertPolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/alert_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go index 81b8c8f5..d6d2047b 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/common.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - distribution "google.golang.org/genproto/googleapis/api/distribution" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go index 0c3ac5a1..b9161423 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go @@ -15,17 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/dropped_labels.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go index c35046ac..6cb42d29 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/group.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go index fbdf9ef5..a0552019 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/group_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" ) const ( @@ -929,277 +924,3 @@ func file_google_monitoring_v3_group_service_proto_init() { file_google_monitoring_v3_group_service_proto_goTypes = nil file_google_monitoring_v3_group_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// GroupServiceClient is the client API for GroupService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GroupServiceClient interface { - // Lists the existing groups. - ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) - // Gets a single group. - GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Creates a new group. - CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Updates an existing group. - // You can change any group attributes except `name`. - UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Deletes an existing group. - DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Lists the monitored resources that are members of a group. - ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) -} - -type groupServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { - return &groupServiceClient{cc} -} - -func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { - out := new(ListGroupsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/GetGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/CreateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/UpdateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/DeleteGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) { - out := new(ListGroupMembersResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroupMembers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GroupServiceServer is the server API for GroupService service. -type GroupServiceServer interface { - // Lists the existing groups. - ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) - // Gets a single group. - GetGroup(context.Context, *GetGroupRequest) (*Group, error) - // Creates a new group. - CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) - // Updates an existing group. - // You can change any group attributes except `name`. - UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) - // Deletes an existing group. - DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) - // Lists the monitored resources that are members of a group. - ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) -} - -// UnimplementedGroupServiceServer can be embedded to have forward compatible implementations. -type UnimplementedGroupServiceServer struct { -} - -func (*UnimplementedGroupServiceServer) ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented") -} -func (*UnimplementedGroupServiceServer) GetGroup(context.Context, *GetGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") -} -func (*UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") -} -func (*UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") -} -func (*UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") -} -func (*UnimplementedGroupServiceServer) ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListGroupMembers not implemented") -} - -func RegisterGroupServiceServer(s *grpc.Server, srv GroupServiceServer) { - s.RegisterService(&_GroupService_serviceDesc, srv) -} - -func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListGroupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).ListGroups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/ListGroups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).GetGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/GetGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).CreateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/CreateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).UpdateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/UpdateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).DeleteGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/DeleteGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_ListGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListGroupMembersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).ListGroupMembers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/ListGroupMembers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).ListGroupMembers(ctx, req.(*ListGroupMembersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _GroupService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.GroupService", - HandlerType: (*GroupServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListGroups", - Handler: _GroupService_ListGroups_Handler, - }, - { - MethodName: "GetGroup", - Handler: _GroupService_GetGroup_Handler, - }, - { - MethodName: "CreateGroup", - Handler: _GroupService_CreateGroup_Handler, - }, - { - MethodName: "UpdateGroup", - Handler: _GroupService_UpdateGroup_Handler, - }, - { - MethodName: "DeleteGroup", - Handler: _GroupService_DeleteGroup_Handler, - }, - { - MethodName: "ListGroupMembers", - Handler: _GroupService_ListGroupMembers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/group_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go new file mode 100644 index 00000000..2828587e --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go @@ -0,0 +1,321 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/group_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + GroupService_ListGroups_FullMethodName = "/google.monitoring.v3.GroupService/ListGroups" + GroupService_GetGroup_FullMethodName = "/google.monitoring.v3.GroupService/GetGroup" + GroupService_CreateGroup_FullMethodName = "/google.monitoring.v3.GroupService/CreateGroup" + GroupService_UpdateGroup_FullMethodName = "/google.monitoring.v3.GroupService/UpdateGroup" + GroupService_DeleteGroup_FullMethodName = "/google.monitoring.v3.GroupService/DeleteGroup" + GroupService_ListGroupMembers_FullMethodName = "/google.monitoring.v3.GroupService/ListGroupMembers" +) + +// GroupServiceClient is the client API for GroupService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GroupServiceClient interface { + // Lists the existing groups. + ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Creates a new group. + CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Deletes an existing group. + DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) +} + +type groupServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { + return &groupServiceClient{cc} +} + +func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { + out := new(ListGroupsResponse) + err := c.cc.Invoke(ctx, GroupService_ListGroups_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_GetGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_CreateGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_UpdateGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, GroupService_DeleteGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) { + out := new(ListGroupMembersResponse) + err := c.cc.Invoke(ctx, GroupService_ListGroupMembers_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GroupServiceServer is the server API for GroupService service. +// All implementations should embed UnimplementedGroupServiceServer +// for forward compatibility +type GroupServiceServer interface { + // Lists the existing groups. + ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(context.Context, *GetGroupRequest) (*Group, error) + // Creates a new group. + CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) + // Deletes an existing group. + DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) +} + +// UnimplementedGroupServiceServer should be embedded to have forward compatible implementations. +type UnimplementedGroupServiceServer struct { +} + +func (UnimplementedGroupServiceServer) ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented") +} +func (UnimplementedGroupServiceServer) GetGroup(context.Context, *GetGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") +} +func (UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") +} +func (UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") +} +func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") +} +func (UnimplementedGroupServiceServer) ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroupMembers not implemented") +} + +// UnsafeGroupServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GroupServiceServer will +// result in compilation errors. +type UnsafeGroupServiceServer interface { + mustEmbedUnimplementedGroupServiceServer() +} + +func RegisterGroupServiceServer(s grpc.ServiceRegistrar, srv GroupServiceServer) { + s.RegisterService(&GroupService_ServiceDesc, srv) +} + +func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_ListGroups_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_GetGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).CreateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_CreateGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_UpdateGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_DeleteGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_ListGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupMembersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroupMembers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_ListGroupMembers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroupMembers(ctx, req.(*ListGroupMembersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// GroupService_ServiceDesc is the grpc.ServiceDesc for GroupService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var GroupService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.GroupService", + HandlerType: (*GroupServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListGroups", + Handler: _GroupService_ListGroups_Handler, + }, + { + MethodName: "GetGroup", + Handler: _GroupService_GetGroup_Handler, + }, + { + MethodName: "CreateGroup", + Handler: _GroupService_CreateGroup_Handler, + }, + { + MethodName: "UpdateGroup", + Handler: _GroupService_UpdateGroup_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _GroupService_DeleteGroup_Handler, + }, + { + MethodName: "ListGroupMembers", + Handler: _GroupService_ListGroupMembers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/group_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go index ae7eea5b..7aefb0a5 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/metric.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - label "google.golang.org/genproto/googleapis/api/label" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go index 39b95952..d4067d85 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go @@ -15,26 +15,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/metric_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" status "google.golang.org/genproto/googleapis/rpc/status" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status1 "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" ) const ( @@ -1863,431 +1858,3 @@ func file_google_monitoring_v3_metric_service_proto_init() { file_google_monitoring_v3_metric_service_proto_goTypes = nil file_google_monitoring_v3_metric_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// MetricServiceClient is the client API for MetricService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetricServiceClient interface { - // Lists monitored resource descriptors that match a filter. - ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) - // Gets a single monitored resource descriptor. - GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) - // Lists metric descriptors that match a filter. - ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) - // Gets a single metric descriptor. - GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) - // Creates a new metric descriptor. - // The creation is executed asynchronously. - // User-created metric descriptors define - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - // The metric descriptor is updated if it already exists, - // except that metric labels are never removed. - CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) - // Deletes a metric descriptor. Only user-created - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - // deleted. - DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Lists time series that match a filter. - ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) - // Creates or adds data to one or more time series. - // The response is empty if all time series in the request were written. - // If any time series could not be written, a corresponding failure message is - // included in the error response. - // This method does not support - // [resource locations constraint of an organization - // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Creates or adds data to one or more service time series. A service time - // series is a time series for a metric from a Google Cloud service. The - // response is empty if all time series in the request were written. If any - // time series could not be written, a corresponding failure message is - // included in the error response. This endpoint rejects writes to - // user-defined metrics. - // This method is only for use by Google Cloud services. Use - // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - // instead. - CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type metricServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewMetricServiceClient(cc grpc.ClientConnInterface) MetricServiceClient { - return &metricServiceClient{cc} -} - -func (c *metricServiceClient) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { - out := new(ListMonitoredResourceDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) { - out := new(monitoredres.MonitoredResourceDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) { - out := new(ListMetricDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMetricDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { - out := new(metric.MetricDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { - out := new(metric.MetricDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) { - out := new(ListTimeSeriesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateServiceTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MetricServiceServer is the server API for MetricService service. -type MetricServiceServer interface { - // Lists monitored resource descriptors that match a filter. - ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) - // Gets a single monitored resource descriptor. - GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) - // Lists metric descriptors that match a filter. - ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) - // Gets a single metric descriptor. - GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) - // Creates a new metric descriptor. - // The creation is executed asynchronously. - // User-created metric descriptors define - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - // The metric descriptor is updated if it already exists, - // except that metric labels are never removed. - CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) - // Deletes a metric descriptor. Only user-created - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - // deleted. - DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) - // Lists time series that match a filter. - ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) - // Creates or adds data to one or more time series. - // The response is empty if all time series in the request were written. - // If any time series could not be written, a corresponding failure message is - // included in the error response. - // This method does not support - // [resource locations constraint of an organization - // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) - // Creates or adds data to one or more service time series. A service time - // series is a time series for a metric from a Google Cloud service. The - // response is empty if all time series in the request were written. If any - // time series could not be written, a corresponding failure message is - // included in the error response. This endpoint rejects writes to - // user-defined metrics. - // This method is only for use by Google Cloud services. Use - // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - // instead. - CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) -} - -// UnimplementedMetricServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetricServiceServer struct { -} - -func (*UnimplementedMetricServiceServer) ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListMonitoredResourceDescriptors not implemented") -} -func (*UnimplementedMetricServiceServer) GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetMonitoredResourceDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListMetricDescriptors not implemented") -} -func (*UnimplementedMetricServiceServer) GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListTimeSeries not implemented") -} -func (*UnimplementedMetricServiceServer) CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateTimeSeries not implemented") -} -func (*UnimplementedMetricServiceServer) CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateServiceTimeSeries not implemented") -} - -func RegisterMetricServiceServer(s *grpc.Server, srv MetricServiceServer) { - s.RegisterService(&_MetricService_serviceDesc, srv) -} - -func _MetricService_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMonitoredResourceDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_GetMonitoredResourceDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMonitoredResourceDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, req.(*GetMonitoredResourceDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_ListMetricDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMetricDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListMetricDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListMetricDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListMetricDescriptors(ctx, req.(*ListMetricDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_GetMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).GetMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/GetMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).GetMetricDescriptor(ctx, req.(*GetMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, req.(*CreateMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_DeleteMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, req.(*DeleteMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_ListTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListTimeSeries(ctx, req.(*ListTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateServiceTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateServiceTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _MetricService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.MetricService", - HandlerType: (*MetricServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListMonitoredResourceDescriptors", - Handler: _MetricService_ListMonitoredResourceDescriptors_Handler, - }, - { - MethodName: "GetMonitoredResourceDescriptor", - Handler: _MetricService_GetMonitoredResourceDescriptor_Handler, - }, - { - MethodName: "ListMetricDescriptors", - Handler: _MetricService_ListMetricDescriptors_Handler, - }, - { - MethodName: "GetMetricDescriptor", - Handler: _MetricService_GetMetricDescriptor_Handler, - }, - { - MethodName: "CreateMetricDescriptor", - Handler: _MetricService_CreateMetricDescriptor_Handler, - }, - { - MethodName: "DeleteMetricDescriptor", - Handler: _MetricService_DeleteMetricDescriptor_Handler, - }, - { - MethodName: "ListTimeSeries", - Handler: _MetricService_ListTimeSeries_Handler, - }, - { - MethodName: "CreateTimeSeries", - Handler: _MetricService_CreateTimeSeries_Handler, - }, - { - MethodName: "CreateServiceTimeSeries", - Handler: _MetricService_CreateServiceTimeSeries_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/metric_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go new file mode 100644 index 00000000..b4a5478c --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go @@ -0,0 +1,480 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/metric_service.proto + +package monitoringpb + +import ( + context "context" + metric "google.golang.org/genproto/googleapis/api/metric" + monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MetricService_ListMonitoredResourceDescriptors_FullMethodName = "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors" + MetricService_GetMonitoredResourceDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor" + MetricService_ListMetricDescriptors_FullMethodName = "/google.monitoring.v3.MetricService/ListMetricDescriptors" + MetricService_GetMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/GetMetricDescriptor" + MetricService_CreateMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/CreateMetricDescriptor" + MetricService_DeleteMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/DeleteMetricDescriptor" + MetricService_ListTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/ListTimeSeries" + MetricService_CreateTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/CreateTimeSeries" + MetricService_CreateServiceTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/CreateServiceTimeSeries" +) + +// MetricServiceClient is the client API for MetricService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MetricServiceClient interface { + // Lists monitored resource descriptors that match a filter. + ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. + GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. + ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. + GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) + // Creates a new metric descriptor. + // The creation is executed asynchronously. + // User-created metric descriptors define + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + // The metric descriptor is updated if it already exists, + // except that metric labels are never removed. + CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + // deleted. + DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists time series that match a filter. + ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + // This method does not support + // [resource locations constraint of an organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Creates or adds data to one or more service time series. A service time + // series is a time series for a metric from a Google Cloud service. The + // response is empty if all time series in the request were written. If any + // time series could not be written, a corresponding failure message is + // included in the error response. This endpoint rejects writes to + // user-defined metrics. + // This method is only for use by Google Cloud services. Use + // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + // instead. + CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type metricServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMetricServiceClient(cc grpc.ClientConnInterface) MetricServiceClient { + return &metricServiceClient{cc} +} + +func (c *metricServiceClient) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { + out := new(ListMonitoredResourceDescriptorsResponse) + err := c.cc.Invoke(ctx, MetricService_ListMonitoredResourceDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) { + out := new(monitoredres.MonitoredResourceDescriptor) + err := c.cc.Invoke(ctx, MetricService_GetMonitoredResourceDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) { + out := new(ListMetricDescriptorsResponse) + err := c.cc.Invoke(ctx, MetricService_ListMetricDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { + out := new(metric.MetricDescriptor) + err := c.cc.Invoke(ctx, MetricService_GetMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { + out := new(metric.MetricDescriptor) + err := c.cc.Invoke(ctx, MetricService_CreateMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_DeleteMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) { + out := new(ListTimeSeriesResponse) + err := c.cc.Invoke(ctx, MetricService_ListTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_CreateTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_CreateServiceTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetricServiceServer is the server API for MetricService service. +// All implementations should embed UnimplementedMetricServiceServer +// for forward compatibility +type MetricServiceServer interface { + // Lists monitored resource descriptors that match a filter. + ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. + GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. + ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. + GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) + // Creates a new metric descriptor. + // The creation is executed asynchronously. + // User-created metric descriptors define + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + // The metric descriptor is updated if it already exists, + // except that metric labels are never removed. + CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + // deleted. + DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) + // Lists time series that match a filter. + ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + // This method does not support + // [resource locations constraint of an organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) + // Creates or adds data to one or more service time series. A service time + // series is a time series for a metric from a Google Cloud service. The + // response is empty if all time series in the request were written. If any + // time series could not be written, a corresponding failure message is + // included in the error response. This endpoint rejects writes to + // user-defined metrics. + // This method is only for use by Google Cloud services. Use + // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + // instead. + CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) +} + +// UnimplementedMetricServiceServer should be embedded to have forward compatible implementations. +type UnimplementedMetricServiceServer struct { +} + +func (UnimplementedMetricServiceServer) ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMonitoredResourceDescriptors not implemented") +} +func (UnimplementedMetricServiceServer) GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMonitoredResourceDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMetricDescriptors not implemented") +} +func (UnimplementedMetricServiceServer) GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTimeSeries not implemented") +} +func (UnimplementedMetricServiceServer) CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateTimeSeries not implemented") +} +func (UnimplementedMetricServiceServer) CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateServiceTimeSeries not implemented") +} + +// UnsafeMetricServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MetricServiceServer will +// result in compilation errors. +type UnsafeMetricServiceServer interface { + mustEmbedUnimplementedMetricServiceServer() +} + +func RegisterMetricServiceServer(s grpc.ServiceRegistrar, srv MetricServiceServer) { + s.RegisterService(&MetricService_ServiceDesc, srv) +} + +func _MetricService_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMonitoredResourceDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListMonitoredResourceDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMonitoredResourceDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMonitoredResourceDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_GetMonitoredResourceDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, req.(*GetMonitoredResourceDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListMetricDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMetricDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListMetricDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, req.(*ListMetricDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_GetMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, req.(*GetMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, req.(*CreateMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_DeleteMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_DeleteMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, req.(*DeleteMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListTimeSeries(ctx, req.(*ListTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateServiceTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateServiceTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MetricService_ServiceDesc is the grpc.ServiceDesc for MetricService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MetricService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.MetricService", + HandlerType: (*MetricServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListMonitoredResourceDescriptors", + Handler: _MetricService_ListMonitoredResourceDescriptors_Handler, + }, + { + MethodName: "GetMonitoredResourceDescriptor", + Handler: _MetricService_GetMonitoredResourceDescriptor_Handler, + }, + { + MethodName: "ListMetricDescriptors", + Handler: _MetricService_ListMetricDescriptors_Handler, + }, + { + MethodName: "GetMetricDescriptor", + Handler: _MetricService_GetMetricDescriptor_Handler, + }, + { + MethodName: "CreateMetricDescriptor", + Handler: _MetricService_CreateMetricDescriptor_Handler, + }, + { + MethodName: "DeleteMetricDescriptor", + Handler: _MetricService_DeleteMetricDescriptor_Handler, + }, + { + MethodName: "ListTimeSeries", + Handler: _MetricService_ListTimeSeries_Handler, + }, + { + MethodName: "CreateTimeSeries", + Handler: _MetricService_CreateTimeSeries_Handler, + }, + { + MethodName: "CreateServiceTimeSeries", + Handler: _MetricService_CreateServiceTimeSeries_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/metric_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go index e03d89ef..82010196 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/mutation_record.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go index 0d5cacbe..b2f0806e 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go @@ -15,21 +15,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/notification.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - api "google.golang.org/genproto/googleapis/api" _ "google.golang.org/genproto/googleapis/api/annotations" label "google.golang.org/genproto/googleapis/api/label" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go index fd023003..1270600b 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go @@ -15,25 +15,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/notification_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -1297,523 +1292,3 @@ func file_google_monitoring_v3_notification_service_proto_init() { file_google_monitoring_v3_notification_service_proto_goTypes = nil file_google_monitoring_v3_notification_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// NotificationChannelServiceClient is the client API for NotificationChannelService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NotificationChannelServiceClient interface { - // Lists the descriptors for supported channel types. The use of descriptors - // makes it possible for new channel types to be dynamically added. - ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) - // Gets a single channel descriptor. The descriptor indicates which fields - // are expected / permitted for a notification channel of the given type. - GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) - // Lists the notification channels that have been created for the project. - // To list the types of notification channels that are supported, use - // the `ListNotificationChannelDescriptors` method. - ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) - // Gets a single notification channel. The channel includes the relevant - // configuration details with which the channel was created. However, the - // response may truncate or omit passwords, API keys, or other private key - // matter and thus the response may not be 100% identical to the information - // that was supplied in the call to the create method. - GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Creates a new notification channel, representing a single notification - // endpoint such as an email address, SMS number, or PagerDuty service. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Updates a notification channel. Fields not specified in the field mask - // remain unchanged. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Deletes a notification channel. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Causes a verification code to be delivered to the channel. The code - // can then be supplied in `VerifyNotificationChannel` to verify the channel. - SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Requests a verification code for an already verified channel that can then - // be used in a call to VerifyNotificationChannel() on a different channel - // with an equivalent identity in the same or in a different project. This - // makes it possible to copy a channel between projects without requiring - // manual reverification of the channel. If the channel is not in the - // verified state, this method will fail (in other words, this may only be - // used if the SendNotificationChannelVerificationCode and - // VerifyNotificationChannel paths have already been used to put the given - // channel into the verified state). - // - // There is no guarantee that the verification codes returned by this method - // will be of a similar structure or form as the ones that are delivered - // to the channel via SendNotificationChannelVerificationCode; while - // VerifyNotificationChannel() will recognize both the codes delivered via - // SendNotificationChannelVerificationCode() and returned from - // GetNotificationChannelVerificationCode(), it is typically the case that - // the verification codes delivered via - // SendNotificationChannelVerificationCode() will be shorter and also - // have a shorter expiration (e.g. codes such as "G-123456") whereas - // GetVerificationCode() will typically return a much longer, websafe base - // 64 encoded string that has a longer expiration time. - GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) - // Verifies a `NotificationChannel` by proving receipt of the code - // delivered to the channel as a result of calling - // `SendNotificationChannelVerificationCode`. - VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) -} - -type notificationChannelServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNotificationChannelServiceClient(cc grpc.ClientConnInterface) NotificationChannelServiceClient { - return ¬ificationChannelServiceClient{cc} -} - -func (c *notificationChannelServiceClient) ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) { - out := new(ListNotificationChannelDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) { - out := new(NotificationChannelDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) { - out := new(ListNotificationChannelsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) { - out := new(GetNotificationChannelVerificationCodeResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NotificationChannelServiceServer is the server API for NotificationChannelService service. -type NotificationChannelServiceServer interface { - // Lists the descriptors for supported channel types. The use of descriptors - // makes it possible for new channel types to be dynamically added. - ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) - // Gets a single channel descriptor. The descriptor indicates which fields - // are expected / permitted for a notification channel of the given type. - GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) - // Lists the notification channels that have been created for the project. - // To list the types of notification channels that are supported, use - // the `ListNotificationChannelDescriptors` method. - ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) - // Gets a single notification channel. The channel includes the relevant - // configuration details with which the channel was created. However, the - // response may truncate or omit passwords, API keys, or other private key - // matter and thus the response may not be 100% identical to the information - // that was supplied in the call to the create method. - GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) - // Creates a new notification channel, representing a single notification - // endpoint such as an email address, SMS number, or PagerDuty service. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) - // Updates a notification channel. Fields not specified in the field mask - // remain unchanged. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) - // Deletes a notification channel. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) - // Causes a verification code to be delivered to the channel. The code - // can then be supplied in `VerifyNotificationChannel` to verify the channel. - SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) - // Requests a verification code for an already verified channel that can then - // be used in a call to VerifyNotificationChannel() on a different channel - // with an equivalent identity in the same or in a different project. This - // makes it possible to copy a channel between projects without requiring - // manual reverification of the channel. If the channel is not in the - // verified state, this method will fail (in other words, this may only be - // used if the SendNotificationChannelVerificationCode and - // VerifyNotificationChannel paths have already been used to put the given - // channel into the verified state). - // - // There is no guarantee that the verification codes returned by this method - // will be of a similar structure or form as the ones that are delivered - // to the channel via SendNotificationChannelVerificationCode; while - // VerifyNotificationChannel() will recognize both the codes delivered via - // SendNotificationChannelVerificationCode() and returned from - // GetNotificationChannelVerificationCode(), it is typically the case that - // the verification codes delivered via - // SendNotificationChannelVerificationCode() will be shorter and also - // have a shorter expiration (e.g. codes such as "G-123456") whereas - // GetVerificationCode() will typically return a much longer, websafe base - // 64 encoded string that has a longer expiration time. - GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) - // Verifies a `NotificationChannel` by proving receipt of the code - // delivered to the channel as a result of calling - // `SendNotificationChannelVerificationCode`. - VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) -} - -// UnimplementedNotificationChannelServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNotificationChannelServiceServer struct { -} - -func (*UnimplementedNotificationChannelServiceServer) ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannelDescriptors not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelDescriptor not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannels not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendNotificationChannelVerificationCode not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelVerificationCode not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyNotificationChannel not implemented") -} - -func RegisterNotificationChannelServiceServer(s *grpc.Server, srv NotificationChannelServiceServer) { - s.RegisterService(&_NotificationChannelService_serviceDesc, srv) -} - -func _NotificationChannelService_ListNotificationChannelDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNotificationChannelDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, req.(*ListNotificationChannelDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannelDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, req.(*GetNotificationChannelDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_ListNotificationChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNotificationChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, req.(*ListNotificationChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, req.(*GetNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_CreateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, req.(*CreateNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_UpdateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, req.(*UpdateNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_DeleteNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, req.(*DeleteNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_SendNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendNotificationChannelVerificationCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, req.(*SendNotificationChannelVerificationCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelVerificationCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, req.(*GetNotificationChannelVerificationCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_VerifyNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, req.(*VerifyNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NotificationChannelService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.NotificationChannelService", - HandlerType: (*NotificationChannelServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListNotificationChannelDescriptors", - Handler: _NotificationChannelService_ListNotificationChannelDescriptors_Handler, - }, - { - MethodName: "GetNotificationChannelDescriptor", - Handler: _NotificationChannelService_GetNotificationChannelDescriptor_Handler, - }, - { - MethodName: "ListNotificationChannels", - Handler: _NotificationChannelService_ListNotificationChannels_Handler, - }, - { - MethodName: "GetNotificationChannel", - Handler: _NotificationChannelService_GetNotificationChannel_Handler, - }, - { - MethodName: "CreateNotificationChannel", - Handler: _NotificationChannelService_CreateNotificationChannel_Handler, - }, - { - MethodName: "UpdateNotificationChannel", - Handler: _NotificationChannelService_UpdateNotificationChannel_Handler, - }, - { - MethodName: "DeleteNotificationChannel", - Handler: _NotificationChannelService_DeleteNotificationChannel_Handler, - }, - { - MethodName: "SendNotificationChannelVerificationCode", - Handler: _NotificationChannelService_SendNotificationChannelVerificationCode_Handler, - }, - { - MethodName: "GetNotificationChannelVerificationCode", - Handler: _NotificationChannelService_GetNotificationChannelVerificationCode_Handler, - }, - { - MethodName: "VerifyNotificationChannel", - Handler: _NotificationChannelService_VerifyNotificationChannel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/notification_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go new file mode 100644 index 00000000..ec5c2fe1 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go @@ -0,0 +1,571 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/notification_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName = "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors" + NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor" + NotificationChannelService_ListNotificationChannels_FullMethodName = "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels" + NotificationChannelService_GetNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel" + NotificationChannelService_CreateNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel" + NotificationChannelService_UpdateNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel" + NotificationChannelService_DeleteNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel" + NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName = "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode" + NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode" + NotificationChannelService_VerifyNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel" +) + +// NotificationChannelServiceClient is the client API for NotificationChannelService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NotificationChannelServiceClient interface { + // Lists the descriptors for supported channel types. The use of descriptors + // makes it possible for new channel types to be dynamically added. + ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) + // Gets a single channel descriptor. The descriptor indicates which fields + // are expected / permitted for a notification channel of the given type. + GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) + // Lists the notification channels that have been created for the project. + // To list the types of notification channels that are supported, use + // the `ListNotificationChannelDescriptors` method. + ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) + // Gets a single notification channel. The channel includes the relevant + // configuration details with which the channel was created. However, the + // response may truncate or omit passwords, API keys, or other private key + // matter and thus the response may not be 100% identical to the information + // that was supplied in the call to the create method. + GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Creates a new notification channel, representing a single notification + // endpoint such as an email address, SMS number, or PagerDuty service. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Updates a notification channel. Fields not specified in the field mask + // remain unchanged. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Deletes a notification channel. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Causes a verification code to be delivered to the channel. The code + // can then be supplied in `VerifyNotificationChannel` to verify the channel. + SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Requests a verification code for an already verified channel that can then + // be used in a call to VerifyNotificationChannel() on a different channel + // with an equivalent identity in the same or in a different project. This + // makes it possible to copy a channel between projects without requiring + // manual reverification of the channel. If the channel is not in the + // verified state, this method will fail (in other words, this may only be + // used if the SendNotificationChannelVerificationCode and + // VerifyNotificationChannel paths have already been used to put the given + // channel into the verified state). + // + // There is no guarantee that the verification codes returned by this method + // will be of a similar structure or form as the ones that are delivered + // to the channel via SendNotificationChannelVerificationCode; while + // VerifyNotificationChannel() will recognize both the codes delivered via + // SendNotificationChannelVerificationCode() and returned from + // GetNotificationChannelVerificationCode(), it is typically the case that + // the verification codes delivered via + // SendNotificationChannelVerificationCode() will be shorter and also + // have a shorter expiration (e.g. codes such as "G-123456") whereas + // GetVerificationCode() will typically return a much longer, websafe base + // 64 encoded string that has a longer expiration time. + GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) + // Verifies a `NotificationChannel` by proving receipt of the code + // delivered to the channel as a result of calling + // `SendNotificationChannelVerificationCode`. + VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) +} + +type notificationChannelServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNotificationChannelServiceClient(cc grpc.ClientConnInterface) NotificationChannelServiceClient { + return ¬ificationChannelServiceClient{cc} +} + +func (c *notificationChannelServiceClient) ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) { + out := new(ListNotificationChannelDescriptorsResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) { + out := new(NotificationChannelDescriptor) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) { + out := new(ListNotificationChannelsResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_ListNotificationChannels_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_CreateNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_UpdateNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, NotificationChannelService_DeleteNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) { + out := new(GetNotificationChannelVerificationCodeResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_VerifyNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NotificationChannelServiceServer is the server API for NotificationChannelService service. +// All implementations should embed UnimplementedNotificationChannelServiceServer +// for forward compatibility +type NotificationChannelServiceServer interface { + // Lists the descriptors for supported channel types. The use of descriptors + // makes it possible for new channel types to be dynamically added. + ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) + // Gets a single channel descriptor. The descriptor indicates which fields + // are expected / permitted for a notification channel of the given type. + GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) + // Lists the notification channels that have been created for the project. + // To list the types of notification channels that are supported, use + // the `ListNotificationChannelDescriptors` method. + ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) + // Gets a single notification channel. The channel includes the relevant + // configuration details with which the channel was created. However, the + // response may truncate or omit passwords, API keys, or other private key + // matter and thus the response may not be 100% identical to the information + // that was supplied in the call to the create method. + GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) + // Creates a new notification channel, representing a single notification + // endpoint such as an email address, SMS number, or PagerDuty service. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) + // Updates a notification channel. Fields not specified in the field mask + // remain unchanged. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) + // Deletes a notification channel. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) + // Causes a verification code to be delivered to the channel. The code + // can then be supplied in `VerifyNotificationChannel` to verify the channel. + SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) + // Requests a verification code for an already verified channel that can then + // be used in a call to VerifyNotificationChannel() on a different channel + // with an equivalent identity in the same or in a different project. This + // makes it possible to copy a channel between projects without requiring + // manual reverification of the channel. If the channel is not in the + // verified state, this method will fail (in other words, this may only be + // used if the SendNotificationChannelVerificationCode and + // VerifyNotificationChannel paths have already been used to put the given + // channel into the verified state). + // + // There is no guarantee that the verification codes returned by this method + // will be of a similar structure or form as the ones that are delivered + // to the channel via SendNotificationChannelVerificationCode; while + // VerifyNotificationChannel() will recognize both the codes delivered via + // SendNotificationChannelVerificationCode() and returned from + // GetNotificationChannelVerificationCode(), it is typically the case that + // the verification codes delivered via + // SendNotificationChannelVerificationCode() will be shorter and also + // have a shorter expiration (e.g. codes such as "G-123456") whereas + // GetVerificationCode() will typically return a much longer, websafe base + // 64 encoded string that has a longer expiration time. + GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) + // Verifies a `NotificationChannel` by proving receipt of the code + // delivered to the channel as a result of calling + // `SendNotificationChannelVerificationCode`. + VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) +} + +// UnimplementedNotificationChannelServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNotificationChannelServiceServer struct { +} + +func (UnimplementedNotificationChannelServiceServer) ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannelDescriptors not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelDescriptor not implemented") +} +func (UnimplementedNotificationChannelServiceServer) ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannels not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendNotificationChannelVerificationCode not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelVerificationCode not implemented") +} +func (UnimplementedNotificationChannelServiceServer) VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyNotificationChannel not implemented") +} + +// UnsafeNotificationChannelServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NotificationChannelServiceServer will +// result in compilation errors. +type UnsafeNotificationChannelServiceServer interface { + mustEmbedUnimplementedNotificationChannelServiceServer() +} + +func RegisterNotificationChannelServiceServer(s grpc.ServiceRegistrar, srv NotificationChannelServiceServer) { + s.RegisterService(&NotificationChannelService_ServiceDesc, srv) +} + +func _NotificationChannelService_ListNotificationChannelDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNotificationChannelDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, req.(*ListNotificationChannelDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannelDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, req.(*GetNotificationChannelDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_ListNotificationChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNotificationChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_ListNotificationChannels_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, req.(*ListNotificationChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, req.(*GetNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_CreateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_CreateNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, req.(*CreateNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_UpdateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_UpdateNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, req.(*UpdateNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_DeleteNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_DeleteNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, req.(*DeleteNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_SendNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendNotificationChannelVerificationCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, req.(*SendNotificationChannelVerificationCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelVerificationCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, req.(*GetNotificationChannelVerificationCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_VerifyNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_VerifyNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, req.(*VerifyNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NotificationChannelService_ServiceDesc is the grpc.ServiceDesc for NotificationChannelService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NotificationChannelService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.NotificationChannelService", + HandlerType: (*NotificationChannelServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListNotificationChannelDescriptors", + Handler: _NotificationChannelService_ListNotificationChannelDescriptors_Handler, + }, + { + MethodName: "GetNotificationChannelDescriptor", + Handler: _NotificationChannelService_GetNotificationChannelDescriptor_Handler, + }, + { + MethodName: "ListNotificationChannels", + Handler: _NotificationChannelService_ListNotificationChannels_Handler, + }, + { + MethodName: "GetNotificationChannel", + Handler: _NotificationChannelService_GetNotificationChannel_Handler, + }, + { + MethodName: "CreateNotificationChannel", + Handler: _NotificationChannelService_CreateNotificationChannel_Handler, + }, + { + MethodName: "UpdateNotificationChannel", + Handler: _NotificationChannelService_UpdateNotificationChannel_Handler, + }, + { + MethodName: "DeleteNotificationChannel", + Handler: _NotificationChannelService_DeleteNotificationChannel_Handler, + }, + { + MethodName: "SendNotificationChannelVerificationCode", + Handler: _NotificationChannelService_SendNotificationChannelVerificationCode_Handler, + }, + { + MethodName: "GetNotificationChannelVerificationCode", + Handler: _NotificationChannelService_GetNotificationChannelVerificationCode_Handler, + }, + { + MethodName: "VerifyNotificationChannel", + Handler: _NotificationChannelService_VerifyNotificationChannel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/notification_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go index 6402f18c..63741c4b 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go @@ -15,21 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/query_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) const ( @@ -128,94 +123,3 @@ func file_google_monitoring_v3_query_service_proto_init() { file_google_monitoring_v3_query_service_proto_goTypes = nil file_google_monitoring_v3_query_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// QueryServiceClient is the client API for QueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryServiceClient interface { - // Deprecated: Do not use. - // Queries time series by using Monitoring Query Language (MQL). We recommend - // using PromQL instead of MQL. For more information about the status of MQL, - // see the [MQL deprecation - // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). - QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) -} - -type queryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryServiceClient(cc grpc.ClientConnInterface) QueryServiceClient { - return &queryServiceClient{cc} -} - -// Deprecated: Do not use. -func (c *queryServiceClient) QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) { - out := new(QueryTimeSeriesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.QueryService/QueryTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServiceServer is the server API for QueryService service. -type QueryServiceServer interface { - // Deprecated: Do not use. - // Queries time series by using Monitoring Query Language (MQL). We recommend - // using PromQL instead of MQL. For more information about the status of MQL, - // see the [MQL deprecation - // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). - QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) -} - -// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServiceServer struct { -} - -func (*UnimplementedQueryServiceServer) QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryTimeSeries not implemented") -} - -func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { - s.RegisterService(&_QueryService_serviceDesc, srv) -} - -func _QueryService_QueryTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).QueryTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.QueryService/QueryTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).QueryTimeSeries(ctx, req.(*QueryTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _QueryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.QueryService", - HandlerType: (*QueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryTimeSeries", - Handler: _QueryService_QueryTimeSeries_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/query_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go new file mode 100644 index 00000000..40353395 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go @@ -0,0 +1,132 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/query_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + QueryService_QueryTimeSeries_FullMethodName = "/google.monitoring.v3.QueryService/QueryTimeSeries" +) + +// QueryServiceClient is the client API for QueryService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryServiceClient interface { + // Deprecated: Do not use. + // Queries time series by using Monitoring Query Language (MQL). We recommend + // using PromQL instead of MQL. For more information about the status of MQL, + // see the [MQL deprecation + // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). + QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) +} + +type queryServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryServiceClient(cc grpc.ClientConnInterface) QueryServiceClient { + return &queryServiceClient{cc} +} + +// Deprecated: Do not use. +func (c *queryServiceClient) QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) { + out := new(QueryTimeSeriesResponse) + err := c.cc.Invoke(ctx, QueryService_QueryTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServiceServer is the server API for QueryService service. +// All implementations should embed UnimplementedQueryServiceServer +// for forward compatibility +type QueryServiceServer interface { + // Deprecated: Do not use. + // Queries time series by using Monitoring Query Language (MQL). We recommend + // using PromQL instead of MQL. For more information about the status of MQL, + // see the [MQL deprecation + // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). + QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) +} + +// UnimplementedQueryServiceServer should be embedded to have forward compatible implementations. +type UnimplementedQueryServiceServer struct { +} + +func (UnimplementedQueryServiceServer) QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryTimeSeries not implemented") +} + +// UnsafeQueryServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServiceServer will +// result in compilation errors. +type UnsafeQueryServiceServer interface { + mustEmbedUnimplementedQueryServiceServer() +} + +func RegisterQueryServiceServer(s grpc.ServiceRegistrar, srv QueryServiceServer) { + s.RegisterService(&QueryService_ServiceDesc, srv) +} + +func _QueryService_QueryTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServiceServer).QueryTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QueryService_QueryTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServiceServer).QueryTimeSeries(ctx, req.(*QueryTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// QueryService_ServiceDesc is the grpc.ServiceDesc for QueryService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var QueryService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.QueryService", + HandlerType: (*QueryServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryTimeSeries", + Handler: _QueryService_QueryTimeSeries_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/query_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go index a9d2ae8c..07a209ac 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/service.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" calendarperiod "google.golang.org/genproto/googleapis/type/calendarperiod" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go index 08c2e08e..f08dfe56 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/service_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -1200,427 +1195,3 @@ func file_google_monitoring_v3_service_service_proto_init() { file_google_monitoring_v3_service_service_proto_goTypes = nil file_google_monitoring_v3_service_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ServiceMonitoringServiceClient is the client API for ServiceMonitoringService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServiceMonitoringServiceClient interface { - // Create a `Service`. - CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) - // Get the named `Service`. - GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) - // List `Service`s for this Metrics Scope. - ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) - // Update this `Service`. - UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) - // Soft delete this `Service`. - DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Create a `ServiceLevelObjective` for the given `Service`. - CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // Get a `ServiceLevelObjective` by name. - GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // List the `ServiceLevelObjective`s for the given `Service`. - ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) - // Update the given `ServiceLevelObjective`. - UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // Delete the given `ServiceLevelObjective`. - DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type serviceMonitoringServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServiceMonitoringServiceClient(cc grpc.ClientConnInterface) ServiceMonitoringServiceClient { - return &serviceMonitoringServiceClient{cc} -} - -func (c *serviceMonitoringServiceClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/CreateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/GetService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { - out := new(ListServicesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/ListServices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/UpdateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/DeleteService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) { - out := new(ListServiceLevelObjectivesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceMonitoringServiceServer is the server API for ServiceMonitoringService service. -type ServiceMonitoringServiceServer interface { - // Create a `Service`. - CreateService(context.Context, *CreateServiceRequest) (*Service, error) - // Get the named `Service`. - GetService(context.Context, *GetServiceRequest) (*Service, error) - // List `Service`s for this Metrics Scope. - ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) - // Update this `Service`. - UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) - // Soft delete this `Service`. - DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) - // Create a `ServiceLevelObjective` for the given `Service`. - CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // Get a `ServiceLevelObjective` by name. - GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // List the `ServiceLevelObjective`s for the given `Service`. - ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) - // Update the given `ServiceLevelObjective`. - UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // Delete the given `ServiceLevelObjective`. - DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) -} - -// UnimplementedServiceMonitoringServiceServer can be embedded to have forward compatible implementations. -type UnimplementedServiceMonitoringServiceServer struct { -} - -func (*UnimplementedServiceMonitoringServiceServer) CreateService(context.Context, *CreateServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServiceLevelObjectives not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteServiceLevelObjective not implemented") -} - -func RegisterServiceMonitoringServiceServer(s *grpc.Server, srv ServiceMonitoringServiceServer) { - s.RegisterService(&_ServiceMonitoringService_serviceDesc, srv) -} - -func _ServiceMonitoringService_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).CreateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/CreateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).CreateService(ctx, req.(*CreateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).GetService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/GetService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).GetService(ctx, req.(*GetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).ListServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/ListServices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).ListServices(ctx, req.(*ListServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_UpdateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/UpdateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, req.(*UpdateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/DeleteService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, req.(*DeleteServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_CreateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, req.(*CreateServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_GetServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, req.(*GetServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_ListServiceLevelObjectives_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServiceLevelObjectivesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, req.(*ListServiceLevelObjectivesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_UpdateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, req.(*UpdateServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_DeleteServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, req.(*DeleteServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ServiceMonitoringService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.ServiceMonitoringService", - HandlerType: (*ServiceMonitoringServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateService", - Handler: _ServiceMonitoringService_CreateService_Handler, - }, - { - MethodName: "GetService", - Handler: _ServiceMonitoringService_GetService_Handler, - }, - { - MethodName: "ListServices", - Handler: _ServiceMonitoringService_ListServices_Handler, - }, - { - MethodName: "UpdateService", - Handler: _ServiceMonitoringService_UpdateService_Handler, - }, - { - MethodName: "DeleteService", - Handler: _ServiceMonitoringService_DeleteService_Handler, - }, - { - MethodName: "CreateServiceLevelObjective", - Handler: _ServiceMonitoringService_CreateServiceLevelObjective_Handler, - }, - { - MethodName: "GetServiceLevelObjective", - Handler: _ServiceMonitoringService_GetServiceLevelObjective_Handler, - }, - { - MethodName: "ListServiceLevelObjectives", - Handler: _ServiceMonitoringService_ListServiceLevelObjectives_Handler, - }, - { - MethodName: "UpdateServiceLevelObjective", - Handler: _ServiceMonitoringService_UpdateServiceLevelObjective_Handler, - }, - { - MethodName: "DeleteServiceLevelObjective", - Handler: _ServiceMonitoringService_DeleteServiceLevelObjective_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/service_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go new file mode 100644 index 00000000..bd7692b9 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go @@ -0,0 +1,475 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/service_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ServiceMonitoringService_CreateService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/CreateService" + ServiceMonitoringService_GetService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/GetService" + ServiceMonitoringService_ListServices_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/ListServices" + ServiceMonitoringService_UpdateService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/UpdateService" + ServiceMonitoringService_DeleteService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/DeleteService" + ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective" + ServiceMonitoringService_GetServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective" + ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives" + ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective" + ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective" +) + +// ServiceMonitoringServiceClient is the client API for ServiceMonitoringService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServiceMonitoringServiceClient interface { + // Create a `Service`. + CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) + // Get the named `Service`. + GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) + // List `Service`s for this Metrics Scope. + ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // Update this `Service`. + UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) + // Soft delete this `Service`. + DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Create a `ServiceLevelObjective` for the given `Service`. + CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // Get a `ServiceLevelObjective` by name. + GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // List the `ServiceLevelObjective`s for the given `Service`. + ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) + // Update the given `ServiceLevelObjective`. + UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // Delete the given `ServiceLevelObjective`. + DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type serviceMonitoringServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceMonitoringServiceClient(cc grpc.ClientConnInterface) ServiceMonitoringServiceClient { + return &serviceMonitoringServiceClient{cc} +} + +func (c *serviceMonitoringServiceClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_CreateService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_GetService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { + out := new(ListServicesResponse) + err := c.cc.Invoke(ctx, ServiceMonitoringService_ListServices_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_UpdateService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ServiceMonitoringService_DeleteService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_GetServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) { + out := new(ListServiceLevelObjectivesResponse) + err := c.cc.Invoke(ctx, ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceMonitoringServiceServer is the server API for ServiceMonitoringService service. +// All implementations should embed UnimplementedServiceMonitoringServiceServer +// for forward compatibility +type ServiceMonitoringServiceServer interface { + // Create a `Service`. + CreateService(context.Context, *CreateServiceRequest) (*Service, error) + // Get the named `Service`. + GetService(context.Context, *GetServiceRequest) (*Service, error) + // List `Service`s for this Metrics Scope. + ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // Update this `Service`. + UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) + // Soft delete this `Service`. + DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) + // Create a `ServiceLevelObjective` for the given `Service`. + CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // Get a `ServiceLevelObjective` by name. + GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // List the `ServiceLevelObjective`s for the given `Service`. + ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) + // Update the given `ServiceLevelObjective`. + UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // Delete the given `ServiceLevelObjective`. + DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) +} + +// UnimplementedServiceMonitoringServiceServer should be embedded to have forward compatible implementations. +type UnimplementedServiceMonitoringServiceServer struct { +} + +func (UnimplementedServiceMonitoringServiceServer) CreateService(context.Context, *CreateServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServiceLevelObjectives not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteServiceLevelObjective not implemented") +} + +// UnsafeServiceMonitoringServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceMonitoringServiceServer will +// result in compilation errors. +type UnsafeServiceMonitoringServiceServer interface { + mustEmbedUnimplementedServiceMonitoringServiceServer() +} + +func RegisterServiceMonitoringServiceServer(s grpc.ServiceRegistrar, srv ServiceMonitoringServiceServer) { + s.RegisterService(&ServiceMonitoringService_ServiceDesc, srv) +} + +func _ServiceMonitoringService_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).CreateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_CreateService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).CreateService(ctx, req.(*CreateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).GetService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_GetService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).GetService(ctx, req.(*GetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).ListServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_ListServices_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).ListServices(ctx, req.(*ListServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_UpdateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_UpdateService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, req.(*UpdateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_DeleteService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, req.(*DeleteServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_CreateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, req.(*CreateServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_GetServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_GetServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, req.(*GetServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_ListServiceLevelObjectives_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceLevelObjectivesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, req.(*ListServiceLevelObjectivesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_UpdateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, req.(*UpdateServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_DeleteServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, req.(*DeleteServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ServiceMonitoringService_ServiceDesc is the grpc.ServiceDesc for ServiceMonitoringService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ServiceMonitoringService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.ServiceMonitoringService", + HandlerType: (*ServiceMonitoringServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateService", + Handler: _ServiceMonitoringService_CreateService_Handler, + }, + { + MethodName: "GetService", + Handler: _ServiceMonitoringService_GetService_Handler, + }, + { + MethodName: "ListServices", + Handler: _ServiceMonitoringService_ListServices_Handler, + }, + { + MethodName: "UpdateService", + Handler: _ServiceMonitoringService_UpdateService_Handler, + }, + { + MethodName: "DeleteService", + Handler: _ServiceMonitoringService_DeleteService_Handler, + }, + { + MethodName: "CreateServiceLevelObjective", + Handler: _ServiceMonitoringService_CreateServiceLevelObjective_Handler, + }, + { + MethodName: "GetServiceLevelObjective", + Handler: _ServiceMonitoringService_GetServiceLevelObjective_Handler, + }, + { + MethodName: "ListServiceLevelObjectives", + Handler: _ServiceMonitoringService_ListServiceLevelObjectives_Handler, + }, + { + MethodName: "UpdateServiceLevelObjective", + Handler: _ServiceMonitoringService_UpdateServiceLevelObjective_Handler, + }, + { + MethodName: "DeleteServiceLevelObjective", + Handler: _ServiceMonitoringService_DeleteServiceLevelObjective_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/service_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go index 861e045f..39a2dc9f 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/snooze.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go index c562d60b..094ab0d0 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go @@ -15,23 +15,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/snooze_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -587,207 +582,3 @@ func file_google_monitoring_v3_snooze_service_proto_init() { file_google_monitoring_v3_snooze_service_proto_goTypes = nil file_google_monitoring_v3_snooze_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SnoozeServiceClient is the client API for SnoozeService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SnoozeServiceClient interface { - // Creates a `Snooze` that will prevent alerts, which match the provided - // criteria, from being opened. The `Snooze` applies for a specific time - // interval. - CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) - // Lists the `Snooze`s associated with a project. Can optionally pass in - // `filter`, which specifies predicates to match `Snooze`s. - ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) - // Retrieves a `Snooze` by `name`. - GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) - // Updates a `Snooze`, identified by its `name`, with the parameters in the - // given `Snooze` object. - UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) -} - -type snoozeServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSnoozeServiceClient(cc grpc.ClientConnInterface) SnoozeServiceClient { - return &snoozeServiceClient{cc} -} - -func (c *snoozeServiceClient) CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/CreateSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) { - out := new(ListSnoozesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/ListSnoozes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/GetSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/UpdateSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SnoozeServiceServer is the server API for SnoozeService service. -type SnoozeServiceServer interface { - // Creates a `Snooze` that will prevent alerts, which match the provided - // criteria, from being opened. The `Snooze` applies for a specific time - // interval. - CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) - // Lists the `Snooze`s associated with a project. Can optionally pass in - // `filter`, which specifies predicates to match `Snooze`s. - ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) - // Retrieves a `Snooze` by `name`. - GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) - // Updates a `Snooze`, identified by its `name`, with the parameters in the - // given `Snooze` object. - UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) -} - -// UnimplementedSnoozeServiceServer can be embedded to have forward compatible implementations. -type UnimplementedSnoozeServiceServer struct { -} - -func (*UnimplementedSnoozeServiceServer) CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSnooze not implemented") -} -func (*UnimplementedSnoozeServiceServer) ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnoozes not implemented") -} -func (*UnimplementedSnoozeServiceServer) GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSnooze not implemented") -} -func (*UnimplementedSnoozeServiceServer) UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateSnooze not implemented") -} - -func RegisterSnoozeServiceServer(s *grpc.Server, srv SnoozeServiceServer) { - s.RegisterService(&_SnoozeService_serviceDesc, srv) -} - -func _SnoozeService_CreateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).CreateSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/CreateSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).CreateSnooze(ctx, req.(*CreateSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_ListSnoozes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSnoozesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).ListSnoozes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/ListSnoozes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).ListSnoozes(ctx, req.(*ListSnoozesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_GetSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).GetSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/GetSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).GetSnooze(ctx, req.(*GetSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_UpdateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).UpdateSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/UpdateSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).UpdateSnooze(ctx, req.(*UpdateSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _SnoozeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.SnoozeService", - HandlerType: (*SnoozeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateSnooze", - Handler: _SnoozeService_CreateSnooze_Handler, - }, - { - MethodName: "ListSnoozes", - Handler: _SnoozeService_ListSnoozes_Handler, - }, - { - MethodName: "GetSnooze", - Handler: _SnoozeService_GetSnooze_Handler, - }, - { - MethodName: "UpdateSnooze", - Handler: _SnoozeService_UpdateSnooze_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/snooze_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go new file mode 100644 index 00000000..0b7e4fa9 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go @@ -0,0 +1,248 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/snooze_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + SnoozeService_CreateSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/CreateSnooze" + SnoozeService_ListSnoozes_FullMethodName = "/google.monitoring.v3.SnoozeService/ListSnoozes" + SnoozeService_GetSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/GetSnooze" + SnoozeService_UpdateSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/UpdateSnooze" +) + +// SnoozeServiceClient is the client API for SnoozeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SnoozeServiceClient interface { + // Creates a `Snooze` that will prevent alerts, which match the provided + // criteria, from being opened. The `Snooze` applies for a specific time + // interval. + CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) + // Lists the `Snooze`s associated with a project. Can optionally pass in + // `filter`, which specifies predicates to match `Snooze`s. + ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) + // Retrieves a `Snooze` by `name`. + GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) + // Updates a `Snooze`, identified by its `name`, with the parameters in the + // given `Snooze` object. + UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) +} + +type snoozeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSnoozeServiceClient(cc grpc.ClientConnInterface) SnoozeServiceClient { + return &snoozeServiceClient{cc} +} + +func (c *snoozeServiceClient) CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_CreateSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) { + out := new(ListSnoozesResponse) + err := c.cc.Invoke(ctx, SnoozeService_ListSnoozes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_GetSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_UpdateSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SnoozeServiceServer is the server API for SnoozeService service. +// All implementations should embed UnimplementedSnoozeServiceServer +// for forward compatibility +type SnoozeServiceServer interface { + // Creates a `Snooze` that will prevent alerts, which match the provided + // criteria, from being opened. The `Snooze` applies for a specific time + // interval. + CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) + // Lists the `Snooze`s associated with a project. Can optionally pass in + // `filter`, which specifies predicates to match `Snooze`s. + ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) + // Retrieves a `Snooze` by `name`. + GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) + // Updates a `Snooze`, identified by its `name`, with the parameters in the + // given `Snooze` object. + UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) +} + +// UnimplementedSnoozeServiceServer should be embedded to have forward compatible implementations. +type UnimplementedSnoozeServiceServer struct { +} + +func (UnimplementedSnoozeServiceServer) CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSnooze not implemented") +} +func (UnimplementedSnoozeServiceServer) ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSnoozes not implemented") +} +func (UnimplementedSnoozeServiceServer) GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSnooze not implemented") +} +func (UnimplementedSnoozeServiceServer) UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSnooze not implemented") +} + +// UnsafeSnoozeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SnoozeServiceServer will +// result in compilation errors. +type UnsafeSnoozeServiceServer interface { + mustEmbedUnimplementedSnoozeServiceServer() +} + +func RegisterSnoozeServiceServer(s grpc.ServiceRegistrar, srv SnoozeServiceServer) { + s.RegisterService(&SnoozeService_ServiceDesc, srv) +} + +func _SnoozeService_CreateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).CreateSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_CreateSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).CreateSnooze(ctx, req.(*CreateSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_ListSnoozes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSnoozesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).ListSnoozes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_ListSnoozes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).ListSnoozes(ctx, req.(*ListSnoozesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_GetSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).GetSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_GetSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).GetSnooze(ctx, req.(*GetSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_UpdateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).UpdateSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_UpdateSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).UpdateSnooze(ctx, req.(*UpdateSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SnoozeService_ServiceDesc is the grpc.ServiceDesc for SnoozeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SnoozeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.SnoozeService", + HandlerType: (*SnoozeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSnooze", + Handler: _SnoozeService_CreateSnooze_Handler, + }, + { + MethodName: "ListSnoozes", + Handler: _SnoozeService_ListSnoozes_Handler, + }, + { + MethodName: "GetSnooze", + Handler: _SnoozeService_GetSnooze_Handler, + }, + { + MethodName: "UpdateSnooze", + Handler: _SnoozeService_UpdateSnooze_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/snooze_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go index 23f42835..b9332612 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go @@ -15,17 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/span_context.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go index f303ac25..2e0fb642 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/uptime.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" ) const ( diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go index 9ea159bb..1ff646bc 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/uptime_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -826,287 +821,3 @@ func file_google_monitoring_v3_uptime_service_proto_init() { file_google_monitoring_v3_uptime_service_proto_goTypes = nil file_google_monitoring_v3_uptime_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// UptimeCheckServiceClient is the client API for UptimeCheckService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type UptimeCheckServiceClient interface { - // Lists the existing valid Uptime check configurations for the project - // (leaving out any invalid configurations). - ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) - // Gets a single Uptime check configuration. - GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Creates a new Uptime check configuration. - CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Updates an Uptime check configuration. You can either replace the entire - // configuration with a new one or replace only certain fields in the current - // configuration by specifying the fields to be updated via `updateMask`. - // Returns the updated configuration. - UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Deletes an Uptime check configuration. Note that this method will fail - // if the Uptime check configuration is referenced by an alert policy or - // other dependent configs that would be rendered invalid by the deletion. - DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Returns the list of IP addresses that checkers run from. - ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) -} - -type uptimeCheckServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewUptimeCheckServiceClient(cc grpc.ClientConnInterface) UptimeCheckServiceClient { - return &uptimeCheckServiceClient{cc} -} - -func (c *uptimeCheckServiceClient) ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) { - out := new(ListUptimeCheckConfigsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) { - out := new(ListUptimeCheckIpsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UptimeCheckServiceServer is the server API for UptimeCheckService service. -type UptimeCheckServiceServer interface { - // Lists the existing valid Uptime check configurations for the project - // (leaving out any invalid configurations). - ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) - // Gets a single Uptime check configuration. - GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Creates a new Uptime check configuration. - CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Updates an Uptime check configuration. You can either replace the entire - // configuration with a new one or replace only certain fields in the current - // configuration by specifying the fields to be updated via `updateMask`. - // Returns the updated configuration. - UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Deletes an Uptime check configuration. Note that this method will fail - // if the Uptime check configuration is referenced by an alert policy or - // other dependent configs that would be rendered invalid by the deletion. - DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) - // Returns the list of IP addresses that checkers run from. - ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) -} - -// UnimplementedUptimeCheckServiceServer can be embedded to have forward compatible implementations. -type UnimplementedUptimeCheckServiceServer struct { -} - -func (*UnimplementedUptimeCheckServiceServer) ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckConfigs not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckIps not implemented") -} - -func RegisterUptimeCheckServiceServer(s *grpc.Server, srv UptimeCheckServiceServer) { - s.RegisterService(&_UptimeCheckService_serviceDesc, srv) -} - -func _UptimeCheckService_ListUptimeCheckConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUptimeCheckConfigsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, req.(*ListUptimeCheckConfigsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_GetUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, req.(*GetUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_CreateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, req.(*CreateUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_UpdateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, req.(*UpdateUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_DeleteUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, req.(*DeleteUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_ListUptimeCheckIps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUptimeCheckIpsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, req.(*ListUptimeCheckIpsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _UptimeCheckService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.UptimeCheckService", - HandlerType: (*UptimeCheckServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListUptimeCheckConfigs", - Handler: _UptimeCheckService_ListUptimeCheckConfigs_Handler, - }, - { - MethodName: "GetUptimeCheckConfig", - Handler: _UptimeCheckService_GetUptimeCheckConfig_Handler, - }, - { - MethodName: "CreateUptimeCheckConfig", - Handler: _UptimeCheckService_CreateUptimeCheckConfig_Handler, - }, - { - MethodName: "UpdateUptimeCheckConfig", - Handler: _UptimeCheckService_UpdateUptimeCheckConfig_Handler, - }, - { - MethodName: "DeleteUptimeCheckConfig", - Handler: _UptimeCheckService_DeleteUptimeCheckConfig_Handler, - }, - { - MethodName: "ListUptimeCheckIps", - Handler: _UptimeCheckService_ListUptimeCheckIps_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/uptime_service.proto", -} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go new file mode 100644 index 00000000..4fd7c67a --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go @@ -0,0 +1,331 @@ +// Copyright 2025 Google LLC +// +// 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 protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/uptime_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UptimeCheckService_ListUptimeCheckConfigs_FullMethodName = "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs" + UptimeCheckService_GetUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig" + UptimeCheckService_CreateUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig" + UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig" + UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig" + UptimeCheckService_ListUptimeCheckIps_FullMethodName = "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps" +) + +// UptimeCheckServiceClient is the client API for UptimeCheckService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UptimeCheckServiceClient interface { + // Lists the existing valid Uptime check configurations for the project + // (leaving out any invalid configurations). + ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) + // Gets a single Uptime check configuration. + GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Creates a new Uptime check configuration. + CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Updates an Uptime check configuration. You can either replace the entire + // configuration with a new one or replace only certain fields in the current + // configuration by specifying the fields to be updated via `updateMask`. + // Returns the updated configuration. + UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Deletes an Uptime check configuration. Note that this method will fail + // if the Uptime check configuration is referenced by an alert policy or + // other dependent configs that would be rendered invalid by the deletion. + DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Returns the list of IP addresses that checkers run from. + ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) +} + +type uptimeCheckServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUptimeCheckServiceClient(cc grpc.ClientConnInterface) UptimeCheckServiceClient { + return &uptimeCheckServiceClient{cc} +} + +func (c *uptimeCheckServiceClient) ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) { + out := new(ListUptimeCheckConfigsResponse) + err := c.cc.Invoke(ctx, UptimeCheckService_ListUptimeCheckConfigs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_GetUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_CreateUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) { + out := new(ListUptimeCheckIpsResponse) + err := c.cc.Invoke(ctx, UptimeCheckService_ListUptimeCheckIps_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UptimeCheckServiceServer is the server API for UptimeCheckService service. +// All implementations should embed UnimplementedUptimeCheckServiceServer +// for forward compatibility +type UptimeCheckServiceServer interface { + // Lists the existing valid Uptime check configurations for the project + // (leaving out any invalid configurations). + ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) + // Gets a single Uptime check configuration. + GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Creates a new Uptime check configuration. + CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Updates an Uptime check configuration. You can either replace the entire + // configuration with a new one or replace only certain fields in the current + // configuration by specifying the fields to be updated via `updateMask`. + // Returns the updated configuration. + UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Deletes an Uptime check configuration. Note that this method will fail + // if the Uptime check configuration is referenced by an alert policy or + // other dependent configs that would be rendered invalid by the deletion. + DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) + // Returns the list of IP addresses that checkers run from. + ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) +} + +// UnimplementedUptimeCheckServiceServer should be embedded to have forward compatible implementations. +type UnimplementedUptimeCheckServiceServer struct { +} + +func (UnimplementedUptimeCheckServiceServer) ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckConfigs not implemented") +} +func (UnimplementedUptimeCheckServiceServer) GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckIps not implemented") +} + +// UnsafeUptimeCheckServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UptimeCheckServiceServer will +// result in compilation errors. +type UnsafeUptimeCheckServiceServer interface { + mustEmbedUnimplementedUptimeCheckServiceServer() +} + +func RegisterUptimeCheckServiceServer(s grpc.ServiceRegistrar, srv UptimeCheckServiceServer) { + s.RegisterService(&UptimeCheckService_ServiceDesc, srv) +} + +func _UptimeCheckService_ListUptimeCheckConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUptimeCheckConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_ListUptimeCheckConfigs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, req.(*ListUptimeCheckConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_GetUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_GetUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, req.(*GetUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_CreateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_CreateUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, req.(*CreateUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_UpdateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, req.(*UpdateUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_DeleteUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, req.(*DeleteUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_ListUptimeCheckIps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUptimeCheckIpsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_ListUptimeCheckIps_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, req.(*ListUptimeCheckIpsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UptimeCheckService_ServiceDesc is the grpc.ServiceDesc for UptimeCheckService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UptimeCheckService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.UptimeCheckService", + HandlerType: (*UptimeCheckServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUptimeCheckConfigs", + Handler: _UptimeCheckService_ListUptimeCheckConfigs_Handler, + }, + { + MethodName: "GetUptimeCheckConfig", + Handler: _UptimeCheckService_GetUptimeCheckConfig_Handler, + }, + { + MethodName: "CreateUptimeCheckConfig", + Handler: _UptimeCheckService_CreateUptimeCheckConfig_Handler, + }, + { + MethodName: "UpdateUptimeCheckConfig", + Handler: _UptimeCheckService_UpdateUptimeCheckConfig_Handler, + }, + { + MethodName: "DeleteUptimeCheckConfig", + Handler: _UptimeCheckService_DeleteUptimeCheckConfig_Handler, + }, + { + MethodName: "ListUptimeCheckIps", + Handler: _UptimeCheckService_ListUptimeCheckIps_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/uptime_service.proto", +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go index 3b36b219..6eac8ffe 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go @@ -381,7 +381,7 @@ func (c *notificationChannelGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *notificationChannelGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go index f792f2bd..97fb1997 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go @@ -183,7 +183,7 @@ func (c *queryGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *queryGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go index 7dc66e37..580f76a2 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go @@ -328,7 +328,7 @@ func (c *serviceMonitoringGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *serviceMonitoringGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go index 5b76a486..52f36302 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go @@ -234,7 +234,7 @@ func (c *snoozeGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *snoozeGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go index df0ec295..7e2aed8c 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go @@ -284,7 +284,7 @@ func (c *uptimeCheckGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *uptimeCheckGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/internal/version.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/internal/version.go index e199c116..e68e8219 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/monitoring/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.24.2" +const Version = "1.24.3" diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md index fec6b1da..2c3300e0 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md @@ -1,4 +1,10 @@ -# Changelog +# Changes + +## [2.16.0](https://github.com/googleapis/google-cloud-go/releases/tag/v2.16.0) (2025-12-17) + +### Features + +* add IsFeatureEnabled (#454) ([2700b8a](https://github.com/googleapis/google-cloud-go/commit/2700b8ab3062c6c6c5a26d0fc6ba1fc064a8fc04)) ## [2.15.0](https://github.com/googleapis/gax-go/compare/v2.14.2...v2.15.0) (2025-07-09) diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/feature.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/feature.go new file mode 100644 index 00000000..32e05a32 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/feature.go @@ -0,0 +1,75 @@ +// Copyright 2025, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package gax + +import ( + "os" + "strings" + "sync" +) + +var ( + // featureEnabledOnce caches results for IsFeatureEnabled. + featureEnabledOnce sync.Once + featureEnabledStore map[string]bool +) + +// IsFeatureEnabled checks if an experimental feature is enabled via +// environment variable. The environment variable must be prefixed with +// "GOOGLE_SDK_GO_EXPERIMENTAL_". The feature name passed to this +// function must be the suffix (e.g., "FOO" for "GOOGLE_SDK_GO_EXPERIMENTAL_FOO"). +// To enable the feature, the environment variable's value must be "true", +// case-insensitive. The result for each name is cached on the first call. +func IsFeatureEnabled(name string) bool { + featureEnabledOnce.Do(func() { + featureEnabledStore = make(map[string]bool) + for _, env := range os.Environ() { + if strings.HasPrefix(env, "GOOGLE_SDK_GO_EXPERIMENTAL_") { + // Parse "KEY=VALUE" + kv := strings.SplitN(env, "=", 2) + if len(kv) == 2 && strings.ToLower(kv[1]) == "true" { + key := strings.TrimPrefix(kv[0], "GOOGLE_SDK_GO_EXPERIMENTAL_") + featureEnabledStore[key] = true + } + } + } + }) + return featureEnabledStore[name] +} + +// TestOnlyResetIsFeatureEnabled is for testing purposes only. It resets the cached +// feature flags, allowing environment variables to be re-read on the next call to IsFeatureEnabled. +// This function is not thread-safe; if another goroutine reads a feature after this +// function is called but before the `featureEnabledOnce` is re-initialized by IsFeatureEnabled, +// it may see an inconsistent state. +func TestOnlyResetIsFeatureEnabled() { + featureEnabledOnce = sync.Once{} + featureEnabledStore = nil +} diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go index 0ab1bce5..fa0e1007 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go @@ -1,33 +1,20 @@ -// Copyright 2022, Google Inc. -// All rights reserved. +// Copyright 2025 Google LLC // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: +// 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 // -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. +// http://www.apache.org/licenses/LICENSE-2.0 // -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// 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 gapicgen. DO NOT EDIT. package internal // Version is the current tagged release of the library. -const Version = "2.15.0" +const Version = "2.16.0" diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/http2/transport.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/http2/transport.go index 1965913e..ccb87e6d 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/http2/transport.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/http2/transport.go @@ -376,11 +376,24 @@ type ClientConn struct { // completely unresponsive connection. pendingResets int + // readBeforeStreamID is the smallest stream ID that has not been followed by + // a frame read from the peer. We use this to determine when a request may + // have been sent to a completely unresponsive connection: + // If the request ID is less than readBeforeStreamID, then we have had some + // indication of life on the connection since sending the request. + readBeforeStreamID uint32 + // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. // Write to reqHeaderMu to lock it, read from it to unlock. // Lock reqmu BEFORE mu or wmu. reqHeaderMu chan struct{} + // internalStateHook reports state changes back to the net/http.ClientConn. + // Note that this is different from the user state hook registered by + // net/http.ClientConn.SetStateHook: The internal hook calls ClientConn, + // which calls the user hook. + internalStateHook func() + // wmu is held while writing. // Acquire BEFORE mu when holding both, to avoid blocking mu on network writes. // Only acquire both at the same time when changing peer settings. @@ -710,7 +723,7 @@ func canRetryError(err error) bool { func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { if t.transportTestHooks != nil { - return t.newClientConn(nil, singleUse) + return t.newClientConn(nil, singleUse, nil) } host, _, err := net.SplitHostPort(addr) if err != nil { @@ -720,7 +733,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b if err != nil { return nil, err } - return t.newClientConn(tconn, singleUse) + return t.newClientConn(tconn, singleUse, nil) } func (t *Transport) newTLSConfig(host string) *tls.Config { @@ -772,10 +785,10 @@ func (t *Transport) expectContinueTimeout() time.Duration { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, t.disableKeepAlives()) + return t.newClientConn(c, t.disableKeepAlives(), nil) } -func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { +func (t *Transport) newClientConn(c net.Conn, singleUse bool, internalStateHook func()) (*ClientConn, error) { conf := configFromTransport(t) cc := &ClientConn{ t: t, @@ -797,6 +810,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), lastActive: time.Now(), + internalStateHook: internalStateHook, } if t.transportTestHooks != nil { t.transportTestHooks.newclientconn(cc) @@ -1037,10 +1051,7 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { maxConcurrentOkay = cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) } - st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && - !cc.doNotReuse && - int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && - !cc.tooIdleLocked() + st.canTakeNewRequest = maxConcurrentOkay && cc.isUsableLocked() // If this connection has never been used for a request and is closed, // then let it take a request (which will fail). @@ -1056,6 +1067,31 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { return } +func (cc *ClientConn) isUsableLocked() bool { + return cc.goAway == nil && + !cc.closed && + !cc.closing && + !cc.doNotReuse && + int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && + !cc.tooIdleLocked() +} + +// canReserveLocked reports whether a net/http.ClientConn can reserve a slot on this conn. +// +// This follows slightly different rules than clientConnIdleState.canTakeNewRequest. +// We only permit reservations up to the conn's concurrency limit. +// This differs from ClientConn.ReserveNewRequest, which permits reservations +// past the limit when StrictMaxConcurrentStreams is set. +func (cc *ClientConn) canReserveLocked() bool { + if cc.currentRequestCountLocked() >= int(cc.maxConcurrentStreams) { + return false + } + if !cc.isUsableLocked() { + return false + } + return true +} + // currentRequestCountLocked reports the number of concurrency slots currently in use, // including active streams, reserved slots, and reset streams waiting for acknowledgement. func (cc *ClientConn) currentRequestCountLocked() int { @@ -1067,6 +1103,14 @@ func (cc *ClientConn) canTakeNewRequestLocked() bool { return st.canTakeNewRequest } +// availableLocked reports the number of concurrency slots available. +func (cc *ClientConn) availableLocked() int { + if !cc.canTakeNewRequestLocked() { + return 0 + } + return max(0, int(cc.maxConcurrentStreams)-cc.currentRequestCountLocked()) +} + // tooIdleLocked reports whether this connection has been been sitting idle // for too much wall time. func (cc *ClientConn) tooIdleLocked() bool { @@ -1091,6 +1135,7 @@ func (cc *ClientConn) closeConn() { t := time.AfterFunc(250*time.Millisecond, cc.forceCloseConn) defer t.Stop() cc.tconn.Close() + cc.maybeCallStateHook() } // A tls.Conn.Close can hang for a long time if the peer is unresponsive. @@ -1616,6 +1661,8 @@ func (cs *clientStream) cleanupWriteRequest(err error) { } bodyClosed := cs.reqBodyClosed closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil + // Have we read any frames from the connection since sending this request? + readSinceStream := cc.readBeforeStreamID > cs.ID cc.mu.Unlock() if mustCloseBody { cs.reqBody.Close() @@ -1647,8 +1694,10 @@ func (cs *clientStream) cleanupWriteRequest(err error) { // // This could be due to the server becoming unresponsive. // To avoid sending too many requests on a dead connection, - // we let the request continue to consume a concurrency slot - // until we can confirm the server is still responding. + // if we haven't read any frames from the connection since + // sending this request, we let it continue to consume + // a concurrency slot until we can confirm the server is + // still responding. // We do this by sending a PING frame along with the RST_STREAM // (unless a ping is already in flight). // @@ -1659,7 +1708,7 @@ func (cs *clientStream) cleanupWriteRequest(err error) { // because it's short lived and will probably be closed before // we get the ping response. ping := false - if !closeOnIdle { + if !closeOnIdle && !readSinceStream { cc.mu.Lock() // rstStreamPingsBlocked works around a gRPC behavior: // see comment on the field for details. @@ -1693,6 +1742,7 @@ func (cs *clientStream) cleanupWriteRequest(err error) { } close(cs.donec) + cc.maybeCallStateHook() } // awaitOpenSlotForStreamLocked waits until len(streams) < maxConcurrentStreams. @@ -2745,6 +2795,7 @@ func (rl *clientConnReadLoop) streamByID(id uint32, headerOrData bool) *clientSt // See comment on ClientConn.rstStreamPingsBlocked for details. rl.cc.rstStreamPingsBlocked = false } + rl.cc.readBeforeStreamID = rl.cc.nextStreamID cs := rl.cc.streams[id] if cs != nil && !cs.readAborted { return cs @@ -2795,6 +2846,7 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc := rl.cc + defer cc.maybeCallStateHook() cc.mu.Lock() defer cc.mu.Unlock() @@ -2975,6 +3027,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error { func (rl *clientConnReadLoop) processPing(f *PingFrame) error { if f.IsAck() { cc := rl.cc + defer cc.maybeCallStateHook() cc.mu.Lock() defer cc.mu.Unlock() // If ack, notify listener if any @@ -3198,9 +3251,13 @@ func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err erro } // noDialH2RoundTripper is a RoundTripper which only tries to complete the request -// if there's already has a cached connection to the host. +// if there's already a cached connection to the host. // (The field is exported so it can be accessed via reflect from net/http; tested // by TestNoDialH2RoundTripperType) +// +// A noDialH2RoundTripper is registered with http1.Transport.RegisterProtocol, +// and the http1.Transport can use type assertions to call non-RoundTrip methods on it. +// This lets us expose, for example, NewClientConn to net/http. type noDialH2RoundTripper struct{ *Transport } func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { @@ -3211,6 +3268,85 @@ func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, err return res, err } +func (rt noDialH2RoundTripper) NewClientConn(conn net.Conn, internalStateHook func()) (http.RoundTripper, error) { + tr := rt.Transport + cc, err := tr.newClientConn(conn, tr.disableKeepAlives(), internalStateHook) + if err != nil { + return nil, err + } + + // RoundTrip should block when the conn is at its concurrency limit, + // not return an error. Setting strictMaxConcurrentStreams enables this. + cc.strictMaxConcurrentStreams = true + + return netHTTPClientConn{cc}, nil +} + +// netHTTPClientConn wraps ClientConn and implements the interface net/http expects from +// the RoundTripper returned by NewClientConn. +type netHTTPClientConn struct { + cc *ClientConn +} + +func (cc netHTTPClientConn) RoundTrip(req *http.Request) (*http.Response, error) { + return cc.cc.RoundTrip(req) +} + +func (cc netHTTPClientConn) Close() error { + return cc.cc.Close() +} + +func (cc netHTTPClientConn) Err() error { + cc.cc.mu.Lock() + defer cc.cc.mu.Unlock() + if cc.cc.closed { + return errors.New("connection closed") + } + return nil +} + +func (cc netHTTPClientConn) Reserve() error { + defer cc.cc.maybeCallStateHook() + cc.cc.mu.Lock() + defer cc.cc.mu.Unlock() + if !cc.cc.canReserveLocked() { + return errors.New("connection is unavailable") + } + cc.cc.streamsReserved++ + return nil +} + +func (cc netHTTPClientConn) Release() { + defer cc.cc.maybeCallStateHook() + cc.cc.mu.Lock() + defer cc.cc.mu.Unlock() + // We don't complain if streamsReserved is 0. + // + // This is consistent with RoundTrip: both Release and RoundTrip will + // consume a reservation iff one exists. + if cc.cc.streamsReserved > 0 { + cc.cc.streamsReserved-- + } +} + +func (cc netHTTPClientConn) Available() int { + cc.cc.mu.Lock() + defer cc.cc.mu.Unlock() + return cc.cc.availableLocked() +} + +func (cc netHTTPClientConn) InFlight() int { + cc.cc.mu.Lock() + defer cc.cc.mu.Unlock() + return cc.cc.currentRequestCountLocked() +} + +func (cc *ClientConn) maybeCallStateHook() { + if cc.internalStateHook != nil { + cc.internalStateHook() + } +} + func (t *Transport) idleConnTimeout() time.Duration { // to keep things backwards compatible, we use non-zero values of // IdleConnTimeout, followed by using the IdleConnTimeout on the underlying diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/trace/events.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/trace/events.go index 3aaffdd1..c2b3c009 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/trace/events.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/net/trace/events.go @@ -58,8 +58,8 @@ func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) { Buckets: buckets, } - data.Families = make([]string, 0, len(families)) famMu.RLock() + data.Families = make([]string, 0, len(families)) for name := range families { data.Families = append(data.Families, name) } diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu.go index 34c9ae76..63541994 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu.go @@ -92,9 +92,6 @@ var ARM64 struct { HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation HasATOMICS bool // Atomic memory operation instruction set - HasHPDS bool // Hierarchical permission disables in translations tables - HasLOR bool // Limited ordering regions - HasPAN bool // Privileged access never HasFPHP bool // Half precision floating-point instruction set HasASIMDHP bool // Advanced SIMD half precision instruction set HasCPUID bool // CPUID identification scheme registers diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.go index f449c679..af2aa99f 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -65,10 +65,10 @@ func setMinimalFeatures() { func readARM64Registers() { Initialized = true - parseARM64SystemRegisters(getisar0(), getisar1(), getmmfr1(), getpfr0()) + parseARM64SystemRegisters(getisar0(), getisar1(), getpfr0()) } -func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) { +func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { // ID_AA64ISAR0_EL1 switch extractBits(isar0, 4, 7) { case 1: @@ -152,22 +152,6 @@ func parseARM64SystemRegisters(isar0, isar1, mmfr1, pfr0 uint64) { ARM64.HasI8MM = true } - // ID_AA64MMFR1_EL1 - switch extractBits(mmfr1, 12, 15) { - case 1, 2: - ARM64.HasHPDS = true - } - - switch extractBits(mmfr1, 16, 19) { - case 1: - ARM64.HasLOR = true - } - - switch extractBits(mmfr1, 20, 23) { - case 1, 2, 3: - ARM64.HasPAN = true - } - // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.s index a4f24b3b..3b0450a0 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -20,13 +20,6 @@ TEXT ·getisar1(SB),NOSPLIT,$0-8 MOVD R0, ret+0(FP) RET -// func getmmfr1() uint64 -TEXT ·getmmfr1(SB),NOSPLIT,$0-8 - // get Memory Model Feature Register 1 into x0 - MRS ID_AA64MMFR1_EL1, R0 - MOVD R0, ret+0(FP) - RET - // func getpfr0() uint64 TEXT ·getpfr0(SB),NOSPLIT,$0-8 // get Processor Feature Register 0 into x0 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index e3fc5a8d..6ac6e1ef 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -8,6 +8,5 @@ package cpu func getisar0() uint64 func getisar1() uint64 -func getmmfr1() uint64 func getpfr0() uint64 func getzfr0() uint64 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 8df2079e..7f194678 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -8,5 +8,4 @@ package cpu func getisar0() uint64 { return 0 } func getisar1() uint64 { return 0 } -func getmmfr1() uint64 { return 0 } func getpfr0() uint64 { return 0 } diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go index 19aea063..ebfb3fc8 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go @@ -167,7 +167,7 @@ func doinit() { setMinimalFeatures() return } - parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64mmfr1, cpuid.aa64pfr0) + parseARM64SystemRegisters(cpuid.aa64isar0, cpuid.aa64isar1, cpuid.aa64pfr0) Initialized = true } diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go index 87fd3a77..85b64d5c 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go @@ -59,7 +59,7 @@ func doinit() { if !ok { return } - parseARM64SystemRegisters(isar0, isar1, 0, 0) + parseARM64SystemRegisters(isar0, isar1, 0) Initialized = true } diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/mkerrors.sh b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/mkerrors.sh index 42517077..fd39be4e 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -256,6 +256,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -613,7 +614,7 @@ ccflags="$@" $2 !~ /IOC_MAGIC/ && $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ || $2 ~ /^(VM|VMADDR)_/ || - $2 ~ /^IOCTL_VM_SOCKETS_/ || + $2 ~ /^(IOCTL_VM_SOCKETS_|IOCTL_MEI_)/ || $2 ~ /^(TASKSTATS|TS)_/ || $2 ~ /^CGROUPSTATS_/ || $2 ~ /^GENL_/ || diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux.go index d0a75da5..120a7b35 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1615,6 +1615,8 @@ const ( IN_OPEN = 0x20 IN_Q_OVERFLOW = 0x4000 IN_UNMOUNT = 0x2000 + IOCTL_MEI_CONNECT_CLIENT = 0xc0104801 + IOCTL_MEI_CONNECT_CLIENT_VTAG = 0xc0144804 IPPROTO_AH = 0x33 IPPROTO_BEETPH = 0x5e IPPROTO_COMP = 0x6c diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 1c37f9fb..97a61fc5 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 6f54d34a..a0d6d498 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 783ec5c1..dd9c903f 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index ca83d3ba..384c61ca 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -120,6 +120,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 607e611c..6384c983 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -116,6 +116,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index b9cb5bd3..553c1c6f 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 65b078a6..b3339f20 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 5298a303..177091d2 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 7bc557c8..c5abf156 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x100 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x80 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 152399bb..f1f3fadf 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 1a1ce240..203ad9c5 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 4231a1fb..4b9abcb2 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 21c0e952..f8798303 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index f00d1cd7..64347eb3 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -115,6 +115,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index bc8d539e..7d719117 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -119,6 +119,8 @@ const ( IEXTEN = 0x8000 IN_CLOEXEC = 0x400000 IN_NONBLOCK = 0x4000 + IOCTL_MEI_NOTIFY_GET = 0x40044803 + IOCTL_MEI_NOTIFY_SET = 0x80044802 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 IPV6_FLOWINFO_MASK = 0xfffffff IPV6_FLOWLABEL_MASK = 0xfffff diff --git a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 439548ec..50e8e644 100644 --- a/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/ci/resources/stemcell-version-bump/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -104,7 +104,7 @@ type Statvfs_t struct { Fsid uint32 Namemax uint32 Owner uint32 - Spare [4]uint32 + Spare [4]uint64 Fstypename [32]byte Mntonname [1024]byte Mntfromname [1024]byte diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/googleapi/googleapi.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/googleapi/googleapi.go index f8a85d5a..167f0610 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/googleapi/googleapi.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/googleapi/googleapi.go @@ -333,6 +333,20 @@ func ChunkRetryDeadline(deadline time.Duration) MediaOption { return chunkRetryDeadlineOption(deadline) } +type enableAutoChecksumOption struct{} + +func (d enableAutoChecksumOption) setOptions(o *MediaOptions) { + o.EnableAutoChecksum = true +} + +// EnableAutoChecksum returns a MediaOption that enables automatic checksum +// calculation, which is only supported for resumable multi-chunk uploads. +// The computed checksum is sent on the final upload request to the server. +// Writes are rejected in the event of a checksum mismatch. +func EnableAutoChecksum() MediaOption { + return enableAutoChecksumOption{} +} + // MediaOptions stores options for customizing media upload. It is not used by developers directly. type MediaOptions struct { ContentType string @@ -340,6 +354,7 @@ type MediaOptions struct { ChunkSize int ChunkRetryDeadline time.Duration ChunkTransferTimeout time.Duration + EnableAutoChecksum bool } // ProcessMediaOptions stores options from opts in a MediaOptions. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go index fb81ad51..e9885ea2 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC. +// Copyright 2026 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/credentialstype/credentialstype.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/credentialstype/credentialstype.go new file mode 100644 index 00000000..0e2c4612 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/credentialstype/credentialstype.go @@ -0,0 +1,113 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package credentialstype defines the CredType used for specifying the type of JSON credentials. +package credentialstype + +import ( + "encoding/json" + "fmt" + "slices" +) + +// CredType specifies the type of JSON credentials. +type CredType string + +const ( + // Unknown represents an unknown JSON file type. + Unknown CredType = "" + // ServiceAccount represents a service account file type. + ServiceAccount CredType = "service_account" + // AuthorizedUser represents an authorized user credentials file type. + AuthorizedUser CredType = "authorized_user" + // ImpersonatedServiceAccount represents an impersonated service account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ImpersonatedServiceAccount CredType = "impersonated_service_account" + // ExternalAccount represents an external account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ExternalAccount CredType = "external_account" + // GDCHServiceAccount represents a GDCH service account file type. + GDCHServiceAccount CredType = "gdc_service_account" + // ExternalAccountAuthorizedUser represents an external account authorized user file type. + ExternalAccountAuthorizedUser CredType = "external_account_authorized_user" +) + +var knownTypes = map[CredType]bool{ + ServiceAccount: true, + AuthorizedUser: true, + ImpersonatedServiceAccount: true, + ExternalAccount: true, + GDCHServiceAccount: true, + ExternalAccountAuthorizedUser: true, +} + +// GetCredType returns the credentials type or the Unknown type, +// or an error for empty data or failure to unmarshal JSON. +func GetCredType(data []byte) (CredType, error) { + var t CredType + if len(data) == 0 { + return t, fmt.Errorf("credential provided is 0 bytes") + } + var f struct { + Type string `json:"type"` + } + if err := json.Unmarshal(data, &f); err != nil { + return t, err + } + t = parseCredType(f.Type) + return t, nil +} + +// CheckCredentialType checks if the provided JSON bytes match the expected +// credential type and, if present, one of the allowed credential types. +// An error is returned if the JSON is invalid, the type field is missing, +// or the types do not match expected and (if present) allowed. +func CheckCredentialType(b []byte, expected CredType, allowed ...CredType) error { + var f struct { + Type string `json:"type"` + } + if err := json.Unmarshal(b, &f); err != nil { + return fmt.Errorf("unable to parse credential type: %w", err) + } + if f.Type == "" { + return fmt.Errorf("missing `type` field in credential") + } + credType := CredType(f.Type) + if credType != expected { + return fmt.Errorf("credential type mismatch: got %q, expected %q", credType, expected) + } + if len(allowed) == 0 { + return nil + } + if !slices.Contains(allowed, credType) { + return fmt.Errorf("credential type not allowed: %q", credType) + } + return nil +} + +// parseCredType returns the matching CredType for the JSON type string if +// it is in the list of publicly exposed types, otherwise Unknown. +func parseCredType(typeString string) CredType { + ct := CredType(typeString) + if knownTypes[ct] { + return ct + } + return Unknown +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/creds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/creds.go index 92bb42c3..2172ba43 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/creds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/creds.go @@ -20,6 +20,7 @@ import ( "cloud.google.com/go/auth/oauth2adapt" "golang.org/x/oauth2" "google.golang.org/api/internal/cert" + "google.golang.org/api/internal/credentialstype" "google.golang.org/api/internal/impersonate" "golang.org/x/oauth2/google" @@ -139,11 +140,13 @@ func detectDefaultFromDialSettings(settings *DialSettings) (*auth.Credentials, e aud = settings.DefaultAudience } + credsFile, _ := settings.GetAuthCredentialsFile() + credsJSON, _ := settings.GetAuthCredentialsJSON() return credentials.DetectDefault(&credentials.DetectOptions{ Scopes: scopes, Audience: aud, - CredentialsFile: settings.CredentialsFile, - CredentialsJSON: settings.CredentialsJSON, + CredentialsFile: credsFile, + CredentialsJSON: credsJSON, UseSelfSignedJWT: useSelfSignedJWT, Logger: settings.Logger, }) @@ -156,15 +159,15 @@ func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, erro if ds.Credentials != nil { return ds.Credentials, nil } - if len(ds.CredentialsJSON) > 0 { - return credentialsFromJSON(ctx, ds.CredentialsJSON, ds) + if credsJSON, checkCredType := ds.GetAuthCredentialsJSON(); len(credsJSON) > 0 { + return credentialsFromJSON(ctx, credsJSON, ds, checkCredType) } - if ds.CredentialsFile != "" { - data, err := os.ReadFile(ds.CredentialsFile) + if credsFile, checkCredType := ds.GetAuthCredentialsFile(); credsFile != "" { + data, err := os.ReadFile(credsFile) if err != nil { return nil, fmt.Errorf("cannot read credentials file: %v", err) } - return credentialsFromJSON(ctx, data, ds) + return credentialsFromJSON(ctx, data, ds, checkCredType) } if ds.TokenSource != nil { return &google.Credentials{TokenSource: ds.TokenSource}, nil @@ -174,7 +177,7 @@ func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, erro return nil, err } if len(cred.JSON) > 0 { - return credentialsFromJSON(ctx, cred.JSON, ds) + return credentialsFromJSON(ctx, cred.JSON, ds, credentialstype.Unknown) } // For GAE and GCE, the JSON is empty so return the default credentials directly. return cred, nil @@ -197,7 +200,12 @@ const ( // // - Otherwise, executes standard OAuth 2.0 flow // More details: google.aip.dev/auth/4111 -func credentialsFromJSON(ctx context.Context, data []byte, ds *DialSettings) (*google.Credentials, error) { +func credentialsFromJSON(ctx context.Context, data []byte, ds *DialSettings, checkCredType credentialstype.CredType) (*google.Credentials, error) { + if checkCredType != credentialstype.Unknown { + if err := credentialstype.CheckCredentialType(data, checkCredType); err != nil { + return nil, err + } + } var params google.CredentialsParams params.Scopes = ds.GetScopes() diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/buffer.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/buffer.go index 3d0817ed..63f38349 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/buffer.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/buffer.go @@ -6,6 +6,7 @@ package gensupport import ( "bytes" + "hash/crc32" "io" "google.golang.org/api/googleapi" @@ -21,8 +22,17 @@ type MediaBuffer struct { // The absolute position of chunk in the underlying media. off int64 + + // fullObjectChecksum holds the running checksum of streamed media chunks when automatic checksum + // calculation is enabled via enableAutoChecksum. + fullObjectChecksum uint32 + enableAutoChecksum bool } +var ( + crc32cTable = crc32.MakeTable(crc32.Castagnoli) +) + // NewMediaBuffer initializes a MediaBuffer. func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer { return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)} @@ -52,6 +62,9 @@ func (mb *MediaBuffer) loadChunk() error { read += n } mb.chunk = mb.chunk[:read] + if mb.enableAutoChecksum { + mb.fullObjectChecksum = crc32.Update(mb.fullObjectChecksum, crc32cTable, mb.chunk) + } return err } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/media.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/media.go index 8c7435de..ec3bf1ba 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/media.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/media.go @@ -118,11 +118,12 @@ func typeHeader(contentType string) textproto.MIMEHeader { // // After PrepareUpload has been called, media should no longer be used: the // media content should be accessed via one of the return values. -func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) { +func PrepareUpload(media io.Reader, chunkSize int, enableAutoChecksum bool) (r io.Reader, mb *MediaBuffer, singleChunk bool) { if chunkSize == 0 { // do not chunk return media, nil, true } mb = NewMediaBuffer(media, chunkSize) + mb.enableAutoChecksum = enableAutoChecksum _, _, _, err := mb.Chunk() // If err is io.EOF, we can upload this in a single request. Otherwise, err is // either nil or a non-EOF error. If it is the latter, then the next call to @@ -159,7 +160,7 @@ func NewInfoFromMedia(r io.Reader, options []googleapi.MediaOption) *MediaInfo { } mi.chunkRetryDeadline = opts.ChunkRetryDeadline mi.chunkTransferTimeout = opts.ChunkTransferTimeout - mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize) + mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize, opts.EnableAutoChecksum) return mi } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/resumable.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/resumable.go index 91108d32..a3b7acad 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/resumable.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/gensupport/resumable.go @@ -6,6 +6,8 @@ package gensupport import ( "context" + "encoding/base64" + "encoding/binary" "errors" "fmt" "io" @@ -18,6 +20,11 @@ import ( "google.golang.org/api/internal" ) +const ( + crc32cPrefix = "crc32c" + hashHeaderKey = "X-Goog-Hash" +) + // ResumableUpload is used by the generated APIs to provide resumable uploads. // It is not used by developers directly. type ResumableUpload struct { @@ -103,6 +110,11 @@ func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader, // 308" response header. req.Header.Set("X-GUploader-No-308", "yes") + // Server accepts checksum only on final request through header. + if final && rx.Media.enableAutoChecksum { + req.Header.Set(hashHeaderKey, fmt.Sprintf("%v=%v", crc32cPrefix, encodeUint32(rx.Media.fullObjectChecksum))) + } + return SendRequest(ctx, rx.Client, req) } @@ -335,3 +347,10 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (*http.Response, error) { return resp, nil } } + +// Encode a uint32 as Base64 in big-endian byte order. +func encodeUint32(u uint32) string { + b := make([]byte, 4) + binary.BigEndian.PutUint32(b, u) + return base64.StdEncoding.EncodeToString(b) +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/settings.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/settings.go index a81d149a..96a5fc3b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/settings.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/settings.go @@ -17,6 +17,7 @@ import ( "cloud.google.com/go/auth" "golang.org/x/oauth2" "golang.org/x/oauth2/google" + "google.golang.org/api/internal/credentialstype" "google.golang.org/api/internal/impersonate" "google.golang.org/grpc" ) @@ -31,16 +32,18 @@ const ( // DialSettings holds information needed to establish a connection with a // Google API service. type DialSettings struct { - Endpoint string - DefaultEndpoint string - DefaultEndpointTemplate string - DefaultMTLSEndpoint string - Scopes []string - DefaultScopes []string - EnableJwtWithScope bool - TokenSource oauth2.TokenSource - Credentials *google.Credentials - CredentialsFile string // if set, Token Source is ignored. + Endpoint string + DefaultEndpoint string + DefaultEndpointTemplate string + DefaultMTLSEndpoint string + Scopes []string + DefaultScopes []string + EnableJwtWithScope bool + TokenSource oauth2.TokenSource + Credentials *google.Credentials + // Deprecated: Use AuthCredentialsFile instead, due to security risk. + CredentialsFile string + // Deprecated: Use AuthCredentialsJSON instead, due to security risk. CredentialsJSON []byte InternalCredentials *google.Credentials UserAgent string @@ -72,6 +75,9 @@ type DialSettings struct { // New Auth library Options AuthCredentials *auth.Credentials + AuthCredentialsJSON []byte + AuthCredentialsFile string + AuthCredentialsType credentialstype.CredType EnableNewAuthLibrary bool // TODO(b/372244283): Remove after b/358175516 has been fixed @@ -113,22 +119,55 @@ func (ds *DialSettings) IsNewAuthLibraryEnabled() bool { if ds.AuthCredentials != nil { return true } + if len(ds.AuthCredentialsJSON) > 0 { + return true + } + if ds.AuthCredentialsFile != "" { + return true + } if b, err := strconv.ParseBool(os.Getenv(newAuthLibEnvVar)); err == nil { return b } return false } +// GetAuthCredentialsJSON returns the AuthCredentialsJSON and AuthCredentialsType, if set. +// Otherwise it falls back to the deprecated CredentialsJSON with an Unknown type. +// +// Use AuthCredentialsJSON if provided, as it is the safer, recommended option. +// CredentialsJSON is populated by the deprecated WithCredentialsJSON. +func (ds *DialSettings) GetAuthCredentialsJSON() ([]byte, credentialstype.CredType) { + if len(ds.AuthCredentialsJSON) > 0 { + return ds.AuthCredentialsJSON, ds.AuthCredentialsType + } + return ds.CredentialsJSON, credentialstype.Unknown +} + +// GetAuthCredentialsFile returns the AuthCredentialsFile and AuthCredentialsType, if set. +// Otherwise it falls back to the deprecated CredentialsFile with an Unknown type. +// +// Use AuthCredentialsFile if provided, as it is the safer, recommended option. +// CredentialsFile is populated by the deprecated WithCredentialsFile. +func (ds *DialSettings) GetAuthCredentialsFile() (string, credentialstype.CredType) { + if ds.AuthCredentialsFile != "" { + return ds.AuthCredentialsFile, ds.AuthCredentialsType + } + return ds.CredentialsFile, credentialstype.Unknown +} + // Validate reports an error if ds is invalid. func (ds *DialSettings) Validate() error { if ds.SkipValidation { return nil } - hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil + hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil || ds.AuthCredentials != nil || len(ds.AuthCredentialsJSON) > 0 || ds.AuthCredentialsFile != "" if ds.NoAuth && hasCreds { return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials") } // Credentials should not appear with other options. + // AuthCredentials is a special case that may be present with + // with other options in order to facilitate automatic conversion of + // oauth2 types (old auth) to cloud.google.com/go/auth types (new auth). // We currently allow TokenSource and CredentialsFile to coexist. // TODO(jba): make TokenSource & CredentialsFile an error (breaking change). nCreds := 0 @@ -138,6 +177,12 @@ func (ds *DialSettings) Validate() error { if len(ds.CredentialsJSON) > 0 { nCreds++ } + if len(ds.AuthCredentialsJSON) > 0 { + nCreds++ + } + if ds.AuthCredentialsFile != "" { + nCreds++ + } if ds.CredentialsFile != "" { nCreds++ } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go index 6368b1d5..9100b0ae 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.257.0" +const Version = "0.259.0" diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/internaloption/internaloption.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/internaloption/internaloption.go index 931f093d..d67351a7 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/internaloption/internaloption.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/internaloption/internaloption.go @@ -290,7 +290,7 @@ func GetLogger(opts []option.ClientOption) *slog.Logger { // options, in this order: // // - [option.WithoutAuthentication] -// - [option.WithAuthCredentials] +// - [option.Credentials] // - [WithCredentials] (internal use only) // - [option.WithCredentials] // - [option.WithTokenSource] @@ -300,7 +300,9 @@ func GetLogger(opts []option.ClientOption) *slog.Logger { // returns the result: // // - [option.WithAudiences] +// - [option.WithAuthCredentialsFile] // - [option.WithCredentialsFile] +// - [option.WithAuthCredentialsJSON] // - [option.WithCredentialsJSON] // - [option.WithScopes] // - [WithDefaultScopes] (internal use only) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/option.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/option.go index 1b134caa..4dbfc3a2 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/option.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/option/option.go @@ -14,10 +14,45 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/internal" + "google.golang.org/api/internal/credentialstype" "google.golang.org/api/internal/impersonate" "google.golang.org/grpc" ) +// CredentialsType specifies the type of JSON credentials being provided +// to a loading function such as [WithAuthCredentialsFile] or +// [WithAuthCredentialsJSON]. +type CredentialsType = credentialstype.CredType + +const ( + // ServiceAccount represents a service account file type. + ServiceAccount = credentialstype.ServiceAccount + // AuthorizedUser represents an authorized user credentials file type. + AuthorizedUser = credentialstype.AuthorizedUser + // ImpersonatedServiceAccount represents an impersonated service account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ImpersonatedServiceAccount = credentialstype.ImpersonatedServiceAccount + // ExternalAccount represents an external account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ExternalAccount = credentialstype.ExternalAccount +) + // A ClientOption is an option for a Google API client. type ClientOption interface { Apply(*internal.DialSettings) @@ -45,6 +80,36 @@ func (w withCredFile) Apply(o *internal.DialSettings) { // API calls with the given service account or refresh token JSON // credentials file. // +// Deprecated: This function is being deprecated because of a potential security risk. +// +// This function does not validate the credential configuration. The security +// risk occurs when a credential configuration is accepted from a source that +// is not under your control and used without validation on your side. +// +// If you know that you will be loading credential configurations of a +// specific type, it is recommended to use a credential-type-specific +// option function. +// This will ensure that an unexpected credential type with potential for +// malicious intent is not loaded unintentionally. You might still have to do +// validation for certain credential types. Please follow the recommendation +// for that function. For example, if you want to load only service accounts, +// you can use [WithAuthCredentialsFile] with [ServiceAccount]: +// +// option.WithAuthCredentialsFile(option.ServiceAccount, "/path/to/file.json") +// +// If you are loading your credential configuration from an untrusted source and have +// not mitigated the risks (e.g. by validating the configuration yourself), make +// these changes as soon as possible to prevent security risks to your environment. +// +// Regardless of the function used, it is always your responsibility to validate +// configurations received from external sources. +func WithCredentialsFile(filename string) ClientOption { + return withCredFile(filename) +} + +// WithAuthCredentialsFile returns a ClientOption that authenticates API calls +// with the given JSON credentials file and credential type. +// // Important: If you accept a credential configuration (credential // JSON/File/Stream) from an external source for authentication to Google // Cloud Platform, you must validate it before providing it to any Google @@ -52,8 +117,21 @@ func (w withCredFile) Apply(o *internal.DialSettings) { // Google APIs can compromise the security of your systems and data. For // more information, refer to [Validate credential configurations from // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). -func WithCredentialsFile(filename string) ClientOption { - return withCredFile(filename) +func WithAuthCredentialsFile(credType CredentialsType, filename string) ClientOption { + return withAuthCredentialsFile{ + credsType: credType, + filename: filename, + } +} + +type withAuthCredentialsFile struct { + credsType CredentialsType + filename string +} + +func (w withAuthCredentialsFile) Apply(o *internal.DialSettings) { + o.AuthCredentialsFile = w.filename + o.AuthCredentialsType = w.credsType } // WithServiceAccountFile returns a ClientOption that uses a Google service @@ -67,15 +145,52 @@ func WithCredentialsFile(filename string) ClientOption { // more information, refer to [Validate credential configurations from // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). // -// Deprecated: Use WithCredentialsFile instead. +// Deprecated: Use WithAuthCredentialsFile instead. func WithServiceAccountFile(filename string) ClientOption { - return WithCredentialsFile(filename) + return WithAuthCredentialsFile(ServiceAccount, filename) } // WithCredentialsJSON returns a ClientOption that authenticates // API calls with the given service account or refresh token JSON // credentials. // +// Deprecated: This function is being deprecated because of a potential security risk. +// +// This function does not validate the credential configuration. The security +// risk occurs when a credential configuration is accepted from a source that +// is not under your control and used without validation on your side. +// +// If you know that you will be loading credential configurations of a +// specific type, it is recommended to use a credential-type-specific +// option function. +// This will ensure that an unexpected credential type with potential for +// malicious intent is not loaded unintentionally. You might still have to do +// validation for certain credential types. Please follow the recommendation +// for that function. For example, if you want to load only service accounts, +// you can use [WithAuthCredentialsJSON] with [ServiceAccount]: +// +// option.WithAuthCredentialsJSON(option.ServiceAccount, json) +// +// If you are loading your credential configuration from an untrusted source and have +// not mitigated the risks (e.g. by validating the configuration yourself), make +// these changes as soon as possible to prevent security risks to your environment. +// +// Regardless of the function used, it is always your responsibility to validate +// configurations received from external sources. +func WithCredentialsJSON(p []byte) ClientOption { + return withCredentialsJSON(p) +} + +type withCredentialsJSON []byte + +func (w withCredentialsJSON) Apply(o *internal.DialSettings) { + o.CredentialsJSON = make([]byte, len(w)) + copy(o.CredentialsJSON, w) +} + +// WithAuthCredentialsJSON returns a ClientOption that authenticates API calls +// with the given JSON credentials and credential type. +// // Important: If you accept a credential configuration (credential // JSON/File/Stream) from an external source for authentication to Google // Cloud Platform, you must validate it before providing it to any Google @@ -83,15 +198,21 @@ func WithServiceAccountFile(filename string) ClientOption { // Google APIs can compromise the security of your systems and data. For // more information, refer to [Validate credential configurations from // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). -func WithCredentialsJSON(p []byte) ClientOption { - return withCredentialsJSON(p) +func WithAuthCredentialsJSON(credType CredentialsType, json []byte) ClientOption { + return withAuthCredentialsJSON{ + credsType: credType, + json: json, + } } -type withCredentialsJSON []byte +type withAuthCredentialsJSON struct { + credsType CredentialsType + json []byte +} -func (w withCredentialsJSON) Apply(o *internal.DialSettings) { - o.CredentialsJSON = make([]byte, len(w)) - copy(o.CredentialsJSON, w) +func (w withAuthCredentialsJSON) Apply(o *internal.DialSettings) { + o.AuthCredentialsJSON = w.json + o.AuthCredentialsType = w.credsType } // WithEndpoint returns a ClientOption that overrides the default endpoint diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json index 22ab414c..6daf228a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json @@ -253,7 +253,7 @@ "location": "northamerica-south1" } ], - "etag": "\"3131343633323936333034313936343439353533\"", + "etag": "\"39373339343838363630393031393634343537\"", "icons": { "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" @@ -4549,7 +4549,7 @@ } } }, - "revision": "20250925", + "revision": "20251118", "rootUrl": "https://storage.googleapis.com/", "schemas": { "AdvanceRelocateBucketOperationRequest": { @@ -5500,6 +5500,10 @@ "description": "A Compose request.", "id": "ComposeRequest", "properties": { + "deleteSourceObjects": { + "description": "If true, the source objects will be deleted.", + "type": "boolean" + }, "destination": { "$ref": "Object", "description": "Properties of the resulting object." diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go index 6d4af390..08cfa07e 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC. +// Copyright 2026 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -1732,6 +1732,8 @@ func (s Channel) MarshalJSON() ([]byte, error) { // ComposeRequest: A Compose request. type ComposeRequest struct { + // DeleteSourceObjects: If true, the source objects will be deleted. + DeleteSourceObjects bool `json:"deleteSourceObjects,omitempty"` // Destination: Properties of the resulting object. Destination *Object `json:"destination,omitempty"` // Kind: The kind of item this is. @@ -1739,15 +1741,15 @@ type ComposeRequest struct { // SourceObjects: The list of source objects that will be concatenated into a // single object. SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` - // ForceSendFields is a list of field names (e.g. "Destination") to + // ForceSendFields is a list of field names (e.g. "DeleteSourceObjects") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Destination") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "DeleteSourceObjects") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/grpc/dial.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/grpc/dial.go index a6630a0e..a39a20f1 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/grpc/dial.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/grpc/dial.go @@ -14,7 +14,6 @@ import ( "net" "os" "strings" - "sync" "time" "cloud.google.com/go/auth" @@ -31,7 +30,6 @@ import ( grpcgoogle "google.golang.org/grpc/credentials/google" grpcinsecure "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/oauth" - "google.golang.org/grpc/stats" // Install grpclb, which is required for direct path. _ "google.golang.org/grpc/balancer/grpclb" @@ -55,26 +53,6 @@ var dialContext = grpc.DialContext // Assign to var for unit test replacement var dialContextNewAuth = grpctransport.Dial -// otelStatsHandler is a singleton otelgrpc.clientHandler to be used across -// all dial connections to avoid the memory leak documented in -// https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4226 -// -// TODO: If 4226 has been fixed in opentelemetry-go-contrib, replace this -// singleton with inline usage for simplicity. -var ( - initOtelStatsHandlerOnce sync.Once - otelStatsHandler stats.Handler -) - -// otelGRPCStatsHandler returns singleton otelStatsHandler for reuse across all -// dial connections. -func otelGRPCStatsHandler() stats.Handler { - initOtelStatsHandlerOnce.Do(func() { - otelStatsHandler = otelgrpc.NewClientHandler() - }) - return otelStatsHandler -} - // Dial returns a GRPC connection for use communicating with a Google cloud // service, configured with the given ClientOptions. func Dial(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) { @@ -220,6 +198,8 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna defaultEndpointTemplate = ds.DefaultEndpoint } + credsJSON, _ := ds.GetAuthCredentialsJSON() + credsFile, _ := ds.GetAuthCredentialsFile() pool, err := dialContextNewAuth(ctx, secure, &grpctransport.Options{ DisableTelemetry: ds.TelemetryDisabled, DisableAuthentication: ds.NoAuth, @@ -233,8 +213,8 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna DetectOpts: &credentials.DetectOptions{ Scopes: ds.Scopes, Audience: aud, - CredentialsFile: ds.CredentialsFile, - CredentialsJSON: ds.CredentialsJSON, + CredentialsFile: credsFile, + CredentialsJSON: credsJSON, Logger: ds.Logger, }, InternalOptions: &grpctransport.InternalOptions{ @@ -400,7 +380,7 @@ func addOpenTelemetryStatsHandler(opts []grpc.DialOption, settings *internal.Dia if settings.TelemetryDisabled { return opts } - return append(opts, grpc.WithStatsHandler(otelGRPCStatsHandler())) + return append(opts, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) } // grpcTokenSource supplies PerRPCCredentials from an oauth.TokenSource. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/http/dial.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/http/dial.go index a33df912..494de475 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/http/dial.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/transport/http/dial.go @@ -108,6 +108,8 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal. if ds.UserAgent != "" { headers.Set("User-Agent", ds.UserAgent) } + credsJSON, _ := ds.GetAuthCredentialsJSON() + credsFile, _ := ds.GetAuthCredentialsFile() client, err := httptransport.NewClient(&httptransport.Options{ DisableTelemetry: ds.TelemetryDisabled, DisableAuthentication: ds.NoAuth, @@ -120,8 +122,8 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal. DetectOpts: &credentials.DetectOptions{ Scopes: ds.Scopes, Audience: aud, - CredentialsFile: ds.CredentialsFile, - CredentialsJSON: ds.CredentialsJSON, + CredentialsFile: credsFile, + CredentialsJSON: credsJSON, Logger: ds.Logger, }, InternalOptions: &httptransport.InternalOptions{ diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go index c4ace87b..f506074e 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/grpclb/grpc_lb_v1/load_balancer_grpc.pb.go @@ -19,7 +19,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v5.27.1 // source: grpc/lb/v1/load_balancer.proto diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/balancer.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/balancer.go index 0de02e5e..7a89f635 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/balancer.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/balancer.go @@ -62,7 +62,7 @@ var ( Description: "EXPERIMENTAL. Number of scheduler updates in which there were not enough endpoints with valid weight, which caused the WRR policy to fall back to RR behavior.", Unit: "{update}", Labels: []string{"grpc.target"}, - OptionalLabels: []string{"grpc.lb.locality"}, + OptionalLabels: []string{"grpc.lb.locality", "grpc.lb.backend_service"}, Default: false, }) @@ -71,7 +71,7 @@ var ( Description: "EXPERIMENTAL. Number of endpoints from each scheduler update that don't yet have usable weight information (i.e., either the load report has not yet been received, or it is within the blackout period).", Unit: "{endpoint}", Labels: []string{"grpc.target"}, - OptionalLabels: []string{"grpc.lb.locality"}, + OptionalLabels: []string{"grpc.lb.locality", "grpc.lb.backend_service"}, Default: false, }) @@ -80,7 +80,7 @@ var ( Description: "EXPERIMENTAL. Number of endpoints from each scheduler update whose latest weight is older than the expiration period.", Unit: "{endpoint}", Labels: []string{"grpc.target"}, - OptionalLabels: []string{"grpc.lb.locality"}, + OptionalLabels: []string{"grpc.lb.locality", "grpc.lb.backend_service"}, Default: false, }) endpointWeightsMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{ @@ -88,7 +88,7 @@ var ( Description: "EXPERIMENTAL. Weight of each endpoint, recorded on every scheduler update. Endpoints without usable weights will be recorded as weight 0.", Unit: "{endpoint}", Labels: []string{"grpc.target"}, - OptionalLabels: []string{"grpc.lb.locality"}, + OptionalLabels: []string{"grpc.lb.locality", "grpc.lb.backend_service"}, Default: false, }) ) @@ -173,6 +173,7 @@ func (b *wrrBalancer) updateEndpointsLocked(endpoints []resolver.Endpoint) { metricsRecorder: b.metricsRecorder, target: b.target, locality: b.locality, + clusterName: b.clusterName, } for _, addr := range endpoint.Addresses { b.addressWeights.Set(addr, ew) @@ -211,6 +212,7 @@ type wrrBalancer struct { mu sync.Mutex cfg *lbConfig // active config locality string + clusterName string stopPicker *grpcsync.Event addressWeights *resolver.AddressMapV2[*endpointWeight] endpointToWeight *resolver.EndpointMap[*endpointWeight] @@ -231,6 +233,7 @@ func (b *wrrBalancer) UpdateClientConnState(ccs balancer.ClientConnState) error b.mu.Lock() b.cfg = cfg b.locality = weightedtarget.LocalityFromResolverState(ccs.ResolverState) + b.clusterName = backendServiceFromState(ccs.ResolverState) b.updateEndpointsLocked(ccs.ResolverState.Endpoints) b.mu.Unlock() @@ -288,6 +291,7 @@ func (b *wrrBalancer) UpdateState(state balancer.State) { metricsRecorder: b.metricsRecorder, locality: b.locality, target: b.target, + clusterName: b.clusterName, } b.stopPicker = grpcsync.NewEvent() @@ -420,6 +424,7 @@ type picker struct { // The following fields are immutable. target string locality string + clusterName string metricsRecorder estats.MetricsRecorder } @@ -499,6 +504,7 @@ type endpointWeight struct { target string metricsRecorder estats.MetricsRecorder locality string + clusterName string // The following fields are only accessed on calls into the LB policy, and // do not need a mutex. @@ -602,14 +608,14 @@ func (w *endpointWeight) weight(now time.Time, weightExpirationPeriod, blackoutP if recordMetrics { defer func() { - endpointWeightsMetric.Record(w.metricsRecorder, weight, w.target, w.locality) + endpointWeightsMetric.Record(w.metricsRecorder, weight, w.target, w.locality, w.clusterName) }() } // The endpoint has not received a load report (i.e. just turned READY with // no load report). if w.lastUpdated.Equal(time.Time{}) { - endpointWeightNotYetUsableMetric.Record(w.metricsRecorder, 1, w.target, w.locality) + endpointWeightNotYetUsableMetric.Record(w.metricsRecorder, 1, w.target, w.locality, w.clusterName) return 0 } @@ -618,7 +624,7 @@ func (w *endpointWeight) weight(now time.Time, weightExpirationPeriod, blackoutP // start getting data again in the future, and return 0. if now.Sub(w.lastUpdated) >= weightExpirationPeriod { if recordMetrics { - endpointWeightStaleMetric.Record(w.metricsRecorder, 1, w.target, w.locality) + endpointWeightStaleMetric.Record(w.metricsRecorder, 1, w.target, w.locality, w.clusterName) } w.nonEmptySince = time.Time{} return 0 @@ -627,10 +633,27 @@ func (w *endpointWeight) weight(now time.Time, weightExpirationPeriod, blackoutP // If we don't have at least blackoutPeriod worth of data, return 0. if blackoutPeriod != 0 && (w.nonEmptySince.Equal(time.Time{}) || now.Sub(w.nonEmptySince) < blackoutPeriod) { if recordMetrics { - endpointWeightNotYetUsableMetric.Record(w.metricsRecorder, 1, w.target, w.locality) + endpointWeightNotYetUsableMetric.Record(w.metricsRecorder, 1, w.target, w.locality, w.clusterName) } return 0 } return w.weightVal } + +type backendServiceKey struct{} + +// SetBackendService stores the backendService on the resolver state so +// that it can be used later as a label in wrr metrics. +func SetBackendService(state resolver.State, backendService string) resolver.State { + state.Attributes = state.Attributes.WithValue(backendServiceKey{}, backendService) + return state +} + +// getBackendServiceFromState retrieves the cluster name stored as an attribute +// in the resolver state. +func backendServiceFromState(state resolver.State) string { + v := state.Attributes.Value(backendServiceKey{}) + name, _ := v.(string) + return name +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/scheduler.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/scheduler.go index 7d3d6815..8ed8d92a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/scheduler.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/balancer/weightedroundrobin/scheduler.go @@ -39,7 +39,7 @@ func (p *picker) newScheduler(recordMetrics bool) scheduler { } if n == 1 { if recordMetrics { - rrFallbackMetric.Record(p.metricsRecorder, 1, p.target, p.locality) + rrFallbackMetric.Record(p.metricsRecorder, 1, p.target, p.locality, p.clusterName) } return &rrScheduler{numSCs: 1, inc: p.inc} } @@ -58,7 +58,7 @@ func (p *picker) newScheduler(recordMetrics bool) scheduler { if numZero >= n-1 { if recordMetrics { - rrFallbackMetric.Record(p.metricsRecorder, 1, p.target, p.locality) + rrFallbackMetric.Record(p.metricsRecorder, 1, p.target, p.locality, p.clusterName) } return &rrScheduler{numSCs: uint32(n), inc: p.inc} } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/clientconn.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/clientconn.go index c0c2c9a7..b767d3e3 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/clientconn.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/clientconn.go @@ -35,6 +35,8 @@ import ( "google.golang.org/grpc/balancer/pickfirst" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" @@ -98,6 +100,41 @@ var ( errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)") ) +var ( + disconnectionsMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ + Name: "grpc.subchannel.disconnections", + Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.", + Unit: "{disconnection}", + Labels: []string{"grpc.target"}, + OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality", "grpc.disconnect_error"}, + Default: false, + }) + connectionAttemptsSucceededMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ + Name: "grpc.subchannel.connection_attempts_succeeded", + Description: "EXPERIMENTAL. Number of successful connection attempts.", + Unit: "{attempt}", + Labels: []string{"grpc.target"}, + OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality"}, + Default: false, + }) + connectionAttemptsFailedMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{ + Name: "grpc.subchannel.connection_attempts_failed", + Description: "EXPERIMENTAL. Number of failed connection attempts.", + Unit: "{attempt}", + Labels: []string{"grpc.target"}, + OptionalLabels: []string{"grpc.lb.backend_service", "grpc.lb.locality"}, + Default: false, + }) + openConnectionsMetric = expstats.RegisterInt64UpDownCount(expstats.MetricDescriptor{ + Name: "grpc.subchannel.open_connections", + Description: "EXPERIMENTAL. Number of open connections.", + Unit: "{attempt}", + Labels: []string{"grpc.target"}, + OptionalLabels: []string{"grpc.lb.backend_service", "grpc.security_level", "grpc.lb.locality"}, + Default: false, + }) +) + const ( defaultClientMaxReceiveMessageSize = 1024 * 1024 * 4 defaultClientMaxSendMessageSize = math.MaxInt32 @@ -262,9 +299,10 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * }() // This creates the name resolver, load balancer, etc. - if err := cc.idlenessMgr.ExitIdleMode(); err != nil { - return nil, err + if err := cc.exitIdleMode(); err != nil { + return nil, fmt.Errorf("failed to exit idle mode: %w", err) } + cc.idlenessMgr.UnsafeSetNotIdle() // Return now for non-blocking dials. if !cc.dopts.block { @@ -332,7 +370,7 @@ func (cc *ClientConn) addTraceEvent(msg string) { Severity: channelz.CtInfo, } } - channelz.AddTraceEvent(logger, cc.channelz, 0, ted) + channelz.AddTraceEvent(logger, cc.channelz, 1, ted) } type idler ClientConn @@ -341,14 +379,17 @@ func (i *idler) EnterIdleMode() { (*ClientConn)(i).enterIdleMode() } -func (i *idler) ExitIdleMode() error { - return (*ClientConn)(i).exitIdleMode() +func (i *idler) ExitIdleMode() { + // Ignore the error returned from this method, because from the perspective + // of the caller (idleness manager), the channel would have always moved out + // of IDLE by the time this method returns. + (*ClientConn)(i).exitIdleMode() } // exitIdleMode moves the channel out of idle mode by recreating the name // resolver and load balancer. This should never be called directly; use // cc.idlenessMgr.ExitIdleMode instead. -func (cc *ClientConn) exitIdleMode() (err error) { +func (cc *ClientConn) exitIdleMode() error { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() @@ -356,11 +397,23 @@ func (cc *ClientConn) exitIdleMode() (err error) { } cc.mu.Unlock() + // Set state to CONNECTING before building the name resolver + // so the channel does not remain in IDLE. + cc.csMgr.updateState(connectivity.Connecting) + // This needs to be called without cc.mu because this builds a new resolver // which might update state or report error inline, which would then need to // acquire cc.mu. if err := cc.resolverWrapper.start(); err != nil { - return err + // If resolver creation fails, treat it like an error reported by the + // resolver before any valid updates. Set channel's state to + // TransientFailure, and set an erroring picker with the resolver build + // error, which will returned as part of any subsequent RPCs. + logger.Warningf("Failed to start resolver: %v", err) + cc.csMgr.updateState(connectivity.TransientFailure) + cc.mu.Lock() + cc.updateResolverStateAndUnlock(resolver.State{}, err) + return fmt.Errorf("failed to start resolver: %w", err) } cc.addTraceEvent("exiting idle mode") @@ -681,10 +734,8 @@ func (cc *ClientConn) GetState() connectivity.State { // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func (cc *ClientConn) Connect() { - if err := cc.idlenessMgr.ExitIdleMode(); err != nil { - cc.addTraceEvent(err.Error()) - return - } + cc.idlenessMgr.ExitIdleMode() + // If the ClientConn was not in idle mode, we need to call ExitIdle on the // LB policy so that connections can be created. cc.mu.Lock() @@ -735,8 +786,8 @@ func init() { internal.EnterIdleModeForTesting = func(cc *ClientConn) { cc.idlenessMgr.EnterIdleModeForTesting() } - internal.ExitIdleModeForTesting = func(cc *ClientConn) error { - return cc.idlenessMgr.ExitIdleMode() + internal.ExitIdleModeForTesting = func(cc *ClientConn) { + cc.idlenessMgr.ExitIdleMode() } } @@ -861,6 +912,7 @@ func (cc *ClientConn) newAddrConnLocked(addrs []resolver.Address, opts balancer. channelz: channelz.RegisterSubChannel(cc.channelz, ""), resetBackoff: make(chan struct{}), } + ac.updateTelemetryLabelsLocked() ac.ctx, ac.cancel = context.WithCancel(cc.ctx) // Start with our address set to the first address; this may be updated if // we connect to different addresses. @@ -977,7 +1029,7 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { } ac.addrs = addrs - + ac.updateTelemetryLabelsLocked() if ac.state == connectivity.Shutdown || ac.state == connectivity.TransientFailure || ac.state == connectivity.Idle { @@ -1216,6 +1268,9 @@ type addrConn struct { resetBackoff chan struct{} channelz *channelz.SubChannel + + localityLabel string + backendServiceLabel string } // Note: this requires a lock on ac.mu. @@ -1223,6 +1278,18 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) if ac.state == s { return } + + // If we are transitioning out of Ready, it means there is a disconnection. + // A SubConn can also transition from CONNECTING directly to IDLE when + // a transport is successfully created, but the connection fails + // before the SubConn can send the notification for READY. We treat + // this as a successful connection and transition to IDLE. + // TODO: https://github.com/grpc/grpc-go/issues/7862 - Remove the second + // part of the if condition below once the issue is fixed. + if ac.state == connectivity.Ready || (ac.state == connectivity.Connecting && s == connectivity.Idle) { + disconnectionsMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel, "unknown") + openConnectionsMetric.Record(ac.cc.metricsRecorderList, -1, ac.cc.target, ac.backendServiceLabel, ac.securityLevelLocked(), ac.localityLabel) + } ac.state = s ac.channelz.ChannelMetrics.State.Store(&s) if lastErr == nil { @@ -1280,6 +1347,15 @@ func (ac *addrConn) resetTransportAndUnlock() { ac.mu.Unlock() if err := ac.tryAllAddrs(acCtx, addrs, connectDeadline); err != nil { + if !errors.Is(err, context.Canceled) { + connectionAttemptsFailedMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel) + } else { + if logger.V(2) { + // This records cancelled connection attempts which can be later + // replaced by a metric. + logger.Infof("Context cancellation detected; not recording this as a failed connection attempt.") + } + } // TODO: #7534 - Move re-resolution requests into the pick_first LB policy // to ensure one resolution request per pass instead of per subconn failure. ac.cc.resolveNow(resolver.ResolveNowOptions{}) @@ -1319,10 +1395,50 @@ func (ac *addrConn) resetTransportAndUnlock() { } // Success; reset backoff. ac.mu.Lock() + connectionAttemptsSucceededMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.localityLabel) + openConnectionsMetric.Record(ac.cc.metricsRecorderList, 1, ac.cc.target, ac.backendServiceLabel, ac.securityLevelLocked(), ac.localityLabel) ac.backoffIdx = 0 ac.mu.Unlock() } +// updateTelemetryLabelsLocked calculates and caches the telemetry labels based on the +// first address in addrConn. +func (ac *addrConn) updateTelemetryLabelsLocked() { + labelsFunc, ok := internal.AddressToTelemetryLabels.(func(resolver.Address) map[string]string) + if !ok || len(ac.addrs) == 0 { + // Reset defaults + ac.localityLabel = "" + ac.backendServiceLabel = "" + return + } + labels := labelsFunc(ac.addrs[0]) + ac.localityLabel = labels["grpc.lb.locality"] + ac.backendServiceLabel = labels["grpc.lb.backend_service"] +} + +type securityLevelKey struct{} + +func (ac *addrConn) securityLevelLocked() string { + var secLevel string + // During disconnection, ac.transport is nil. Fall back to the security level + // stored in the current address during connection. + if ac.transport == nil { + secLevel, _ = ac.curAddr.Attributes.Value(securityLevelKey{}).(string) + return secLevel + } + authInfo := ac.transport.Peer().AuthInfo + if ci, ok := authInfo.(interface { + GetCommonAuthInfo() credentials.CommonAuthInfo + }); ok { + secLevel = ci.GetCommonAuthInfo().SecurityLevel.String() + // Store the security level in the current address' attributes so + // that it remains available for disconnection metrics after the + // transport is closed. + ac.curAddr.Attributes = ac.curAddr.Attributes.WithValue(securityLevelKey{}, secLevel) + } + return secLevel +} + // tryAllAddrs tries to create a connection to the addresses, and stop when at // the first successful one. It returns an error if no address was successfully // connected, or updates ac appropriately with the new transport. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go index 21cb01be..44b99ce7 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v5.27.1 // source: grpc/gcp/handshaker.proto diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go index 2b57ba65..472813f5 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go @@ -76,6 +76,7 @@ const ( MetricTypeFloatHisto MetricTypeIntGauge MetricTypeIntUpDownCount + MetricTypeIntAsyncGauge ) // Int64CountHandle is a typed handle for a int count metric. This handle @@ -172,6 +173,30 @@ func (h *Int64GaugeHandle) Record(recorder MetricsRecorder, incr int64, labels . recorder.RecordInt64Gauge(h, incr, labels...) } +// AsyncMetric is a marker interface for asynchronous metric types. +type AsyncMetric interface { + isAsync() + Descriptor() *MetricDescriptor +} + +// Int64AsyncGaugeHandle is a typed handle for an int gauge metric. This handle is +// passed at the recording point in order to know which metric to record on. +type Int64AsyncGaugeHandle MetricDescriptor + +// isAsync implements the AsyncMetric interface. +func (h *Int64AsyncGaugeHandle) isAsync() {} + +// Descriptor returns the int64 gauge handle typecast to a pointer to a +// MetricDescriptor. +func (h *Int64AsyncGaugeHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the int64 gauge value on the metrics recorder provided. +func (h *Int64AsyncGaugeHandle) Record(recorder AsyncMetricsRecorder, value int64, labels ...string) { + recorder.RecordInt64AsyncGauge(h, value, labels...) +} + // registeredMetrics are the registered metric descriptor names. var registeredMetrics = make(map[string]bool) @@ -282,6 +307,20 @@ func RegisterInt64UpDownCount(descriptor MetricDescriptor) *Int64UpDownCountHand return (*Int64UpDownCountHandle)(descPtr) } +// RegisterInt64AsyncGauge registers the metric description onto the global registry. +// It returns a typed handle to use for recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterInt64AsyncGauge(descriptor MetricDescriptor) *Int64AsyncGaugeHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeIntAsyncGauge + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Int64AsyncGaugeHandle)(descPtr) +} + // snapshotMetricsRegistryForTesting snapshots the global data of the metrics // registry. Returns a cleanup function that sets the metrics registry to its // original state. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metrics.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metrics.go index cb57f1a7..d7d404cb 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metrics.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/experimental/stats/metrics.go @@ -43,6 +43,13 @@ type MetricsRecorder interface { RecordInt64UpDownCount(handle *Int64UpDownCountHandle, incr int64, labels ...string) } +// AsyncMetricsRecorder records on asynchronous metrics derived from metric registry. +type AsyncMetricsRecorder interface { + // RecordInt64AsyncGauge records the measurement alongside labels on the int + // count associated with the provided handle asynchronously + RecordInt64AsyncGauge(handle *Int64AsyncGaugeHandle, incr int64, labels ...string) +} + // Metrics is an experimental legacy alias of the now-stable stats.MetricSet. // Metrics will be deleted in a future release. type Metrics = stats.MetricSet diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go index ba25b898..f38de74a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go @@ -67,6 +67,10 @@ type Balancer struct { // balancerCurrent before the UpdateSubConnState is called on the // balancerCurrent. currentMu sync.Mutex + + // activeGoroutines tracks all the goroutines that this balancer has started + // and that should be waited on when the balancer closes. + activeGoroutines sync.WaitGroup } // swap swaps out the current lb with the pending lb and updates the ClientConn. @@ -76,7 +80,9 @@ func (gsb *Balancer) swap() { cur := gsb.balancerCurrent gsb.balancerCurrent = gsb.balancerPending gsb.balancerPending = nil + gsb.activeGoroutines.Add(1) go func() { + defer gsb.activeGoroutines.Done() gsb.currentMu.Lock() defer gsb.currentMu.Unlock() cur.Close() @@ -274,6 +280,7 @@ func (gsb *Balancer) Close() { currentBalancerToClose.Close() pendingBalancerToClose.Close() + gsb.activeGoroutines.Wait() } // balancerWrapper wraps a balancer.Balancer, and overrides some Balancer @@ -324,7 +331,12 @@ func (bw *balancerWrapper) UpdateState(state balancer.State) { defer bw.gsb.mu.Unlock() bw.lastState = state + // If Close() acquires the mutex before UpdateState(), the balancer + // will already have been removed from the current or pending state when + // reaching this point. if !bw.gsb.balancerCurrentOrPending(bw) { + // Returning here ensures that (*Balancer).swap() is not invoked after + // (*Balancer).Close() and therefore prevents "use after close". return } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 91f76093..6414ee4b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -77,6 +77,11 @@ var ( // - Target resolution is disabled. // - The DNS resolver is being used. EnableDefaultPortForProxyTarget = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_DEFAULT_PORT_FOR_PROXY_TARGET", true) + + // XDSAuthorityRewrite indicates whether xDS authority rewriting is enabled. + // This feature is defined in gRFC A81 and is enabled by setting the + // environment variable GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE to "true". + XDSAuthorityRewrite = boolFromEnv("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", false) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/experimental.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/experimental.go index 7617be21..c90cc51b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/experimental.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/experimental.go @@ -25,4 +25,8 @@ var ( // BufferPool is implemented by the grpc package and returns a server // option to configure a shared buffer pool for a grpc.Server. BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption + + // AcceptCompressors is implemented by the grpc package and returns + // a call option that restricts the grpc-accept-encoding header for a call. + AcceptCompressors any // func(...string) grpc.CallOption ) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/idle/idle.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/idle/idle.go index 2c13ee9d..d3cd24f8 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/idle/idle.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/idle/idle.go @@ -21,7 +21,6 @@ package idle import ( - "fmt" "math" "sync" "sync/atomic" @@ -33,15 +32,15 @@ var timeAfterFunc = func(d time.Duration, f func()) *time.Timer { return time.AfterFunc(d, f) } -// Enforcer is the functionality provided by grpc.ClientConn to enter -// and exit from idle mode. -type Enforcer interface { - ExitIdleMode() error +// ClientConn is the functionality provided by grpc.ClientConn to enter and exit +// from idle mode. +type ClientConn interface { + ExitIdleMode() EnterIdleMode() } -// Manager implements idleness detection and calls the configured Enforcer to -// enter/exit idle mode when appropriate. Must be created by NewManager. +// Manager implements idleness detection and calls the ClientConn to enter/exit +// idle mode when appropriate. Must be created by NewManager. type Manager struct { // State accessed atomically. lastCallEndTime int64 // Unix timestamp in nanos; time when the most recent RPC completed. @@ -51,8 +50,8 @@ type Manager struct { // Can be accessed without atomics or mutex since these are set at creation // time and read-only after that. - enforcer Enforcer // Functionality provided by grpc.ClientConn. - timeout time.Duration + cc ClientConn // Functionality provided by grpc.ClientConn. + timeout time.Duration // idleMu is used to guarantee mutual exclusion in two scenarios: // - Opposing intentions: @@ -72,9 +71,9 @@ type Manager struct { // NewManager creates a new idleness manager implementation for the // given idle timeout. It begins in idle mode. -func NewManager(enforcer Enforcer, timeout time.Duration) *Manager { +func NewManager(cc ClientConn, timeout time.Duration) *Manager { return &Manager{ - enforcer: enforcer, + cc: cc, timeout: timeout, actuallyIdle: true, activeCallsCount: -math.MaxInt32, @@ -127,7 +126,7 @@ func (m *Manager) handleIdleTimeout() { // Now that we've checked that there has been no activity, attempt to enter // idle mode, which is very likely to succeed. - if m.tryEnterIdleMode() { + if m.tryEnterIdleMode(true) { // Successfully entered idle mode. No timer needed until we exit idle. return } @@ -142,10 +141,13 @@ func (m *Manager) handleIdleTimeout() { // that, it performs a last minute check to ensure that no new RPC has come in, // making the channel active. // +// checkActivity controls if a check for RPC activity, since the last time the +// idle_timeout fired, is made. + // Return value indicates whether or not the channel moved to idle mode. // // Holds idleMu which ensures mutual exclusion with exitIdleMode. -func (m *Manager) tryEnterIdleMode() bool { +func (m *Manager) tryEnterIdleMode(checkActivity bool) bool { // Setting the activeCallsCount to -math.MaxInt32 indicates to OnCallBegin() // that the channel is either in idle mode or is trying to get there. if !atomic.CompareAndSwapInt32(&m.activeCallsCount, 0, -math.MaxInt32) { @@ -166,7 +168,7 @@ func (m *Manager) tryEnterIdleMode() bool { atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) return false } - if atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { + if checkActivity && atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { // A very short RPC could have come in (and also finished) after we // checked for calls count and activity in handleIdleTimeout(), but // before the CAS operation. So, we need to check for activity again. @@ -177,44 +179,37 @@ func (m *Manager) tryEnterIdleMode() bool { // No new RPCs have come in since we set the active calls count value to // -math.MaxInt32. And since we have the lock, it is safe to enter idle mode // unconditionally now. - m.enforcer.EnterIdleMode() + m.cc.EnterIdleMode() m.actuallyIdle = true return true } // EnterIdleModeForTesting instructs the channel to enter idle mode. func (m *Manager) EnterIdleModeForTesting() { - m.tryEnterIdleMode() + m.tryEnterIdleMode(false) } // OnCallBegin is invoked at the start of every RPC. -func (m *Manager) OnCallBegin() error { +func (m *Manager) OnCallBegin() { if m.isClosed() { - return nil + return } if atomic.AddInt32(&m.activeCallsCount, 1) > 0 { // Channel is not idle now. Set the activity bit and allow the call. atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) - return nil + return } // Channel is either in idle mode or is in the process of moving to idle // mode. Attempt to exit idle mode to allow this RPC. - if err := m.ExitIdleMode(); err != nil { - // Undo the increment to calls count, and return an error causing the - // RPC to fail. - atomic.AddInt32(&m.activeCallsCount, -1) - return err - } - + m.ExitIdleMode() atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) - return nil } -// ExitIdleMode instructs m to call the enforcer's ExitIdleMode and update m's +// ExitIdleMode instructs m to call the ClientConn's ExitIdleMode and update its // internal state. -func (m *Manager) ExitIdleMode() error { +func (m *Manager) ExitIdleMode() { // Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. m.idleMu.Lock() defer m.idleMu.Unlock() @@ -231,12 +226,10 @@ func (m *Manager) ExitIdleMode() error { // m.ExitIdleMode. // // In any case, there is nothing to do here. - return nil + return } - if err := m.enforcer.ExitIdleMode(); err != nil { - return fmt.Errorf("failed to exit idle mode: %w", err) - } + m.cc.ExitIdleMode() // Undo the idle entry process. This also respects any new RPC attempts. atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) @@ -244,7 +237,23 @@ func (m *Manager) ExitIdleMode() error { // Start a new timer to fire after the configured idle timeout. m.resetIdleTimerLocked(m.timeout) - return nil +} + +// UnsafeSetNotIdle instructs the Manager to update its internal state to +// reflect the reality that the channel is no longer in IDLE mode. +// +// N.B. This method is intended only for internal use by the gRPC client +// when it exits IDLE mode **manually** from `Dial`. The callsite must ensure: +// - The channel was **actually in IDLE mode** immediately prior to the call. +// - There is **no concurrent activity** that could cause the channel to exit +// IDLE mode *naturally* at the same time. +func (m *Manager) UnsafeSetNotIdle() { + m.idleMu.Lock() + defer m.idleMu.Unlock() + + atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) + m.actuallyIdle = false + m.resetIdleTimerLocked(m.timeout) } // OnCallEnd is invoked at the end of every RPC. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/internal.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/internal.go index 2699223a..27bef83d 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/internal.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/internal.go @@ -244,6 +244,10 @@ var ( // When set, the function will be called before the stream enters // the blocking state. NewStreamWaitingForResolver = func() {} + + // AddressToTelemetryLabels is an xDS-provided function to extract telemetry + // labels from a resolver.Address. Callers must assert its type before calling. + AddressToTelemetryLabels any // func(addr resolver.Address) map[string]string ) // HealthChecker defines the signature of the client-side LB channel health diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/proto/grpc_lookup_v1/rls_grpc.pb.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/proto/grpc_lookup_v1/rls_grpc.pb.go index 16611074..5b340129 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/proto/grpc_lookup_v1/rls_grpc.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/proto/grpc_lookup_v1/rls_grpc.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.0 // - protoc v5.27.1 // source: grpc/lookup/v1/rls.proto diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 65b4ab24..38ca031a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -370,7 +370,7 @@ func NewHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts }) t.logger = prefixLoggerForClientTransport(t) // Add peer information to the http2client context. - t.ctx = peer.NewContext(t.ctx, t.getPeer()) + t.ctx = peer.NewContext(t.ctx, t.Peer()) if md, ok := addr.Metadata.(*metadata.MD); ok { t.md = *md @@ -510,7 +510,7 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *ClientSt return s } -func (t *http2Client) getPeer() *peer.Peer { +func (t *http2Client) Peer() *peer.Peer { return &peer.Peer{ Addr: t.remoteAddr, AuthInfo: t.authInfo, // Can be nil @@ -551,6 +551,9 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) hfLen := 7 // :method, :scheme, :path, :authority, content-type, user-agent, te hfLen += len(authData) + len(callAuthData) registeredCompressors := t.registeredCompressors + if callHdr.AcceptedCompressors != nil { + registeredCompressors = *callHdr.AcceptedCompressors + } if callHdr.PreviousAttempts > 0 { hfLen++ } @@ -742,7 +745,7 @@ func (e NewStreamError) Error() string { // NewStream creates a stream and registers it into the transport as "active" // streams. All non-nil errors returned will be *NewStreamError. func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*ClientStream, error) { - ctx = peer.NewContext(ctx, t.getPeer()) + ctx = peer.NewContext(ctx, t.Peer()) // ServerName field of the resolver returned address takes precedence over // Host field of CallHdr to determine the :authority header. This is because, @@ -1485,7 +1488,7 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { case "grpc-status": code, err := strconv.ParseInt(hf.Value, 10, 32) if err != nil { - se := status.New(codes.Internal, fmt.Sprintf("transport: malformed grpc-status: %v", err)) + se := status.New(codes.Unknown, fmt.Sprintf("transport: malformed grpc-status: %v", err)) t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream) return } @@ -1807,8 +1810,6 @@ func (t *http2Client) socketMetrics() *channelz.EphemeralSocketMetrics { } } -func (t *http2Client) RemoteAddr() net.Addr { return t.remoteAddr } - func (t *http2Client) incrMsgSent() { if channelz.IsOn() { t.channelz.SocketMetrics.MessagesSent.Add(1) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http_util.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http_util.go index 6209eb23..5bbb641a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -411,12 +411,6 @@ var writeBufferPoolMap = make(map[int]*sync.Pool) var writeBufferMutex sync.Mutex func newFramer(conn io.ReadWriter, writeBufferSize, readBufferSize int, sharedWriteBuffer bool, maxHeaderListSize uint32, memPool mem.BufferPool) *framer { - if memPool == nil { - // Note that this is only supposed to be nil in tests. Otherwise, stream - // is always initialized with a BufferPool. - memPool = mem.DefaultBufferPool() - } - if writeBufferSize < 0 { writeBufferSize = 0 } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/transport.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/transport.go index 5ff83a7d..6daf1e00 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -553,6 +553,12 @@ type CallHdr struct { // outbound message. SendCompress string + // AcceptedCompressors overrides the grpc-accept-encoding header for this + // call. When nil, the transport advertises the default set of registered + // compressors. A non-nil pointer overrides that value (including the empty + // string to advertise none). + AcceptedCompressors *string + // Creds specifies credentials.PerRPCCredentials for a call. Creds credentials.PerRPCCredentials @@ -608,8 +614,9 @@ type ClientTransport interface { // with a human readable string with debug info. GetGoAwayReason() (GoAwayReason, string) - // RemoteAddr returns the remote network address. - RemoteAddr() net.Addr + // Peer returns information about the peer associated with the Transport. + // The returned information includes authentication and network address details. + Peer() *peer.Peer } // ServerTransport is the common interface for all gRPC server-side transport diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cdsbalancer.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cdsbalancer.go index 0ad77b85..a94fc664 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cdsbalancer.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cdsbalancer.go @@ -448,7 +448,7 @@ func (b *cdsBalancer) annotateErrorWithNodeID(err error) error { // graph is resolved, generates child policy config and pushes it down. // // Only executed in the context of a serializer callback. -func (b *cdsBalancer) onClusterUpdate(name string, update xdsresource.ClusterUpdate) { +func (b *cdsBalancer) onClusterUpdate(name string, update *xdsresource.ClusterUpdate) { state := b.watchers[name] if state == nil { // We are currently not watching this cluster anymore. Return early. @@ -458,7 +458,7 @@ func (b *cdsBalancer) onClusterUpdate(name string, update xdsresource.ClusterUpd b.logger.Infof("Received Cluster resource: %s", pretty.ToJSON(update)) // Update the watchers map with the update for the cluster. - state.lastUpdate = &update + state.lastUpdate = update // For an aggregate cluster, always use the security configuration on the // root cluster. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cluster_watcher.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cluster_watcher.go index dd702b12..35592396 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cluster_watcher.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/cluster_watcher.go @@ -32,8 +32,9 @@ type clusterWatcher struct { parent *cdsBalancer } -func (cw *clusterWatcher) ResourceChanged(u *xdsresource.ClusterResourceData, onDone func()) { - handleUpdate := func(context.Context) { cw.parent.onClusterUpdate(cw.name, u.Resource); onDone() } +func (cw *clusterWatcher) ResourceChanged(u *xdsresource.ClusterUpdate, onDone func()) { + handleUpdate := func(context.Context) { cw.parent.onClusterUpdate(cw.name, u); onDone() } + cw.parent.serializer.ScheduleOr(handleUpdate, onDone) } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go index cdc7bf2e..b5dc7737 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/clusterimpl.go @@ -33,6 +33,7 @@ import ( "time" "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/weightedroundrobin" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" @@ -297,7 +298,7 @@ func (b *clusterImplBalancer) UpdateClientConnState(s balancer.ClientConnState) // Addresses and sub-balancer config are sent to sub-balancer. err = b.child.UpdateClientConnState(balancer.ClientConnState{ - ResolverState: s.ResolverState, + ResolverState: weightedroundrobin.SetBackendService(s.ResolverState, b.clusterName), BalancerConfig: parsedCfg, }) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/picker.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/picker.go index 0c033261..d766a09a 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/picker.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterimpl/picker.go @@ -194,3 +194,25 @@ func (d *picker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { return pr, err } + +// autoHostRewriteKey is the context key used to store the value of +// route's autoHostRewrite in the RPC context. +type autoHostRewriteKey struct{} + +// autoHostRewrite retrieves the autoHostRewrite value from the provided context. +func autoHostRewrite(ctx context.Context) bool { + v, _ := ctx.Value(autoHostRewriteKey{}).(bool) + return v +} + +// AutoHostRewriteForTesting returns the value of autoHostRewrite field; +// to be used for testing only. +func AutoHostRewriteForTesting(ctx context.Context) bool { + return autoHostRewrite(ctx) +} + +// SetAutoHostRewrite adds the autoHostRewrite value to the context for +// the xds_cluster_impl LB policy to pick. +func SetAutoHostRewrite(ctx context.Context, autohostRewrite bool) context.Context { + return context.WithValue(ctx, autoHostRewriteKey{}, autohostRewrite) +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterresolver/resource_resolver_eds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterresolver/resource_resolver_eds.go index 18b517f1..6dcdb898 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterresolver/resource_resolver_eds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/balancer/clusterresolver/resource_resolver_eds.go @@ -76,14 +76,14 @@ func newEDSResolver(nameToWatch string, producer xdsresource.Producer, topLevelR } // ResourceChanged is invoked to report an update for the resource being watched. -func (er *edsDiscoveryMechanism) ResourceChanged(update *xdsresource.EndpointsResourceData, onDone func()) { +func (er *edsDiscoveryMechanism) ResourceChanged(update *xdsresource.EndpointsUpdate, onDone func()) { if er.stopped.HasFired() { onDone() return } er.mu.Lock() - er.update = &update.Resource + er.update = update er.mu.Unlock() er.topLevelResolver.onUpdate(onDone) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go index f3960def..79fb7902 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/bootstrap/bootstrap.go @@ -44,6 +44,7 @@ import ( const ( serverFeaturesIgnoreResourceDeletion = "ignore_resource_deletion" + serverFeaturesTrustedXDSServer = "trusted_xds_server" gRPCUserAgentName = "gRPC Go" clientFeatureNoOverprovisioning = "envoy.lb.does_not_support_overprovisioning" clientFeatureResourceWrapper = "xds.config.resource-in-sotw" @@ -256,6 +257,18 @@ func (sc *ServerConfig) ServerFeaturesIgnoreResourceDeletion() bool { return false } +// ServerFeaturesTrustedXDSServer returns true if this server is trusted, +// and gRPC should accept security-config-affecting fields from the server +// as described in gRFC A81. +func (sc *ServerConfig) ServerFeaturesTrustedXDSServer() bool { + for _, sf := range sc.serverFeatures { + if sf == serverFeaturesTrustedXDSServer { + return true + } + } + return false +} + // SelectedChannelCreds returns the selected credentials configuration for // communicating with this server. func (sc *ServerConfig) SelectedChannelCreds() ChannelCreds { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go index 3e6e99d0..52b8dab8 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/internal/buffer/unbounded.go @@ -83,6 +83,7 @@ func (b *Unbounded) Load() { default: } } else if b.closing && !b.closed { + b.closed = true close(b.c) } } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/ads_stream.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/ads_stream.go index 3ad62ac1..24e66b83 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/ads_stream.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/ads_stream.go @@ -28,7 +28,6 @@ import ( igrpclog "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/xds/clients" "google.golang.org/grpc/internal/xds/clients/internal/backoff" - "google.golang.org/grpc/internal/xds/clients/internal/buffer" "google.golang.org/grpc/internal/xds/clients/internal/pretty" "google.golang.org/grpc/internal/xds/clients/xdsclient/internal/xdsresource" @@ -48,6 +47,13 @@ const ( perRPCVerbosityLevel = 9 ) +// request represents a queued request message to be sent on the ADS stream. It +// contains the type of the resource and the list of resource names to be sent. +type request struct { + typ ResourceType + resourceNames []string +} + // response represents a response received on the ADS stream. It contains the // type URL, version, and resources for the response. type response struct { @@ -76,9 +82,7 @@ type adsStreamEventHandler interface { type resourceTypeState struct { version string // Last acked version. Should not be reset when the stream breaks. nonce string // Last received nonce. Should be reset when the stream breaks. - bufferedRequests chan struct{} // Channel to buffer requests when writing is blocked. subscribedResources map[string]*xdsresource.ResourceWatchState // Map of subscribed resource names to their state. - pendingWrite bool // True if there is a pending write for this resource type. } // adsStreamImpl provides the functionality associated with an ADS (Aggregated @@ -99,15 +103,16 @@ type adsStreamImpl struct { // The following fields are initialized in the constructor and are not // written to afterwards, and hence can be accessed without a mutex. streamCh chan clients.Stream // New ADS streams are pushed here. - requestCh *buffer.Unbounded // Subscriptions and unsubscriptions are pushed here. runnerDoneCh chan struct{} // Notify completion of runner goroutine. cancel context.CancelFunc // To cancel the context passed to the runner goroutine. fc *adsFlowControl // Flow control for ADS stream. + notifySender chan struct{} // To notify the sending goroutine of a pending request. // Guards access to the below fields (and to the contents of the map). mu sync.Mutex resourceTypeState map[ResourceType]*resourceTypeState // Map of resource types to their state. firstRequest bool // False after the first request is sent out. + pendingRequests []request // Subscriptions and unsubscriptions are pushed here. } // adsStreamOpts contains the options for creating a new ADS Stream. @@ -132,9 +137,9 @@ func newADSStreamImpl(opts adsStreamOpts) *adsStreamImpl { watchExpiryTimeout: opts.watchExpiryTimeout, streamCh: make(chan clients.Stream, 1), - requestCh: buffer.NewUnbounded(), runnerDoneCh: make(chan struct{}), fc: newADSFlowControl(), + notifySender: make(chan struct{}, 1), resourceTypeState: make(map[ResourceType]*resourceTypeState), } @@ -151,76 +156,79 @@ func newADSStreamImpl(opts adsStreamOpts) *adsStreamImpl { func (s *adsStreamImpl) Stop() { s.cancel() s.fc.stop() - s.requestCh.Close() <-s.runnerDoneCh s.logger.Infof("Shutdown ADS stream") } // subscribe subscribes to the given resource. It is assumed that multiple // subscriptions for the same resource is deduped at the caller. A discovery -// request is sent out on the underlying stream for the resource type when there -// is sufficient flow control quota. +// request is sent out on the underlying stream, for the resource type with the +// newly subscribed resource. func (s *adsStreamImpl) subscribe(typ ResourceType, name string) { if s.logger.V(2) { s.logger.Infof("Subscribing to resource %q of type %q", name, typ.TypeName) } s.mu.Lock() - defer s.mu.Unlock() - state, ok := s.resourceTypeState[typ] if !ok { // An entry in the type state map is created as part of the first // subscription request for this type. - state = &resourceTypeState{ - subscribedResources: make(map[string]*xdsresource.ResourceWatchState), - bufferedRequests: make(chan struct{}, 1), - } + state = &resourceTypeState{subscribedResources: make(map[string]*xdsresource.ResourceWatchState)} s.resourceTypeState[typ] = state } // Create state for the newly subscribed resource. The watch timer will // be started when a request for this resource is actually sent out. state.subscribedResources[name] = &xdsresource.ResourceWatchState{State: xdsresource.ResourceWatchStateStarted} - state.pendingWrite = true // Send a request for the resource type with updated subscriptions. - s.requestCh.Put(typ) + s.pendingRequests = append(s.pendingRequests, request{typ: typ, resourceNames: resourceNames(state.subscribedResources)}) + s.mu.Unlock() + + select { + case s.notifySender <- struct{}{}: + default: + } } -// Unsubscribe cancels the subscription to the given resource. It is a no-op if +// unsubscribe cancels the subscription to the given resource. It is a no-op if // the given resource does not exist. The watch expiry timer associated with the // resource is stopped if one is active. A discovery request is sent out on the -// stream for the resource type when there is sufficient flow control quota. -func (s *adsStreamImpl) Unsubscribe(typ ResourceType, name string) { +// stream for the resource type with the updated set of resource names. +func (s *adsStreamImpl) unsubscribe(typ ResourceType, name string) { if s.logger.V(2) { s.logger.Infof("Unsubscribing to resource %q of type %q", name, typ.TypeName) } s.mu.Lock() - defer s.mu.Unlock() - state, ok := s.resourceTypeState[typ] if !ok { + s.mu.Unlock() return } - rs, ok := state.subscribedResources[name] if !ok { + s.mu.Unlock() return } if rs.ExpiryTimer != nil { rs.ExpiryTimer.Stop() } delete(state.subscribedResources, name) - state.pendingWrite = true // Send a request for the resource type with updated subscriptions. - s.requestCh.Put(typ) + s.pendingRequests = append(s.pendingRequests, request{typ: typ, resourceNames: resourceNames(state.subscribedResources)}) + s.mu.Unlock() + + select { + case s.notifySender <- struct{}{}: + default: + } } // runner is a long-running goroutine that handles the lifecycle of the ADS -// stream. It spwans another goroutine to handle writes of discovery request +// stream. It spawns another goroutine to handle writes of discovery request // messages on the stream. Whenever an existing stream fails, it performs // exponential backoff (if no messages were received on that stream) before // creating a new stream. @@ -280,53 +288,44 @@ func (s *adsStreamImpl) send(ctx context.Context) { stream = nil continue } - case req, ok := <-s.requestCh.Get(): - if !ok { - return + case <-s.notifySender: + // If there's no stream yet, skip the request. This request will be resent + // when a new stream is created. If no stream is created, the watcher will + // timeout (same as server not sending response back). + if stream == nil { + continue } - s.requestCh.Load() - typ := req.(ResourceType) - if err := s.sendNew(stream, typ); err != nil { + // Resetting the pendingRequests slice to nil works for both cases: + // - When we successfully sends the requests out on the wire. + // - When sending fails. This can happen only when the stream fails, + // and in this case, we rely on the `sendExisting` to send out + // requests for all subscriptions when the stream is recreated. + s.mu.Lock() + if err := s.sendNewLocked(stream, s.pendingRequests); err != nil { stream = nil - continue } + s.pendingRequests = nil + s.mu.Unlock() } } } -// sendNew attempts to send a discovery request based on a new subscription or -// unsubscription. If there is no flow control quota, the request is buffered -// and will be sent later. This method also starts the watch expiry timer for -// resources that were sent in the request for the first time, i.e. their watch -// state is `watchStateStarted`. -func (s *adsStreamImpl) sendNew(stream clients.Stream, typ ResourceType) error { - s.mu.Lock() - defer s.mu.Unlock() - - // If there's no stream yet, skip the request. This request will be resent - // when a new stream is created. If no stream is created, the watcher will - // timeout (same as server not sending response back). - if stream == nil { - return nil - } - - // If local processing of the most recently received response is not yet - // complete, i.e. fc.pending == true, queue this write and return early. - // This allows us to batch writes for requests which are generated as part - // of local processing of a received response. - state := s.resourceTypeState[typ] - bufferRequest := func() { - select { - case state.bufferedRequests <- struct{}{}: - default: +// sendNewLocked attempts to send a discovery request based on a new subscription or +// unsubscription. This method also starts the watch expiry timer for resources +// that were sent in the request for the first time, i.e. their watch state is +// `watchStateStarted`. +// +// Caller needs to hold c.mu. +func (s *adsStreamImpl) sendNewLocked(stream clients.Stream, requests []request) error { + for _, req := range requests { + state := s.resourceTypeState[req.typ] + if err := s.sendMessageLocked(stream, req.resourceNames, req.typ.TypeURL, state.version, state.nonce, nil); err != nil { + return err } + s.startWatchTimersLocked(req.typ, req.resourceNames) } - if s.fc.runIfPending(bufferRequest) { - return nil - } - - return s.sendMessageIfWritePendingLocked(stream, typ, state) + return nil } // sendExisting sends out discovery requests for existing resources when @@ -337,6 +336,10 @@ func (s *adsStreamImpl) sendExisting(stream clients.Stream) error { s.mu.Lock() defer s.mu.Unlock() + // Clear any queued requests. Previously subscribed to resources will be + // resent below. + s.pendingRequests = nil + for typ, state := range s.resourceTypeState { // Reset only the nonces map when the stream restarts. // @@ -355,69 +358,15 @@ func (s *adsStreamImpl) sendExisting(stream clients.Stream) error { continue } - state.pendingWrite = true - if err := s.sendMessageIfWritePendingLocked(stream, typ, state); err != nil { + names := resourceNames(state.subscribedResources) + if err := s.sendMessageLocked(stream, names, typ.TypeURL, state.version, state.nonce, nil); err != nil { return err } + s.startWatchTimersLocked(typ, names) } return nil } -// sendBuffered sends out discovery requests for resources that were buffered -// when they were subscribed to, because local processing of the previously -// received response was not yet complete. -// -// The stream argument is guaranteed to be non-nil. -func (s *adsStreamImpl) sendBuffered(stream clients.Stream) error { - s.mu.Lock() - defer s.mu.Unlock() - - for typ, state := range s.resourceTypeState { - select { - case <-state.bufferedRequests: - if err := s.sendMessageIfWritePendingLocked(stream, typ, state); err != nil { - return err - } - default: - // No buffered request. - continue - } - } - return nil -} - -// sendMessageIfWritePendingLocked attempts to sends a discovery request to the -// server, if there is a pending write for the given resource type. -// -// If the request is successfully sent, the pending write field is cleared and -// watch timers are started for the resources in the request. -// -// Caller needs to hold c.mu. -func (s *adsStreamImpl) sendMessageIfWritePendingLocked(stream clients.Stream, typ ResourceType, state *resourceTypeState) error { - if !state.pendingWrite { - if s.logger.V(2) { - s.logger.Infof("Skipping sending request for type %q, because all subscribed resources were already sent", typ.TypeURL) - } - return nil - } - - names := resourceNames(state.subscribedResources) - if err := s.sendMessageLocked(stream, names, typ.TypeURL, state.version, state.nonce, nil); err != nil { - return err - } - state.pendingWrite = false - - // Drain the buffered requests channel because we just sent a request for this - // resource type. - select { - case <-state.bufferedRequests: - default: - } - - s.startWatchTimersLocked(typ, names) - return nil -} - // sendMessageLocked sends a discovery request to the server, populating the // different fields of the message with the given parameters. Returns a non-nil // error if the request could not be sent. @@ -467,11 +416,9 @@ func (s *adsStreamImpl) sendMessageLocked(stream clients.Stream, names []string, // recv is responsible for receiving messages from the ADS stream. // // It performs the following actions: -// - Waits for local flow control to be available before sending buffered -// requests, if any. -// - Receives a message from the ADS stream. If an error is encountered here, -// it is handled by the onError method which propagates the error to all -// watchers. +// - Waits for local flow control to be available before it receives a message +// from the ADS stream. If an error is encountered here, it is handled by +// the onError method which propagates the error to all watchers. // - Invokes the event handler's OnADSResponse method to process the message. // - Sends an ACK or NACK to the server based on the response. // @@ -488,10 +435,6 @@ func (s *adsStreamImpl) recv(stream clients.Stream) bool { return msgReceived } - // Send out a request if anything was buffered while we were waiting for - // local processing of the previous response to complete. - s.sendBuffered(stream) - resources, url, version, nonce, err := s.recvMessage(stream) if err != nil { s.onError(err, msgReceived) @@ -760,23 +703,6 @@ func (fc *adsFlowControl) setPending(pending bool) { } } -func (fc *adsFlowControl) runIfPending(f func()) bool { - fc.mu.Lock() - defer fc.mu.Unlock() - - if fc.stopped { - return false - } - - // If there's a pending update, run the function while still holding the - // lock. This ensures that the pending state does not change between the - // check and the function call. - if fc.pending { - f() - } - return fc.pending -} - // wait blocks until all the watchers have consumed the most recent update. // Returns true if the flow control was stopped while waiting, false otherwise. func (fc *adsFlowControl) wait() bool { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go index e4425fa7..b8cb78fb 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/authority.go @@ -470,7 +470,7 @@ func (a *authority) handleADSResourceUpdate(serverConfig *ServerConfig, rType Re // "resource-not-found" error. continue } - if serverConfig.IgnoreResourceDeletion { + if serverConfig.SupportsServerFeature(ServerFeatureIgnoreResourceDeletion) { // Per A53, resource deletions are ignored if the // `ignore_resource_deletion` server feature is enabled through the // xDS client configuration. If the resource deletion is to be diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/channel.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/channel.go index 7c40f1da..9da5eb36 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/channel.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/channel.go @@ -163,7 +163,7 @@ func (xc *xdsChannel) unsubscribe(typ ResourceType, name string) { } return } - xc.ads.Unsubscribe(typ, name) + xc.ads.unsubscribe(typ, name) } // The following onADSXxx() methods implement the StreamEventHandler interface diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/clientimpl_watchers.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/clientimpl_watchers.go index 68b29295..b305b064 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/clientimpl_watchers.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/clientimpl_watchers.go @@ -19,6 +19,7 @@ package xdsclient import ( + "context" "fmt" "google.golang.org/grpc/internal/xds/clients/xdsclient/internal/xdsresource" @@ -41,9 +42,11 @@ func (w *wrappingWatcher) ResourceError(err error, done func()) { // WatchResource starts watching the specified resource. // -// typeURL specifies the resource type implementation to use. The watch fails -// if there is no resource type implementation for the given typeURL. See the -// ResourceTypes field in the Config struct used to create the XDSClient. +// The watch fails to start if: +// - There is no ResourceType implementation for the given typeURL in the +// ResourceTypes field of the Config struct used to create the XDSClient. +// - The provided resourceName contains an authority that is not present in the +// Authorities field. // // The returned function cancels the watch and prevents future calls to the // watcher. @@ -61,8 +64,10 @@ func (c *XDSClient) WatchResource(typeURL, resourceName string, watcher Resource rType, ok := c.config.ResourceTypes[typeURL] if !ok { - logger.Warningf("ResourceType implementation for resource type url %v is not found", rType.TypeURL) - watcher.ResourceError(fmt.Errorf("ResourceType implementation for resource type url %v is not found", rType.TypeURL), func() {}) + logger.Warningf("ResourceType implementation for resource type url %q is not found", rType.TypeURL) + c.serializer.TrySchedule(func(context.Context) { + watcher.ResourceError(fmt.Errorf("no ResourceType implementation found for typeURL %q", rType.TypeURL), func() {}) + }) return func() {} } @@ -70,7 +75,9 @@ func (c *XDSClient) WatchResource(typeURL, resourceName string, watcher Resource a := c.getAuthorityForResource(n) if a == nil { logger.Warningf("Watch registered for name %q of type %q, authority %q is not found", rType.TypeName, resourceName, n.Authority) - watcher.ResourceError(fmt.Errorf("authority %q not found in bootstrap config for resource %q", n.Authority, resourceName), func() {}) + c.serializer.TrySchedule(func(context.Context) { + watcher.ResourceError(fmt.Errorf("authority %q not found in the config for resource %q", n.Authority, resourceName), func() {}) + }) return func() {} } // The watchResource method on the authority is invoked with n.String() diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/resource_watcher.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/resource_watcher.go index 37d01bc7..15891d9b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/resource_watcher.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/resource_watcher.go @@ -21,6 +21,9 @@ package xdsclient // ResourceWatcher is notified of the resource updates and errors that are // received by the xDS client from the management server. // +// All methods on this interface are guaranteed to be called serially by the xDS +// client. +// // All methods contain a done parameter which should be called when processing // of the update has completed. For example, if processing a resource requires // watching new resources, those watches should be completed before done is diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/xdsconfig.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/xdsconfig.go index 9d376e50..14d64c1e 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/xdsconfig.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/clients/xdsclient/xdsconfig.go @@ -24,6 +24,20 @@ import ( "google.golang.org/grpc/internal/xds/clients" ) +// ServerFeature indicates the features that will be supported by an xDS server. +type ServerFeature uint64 + +const ( + // ServerFeatureIgnoreResourceDeletion indicates that the server supports a + // feature where the xDS client can ignore resource deletions from this server, + // as described in gRFC A53. + ServerFeatureIgnoreResourceDeletion ServerFeature = 1 << iota + // ServerFeatureTrustedXDSServer returns true if this server is trusted, + // and gRPC should accept security-config-affecting fields from the server + // as described in gRFC A81. + ServerFeatureTrustedXDSServer +) + // Config is used to configure an xDS client. After one has been passed to the // xDS client's New function, no part of it may be modified. A Config may be // reused; the xdsclient package will also not modify it. @@ -74,17 +88,7 @@ type Config struct { // ServerConfig contains configuration for an xDS management server. type ServerConfig struct { ServerIdentifier clients.ServerIdentifier - - // IgnoreResourceDeletion is a server feature which if set to true, - // indicates that resource deletion errors from xDS management servers can - // be ignored and cached resource data can be used. - // - // This will be removed in the future once we implement gRFC A88 - // and two new fields FailOnDataErrors and - // ResourceTimerIsTransientError will be introduced. - IgnoreResourceDeletion bool - - // TODO: Link to gRFC A88 + ServerFeature ServerFeature // ServerFeature stores a bitmap of supported features. } // Authority contains configuration for an xDS control plane authority. @@ -98,5 +102,11 @@ type Authority struct { } func isServerConfigEqual(a, b *ServerConfig) bool { - return a.ServerIdentifier == b.ServerIdentifier && a.IgnoreResourceDeletion == b.IgnoreResourceDeletion + return a.ServerIdentifier == b.ServerIdentifier && a.ServerFeature == b.ServerFeature +} + +// SupportsServerFeature returns true if the server configuration indicates that +// the server supports the given feature. +func (s *ServerConfig) SupportsServerFeature(feature ServerFeature) bool { + return s.ServerFeature&feature != 0 } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/matcher/string_matcher.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/matcher/string_matcher.go index c138f787..a6cf05dd 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/matcher/string_matcher.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/matcher/string_matcher.go @@ -48,24 +48,49 @@ type StringMatcher struct { // Match returns true if input matches the criteria in the given StringMatcher. func (sm StringMatcher) Match(input string) bool { - if sm.ignoreCase { - input = strings.ToLower(input) - } switch { case sm.exactMatch != nil: + if sm.ignoreCase { + input = strings.ToLower(input) + } return input == *sm.exactMatch case sm.prefixMatch != nil: + if sm.ignoreCase { + input = strings.ToLower(input) + } return strings.HasPrefix(input, *sm.prefixMatch) case sm.suffixMatch != nil: + if sm.ignoreCase { + input = strings.ToLower(input) + } return strings.HasSuffix(input, *sm.suffixMatch) - case sm.regexMatch != nil: - return grpcutil.FullMatchWithRegex(sm.regexMatch, input) case sm.containsMatch != nil: + if sm.ignoreCase { + input = strings.ToLower(input) + } return strings.Contains(input, *sm.containsMatch) + case sm.regexMatch != nil: + return grpcutil.FullMatchWithRegex(sm.regexMatch, input) } return false } +// newStrPtr allocates a new string that holds the value of input and returns a +// pointer to it. ignoreCase controls if a lower case version of input is used. +func newStrPtr(input *string, ignoreCase bool) *string { + if input == nil { + return nil + } + + s := new(string) + if ignoreCase { + *s = strings.ToLower(*input) + } else { + *s = *input + } + return s +} + // StringMatcherFromProto is a helper function to create a StringMatcher from // the corresponding StringMatcher proto. // @@ -78,26 +103,17 @@ func StringMatcherFromProto(matcherProto *v3matcherpb.StringMatcher) (StringMatc matcher := StringMatcher{ignoreCase: matcherProto.GetIgnoreCase()} switch mt := matcherProto.GetMatchPattern().(type) { case *v3matcherpb.StringMatcher_Exact: - matcher.exactMatch = &mt.Exact - if matcher.ignoreCase { - *matcher.exactMatch = strings.ToLower(*matcher.exactMatch) - } + matcher.exactMatch = newStrPtr(&mt.Exact, matcher.ignoreCase) case *v3matcherpb.StringMatcher_Prefix: if matcherProto.GetPrefix() == "" { return StringMatcher{}, errors.New("empty prefix is not allowed in StringMatcher") } - matcher.prefixMatch = &mt.Prefix - if matcher.ignoreCase { - *matcher.prefixMatch = strings.ToLower(*matcher.prefixMatch) - } + matcher.prefixMatch = newStrPtr(&mt.Prefix, matcher.ignoreCase) case *v3matcherpb.StringMatcher_Suffix: if matcherProto.GetSuffix() == "" { return StringMatcher{}, errors.New("empty suffix is not allowed in StringMatcher") } - matcher.suffixMatch = &mt.Suffix - if matcher.ignoreCase { - *matcher.suffixMatch = strings.ToLower(*matcher.suffixMatch) - } + matcher.suffixMatch = newStrPtr(&mt.Suffix, matcher.ignoreCase) case *v3matcherpb.StringMatcher_SafeRegex: regex := matcherProto.GetSafeRegex().GetRegex() re, err := regexp.Compile(regex) @@ -109,40 +125,59 @@ func StringMatcherFromProto(matcherProto *v3matcherpb.StringMatcher) (StringMatc if matcherProto.GetContains() == "" { return StringMatcher{}, errors.New("empty contains is not allowed in StringMatcher") } - matcher.containsMatch = &mt.Contains - if matcher.ignoreCase { - *matcher.containsMatch = strings.ToLower(*matcher.containsMatch) - } + matcher.containsMatch = newStrPtr(&mt.Contains, matcher.ignoreCase) default: return StringMatcher{}, fmt.Errorf("unrecognized string matcher: %+v", matcherProto) } return matcher, nil } -// StringMatcherForTesting is a helper function to create a StringMatcher based -// on the given arguments. Intended only for testing purposes. -func StringMatcherForTesting(exact, prefix, suffix, contains *string, regex *regexp.Regexp, ignoreCase bool) StringMatcher { - sm := StringMatcher{ - exactMatch: exact, - prefixMatch: prefix, - suffixMatch: suffix, - regexMatch: regex, - containsMatch: contains, +// NewExactStringMatcher creates a string matcher that requires the input string +// to exactly match the pattern specified here. The match will be case +// insensitive if ignore_case is true. +func NewExactStringMatcher(pattern string, ignoreCase bool) StringMatcher { + return StringMatcher{ + exactMatch: newStrPtr(&pattern, ignoreCase), + ignoreCase: ignoreCase, + } +} + +// NewPrefixStringMatcher creates a string matcher that requires the input +// string to contain the prefix specified here. The match will be case +// insensitive if ignore_case is true. +func NewPrefixStringMatcher(prefix string, ignoreCase bool) StringMatcher { + return StringMatcher{ + prefixMatch: newStrPtr(&prefix, ignoreCase), + ignoreCase: ignoreCase, + } +} + +// NewSuffixStringMatcher creates a string matcher that requires the input +// string to contain the suffix specified here. The match will be case +// insensitive if ignore_case is true. +func NewSuffixStringMatcher(suffix string, ignoreCase bool) StringMatcher { + return StringMatcher{ + suffixMatch: newStrPtr(&suffix, ignoreCase), + ignoreCase: ignoreCase, + } +} + +// NewContainsStringMatcher creates a string matcher that requires the input +// string to contain the pattern specified here. The match will be case +// insensitive if ignore_case is true. +func NewContainsStringMatcher(pattern string, ignoreCase bool) StringMatcher { + return StringMatcher{ + containsMatch: newStrPtr(&pattern, ignoreCase), ignoreCase: ignoreCase, } - if ignoreCase { - switch { - case sm.exactMatch != nil: - *sm.exactMatch = strings.ToLower(*exact) - case sm.prefixMatch != nil: - *sm.prefixMatch = strings.ToLower(*prefix) - case sm.suffixMatch != nil: - *sm.suffixMatch = strings.ToLower(*suffix) - case sm.containsMatch != nil: - *sm.containsMatch = strings.ToLower(*contains) - } +} + +// NewRegexStringMatcher creates a string matcher that requires the input string +// to match the regular expression specified here. +func NewRegexStringMatcher(regex *regexp.Regexp) StringMatcher { + return StringMatcher{ + regexMatch: regex, } - return sm } // ExactMatch returns the value of the configured exact match or an empty string diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go index f2ceabe7..e0416366 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go @@ -35,6 +35,7 @@ import ( iringhash "google.golang.org/grpc/internal/ringhash" "google.golang.org/grpc/internal/serviceconfig" "google.golang.org/grpc/internal/wrr" + "google.golang.org/grpc/internal/xds/balancer/clusterimpl" "google.golang.org/grpc/internal/xds/balancer/clustermanager" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" @@ -97,17 +98,14 @@ func serviceConfigJSON(activeClusters map[string]*clusterInfo) []byte { } type virtualHost struct { - // map from filter name to its config - httpFilterConfigOverride map[string]httpfilter.FilterConfig // retry policy present in virtual host retryConfig *xdsresource.RetryConfig } // routeCluster holds information about a cluster as referenced by a route. type routeCluster struct { - name string - // map from filter name to its config - httpFilterConfigOverride map[string]httpfilter.FilterConfig + name string // Name of the cluster. + interceptor iresolver.ClientInterceptor // HTTP filters to run for RPCs matching this route. } type route struct { @@ -115,10 +113,9 @@ type route struct { actionType xdsresource.RouteActionType // holds route action type clusters wrr.WRR // holds *routeCluster entries maxStreamDuration time.Duration - // map from filter name to its config - httpFilterConfigOverride map[string]httpfilter.FilterConfig - retryConfig *xdsresource.RetryConfig - hashPolicies []*xdsresource.HashPolicy + retryConfig *xdsresource.RetryConfig + hashPolicies []*xdsresource.HashPolicy + autoHostRewrite bool } func (r route) String() string { @@ -200,13 +197,9 @@ func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RP ref := &cs.clusters[cluster.name].refCount atomic.AddInt32(ref, 1) - interceptor, err := cs.newInterceptor(rt, cluster) - if err != nil { - return nil, annotateErrorWithNodeID(err, cs.xdsNodeID) - } - lbCtx := clustermanager.SetPickedCluster(rpcInfo.Context, cluster.name) lbCtx = iringhash.SetXDSRequestHash(lbCtx, cs.generateHash(rpcInfo, rt.hashPolicies)) + lbCtx = clusterimpl.SetAutoHostRewrite(lbCtx, rt.autoHostRewrite) config := &iresolver.RPCConfig{ // Communicate to the LB policy the chosen cluster and request hash, if Ring Hash LB policy. @@ -220,7 +213,7 @@ func (cs *configSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*iresolver.RP cs.sendNewServiceConfig() } }, - Interceptor: interceptor, + Interceptor: cluster.interceptor, } if rt.maxStreamDuration != 0 { @@ -310,35 +303,6 @@ func (cs *configSelector) generateHash(rpcInfo iresolver.RPCInfo, hashPolicies [ return rand.Uint64() } -func (cs *configSelector) newInterceptor(rt *route, cluster *routeCluster) (iresolver.ClientInterceptor, error) { - if len(cs.httpFilterConfig) == 0 { - return nil, nil - } - interceptors := make([]iresolver.ClientInterceptor, 0, len(cs.httpFilterConfig)) - for _, filter := range cs.httpFilterConfig { - override := cluster.httpFilterConfigOverride[filter.Name] // cluster is highest priority - if override == nil { - override = rt.httpFilterConfigOverride[filter.Name] // route is second priority - } - if override == nil { - override = cs.virtualHost.httpFilterConfigOverride[filter.Name] // VH is third & lowest priority - } - ib, ok := filter.Filter.(httpfilter.ClientInterceptorBuilder) - if !ok { - // Should not happen if it passed xdsClient validation. - return nil, fmt.Errorf("filter does not support use in client") - } - i, err := ib.BuildClientInterceptor(filter.Config, override) - if err != nil { - return nil, fmt.Errorf("error constructing filter: %v", err) - } - if i != nil { - interceptors = append(interceptors, i) - } - } - return &interceptorList{interceptors: interceptors}, nil -} - // stop decrements refs of all clusters referenced by this config selector. func (cs *configSelector) stop() { // The resolver's old configSelector may be nil. Handle that here. @@ -363,6 +327,38 @@ func (cs *configSelector) stop() { } } +// newInterceptor builds a chain of client interceptors for the given filters +// and override configuration. The cluster override has the highest priority, +// followed by the route override, and finally the virtual host override. +func newInterceptor(filters []xdsresource.HTTPFilter, clusterOverride, routeOverride, virtualHostOverride map[string]httpfilter.FilterConfig) (iresolver.ClientInterceptor, error) { + if len(filters) == 0 { + return nil, nil + } + interceptors := make([]iresolver.ClientInterceptor, 0, len(filters)) + for _, filter := range filters { + override := clusterOverride[filter.Name] + if override == nil { + override = routeOverride[filter.Name] + } + if override == nil { + override = virtualHostOverride[filter.Name] + } + ib, ok := filter.Filter.(httpfilter.ClientInterceptorBuilder) + if !ok { + // Should not happen if it passed xdsClient validation. + return nil, fmt.Errorf("filter %q does not support use in client", filter.Name) + } + i, err := ib.BuildClientInterceptor(filter.Config, override) + if err != nil { + return nil, fmt.Errorf("error constructing filter: %v", err) + } + if i != nil { + interceptors = append(interceptors, i) + } + } + return &interceptorList{interceptors: interceptors}, nil +} + type interceptorList struct { interceptors []iresolver.ClientInterceptor } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/watch_service.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/watch_service.go deleted file mode 100644 index 43ff23b7..00000000 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/watch_service.go +++ /dev/null @@ -1,92 +0,0 @@ -/* - * - * Copyright 2020 gRPC 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" - - "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" -) - -type listenerWatcher struct { - resourceName string - cancel func() - parent *xdsResolver -} - -func newListenerWatcher(resourceName string, parent *xdsResolver) *listenerWatcher { - lw := &listenerWatcher{resourceName: resourceName, parent: parent} - lw.cancel = xdsresource.WatchListener(parent.xdsClient, resourceName, lw) - return lw -} - -func (l *listenerWatcher) ResourceChanged(update *xdsresource.ListenerUpdate, onDone func()) { - handleUpdate := func(context.Context) { l.parent.onListenerResourceUpdate(update); onDone() } - l.parent.serializer.ScheduleOr(handleUpdate, onDone) -} - -func (l *listenerWatcher) ResourceError(err error, onDone func()) { - handleError := func(context.Context) { l.parent.onListenerResourceError(err); onDone() } - l.parent.serializer.ScheduleOr(handleError, onDone) -} - -func (l *listenerWatcher) AmbientError(err error, onDone func()) { - handleError := func(context.Context) { l.parent.onListenerResourceAmbientError(err); onDone() } - l.parent.serializer.ScheduleOr(handleError, onDone) -} - -func (l *listenerWatcher) stop() { - l.cancel() - l.parent.logger.Infof("Canceling watch on Listener resource %q", l.resourceName) -} - -type routeConfigWatcher struct { - resourceName string - cancel func() - parent *xdsResolver -} - -func newRouteConfigWatcher(resourceName string, parent *xdsResolver) *routeConfigWatcher { - rw := &routeConfigWatcher{resourceName: resourceName, parent: parent} - rw.cancel = xdsresource.WatchRouteConfig(parent.xdsClient, resourceName, rw) - return rw -} - -func (r *routeConfigWatcher) ResourceChanged(u *xdsresource.RouteConfigResourceData, onDone func()) { - handleUpdate := func(context.Context) { - r.parent.onRouteConfigResourceUpdate(r.resourceName, u.Resource) - onDone() - } - r.parent.serializer.ScheduleOr(handleUpdate, onDone) -} - -func (r *routeConfigWatcher) ResourceError(err error, onDone func()) { - handleError := func(context.Context) { r.parent.onRouteConfigResourceError(r.resourceName, err); onDone() } - r.parent.serializer.ScheduleOr(handleError, onDone) -} - -func (r *routeConfigWatcher) AmbientError(err error, onDone func()) { - handleError := func(context.Context) { r.parent.onRouteConfigResourceAmbientError(r.resourceName, err); onDone() } - r.parent.serializer.ScheduleOr(handleError, onDone) -} - -func (r *routeConfigWatcher) stop() { - r.cancel() - r.parent.logger.Infof("Canceling watch on RouteConfiguration resource %q", r.resourceName) -} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go index 9180cd07..44b7dd4b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go @@ -29,13 +29,13 @@ import ( "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcsync" - "google.golang.org/grpc/internal/pretty" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/wrr" "google.golang.org/grpc/internal/xds/bootstrap" rinternal "google.golang.org/grpc/internal/xds/resolver/internal" "google.golang.org/grpc/internal/xds/xdsclient" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" + "google.golang.org/grpc/internal/xds/xdsdepmgr" "google.golang.org/grpc/resolver" ) @@ -111,50 +111,46 @@ type xdsResolverBuilder struct { // The xds bootstrap process is performed (and a new xDS client is built) every // time an xds resolver is built. func (b *xdsResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (_ resolver.Resolver, retErr error) { - r := &xdsResolver{ - cc: cc, - activeClusters: make(map[string]*clusterInfo), - channelID: rand.Uint64(), - } - defer func() { - if retErr != nil { - r.Close() - } - }() - r.logger = prefixLogger(r) - r.logger.Infof("Creating resolver for target: %+v", target) - - // Initialize the serializer used to synchronize the following: - // - updates from the xDS client. This could lead to generation of new - // service config if resolution is complete. - // - completion of an RPC to a removed cluster causing the associated ref - // count to become zero, resulting in generation of new service config. - // - stopping of a config selector that results in generation of new service - // config. - ctx, cancel := context.WithCancel(context.Background()) - r.serializer = grpcsync.NewCallbackSerializer(ctx) - r.serializerCancel = cancel - // Initialize the xDS client. newXDSClient := rinternal.NewXDSClient.(func(string, estats.MetricsRecorder) (xdsclient.XDSClient, func(), error)) if b.newXDSClient != nil { newXDSClient = b.newXDSClient } - client, closeFn, err := newXDSClient(target.String(), opts.MetricsRecorder) + client, xdsClientClose, err := newXDSClient(target.String(), opts.MetricsRecorder) if err != nil { return nil, fmt.Errorf("xds: failed to create xds-client: %v", err) } - r.xdsClient = client - r.xdsClientClose = closeFn - // Determine the listener resource name and start a watcher for it. - template, err := r.sanityChecksOnBootstrapConfig(target, opts, r.xdsClient) + template, err := sanityChecksOnBootstrapConfig(target, client) if err != nil { + xdsClientClose() return nil, err } - r.dataplaneAuthority = opts.Authority - r.ldsResourceName = bootstrap.PopulateResourceTemplate(template, target.Endpoint()) - r.listenerWatcher = newListenerWatcher(r.ldsResourceName, r) + ldsResourceName := bootstrap.PopulateResourceTemplate(template, target.Endpoint()) + + ctx, cancel := context.WithCancel(context.Background()) + r := &xdsResolver{ + cc: cc, + xdsClient: client, + xdsClientClose: xdsClientClose, + activeClusters: make(map[string]*clusterInfo), + channelID: rand.Uint64(), + ldsResourceName: ldsResourceName, + + // serializer used to synchronize the following: + // - updates from the dependency manager. This could lead to generation + // of new service config if resolution is complete. + // - completion of an RPC to a removed cluster causing the associated + // ref count to become zero, resulting in generation of new service + // config. + // - stopping of a config selector that results in generation of new + // service config. + serializer: grpcsync.NewCallbackSerializer(ctx), + serializerCancel: cancel, + } + r.logger = prefixLogger(r) + r.logger.Infof("Creating resolver for target: %+v", target) + r.dm = xdsdepmgr.New(r.ldsResourceName, opts.Authority, r.xdsClient, r) return r, nil } @@ -167,7 +163,7 @@ func (b *xdsResolverBuilder) Build(target resolver.Target, cc resolver.ClientCon // // Returns the listener resource name template to use. If any of the above // validations fail, a non-nil error is returned. -func (r *xdsResolver) sanityChecksOnBootstrapConfig(target resolver.Target, _ resolver.BuildOptions, client xdsclient.XDSClient) (string, error) { +func sanityChecksOnBootstrapConfig(target resolver.Target, client xdsclient.XDSClient) (string, error) { bootstrapConfig := client.BootstrapConfig() if bootstrapConfig == nil { // This is never expected to happen after a successful xDS client @@ -205,50 +201,32 @@ func (*xdsResolverBuilder) Scheme() string { // xdsResolver implements the resolver.Resolver interface. // -// It registers a watcher for ServiceConfig updates with the xdsClient object -// (which performs LDS/RDS queries for the same), and passes the received -// updates to the ClientConn. +// It manages the dependency manager which in turn manages all xDS resource +// watches. It receives the xDS resource config and passes them to ClientConn. type xdsResolver struct { - cc resolver.ClientConn - logger *grpclog.PrefixLogger - // The underlying xdsClient which performs all xDS requests and responses. - xdsClient xdsclient.XDSClient - xdsClientClose func() - // A random number which uniquely identifies the channel which owns this - // resolver. - channelID uint64 - + // The following fields are initialized at creation time and are read-only + // after that. + cc resolver.ClientConn + logger *grpclog.PrefixLogger + ldsResourceName string + dm *xdsdepmgr.DependencyManager + xdsClient xdsclient.XDSClient + xdsClientClose func() + channelID uint64 // Unique random ID for the channel owning this resolver. // All methods on the xdsResolver type except for the ones invoked by gRPC, // i.e ResolveNow() and Close(), are guaranteed to execute in the context of - // this serializer's callback. And since the serializer guarantees mutual - // exclusion among these callbacks, we can get by without any mutexes to - // access all of the below defined state. The only exception is Close(), - // which does access some of this shared state, but it does so after - // cancelling the context passed to the serializer. + // this serializer's callback. We use the serializer because these shared + // states are accessed by each RPC when it is committed, and so + // serializer is preffered over a mutex. serializer *grpcsync.CallbackSerializer serializerCancel context.CancelFunc - // dataplaneAuthority is the authority used for the data plane connections, - // which is also used to select the VirtualHost within the xDS - // RouteConfiguration. This is %-encoded to match with VirtualHost Domain - // in xDS RouteConfiguration. - dataplaneAuthority string - - ldsResourceName string - listenerWatcher *listenerWatcher - listenerUpdateRecvd bool - currentListener *xdsresource.ListenerUpdate - - rdsResourceName string - routeConfigWatcher *routeConfigWatcher - routeConfigUpdateRecvd bool - currentRouteConfig xdsresource.RouteConfigUpdate - currentVirtualHost *xdsresource.VirtualHost // Matched virtual host for quick access. - + // The following fields are accessed only from within the serializer + // callbacks. + xdsConfig *xdsresource.XDSConfig // activeClusters is a map from cluster name to information about the // cluster that includes a ref count and load balancing configuration. - activeClusters map[string]*clusterInfo - + activeClusters map[string]*clusterInfo curConfigSelector stoppableConfigSelector } @@ -262,22 +240,53 @@ func (r *xdsResolver) Close() { r.serializerCancel() <-r.serializer.Done() - // Note that Close needs to check for nils even if some of them are always - // set in the constructor. This is because the constructor defers Close() in - // error cases, and the fields might not be set when the error happens. - - if r.listenerWatcher != nil { - r.listenerWatcher.stop() - } - if r.routeConfigWatcher != nil { - r.routeConfigWatcher.stop() + if r.dm != nil { + r.dm.Close() } + if r.xdsClientClose != nil { r.xdsClientClose() } r.logger.Infof("Shutdown") } +// Update is called when there is a new xDS config available from the dependency +// manager and does the following: +// - creates a new config selector (this involves incrementing references to +// clusters owned by this config selector). +// - stops the old config selector (this involves decrementing references to +// clusters owned by this config selector). +// - prunes active clusters and pushes a new service config to the channel. +// - updates the current config selector used by the resolver. +func (r *xdsResolver) Update(config *xdsresource.XDSConfig) { + r.serializer.TrySchedule(func(context.Context) { + r.xdsConfig = config + cs, err := r.newConfigSelector() + if err != nil { + r.onResourceError(err) + return + } + if !r.sendNewServiceConfig(cs) { + // Channel didn't like the update we provided (unexpected); erase + // this config selector and ignore this update, continuing with + // the previous config selector. + cs.stop() + return + } + + if r.curConfigSelector != nil { + r.curConfigSelector.stop() + } + r.curConfigSelector = cs + }) +} + +func (r *xdsResolver) Error(err error) { + r.serializer.TrySchedule(func(context.Context) { + r.onResourceError(err) + }) +} + // sendNewServiceConfig prunes active clusters, generates a new service config // based on the current set of active clusters, and sends an update to the // channel with that service config and the provided config selector. Returns @@ -308,7 +317,9 @@ func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) bool { } sc := serviceConfigJSON(r.activeClusters) - r.logger.Infof("For Listener resource %q and RouteConfiguration resource %q, generated service config: %v", r.ldsResourceName, r.rdsResourceName, pretty.FormatJSON(sc)) + if r.logger.V(2) { + r.logger.Infof("For Listener resource %q and RouteConfiguration resource %q, generated service config: %+v", r.ldsResourceName, r.xdsConfig.Listener.RouteConfigName, sc) + } // Send the update to the ClientConn. state := iresolver.SetConfigSelector(resolver.State{ @@ -328,7 +339,7 @@ func (r *xdsResolver) sendNewServiceConfig(cs stoppableConfigSelector) bool { // r.activeClusters for previously-unseen clusters. // // Only executed in the context of a serializer callback. -func (r *xdsResolver) newConfigSelector() *configSelector { +func (r *xdsResolver) newConfigSelector() (*configSelector, error) { cs := &configSelector{ channelID: r.channelID, xdsNodeID: r.xdsClient.BootstrapConfig().Node().GetId(), @@ -338,30 +349,31 @@ func (r *xdsResolver) newConfigSelector() *configSelector { }) }, virtualHost: virtualHost{ - httpFilterConfigOverride: r.currentVirtualHost.HTTPFilterConfigOverride, - retryConfig: r.currentVirtualHost.RetryConfig, + retryConfig: r.xdsConfig.VirtualHost.RetryConfig, }, - routes: make([]route, len(r.currentVirtualHost.Routes)), + routes: make([]route, len(r.xdsConfig.VirtualHost.Routes)), clusters: make(map[string]*clusterInfo), - httpFilterConfig: r.currentListener.HTTPFilters, + httpFilterConfig: r.xdsConfig.Listener.HTTPFilters, } - for i, rt := range r.currentVirtualHost.Routes { + for i, rt := range r.xdsConfig.VirtualHost.Routes { clusters := rinternal.NewWRR.(func() wrr.WRR)() if rt.ClusterSpecifierPlugin != "" { clusterName := clusterSpecifierPluginPrefix + rt.ClusterSpecifierPlugin - clusters.Add(&routeCluster{ - name: clusterName, - }, 1) + clusters.Add(&routeCluster{name: clusterName}, 1) ci := r.addOrGetActiveClusterInfo(clusterName) - ci.cfg = xdsChildConfig{ChildPolicy: balancerConfig(r.currentRouteConfig.ClusterSpecifierPlugins[rt.ClusterSpecifierPlugin])} + ci.cfg = xdsChildConfig{ChildPolicy: balancerConfig(r.xdsConfig.RouteConfig.ClusterSpecifierPlugins[rt.ClusterSpecifierPlugin])} cs.clusters[clusterName] = ci } else { for _, wc := range rt.WeightedClusters { clusterName := clusterPrefix + wc.Name + interceptor, err := newInterceptor(r.xdsConfig.Listener.HTTPFilters, wc.HTTPFilterConfigOverride, rt.HTTPFilterConfigOverride, r.xdsConfig.VirtualHost.HTTPFilterConfigOverride) + if err != nil { + return nil, err + } clusters.Add(&routeCluster{ - name: clusterName, - httpFilterConfigOverride: wc.HTTPFilterConfigOverride, + name: clusterName, + interceptor: interceptor, }, int64(wc.Weight)) ci := r.addOrGetActiveClusterInfo(clusterName) ci.cfg = xdsChildConfig{ChildPolicy: newBalancerConfig(cdsName, cdsBalancerConfig{Cluster: wc.Name})} @@ -373,14 +385,14 @@ func (r *xdsResolver) newConfigSelector() *configSelector { cs.routes[i].m = xdsresource.RouteToMatcher(rt) cs.routes[i].actionType = rt.ActionType if rt.MaxStreamDuration == nil { - cs.routes[i].maxStreamDuration = r.currentListener.MaxStreamDuration + cs.routes[i].maxStreamDuration = r.xdsConfig.Listener.MaxStreamDuration } else { cs.routes[i].maxStreamDuration = *rt.MaxStreamDuration } - cs.routes[i].httpFilterConfigOverride = rt.HTTPFilterConfigOverride cs.routes[i].retryConfig = rt.RetryConfig cs.routes[i].hashPolicies = rt.HashPolicies + cs.routes[i].autoHostRewrite = rt.AutoHostRewrite } // Account for this config selector's clusters. Do this after no further @@ -390,7 +402,7 @@ func (r *xdsResolver) newConfigSelector() *configSelector { atomic.AddInt32(&ci.refCount, 1) } - return cs + return cs, nil } // pruneActiveClusters deletes entries in r.activeClusters with zero @@ -422,70 +434,6 @@ type clusterInfo struct { cfg xdsChildConfig } -// Determines if the xdsResolver has received all required configuration, i.e -// Listener and RouteConfiguration resources, from the management server, and -// whether a matching virtual host was found in the RouteConfiguration resource. -func (r *xdsResolver) resolutionComplete() bool { - return r.listenerUpdateRecvd && r.routeConfigUpdateRecvd && r.currentVirtualHost != nil -} - -// onResolutionComplete performs the following actions when resolution is -// complete, i.e Listener and RouteConfiguration resources have been received -// from the management server and a matching virtual host is found in the -// latter. -// - creates a new config selector (this involves incrementing references to -// clusters owned by this config selector). -// - stops the old config selector (this involves decrementing references to -// clusters owned by this config selector). -// - prunes active clusters and pushes a new service config to the channel. -// - updates the current config selector used by the resolver. -// -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onResolutionComplete() { - if !r.resolutionComplete() { - return - } - - cs := r.newConfigSelector() - if !r.sendNewServiceConfig(cs) { - // Channel didn't like the update we provided (unexpected); erase - // this config selector and ignore this update, continuing with - // the previous config selector. - cs.stop() - return - } - - if r.curConfigSelector != nil { - r.curConfigSelector.stop() - } - r.curConfigSelector = cs -} - -func (r *xdsResolver) applyRouteConfigUpdate(update xdsresource.RouteConfigUpdate) { - matchVh := xdsresource.FindBestMatchingVirtualHost(r.dataplaneAuthority, update.VirtualHosts) - if matchVh == nil { - // TODO(purnesh42h): Should this be a resource or ambient error? Note - // that its being called only from resource update methods when we have - // finished removing the previous update. - r.onAmbientError(fmt.Errorf("no matching virtual host found for %q", r.dataplaneAuthority)) - return - } - r.currentRouteConfig = update - r.currentVirtualHost = matchVh - r.routeConfigUpdateRecvd = true - - r.onResolutionComplete() -} - -// onAmbientError propagates the error up to the channel. And since this is -// invoked only for non resource errors, we don't have to update resolver -// state and we can keep using the old config. -// -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onAmbientError(err error) { - r.cc.ReportError(err) -} - // Contains common functionality to be executed when resources of either type // are removed. // @@ -508,107 +456,3 @@ func (r *xdsResolver) onResourceError(err error) { } r.curConfigSelector = cs } - -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onListenerResourceUpdate(update *xdsresource.ListenerUpdate) { - if r.logger.V(2) { - r.logger.Infof("Received update for Listener resource %q: %v", r.ldsResourceName, pretty.ToJSON(update)) - } - - r.currentListener = update - r.listenerUpdateRecvd = true - - if update.InlineRouteConfig != nil { - // If there was a previous route config watcher because of a non-inline - // route configuration, cancel it. - r.rdsResourceName = "" - if r.routeConfigWatcher != nil { - r.routeConfigWatcher.stop() - r.routeConfigWatcher = nil - } - - r.applyRouteConfigUpdate(*update.InlineRouteConfig) - return - } - - // We get here only if there was no inline route configuration. - - // If the route config name has not changed, send an update with existing - // route configuration and the newly received listener configuration. - if r.rdsResourceName == update.RouteConfigName { - r.onResolutionComplete() - return - } - - // If the route config name has changed, cancel the old watcher and start a - // new one. At this point, since we have not yet resolved the new route - // config name, we don't send an update to the channel, and therefore - // continue using the old route configuration (if received) until the new - // one is received. - r.rdsResourceName = update.RouteConfigName - if r.routeConfigWatcher != nil { - r.routeConfigWatcher.stop() - r.currentVirtualHost = nil - r.routeConfigUpdateRecvd = false - } - r.routeConfigWatcher = newRouteConfigWatcher(r.rdsResourceName, r) -} - -func (r *xdsResolver) onListenerResourceAmbientError(err error) { - if r.logger.V(2) { - r.logger.Infof("Received ambient error for Listener resource %q: %v", r.ldsResourceName, err) - } - r.onAmbientError(err) -} - -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onListenerResourceError(err error) { - if r.logger.V(2) { - r.logger.Infof("Received resource error for Listener resource %q: %v", r.ldsResourceName, err) - } - - r.listenerUpdateRecvd = false - if r.routeConfigWatcher != nil { - r.routeConfigWatcher.stop() - } - r.rdsResourceName = "" - r.currentVirtualHost = nil - r.routeConfigUpdateRecvd = false - r.routeConfigWatcher = nil - - r.onResourceError(err) -} - -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onRouteConfigResourceUpdate(name string, update xdsresource.RouteConfigUpdate) { - if r.logger.V(2) { - r.logger.Infof("Received update for RouteConfiguration resource %q: %v", name, pretty.ToJSON(update)) - } - - if r.rdsResourceName != name { - // Drop updates from canceled watchers. - return - } - - r.applyRouteConfigUpdate(update) -} - -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onRouteConfigResourceAmbientError(name string, err error) { - if r.logger.V(2) { - r.logger.Infof("Received ambient error for RouteConfiguration resource %q: %v", name, err) - } - r.onAmbientError(err) -} - -// Only executed in the context of a serializer callback. -func (r *xdsResolver) onRouteConfigResourceError(name string, err error) { - if r.logger.V(2) { - r.logger.Infof("Received resource error for RouteConfiguration resource %q: %v", name, err) - } - - if r.rdsResourceName != name { - return - } - r.onResourceError(err) -} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go index 49cfdb63..15f6c17c 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go @@ -59,8 +59,7 @@ type ServingModeCallback func(addr net.Addr, mode connectivity.ServingMode, err // XDSClient wraps the methods on the XDSClient which are required by // the listenerWrapper. type XDSClient interface { - WatchResource(rType xdsresource.Type, resourceName string, watcher xdsresource.ResourceWatcher) (cancel func()) - WatchResourceV2(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) + WatchResource(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) BootstrapConfig() *bootstrap.Config } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/rds_handler.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/rds_handler.go index bf78c37c..53ebef5e 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/rds_handler.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/server/rds_handler.go @@ -135,7 +135,7 @@ type rdsWatcher struct { canceled bool // eats callbacks if true } -func (rw *rdsWatcher) ResourceChanged(update *xdsresource.RouteConfigResourceData, onDone func()) { +func (rw *rdsWatcher) ResourceChanged(update *xdsresource.RouteConfigUpdate, onDone func()) { defer onDone() rw.mu.Lock() if rw.canceled { @@ -144,11 +144,11 @@ func (rw *rdsWatcher) ResourceChanged(update *xdsresource.RouteConfigResourceDat } rw.mu.Unlock() if rw.logger.V(2) { - rw.logger.Infof("RDS watch for resource %q received update: %#v", rw.routeName, update.Resource) + rw.logger.Infof("RDS watch for resource %q received update: %#v", rw.routeName, update) } routeName := rw.routeName - rwu := rdsWatcherUpdate{data: &update.Resource} + rwu := rdsWatcherUpdate{data: update} rw.parent.updates[routeName] = rwu rw.parent.callback(routeName, rwu) } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xds.go index 4d5a85ef..866fc53b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xds.go @@ -24,6 +24,7 @@ import ( "fmt" "google.golang.org/grpc/attributes" + "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/xds/clients" "google.golang.org/grpc/resolver" ) @@ -46,6 +47,17 @@ func GetXDSHandshakeClusterName(attr *attributes.Attributes) (string, bool) { return name, ok } +// addressToTelemetryLabels prepares a telemetry label map from resolver +// address attributes. +func addressToTelemetryLabels(addr resolver.Address) map[string]string { + cluster, _ := GetXDSHandshakeClusterName(addr.Attributes) + locality := LocalityString(GetLocalityID(addr)) + return map[string]string{ + "grpc.lb.locality": locality, + "grpc.lb.backend_service": cluster, + } +} + // LocalityString generates a string representation of clients.Locality in the // format specified in gRFC A76. func LocalityString(l clients.Locality) string { @@ -99,3 +111,7 @@ var UnknownCSMLabels = map[string]string{ "csm.service_name": "unknown", "csm.service_namespace_name": "unknown", } + +func init() { + internal.AddressToTelemetryLabels = addressToTelemetryLabels +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/client.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/client.go index 1d803402..d05382d0 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/client.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/client.go @@ -26,7 +26,6 @@ import ( "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/grpc/internal/xds/clients/lrsclient" "google.golang.org/grpc/internal/xds/clients/xdsclient" - "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" v3statuspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v3" ) @@ -49,12 +48,7 @@ type XDSClient interface { // During a race (e.g. an xDS response is received while the user is calling // cancel()), there's a small window where the callback can be called after // the watcher is canceled. Callers need to handle this case. - WatchResource(rType xdsresource.Type, resourceName string, watcher xdsresource.ResourceWatcher) (cancel func()) - - // WatchResourceV2 matches the API of the external xdsclient interface. - // Once all users of xdsclient have been moved to this watch API, we can - // remove the WatchResource API above, and rename this to WatchResource. - WatchResourceV2(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) + WatchResource(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) ReportLoad(*bootstrap.ServerConfig) (*lrsclient.LoadStore, func(context.Context)) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl.go index f2325e0e..b2088647 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl.go @@ -162,6 +162,32 @@ func (c *clientImpl) decrRef() int32 { return atomic.AddInt32(&c.refCount, -1) } +func buildServerConfigs(bootstrapSC []*bootstrap.ServerConfig, grpcTransportConfigs map[string]grpctransport.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) ([]xdsclient.ServerConfig, error) { + var gServerCfg []xdsclient.ServerConfig + for _, sc := range bootstrapSC { + if err := populateGRPCTransportConfigsFromServerConfig(sc, grpcTransportConfigs); err != nil { + return nil, err + } + var serverFeatures xdsclient.ServerFeature + if sc.ServerFeaturesIgnoreResourceDeletion() { + serverFeatures = serverFeatures | xdsclient.ServerFeatureIgnoreResourceDeletion + } + if sc.ServerFeaturesTrustedXDSServer() { + serverFeatures = serverFeatures | xdsclient.ServerFeatureTrustedXDSServer + } + gsc := xdsclient.ServerConfig{ + ServerIdentifier: clients.ServerIdentifier{ + ServerURI: sc.ServerURI(), + Extensions: grpctransport.ServerIdentifierExtension{ConfigName: sc.SelectedChannelCreds().Type}, + }, + ServerFeature: serverFeatures, + } + gServerCfg = append(gServerCfg, gsc) + gServerCfgMap[gsc] = sc + } + return gServerCfg, nil +} + // buildXDSClientConfig builds the xdsclient.Config from the bootstrap.Config. func buildXDSClientConfig(config *bootstrap.Config, metricsRecorder estats.MetricsRecorder, target string, watchExpiryTimeout time.Duration) (xdsclient.Config, error) { grpcTransportConfigs := make(map[string]grpctransport.Config) @@ -175,30 +201,16 @@ func buildXDSClientConfig(config *bootstrap.Config, metricsRecorder estats.Metri if len(cfg.XDSServers) >= 1 { serverCfg = cfg.XDSServers } - var gServerCfg []xdsclient.ServerConfig - for _, sc := range serverCfg { - if err := populateGRPCTransportConfigsFromServerConfig(sc, grpcTransportConfigs); err != nil { - return xdsclient.Config{}, err - } - gsc := xdsclient.ServerConfig{ - ServerIdentifier: clients.ServerIdentifier{ServerURI: sc.ServerURI(), Extensions: grpctransport.ServerIdentifierExtension{ConfigName: sc.SelectedChannelCreds().Type}}, - IgnoreResourceDeletion: sc.ServerFeaturesIgnoreResourceDeletion()} - gServerCfg = append(gServerCfg, gsc) - gServerCfgMap[gsc] = sc + gsc, err := buildServerConfigs(serverCfg, grpcTransportConfigs, gServerCfgMap) + if err != nil { + return xdsclient.Config{}, err } - gAuthorities[name] = xdsclient.Authority{XDSServers: gServerCfg} + gAuthorities[name] = xdsclient.Authority{XDSServers: gsc} } - gServerCfgs := make([]xdsclient.ServerConfig, 0, len(config.XDSServers())) - for _, sc := range config.XDSServers() { - if err := populateGRPCTransportConfigsFromServerConfig(sc, grpcTransportConfigs); err != nil { - return xdsclient.Config{}, err - } - gsc := xdsclient.ServerConfig{ - ServerIdentifier: clients.ServerIdentifier{ServerURI: sc.ServerURI(), Extensions: grpctransport.ServerIdentifierExtension{ConfigName: sc.SelectedChannelCreds().Type}}, - IgnoreResourceDeletion: sc.ServerFeaturesIgnoreResourceDeletion()} - gServerCfgs = append(gServerCfgs, gsc) - gServerCfgMap[gsc] = sc + gServerCfgs, err := buildServerConfigs(config.XDSServers(), grpcTransportConfigs, gServerCfgMap) + if err != nil { + return xdsclient.Config{}, err } node := config.Node() diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl_watchers.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl_watchers.go deleted file mode 100644 index b90d3d36..00000000 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/clientimpl_watchers.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2020 gRPC 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 xdsclient - -import ( - "google.golang.org/grpc/internal/xds/clients/xdsclient" - "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" -) - -// WatchResource uses xDS to discover the resource associated with the provided -// resource name. The resource type implementation determines how xDS responses -// are are deserialized and validated, as received from the xDS management -// server. Upon receipt of a response from the management server, an -// appropriate callback on the watcher is invoked. -func (c *clientImpl) WatchResource(rType xdsresource.Type, resourceName string, watcher xdsresource.ResourceWatcher) (cancel func()) { - return c.XDSClient.WatchResource(rType.TypeURL(), resourceName, xdsresource.GenericResourceWatcher(watcher)) -} - -func (c *clientImpl) WatchResourceV2(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) { - return c.XDSClient.WatchResource(typeURL, resourceName, watcher) -} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go index a044eedf..29d1ed4c 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/resource_types.go @@ -36,19 +36,19 @@ func supportedResourceTypes(config *bootstrap.Config, gServerCfgMap map[xdsclien TypeURL: version.V3RouteConfigURL, TypeName: xdsresource.RouteConfigTypeName, AllResourcesRequiredInSotW: false, - Decoder: xdsresource.NewGenericRouteConfigResourceTypeDecoder(), + Decoder: xdsresource.NewRouteConfigResourceTypeDecoder(config), }, version.V3ClusterURL: { TypeURL: version.V3ClusterURL, TypeName: xdsresource.ClusterResourceTypeName, AllResourcesRequiredInSotW: true, - Decoder: xdsresource.NewGenericClusterResourceTypeDecoder(config, gServerCfgMap), + Decoder: xdsresource.NewClusterResourceTypeDecoder(config, gServerCfgMap), }, version.V3EndpointsURL: { TypeURL: version.V3EndpointsURL, TypeName: xdsresource.EndpointsResourceTypeName, AllResourcesRequiredInSotW: false, - Decoder: xdsresource.NewGenericEndpointsResourceTypeDecoder(), + Decoder: xdsresource.NewEndpointsResourceTypeDecoder(config), }, } } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/cluster_resource_type.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/cluster_resource_type.go index 2a6a08f9..af4e785b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/cluster_resource_type.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/cluster_resource_type.go @@ -18,12 +18,12 @@ package xdsresource import ( - "google.golang.org/grpc/internal/pretty" + "bytes" + "fmt" + "google.golang.org/grpc/internal/xds/bootstrap" xdsclient "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" ) const ( @@ -32,81 +32,62 @@ const ( ClusterResourceTypeName = "ClusterResource" ) -var ( - // Compile time interface checks. - _ Type = clusterResourceType{} - - // Singleton instantiation of the resource type implementation. - clusterType = clusterResourceType{ - resourceTypeState: resourceTypeState{ - typeURL: version.V3ClusterURL, - typeName: ClusterResourceTypeName, - allResourcesRequiredInSotW: true, - }, - } -) - -// clusterResourceType provides the resource-type specific functionality for a -// Cluster resource. -// -// Implements the Type interface. -type clusterResourceType struct { - resourceTypeState +// clusterResourceDecoder is an implementation of the xdsclient.Decoder +// interface for listener resources. +type clusterResourceDecoder struct { + bootstrapConfig *bootstrap.Config + serverConfigs map[xdsclient.ServerConfig]*bootstrap.ServerConfig } -// Decode deserializes and validates an xDS resource serialized inside the -// provided `Any` proto, as received from the xDS management server. -func (clusterResourceType) Decode(opts *DecodeOptions, resource *anypb.Any) (*DecodeResult, error) { - name, cluster, err := unmarshalClusterResource(resource, opts.ServerConfig) - switch { - case name == "": +func (d *clusterResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { + serverCfg, ok := d.serverConfigs[*opts.ServerConfig] + if !ok { + return nil, fmt.Errorf("no server config found for {%+v}", opts.ServerConfig) + } + name, cluster, err := unmarshalClusterResource(resource.ToAny(), serverCfg) + if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err - case err != nil: + } + if err != nil { // Protobuf deserialization succeeded, but resource validation failed. - return &DecodeResult{Name: name, Resource: &ClusterResourceData{Resource: ClusterUpdate{}}}, err + return &xdsclient.DecodeResult{ + Name: name, + Resource: &ClusterResourceData{Resource: ClusterUpdate{}}, + }, err } // Perform extra validation here. - if err := securityConfigValidator(opts.BootstrapConfig, cluster.SecurityCfg); err != nil { - return &DecodeResult{Name: name, Resource: &ClusterResourceData{Resource: ClusterUpdate{}}}, err + if err := securityConfigValidator(d.bootstrapConfig, cluster.SecurityCfg); err != nil { + return &xdsclient.DecodeResult{ + Name: name, + Resource: &ClusterResourceData{Resource: ClusterUpdate{}}, + }, err } - return &DecodeResult{Name: name, Resource: &ClusterResourceData{Resource: cluster}}, nil - + return &xdsclient.DecodeResult{ + Name: name, + Resource: &ClusterResourceData{Resource: cluster}, + }, nil } // ClusterResourceData wraps the configuration of a Cluster resource as received // from the management server. -// -// Implements the ResourceData interface. type ClusterResourceData struct { - ResourceData - - // TODO: We have always stored update structs by value. See if this can be - // switched to a pointer? Resource ClusterUpdate } -// RawEqual returns true if other is equal to r. -func (c *ClusterResourceData) RawEqual(other ResourceData) bool { - if c == nil && other == nil { - return true - } - if (c == nil) != (other == nil) { +// Equal returns true if other is equal to c. +func (c *ClusterResourceData) Equal(other xdsclient.ResourceData) bool { + if other == nil { return false } - return proto.Equal(c.Resource.Raw, other.Raw()) -} - -// ToJSON returns a JSON string representation of the resource data. -func (c *ClusterResourceData) ToJSON() string { - return pretty.ToJSON(c.Resource) + return bytes.Equal(c.Bytes(), other.Bytes()) } -// Raw returns the underlying raw protobuf form of the cluster resource. -func (c *ClusterResourceData) Raw() *anypb.Any { - return c.Resource.Raw +// Bytes returns the protobuf serialized bytes of the cluster resource proto. +func (c *ClusterResourceData) Bytes() []byte { + return c.Resource.Raw.GetValue() } // ClusterWatcher wraps the callbacks to be invoked for different events @@ -114,7 +95,7 @@ func (c *ClusterResourceData) Raw() *anypb.Any { // exhaustive list of what method is invoked under what conditions. type ClusterWatcher interface { // ResourceChanged indicates a new version of the resource is available. - ResourceChanged(resource *ClusterResourceData, done func()) + ResourceChanged(resource *ClusterUpdate, done func()) // ResourceError indicates an error occurred while trying to fetch or // decode the associated resource. The previous version of the resource @@ -133,9 +114,9 @@ type delegatingClusterWatcher struct { watcher ClusterWatcher } -func (d *delegatingClusterWatcher) ResourceChanged(data ResourceData, onDone func()) { +func (d *delegatingClusterWatcher) ResourceChanged(data xdsclient.ResourceData, onDone func()) { c := data.(*ClusterResourceData) - d.watcher.ResourceChanged(c, onDone) + d.watcher.ResourceChanged(&c.Resource, onDone) } func (d *delegatingClusterWatcher) ResourceError(err error, onDone func()) { @@ -149,12 +130,11 @@ func (d *delegatingClusterWatcher) AmbientError(err error, onDone func()) { // WatchCluster uses xDS to discover the configuration associated with the // provided cluster resource name. func WatchCluster(p Producer, name string, w ClusterWatcher) (cancel func()) { - delegator := &delegatingClusterWatcher{watcher: w} - return p.WatchResource(clusterType, name, delegator) + return p.WatchResource(version.V3ClusterURL, name, &delegatingClusterWatcher{watcher: w}) } -// NewGenericClusterResourceTypeDecoder returns a xdsclient.Decoder that -// wraps the xdsresource.clusterType. -func NewGenericClusterResourceTypeDecoder(bc *bootstrap.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) xdsclient.Decoder { - return &GenericResourceTypeDecoder{ResourceType: clusterType, BootstrapConfig: bc, ServerConfigMap: gServerCfgMap} +// NewClusterResourceTypeDecoder returns a xdsclient.Decoder that wraps +// the xdsresource.clusterType. +func NewClusterResourceTypeDecoder(bc *bootstrap.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) xdsclient.Decoder { + return &clusterResourceDecoder{bootstrapConfig: bc, serverConfigs: gServerCfgMap} } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/endpoints_resource_type.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/endpoints_resource_type.go index 7ca45ec6..cf72c495 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/endpoints_resource_type.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/endpoints_resource_type.go @@ -18,11 +18,11 @@ package xdsresource import ( - "google.golang.org/grpc/internal/pretty" + "bytes" + + "google.golang.org/grpc/internal/xds/bootstrap" xdsclient "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" ) const ( @@ -31,77 +31,49 @@ const ( EndpointsResourceTypeName = "EndpointsResource" ) -var ( - // Compile time interface checks. - _ Type = endpointsResourceType{} - - // Singleton instantiation of the resource type implementation. - endpointsType = endpointsResourceType{ - resourceTypeState: resourceTypeState{ - typeURL: version.V3EndpointsURL, - typeName: "EndpointsResource", - allResourcesRequiredInSotW: false, - }, - } -) - -// endpointsResourceType provides the resource-type specific functionality for a -// ClusterLoadAssignment (or Endpoints) resource. -// -// Implements the Type interface. -type endpointsResourceType struct { - resourceTypeState +// endpointsResourceDecoder is an implementation of the xdsclient.Decoder +// interface for endpoints resources. +type endpointsResourceDecoder struct { + bootstrapConfig *bootstrap.Config } -// Decode deserializes and validates an xDS resource serialized inside the -// provided `Any` proto, as received from the xDS management server. -func (endpointsResourceType) Decode(_ *DecodeOptions, resource *anypb.Any) (*DecodeResult, error) { - name, rc, err := unmarshalEndpointsResource(resource) - switch { - case name == "": +func (d *endpointsResourceDecoder) Decode(resource *xdsclient.AnyProto, _ xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { + name, endpoints, err := unmarshalEndpointsResource(resource.ToAny()) + if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err - case err != nil: + } + if err != nil { // Protobuf deserialization succeeded, but resource validation failed. - return &DecodeResult{Name: name, Resource: &EndpointsResourceData{Resource: EndpointsUpdate{}}}, err + return &xdsclient.DecodeResult{ + Name: name, + Resource: &ListenerResourceData{Resource: ListenerUpdate{}}, + }, err } - return &DecodeResult{Name: name, Resource: &EndpointsResourceData{Resource: rc}}, nil - + return &xdsclient.DecodeResult{ + Name: name, + Resource: &EndpointsResourceData{Resource: endpoints}, + }, nil } -// EndpointsResourceData wraps the configuration of an Endpoints resource as -// received from the management server. -// -// Implements the ResourceData interface. +// EndpointsResourceData is an implementation of the xdsclient.ResourceData +// interface for endpoints resources. type EndpointsResourceData struct { - ResourceData - - // TODO: We have always stored update structs by value. See if this can be - // switched to a pointer? Resource EndpointsUpdate } -// RawEqual returns true if other is equal to r. -func (e *EndpointsResourceData) RawEqual(other ResourceData) bool { - if e == nil && other == nil { - return true - } - if (e == nil) != (other == nil) { +// Equal returns true if other is equal to e. +func (e *EndpointsResourceData) Equal(other xdsclient.ResourceData) bool { + if other == nil { return false } - return proto.Equal(e.Resource.Raw, other.Raw()) - -} - -// ToJSON returns a JSON string representation of the resource data. -func (e *EndpointsResourceData) ToJSON() string { - return pretty.ToJSON(e.Resource) + return bytes.Equal(e.Bytes(), other.Bytes()) } -// Raw returns the underlying raw protobuf form of the listener resource. -func (e *EndpointsResourceData) Raw() *anypb.Any { - return e.Resource.Raw +// Bytes returns the protobuf serialized bytes of the listener resource proto. +func (e *EndpointsResourceData) Bytes() []byte { + return e.Resource.Raw.GetValue() } // EndpointsWatcher wraps the callbacks to be invoked for different @@ -109,7 +81,7 @@ func (e *EndpointsResourceData) Raw() *anypb.Any { // contains an exhaustive list of what method is invoked under what conditions. type EndpointsWatcher interface { // ResourceChanged indicates a new version of the resource is available. - ResourceChanged(resource *EndpointsResourceData, done func()) + ResourceChanged(resource *EndpointsUpdate, done func()) // ResourceError indicates an error occurred while trying to fetch or // decode the associated resource. The previous version of the resource @@ -128,9 +100,9 @@ type delegatingEndpointsWatcher struct { watcher EndpointsWatcher } -func (d *delegatingEndpointsWatcher) ResourceChanged(data ResourceData, onDone func()) { +func (d *delegatingEndpointsWatcher) ResourceChanged(data xdsclient.ResourceData, onDone func()) { e := data.(*EndpointsResourceData) - d.watcher.ResourceChanged(e, onDone) + d.watcher.ResourceChanged(&e.Resource, onDone) } func (d *delegatingEndpointsWatcher) ResourceError(err error, onDone func()) { @@ -144,12 +116,11 @@ func (d *delegatingEndpointsWatcher) AmbientError(err error, onDone func()) { // WatchEndpoints uses xDS to discover the configuration associated with the // provided endpoints resource name. func WatchEndpoints(p Producer, name string, w EndpointsWatcher) (cancel func()) { - delegator := &delegatingEndpointsWatcher{watcher: w} - return p.WatchResource(endpointsType, name, delegator) + return p.WatchResource(version.V3EndpointsURL, name, &delegatingEndpointsWatcher{watcher: w}) } -// NewGenericEndpointsResourceTypeDecoder returns a xdsclient.Decoder that -// wraps the xdsresource.endpointsType. -func NewGenericEndpointsResourceTypeDecoder() xdsclient.Decoder { - return &GenericResourceTypeDecoder{ResourceType: endpointsType} +// NewEndpointsResourceTypeDecoder returns a xdsclient.Decoder that wraps +// the xdsresource.endpointsType. +func NewEndpointsResourceTypeDecoder(bc *bootstrap.Config) xdsclient.Decoder { + return &endpointsResourceDecoder{bootstrapConfig: bc} } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go index 76ace109..50b72e0d 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/filter_chain.go @@ -680,7 +680,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*FilterChain, error) // server-side." - A36 // Can specify v3 here, as will never get to this function // if v2. - routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig()) + routeU, err := generateRDSUpdateFromRouteConfiguration(hcm.GetRouteConfig(), nil) if err != nil { return nil, fmt.Errorf("failed to parse inline RDS resp: %v", err) } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go index a1e1c672..2b9000fd 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/listener_resource_type.go @@ -35,8 +35,8 @@ type listenerResourceDecoder struct { bootstrapConfig *bootstrap.Config } -func (d *listenerResourceDecoder) Decode(resource *xdsclient.AnyProto, _ xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { - name, listener, err := unmarshalListenerResource(resource.ToAny()) +func (d *listenerResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { + name, listener, err := unmarshalListenerResource(resource.ToAny(), &opts) if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err @@ -149,8 +149,8 @@ func (d *delegatingListenerWatcher) AmbientError(err error, onDone func()) { // WatchListener uses xDS to discover the configuration associated with the // provided listener resource name. -func WatchListener(p ProducerV2, name string, w ListenerWatcher) (cancel func()) { - return p.WatchResourceV2(version.V3ListenerURL, name, &delegatingListenerWatcher{watcher: w}) +func WatchListener(p Producer, name string, w ListenerWatcher) (cancel func()) { + return p.WatchResource(version.V3ListenerURL, name, &delegatingListenerWatcher{watcher: w}) } // NewListenerResourceTypeDecoder returns a xdsclient.Decoder that wraps diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/resource_type.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/resource_type.go index aaa30cec..05f0d58f 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/resource_type.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/resource_type.go @@ -25,8 +25,6 @@ package xdsresource import ( - "fmt" - "google.golang.org/grpc/internal/xds/bootstrap" "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/protobuf/types/known/anypb" @@ -42,16 +40,7 @@ type Producer interface { // xDS responses are are deserialized and validated, as received from the // xDS management server. Upon receipt of a response from the management // server, an appropriate callback on the watcher is invoked. - WatchResource(rType Type, resourceName string, watcher ResourceWatcher) (cancel func()) -} - -// ProducerV2 is like Producer, but uses the external xdsclient API. -// -// Once all resource type implementations have been migrated to use the external -// xdsclient API, this interface will be renamed to Producer and the existing -// Producer interface will be deleted. -type ProducerV2 interface { - WatchResourceV2(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) + WatchResource(typeURL, resourceName string, watcher xdsclient.ResourceWatcher) (cancel func()) } // ResourceWatcher is notified of the resource updates and errors that are @@ -148,136 +137,3 @@ type DecodeResult struct { // watched. Resource ResourceData } - -// resourceTypeState wraps the static state associated with concrete resource -// type implementations, which can then embed this struct and get the methods -// implemented here for free. -type resourceTypeState struct { - typeURL string - typeName string - allResourcesRequiredInSotW bool -} - -func (r resourceTypeState) TypeURL() string { - return r.typeURL -} - -func (r resourceTypeState) TypeName() string { - return r.typeName -} - -func (r resourceTypeState) AllResourcesRequiredInSotW() bool { - return r.allResourcesRequiredInSotW -} - -// GenericResourceTypeDecoder wraps an xdsresource.Type and implements -// xdsclient.Decoder. -// -// TODO: #8313 - Delete this once the internal xdsclient usages are updated -// to use the generic xdsclient.ResourceType interface directly. -type GenericResourceTypeDecoder struct { - ResourceType Type - BootstrapConfig *bootstrap.Config - ServerConfigMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig -} - -// Decode deserialize and validate resource bytes of an xDS resource received -// from the xDS management server. -func (gd *GenericResourceTypeDecoder) Decode(resource *xdsclient.AnyProto, gOpts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { - opts := &DecodeOptions{BootstrapConfig: gd.BootstrapConfig} - if gOpts.ServerConfig != nil { - opts.ServerConfig = gd.ServerConfigMap[*gOpts.ServerConfig] - } - - result, err := gd.ResourceType.Decode(opts, resource.ToAny()) - if result == nil { - return nil, err - } - if err != nil { - return &xdsclient.DecodeResult{Name: result.Name}, err - } - - return &xdsclient.DecodeResult{Name: result.Name, Resource: &genericResourceData{resourceData: result.Resource}}, nil -} - -// genericResourceData embed an xdsresource.ResourceData and implements -// xdsclient.ResourceData. -// -// TODO: #8313 - Delete this once the internal xdsclient usages are updated -// to use the generic xdsclient.ResourceData interface directly. -type genericResourceData struct { - resourceData ResourceData -} - -// Equal returns true if the passed in xdsclient.ResourceData -// is equal to that of the receiver. -func (grd *genericResourceData) Equal(other xdsclient.ResourceData) bool { - if other == nil { - return false - } - otherResourceData, ok := other.(*genericResourceData) - if !ok { - return false - } - return grd.resourceData.RawEqual(otherResourceData.resourceData) -} - -// Bytes returns the underlying raw bytes of the wrapped resource. -func (grd *genericResourceData) Bytes() []byte { - rawAny := grd.resourceData.Raw() - if rawAny == nil { - return nil - } - return rawAny.Value -} - -// genericResourceWatcher wraps xdsresource.ResourceWatcher and implements -// xdsclient.ResourceWatcher. -// -// TODO: #8313 - Delete this once the internal xdsclient usages are updated -// to use the generic xdsclient.ResourceWatcher interface directly. -type genericResourceWatcher struct { - xdsResourceWatcher ResourceWatcher -} - -// ResourceChanged indicates a new version of the wrapped resource is -// available. -func (gw *genericResourceWatcher) ResourceChanged(gData xdsclient.ResourceData, done func()) { - if gData == nil { - gw.xdsResourceWatcher.ResourceChanged(nil, done) - return - } - - grd, ok := gData.(*genericResourceData) - if !ok { - err := fmt.Errorf("genericResourceWatcher received unexpected xdsclient.ResourceData type %T, want *genericResourceData", gData) - gw.xdsResourceWatcher.ResourceError(err, done) - return - } - gw.xdsResourceWatcher.ResourceChanged(grd.resourceData, done) -} - -// ResourceError indicates an error occurred while trying to fetch or -// decode the associated wrapped resource. The previous version of the -// wrapped resource should be considered invalid. -func (gw *genericResourceWatcher) ResourceError(err error, done func()) { - gw.xdsResourceWatcher.ResourceError(err, done) -} - -// AmbientError indicates an error occurred after a resource has been -// received that should not modify the use of that wrapped resource but may -// provide useful information about the state of the XDSClient for debugging -// purposes. The previous version of the wrapped resource should still be -// considered valid. -func (gw *genericResourceWatcher) AmbientError(err error, done func()) { - gw.xdsResourceWatcher.AmbientError(err, done) -} - -// GenericResourceWatcher returns a xdsclient.ResourceWatcher that wraps an -// xdsresource.ResourceWatcher to make it compatible with xdsclient.ResourceWatcher. -func GenericResourceWatcher(xdsResourceWatcher ResourceWatcher) xdsclient.ResourceWatcher { - if xdsResourceWatcher == nil { - return nil - } - return &genericResourceWatcher{xdsResourceWatcher: xdsResourceWatcher} -} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go index 912dc1b7..1104fe9f 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/route_config_resource_type.go @@ -18,11 +18,11 @@ package xdsresource import ( - "google.golang.org/grpc/internal/pretty" + "bytes" + + "google.golang.org/grpc/internal/xds/bootstrap" xdsclient "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" ) const ( @@ -31,78 +31,49 @@ const ( RouteConfigTypeName = "RouteConfigResource" ) -var ( - // Compile time interface checks. - _ Type = routeConfigResourceType{} - - // Singleton instantiation of the resource type implementation. - routeConfigType = routeConfigResourceType{ - resourceTypeState: resourceTypeState{ - typeURL: version.V3RouteConfigURL, - typeName: "RouteConfigResource", - allResourcesRequiredInSotW: false, - }, - } -) - -// routeConfigResourceType provides the resource-type specific functionality for -// a RouteConfiguration resource. -// -// Implements the Type interface. -type routeConfigResourceType struct { - resourceTypeState +// routeConfigResourceDecoder is an implementation of the xdsclient.Decoder +// interface for route configuration resources. +type routeConfigResourceDecoder struct { + bootstrapConfig *bootstrap.Config } -// Decode deserializes and validates an xDS resource serialized inside the -// provided `Any` proto, as received from the xDS management server. -func (routeConfigResourceType) Decode(_ *DecodeOptions, resource *anypb.Any) (*DecodeResult, error) { - name, rc, err := unmarshalRouteConfigResource(resource) - switch { - case name == "": +func (d *routeConfigResourceDecoder) Decode(resource *xdsclient.AnyProto, opts xdsclient.DecodeOptions) (*xdsclient.DecodeResult, error) { + name, rc, err := unmarshalRouteConfigResource(resource.ToAny(), &opts) + if name == "" { // Name is unset only when protobuf deserialization fails. return nil, err - case err != nil: + } + if err != nil { // Protobuf deserialization succeeded, but resource validation failed. - return &DecodeResult{Name: name, Resource: &RouteConfigResourceData{Resource: RouteConfigUpdate{}}}, err + return &xdsclient.DecodeResult{ + Name: name, + Resource: &RouteConfigResourceData{Resource: RouteConfigUpdate{}}, + }, err } - return &DecodeResult{Name: name, Resource: &RouteConfigResourceData{Resource: rc}}, nil - + return &xdsclient.DecodeResult{ + Name: name, + Resource: &RouteConfigResourceData{Resource: rc}, + }, nil } -// RouteConfigResourceData wraps the configuration of a RouteConfiguration -// resource as received from the management server. -// -// Implements the ResourceData interface. +// RouteConfigResourceData is an implementation of the xdsclient.ResourceData +// interface for route configuration resources. type RouteConfigResourceData struct { - ResourceData - - // TODO: We have always stored update structs by value. See if this can be - // switched to a pointer? Resource RouteConfigUpdate } -// RawEqual returns true if other is equal to r. -func (r *RouteConfigResourceData) RawEqual(other ResourceData) bool { - if r == nil && other == nil { - return true - } - if (r == nil) != (other == nil) { +// Equal returns true if other is equal to er. +func (r *RouteConfigResourceData) Equal(other xdsclient.ResourceData) bool { + if other == nil { return false } - return proto.Equal(r.Resource.Raw, other.Raw()) - -} - -// ToJSON returns a JSON string representation of the resource data. -func (r *RouteConfigResourceData) ToJSON() string { - return pretty.ToJSON(r.Resource) + return bytes.Equal(r.Bytes(), other.Bytes()) } -// Raw returns the underlying raw protobuf form of the route configuration -// resource. -func (r *RouteConfigResourceData) Raw() *anypb.Any { - return r.Resource.Raw +// Bytes returns the protobuf serialized bytes of the route config resource proto. +func (r *RouteConfigResourceData) Bytes() []byte { + return r.Resource.Raw.GetValue() } // RouteConfigWatcher wraps the callbacks to be invoked for different @@ -111,7 +82,7 @@ func (r *RouteConfigResourceData) Raw() *anypb.Any { // conditions. type RouteConfigWatcher interface { // ResourceChanged indicates a new version of the resource is available. - ResourceChanged(resource *RouteConfigResourceData, done func()) + ResourceChanged(resource *RouteConfigUpdate, done func()) // ResourceError indicates an error occurred while trying to fetch or // decode the associated resource. The previous version of the resource @@ -130,9 +101,9 @@ type delegatingRouteConfigWatcher struct { watcher RouteConfigWatcher } -func (d *delegatingRouteConfigWatcher) ResourceChanged(data ResourceData, onDone func()) { +func (d *delegatingRouteConfigWatcher) ResourceChanged(data xdsclient.ResourceData, onDone func()) { rc := data.(*RouteConfigResourceData) - d.watcher.ResourceChanged(rc, onDone) + d.watcher.ResourceChanged(&rc.Resource, onDone) } func (d *delegatingRouteConfigWatcher) ResourceError(err error, onDone func()) { @@ -146,12 +117,11 @@ func (d *delegatingRouteConfigWatcher) AmbientError(err error, onDone func()) { // WatchRouteConfig uses xDS to discover the configuration associated with the // provided route configuration resource name. func WatchRouteConfig(p Producer, name string, w RouteConfigWatcher) (cancel func()) { - delegator := &delegatingRouteConfigWatcher{watcher: w} - return p.WatchResource(routeConfigType, name, delegator) + return p.WatchResource(version.V3RouteConfigURL, name, &delegatingRouteConfigWatcher{watcher: w}) } -// NewGenericRouteConfigResourceTypeDecoder returns a xdsclient.Decoder that -// wraps the xdsresource.routeConfigType. -func NewGenericRouteConfigResourceTypeDecoder() xdsclient.Decoder { - return &GenericResourceTypeDecoder{ResourceType: routeConfigType} +// NewRouteConfigResourceTypeDecoder returns a xdsclient.Decoder that wraps +// the xdsresource.routeConfigType. +func NewRouteConfigResourceTypeDecoder(bc *bootstrap.Config) xdsclient.Decoder { + return &routeConfigResourceDecoder{bootstrapConfig: bc} } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_eds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_eds.go index a8d568e1..39b2ba74 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_eds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_eds.go @@ -54,6 +54,7 @@ type Endpoint struct { Weight uint32 HashKey string Metadata map[string]any + Hostname string } // Locality contains information of a locality. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go index 0cde9738..48e8051b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go @@ -150,6 +150,9 @@ type Route struct { // ClusterSpecifierPlugin is the name of the Cluster Specifier Plugin that // this Route is linked to, if specified by xDS. ClusterSpecifierPlugin string + // AutoHostRewrite indicates that the ":authority" header can be rewritten + // to the hostname of the upstream endpoint. + AutoHostRewrite bool } // WeightedCluster contains settings for an xds ActionType.WeightedCluster. diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go index c5b9723a..ebf47961 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_eds.go @@ -132,6 +132,7 @@ func parseEndpoints(lbEndpoints []*v3endpointpb.LbEndpoint, uniqueEndpointAddrs Weight: weight, HashKey: hashKey, Metadata: endpointMetadata, + Hostname: lbEndpoint.GetEndpoint().GetHostname(), }) } return endpoints, nil diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go index 25c607b4..604c086b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_lds.go @@ -27,12 +27,13 @@ import ( v3listenerpb "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" v3httppb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) -func unmarshalListenerResource(r *anypb.Any) (string, ListenerUpdate, error) { +func unmarshalListenerResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (string, ListenerUpdate, error) { r, err := UnwrapResource(r) if err != nil { return "", ListenerUpdate{}, fmt.Errorf("failed to unwrap resource: %v", err) @@ -46,7 +47,7 @@ func unmarshalListenerResource(r *anypb.Any) (string, ListenerUpdate, error) { return "", ListenerUpdate{}, fmt.Errorf("failed to unmarshal resource: %v", err) } - lu, err := processListener(lis) + lu, err := processListener(lis, opts) if err != nil { return lis.GetName(), ListenerUpdate{}, err } @@ -54,16 +55,16 @@ func unmarshalListenerResource(r *anypb.Any) (string, ListenerUpdate, error) { return lis.GetName(), *lu, nil } -func processListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { +func processListener(lis *v3listenerpb.Listener, opts *xdsclient.DecodeOptions) (*ListenerUpdate, error) { if lis.GetApiListener() != nil { - return processClientSideListener(lis) + return processClientSideListener(lis, opts) } return processServerSideListener(lis) } // processClientSideListener checks if the provided Listener proto meets // the expected criteria. If so, it returns a non-empty routeConfigName. -func processClientSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) { +func processClientSideListener(lis *v3listenerpb.Listener, opts *xdsclient.DecodeOptions) (*ListenerUpdate, error) { update := &ListenerUpdate{} apiLisAny := lis.GetApiListener().GetApiListener() @@ -95,7 +96,7 @@ func processClientSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, err } update.RouteConfigName = name case *v3httppb.HttpConnectionManager_RouteConfig: - routeU, err := generateRDSUpdateFromRouteConfiguration(apiLis.GetRouteConfig()) + routeU, err := generateRDSUpdateFromRouteConfiguration(apiLis.GetRouteConfig(), opts) if err != nil { return nil, fmt.Errorf("failed to parse inline RDS resp: %v", err) } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go index 479d023f..d988b4e7 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go @@ -25,6 +25,8 @@ import ( "time" "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/xds/clients/xdsclient" "google.golang.org/grpc/internal/xds/clusterspecifier" "google.golang.org/grpc/internal/xds/matcher" "google.golang.org/protobuf/proto" @@ -34,7 +36,7 @@ import ( v3typepb "github.com/envoyproxy/go-control-plane/envoy/type/v3" ) -func unmarshalRouteConfigResource(r *anypb.Any) (string, RouteConfigUpdate, error) { +func unmarshalRouteConfigResource(r *anypb.Any, opts *xdsclient.DecodeOptions) (string, RouteConfigUpdate, error) { r, err := UnwrapResource(r) if err != nil { return "", RouteConfigUpdate{}, fmt.Errorf("failed to unwrap resource: %v", err) @@ -48,7 +50,7 @@ func unmarshalRouteConfigResource(r *anypb.Any) (string, RouteConfigUpdate, erro return "", RouteConfigUpdate{}, fmt.Errorf("failed to unmarshal resource: %v", err) } - u, err := generateRDSUpdateFromRouteConfiguration(rc) + u, err := generateRDSUpdateFromRouteConfiguration(rc, opts) if err != nil { return rc.GetName(), RouteConfigUpdate{}, err } @@ -67,12 +69,12 @@ func unmarshalRouteConfigResource(r *anypb.Any) (string, RouteConfigUpdate, erro // The RouteConfiguration includes a list of virtualHosts, which may have zero // or more elements. We are interested in the element whose domains field // matches the server name specified in the "xds:" URI. The only field in the -// VirtualHost proto that the we are interested in is the list of routes. We +// VirtualHost proto that we are interested in is the list of routes. We // only look at the last route in the list (the default route), whose match -// field must be empty and whose route field must be set. Inside that route +// field must be empty and whose route field must be set. Inside that route // message, the cluster field will contain the clusterName or weighted clusters // we are looking for. -func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration) (RouteConfigUpdate, error) { +func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration, opts *xdsclient.DecodeOptions) (RouteConfigUpdate, error) { vhs := make([]*VirtualHost, 0, len(rc.GetVirtualHosts())) csps, err := processClusterSpecifierPlugins(rc.ClusterSpecifierPlugins) if err != nil { @@ -83,7 +85,7 @@ func generateRDSUpdateFromRouteConfiguration(rc *v3routepb.RouteConfiguration) ( // ignored and not emitted by the xdsclient. var cspNames = make(map[string]bool) for _, vh := range rc.GetVirtualHosts() { - routes, cspNs, err := routesProtoToSlice(vh.Routes, csps) + routes, cspNs, err := routesProtoToSlice(vh.Routes, csps, opts) if err != nil { return RouteConfigUpdate{}, fmt.Errorf("received route is invalid: %v", err) } @@ -206,7 +208,7 @@ func generateRetryConfig(rp *v3routepb.RetryPolicy) (*RetryConfig, error) { return cfg, nil } -func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecifier.BalancerConfig) ([]*Route, map[string]bool, error) { +func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecifier.BalancerConfig, opts *xdsclient.DecodeOptions) ([]*Route, map[string]bool, error) { var routesRet []*Route var cspNames = make(map[string]bool) for _, r := range routes { @@ -302,6 +304,12 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif case *v3routepb.Route_Route: action := r.GetRoute() + if envconfig.XDSAuthorityRewrite { + if opts != nil && opts.ServerConfig != nil && opts.ServerConfig.SupportsServerFeature(xdsclient.ServerFeatureTrustedXDSServer) { + route.AutoHostRewrite = action.GetAutoHostRewrite().GetValue() + } + } + // Hash Policies are only applicable for a Ring Hash LB. hp, err := hashPoliciesProtoToSlice(action.HashPolicy) if err != nil { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/xdsconfig.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/xdsconfig.go new file mode 100644 index 00000000..5c13714a --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/xdsconfig.go @@ -0,0 +1,114 @@ +/* + * + * Copyright 2025 gRPC 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 xdsresource + +import "google.golang.org/grpc/resolver" + +// XDSConfig holds the complete gRPC client-side xDS configuration containing +// all necessary resources. +type XDSConfig struct { + // Listener holds the listener configuration. It is guaranteed to be + // non-nil. + Listener *ListenerUpdate + + // RouteConfig holds the route configuration. It will be populated even if + // the route configuration was inlined into the Listener resource. It is + // guaranteed to be non-nil. + RouteConfig *RouteConfigUpdate + + // VirtualHost is selected from the route configuration whose domain field + // offers the best match against the provided dataplane authority. It is + // guaranteed to be non-nil. + VirtualHost *VirtualHost + + // Clusters is a map from cluster name to its configuration. + Clusters map[string]*ClusterResult +} + +// ClusterResult contains a cluster's configuration when a valid resource is +// received from the management server. It contains an error when: +// - an invalid resource is received from the management server and +// a valid resource was not already present or +// - the cluster resource does not exist on the management server +type ClusterResult struct { + Config ClusterConfig + Err error +} + +// ClusterConfig contains configuration for a single cluster. +type ClusterConfig struct { + // Cluster configuration for the cluster. This field is always set to a + // non-nil value. + Cluster *ClusterUpdate + // EndpointConfig contains endpoint configuration for a leaf cluster. This + // field is only set for EDS and LOGICAL_DNS clusters. + EndpointConfig *EndpointConfig + // AggregateConfig contains configuration for an aggregate cluster. This + // field is only set for AGGREGATE clusters. + AggregateConfig *AggregateConfig +} + +// AggregateConfig holds the configuration for an aggregate cluster. +type AggregateConfig struct { + // LeafClusters contains a prioritized list of names of the leaf clusters + // for the cluster. + LeafClusters []string +} + +// EndpointConfig contains configuration corresponding to the endpoints in a +// cluster. Only one of EDSUpdate or DNSEndpoints will be populated based on the +// cluster type. +type EndpointConfig struct { + // Endpoint configurartion for the EDS clusters. + EDSUpdate *EndpointsUpdate + // Endpoint configuration for the LOGICAL_DNS clusters. + DNSEndpoints *DNSUpdate + // ResolutionNote stores error encountered while obtaining endpoints data + // for the cluster. It will contain a nil value when a valid endpoint data is + // received. It contains an error when: + // - an invalid resource is received from the management server or + // - the endpoint resource does not exist on the management server + ResolutionNote error +} + +// DNSUpdate represents the result of a DNS resolution, containing a list of +// discovered endpoints. +type DNSUpdate struct { + // Endpoints is the complete list of endpoints returned by the DNS resolver. + Endpoints []resolver.Endpoint +} + +// xdsConfigkey is the type used as the key to store XDSConfig in the Attributes +// field of resolver.State. +type xdsConfigkey struct{} + +// SetXDSConfig returns a copy of state in which the Attributes field is updated +// with the XDSConfig. +func SetXDSConfig(state resolver.State, config *XDSConfig) resolver.State { + state.Attributes = state.Attributes.WithValue(xdsConfigkey{}, config) + return state +} + +// XDSConfigFromResolverState returns XDSConfig stored as an attribute in the +// resolver state. +func XDSConfigFromResolverState(state resolver.State) *XDSConfig { + if v := state.Attributes.Value(xdsConfigkey{}); v != nil { + return v.(*XDSConfig) + } + return nil +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/watch_service.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/watch_service.go new file mode 100644 index 00000000..73f1b703 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/watch_service.go @@ -0,0 +1,83 @@ +/* + * + * Copyright 2025 gRPC 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 xdsdepmgr + +import "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" + +type listenerWatcher struct { + resourceName string + cancel func() + depMgr *DependencyManager +} + +func newListenerWatcher(resourceName string, depMgr *DependencyManager) *listenerWatcher { + lw := &listenerWatcher{resourceName: resourceName, depMgr: depMgr} + lw.cancel = xdsresource.WatchListener(depMgr.xdsClient, resourceName, lw) + return lw +} + +func (l *listenerWatcher) ResourceChanged(update *xdsresource.ListenerUpdate, onDone func()) { + l.depMgr.onListenerResourceUpdate(update, onDone) +} + +func (l *listenerWatcher) ResourceError(err error, onDone func()) { + l.depMgr.onListenerResourceError(err, onDone) +} + +func (l *listenerWatcher) AmbientError(err error, onDone func()) { + l.depMgr.onListenerResourceAmbientError(err, onDone) +} + +func (l *listenerWatcher) stop() { + l.cancel() + if l.depMgr.logger.V(2) { + l.depMgr.logger.Infof("Canceling watch on Listener resource %q", l.resourceName) + } +} + +type routeConfigWatcher struct { + resourceName string + cancel func() + depMgr *DependencyManager +} + +func newRouteConfigWatcher(resourceName string, depMgr *DependencyManager) *routeConfigWatcher { + rw := &routeConfigWatcher{resourceName: resourceName, depMgr: depMgr} + rw.cancel = xdsresource.WatchRouteConfig(depMgr.xdsClient, resourceName, rw) + return rw +} + +func (r *routeConfigWatcher) ResourceChanged(u *xdsresource.RouteConfigUpdate, onDone func()) { + r.depMgr.onRouteConfigResourceUpdate(r.resourceName, u, onDone) +} + +func (r *routeConfigWatcher) ResourceError(err error, onDone func()) { + r.depMgr.onRouteConfigResourceError(r.resourceName, err, onDone) +} + +func (r *routeConfigWatcher) AmbientError(err error, onDone func()) { + r.depMgr.onRouteConfigResourceAmbientError(r.resourceName, err, onDone) +} + +func (r *routeConfigWatcher) stop() { + r.cancel() + if r.depMgr.logger.V(2) { + r.depMgr.logger.Infof("Canceling watch on RouteConfiguration resource %q", r.resourceName) + } +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go new file mode 100644 index 00000000..fae5ca96 --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go @@ -0,0 +1,279 @@ +/* + * Copyright 2025 gRPC 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 xdsdepmgr provides the implementation of the xDS dependency manager +// that manages all the xDS watches and resources as described in gRFC A74. +package xdsdepmgr + +import ( + "fmt" + "sync" + + "google.golang.org/grpc/grpclog" + internalgrpclog "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/xds/xdsclient" + "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" +) + +const prefix = "[xdsdepmgr %p] " + +var logger = grpclog.Component("xds") + +func prefixLogger(p *DependencyManager) *internalgrpclog.PrefixLogger { + return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(prefix, p)) +} + +// ConfigWatcher is the interface for consumers of aggregated xDS configuration +// from the DependencyManager. The only consumer of this configuration is +// currently the xDS resolver. +type ConfigWatcher interface { + // Update is invoked when a new, validated xDS configuration is available. + // + // Implementations must treat the received config as read-only and should + // not modify it. + Update(*xdsresource.XDSConfig) + + // Error is invoked when an error is received from the listener or route + // resource watcher. This includes cases where: + // - The listener or route resource watcher reports a resource error. + // - The received listener resource is a socket listener, not an API + // listener. TODO(i/8114): Implement this check. + // - The received route configuration does not contain a virtual host + // matching the channel's default authority. + Error(error) +} + +// DependencyManager registers watches on the xDS client for all required xDS +// resources, resolves dependencies between them, and returns a complete +// configuration to the xDS resolver. +type DependencyManager struct { + // The following fields are initialized at creation time and are read-only + // after that. + logger *internalgrpclog.PrefixLogger + watcher ConfigWatcher + xdsClient xdsclient.XDSClient + ldsResourceName string + dataplaneAuthority string + nodeID string + + // All the fields below are protected by mu. + mu sync.Mutex + stopped bool + + listenerWatcher *listenerWatcher + currentListenerUpdate *xdsresource.ListenerUpdate + routeConfigWatcher *routeConfigWatcher + rdsResourceName string + currentRouteConfig *xdsresource.RouteConfigUpdate + currentVirtualHost *xdsresource.VirtualHost +} + +// New creates a new DependencyManager. +// +// - listenerName is the name of the Listener resource to request from the +// management server. +// - dataplaneAuthority is used to select the best matching virtual host from +// the route configuration received from the management server. +// - xdsClient is the xDS client to use to register resource watches. +// - watcher is the ConfigWatcher interface that will receive the aggregated +// XDSConfig updates and errors. +func New(listenerName, dataplaneAuthority string, xdsClient xdsclient.XDSClient, watcher ConfigWatcher) *DependencyManager { + dm := &DependencyManager{ + ldsResourceName: listenerName, + dataplaneAuthority: dataplaneAuthority, + xdsClient: xdsClient, + watcher: watcher, + nodeID: xdsClient.BootstrapConfig().Node().GetId(), + } + dm.logger = prefixLogger(dm) + + // Start the listener watch. Listener watch will start the other resource + // watches as needed. + dm.listenerWatcher = newListenerWatcher(listenerName, dm) + return dm +} + +// Close cancels all registered resource watches. +func (m *DependencyManager) Close() { + m.mu.Lock() + defer m.mu.Unlock() + + if m.stopped { + return + } + + m.stopped = true + if m.listenerWatcher != nil { + m.listenerWatcher.stop() + } + if m.routeConfigWatcher != nil { + m.routeConfigWatcher.stop() + } +} + +// annotateErrorWithNodeID annotates the given error with the provided xDS node +// ID. +func (m *DependencyManager) annotateErrorWithNodeID(err error) error { + return fmt.Errorf("[xDS node id: %v]: %v", m.nodeID, err) +} + +// maybeSendUpdateLocked checks that all the resources have been received and sends +// the current aggregated xDS configuration to the watcher if all the updates +// are available. +func (m *DependencyManager) maybeSendUpdateLocked() { + m.watcher.Update(&xdsresource.XDSConfig{ + Listener: m.currentListenerUpdate, + RouteConfig: m.currentRouteConfig, + VirtualHost: m.currentVirtualHost, + }) +} + +func (m *DependencyManager) applyRouteConfigUpdateLocked(update *xdsresource.RouteConfigUpdate) { + matchVH := xdsresource.FindBestMatchingVirtualHost(m.dataplaneAuthority, update.VirtualHosts) + if matchVH == nil { + m.watcher.Error(m.annotateErrorWithNodeID(fmt.Errorf("could not find VirtualHost for %q", m.dataplaneAuthority))) + return + } + m.currentRouteConfig = update + m.currentVirtualHost = matchVH + m.maybeSendUpdateLocked() +} + +func (m *DependencyManager) onListenerResourceUpdate(update *xdsresource.ListenerUpdate, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped { + return + } + + if m.logger.V(2) { + m.logger.Infof("Received update for Listener resource %q: %+v", m.ldsResourceName, update) + } + + m.currentListenerUpdate = update + + if update.InlineRouteConfig != nil { + // If there was a previous route config watcher because of a non-inline + // route configuration, cancel it. + m.rdsResourceName = "" + if m.routeConfigWatcher != nil { + m.routeConfigWatcher.stop() + m.routeConfigWatcher = nil + } + m.applyRouteConfigUpdateLocked(update.InlineRouteConfig) + return + } + + // We get here only if there was no inline route configuration. If the route + // config name has not changed, send an update with existing route + // configuration and the newly received listener configuration. + if m.rdsResourceName == update.RouteConfigName { + m.maybeSendUpdateLocked() + return + } + + // If the route config name has changed, cancel the old watcher and start a + // new one. At this point, since the new route config name has not yet been + // resolved, no update is sent to the channel, and therefore the old route + // configuration (if received) is used until the new one is received. + m.rdsResourceName = update.RouteConfigName + if m.routeConfigWatcher != nil { + m.routeConfigWatcher.stop() + m.currentVirtualHost = nil + } + m.routeConfigWatcher = newRouteConfigWatcher(m.rdsResourceName, m) +} + +func (m *DependencyManager) onListenerResourceError(err error, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped { + return + } + + m.logger.Warningf("Received resource error for Listener resource %q: %v", m.ldsResourceName, m.annotateErrorWithNodeID(err)) + + if m.routeConfigWatcher != nil { + m.routeConfigWatcher.stop() + } + m.rdsResourceName = "" + m.currentVirtualHost = nil + m.routeConfigWatcher = nil + m.watcher.Error(fmt.Errorf("listener resource error: %v", m.annotateErrorWithNodeID(err))) +} + +// onListenerResourceAmbientError handles ambient errors received from the +// listener resource watcher. Since ambient errors do not impact the current +// state of the resource, no change is made to the current configuration and the +// errors are only logged for visibility. +func (m *DependencyManager) onListenerResourceAmbientError(err error, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped { + return + } + + m.logger.Warningf("Listener resource ambient error: %v", m.annotateErrorWithNodeID(err)) +} + +func (m *DependencyManager) onRouteConfigResourceUpdate(resourceName string, update *xdsresource.RouteConfigUpdate, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped || m.rdsResourceName != resourceName { + return + } + + if m.logger.V(2) { + m.logger.Infof("Received update for RouteConfiguration resource %q: %+v", resourceName, update) + } + m.applyRouteConfigUpdateLocked(update) +} + +func (m *DependencyManager) onRouteConfigResourceError(resourceName string, err error, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped || m.rdsResourceName != resourceName { + return + } + m.logger.Warningf("Received resource error for RouteConfiguration resource %q: %v", resourceName, m.annotateErrorWithNodeID(err)) + m.watcher.Error(fmt.Errorf("route resource error: %v", m.annotateErrorWithNodeID(err))) +} + +// onRouteResourceAmbientError handles ambient errors received from the route +// resource watcher. Since ambient errors do not impact the current state of the +// resource, no change is made to the current configuration and the errors are +// only logged for visibility. +func (m *DependencyManager) onRouteConfigResourceAmbientError(resourceName string, err error, onDone func()) { + m.mu.Lock() + defer m.mu.Unlock() + + defer onDone() + if m.stopped || m.rdsResourceName != resourceName { + return + } + + m.logger.Warningf("Route resource ambient error %q: %v", resourceName, m.annotateErrorWithNodeID(err)) +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/mem/buffer_pool.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/mem/buffer_pool.go index f211e727..e37afdd1 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/mem/buffer_pool.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/mem/buffer_pool.go @@ -38,9 +38,11 @@ type BufferPool interface { Put(*[]byte) } +const goPageSize = 4 << 10 // 4KiB. N.B. this must be a power of 2. + var defaultBufferPoolSizes = []int{ 256, - 4 << 10, // 4KB (go page size) + goPageSize, 16 << 10, // 16KB (max HTTP/2 frame size used by gRPC) 32 << 10, // 32KB (default buffer size for io.Copy) 1 << 20, // 1MB @@ -172,7 +174,14 @@ func (p *simpleBufferPool) Get(size int) *[]byte { p.pool.Put(bs) } - b := make([]byte, size) + // If we're going to allocate, round up to the nearest page. This way if + // requests frequently arrive with small variation we don't allocate + // repeatedly if we get unlucky and they increase over time. By default we + // only allocate here if size > 1MiB. Because goPageSize is a power of 2, we + // can round up efficiently. + allocSize := (size + goPageSize - 1) & ^(goPageSize - 1) + + b := make([]byte, size, allocSize) return &b } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/resolver_wrapper.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/resolver_wrapper.go index 80e16a32..6e613764 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/resolver_wrapper.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/resolver_wrapper.go @@ -69,6 +69,7 @@ func (ccr *ccResolverWrapper) start() error { errCh := make(chan error) ccr.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil { + errCh <- ctx.Err() return } opts := resolver.BuildOptions{ diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/rpc_util.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/rpc_util.go index 6b04c9e8..8160f943 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/rpc_util.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/rpc_util.go @@ -33,6 +33,8 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" @@ -41,6 +43,10 @@ import ( "google.golang.org/grpc/status" ) +func init() { + internal.AcceptCompressors = acceptCompressors +} + // Compressor defines the interface gRPC uses to compress a message. // // Deprecated: use package encoding. @@ -151,16 +157,32 @@ func (d *gzipDecompressor) Type() string { // callInfo contains all related configuration and information about an RPC. type callInfo struct { - compressorName string - failFast bool - maxReceiveMessageSize *int - maxSendMessageSize *int - creds credentials.PerRPCCredentials - contentSubtype string - codec baseCodec - maxRetryRPCBufferSize int - onFinish []func(err error) - authority string + compressorName string + failFast bool + maxReceiveMessageSize *int + maxSendMessageSize *int + creds credentials.PerRPCCredentials + contentSubtype string + codec baseCodec + maxRetryRPCBufferSize int + onFinish []func(err error) + authority string + acceptedResponseCompressors []string +} + +func acceptedCompressorAllows(allowed []string, name string) bool { + if allowed == nil { + return true + } + if name == "" || name == encoding.Identity { + return true + } + for _, a := range allowed { + if a == name { + return true + } + } + return false } func defaultCallInfo() *callInfo { @@ -170,6 +192,29 @@ func defaultCallInfo() *callInfo { } } +func newAcceptedCompressionConfig(names []string) ([]string, error) { + if len(names) == 0 { + return nil, nil + } + var allowed []string + seen := make(map[string]struct{}, len(names)) + for _, name := range names { + name = strings.TrimSpace(name) + if name == "" || name == encoding.Identity { + continue + } + if !grpcutil.IsCompressorNameRegistered(name) { + return nil, status.Errorf(codes.InvalidArgument, "grpc: compressor %q is not registered", name) + } + if _, dup := seen[name]; dup { + continue + } + seen[name] = struct{}{} + allowed = append(allowed, name) + } + return allowed, nil +} + // CallOption configures a Call before it starts or extracts information from // a Call after it completes. type CallOption interface { @@ -471,6 +516,31 @@ func (o CompressorCallOption) before(c *callInfo) error { } func (o CompressorCallOption) after(*callInfo, *csAttempt) {} +// acceptCompressors returns a CallOption that limits the compression algorithms +// advertised in the grpc-accept-encoding header for response messages. +// Compression algorithms not in the provided list will not be advertised, and +// responses compressed with non-listed algorithms will be rejected. +func acceptCompressors(names ...string) CallOption { + cp := append([]string(nil), names...) + return acceptCompressorsCallOption{names: cp} +} + +// acceptCompressorsCallOption is a CallOption that limits response compression. +type acceptCompressorsCallOption struct { + names []string +} + +func (o acceptCompressorsCallOption) before(c *callInfo) error { + allowed, err := newAcceptedCompressionConfig(o.names) + if err != nil { + return err + } + c.acceptedResponseCompressors = allowed + return nil +} + +func (acceptCompressorsCallOption) after(*callInfo, *csAttempt) {} + // CallContentSubtype returns a CallOption that will set the content-subtype // for a call. For example, if content-subtype is "json", the Content-Type over // the wire will be "application/grpc+json". The content-subtype is converted @@ -857,8 +927,7 @@ func (p *payloadInfo) free() { // the buffer is no longer needed. // TODO: Refactor this function to reduce the number of arguments. // See: https://google.github.io/styleguide/go/best-practices.html#function-argument-lists -func recvAndDecompress(p *parser, s recvCompressor, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool, -) (out mem.BufferSlice, err error) { +func recvAndDecompress(p *parser, s recvCompressor, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) (out mem.BufferSlice, err error) { pf, compressed, err := p.recvMsg(maxReceiveMessageSize) if err != nil { return nil, err diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/stream.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/stream.go index ca87ff97..ec9577b2 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/stream.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/stream.go @@ -25,6 +25,7 @@ import ( "math" rand "math/rand/v2" "strconv" + "strings" "sync" "time" @@ -179,13 +180,41 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth var emptyMethodConfig = serviceconfig.MethodConfig{} +// endOfClientStream performs cleanup actions required for both successful and +// failed streams. This includes incrementing channelz stats and invoking all +// registered OnFinish call options. +func endOfClientStream(cc *ClientConn, err error, opts ...CallOption) { + if channelz.IsOn() { + if err != nil { + cc.incrCallsFailed() + } else { + cc.incrCallsSucceeded() + } + } + + for _, o := range opts { + if o, ok := o.(OnFinishCallOption); ok { + o.OnFinish(err) + } + } +} + func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { + if channelz.IsOn() { + cc.incrCallsStarted() + } + defer func() { + if err != nil { + // Ensure cleanup when stream creation fails. + endOfClientStream(cc, err, opts...) + } + }() + // Start tracking the RPC for idleness purposes. This is where a stream is // created for both streaming and unary RPCs, and hence is a good place to // track active RPC count. - if err := cc.idlenessMgr.OnCallBegin(); err != nil { - return nil, err - } + cc.idlenessMgr.OnCallBegin() + // Add a calloption, to decrement the active call count, that gets executed // when the RPC completes. opts = append([]CallOption{OnFinish(func(error) { cc.idlenessMgr.OnCallEnd() })}, opts...) @@ -204,14 +233,6 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } } } - if channelz.IsOn() { - cc.incrCallsStarted() - defer func() { - if err != nil { - cc.incrCallsFailed() - } - }() - } // Provide an opportunity for the first RPC to see the first service config // provided by the resolver. nameResolutionDelayed, err := cc.waitForResolvedAddrs(ctx) @@ -301,6 +322,10 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client DoneFunc: doneFunc, Authority: callInfo.authority, } + if allowed := callInfo.acceptedResponseCompressors; len(allowed) > 0 { + headerValue := strings.Join(allowed, ",") + callHdr.AcceptedCompressors = &headerValue + } // Set our outgoing compression according to the UseCompressor CallOption, if // set. In that case, also find the compressor from the encoding package. @@ -484,7 +509,7 @@ func (a *csAttempt) getTransport() error { return err } if a.trInfo != nil { - a.trInfo.firstLine.SetRemoteAddr(a.transport.RemoteAddr()) + a.trInfo.firstLine.SetRemoteAddr(a.transport.Peer().Addr) } if pick.blocked && a.statsHandler != nil { a.statsHandler.HandleRPC(a.ctx, &stats.DelayedPickComplete{}) @@ -1042,9 +1067,6 @@ func (cs *clientStream) finish(err error) { return } cs.finished = true - for _, onFinish := range cs.callInfo.onFinish { - onFinish(err) - } cs.commitAttemptLocked() if cs.attempt != nil { cs.attempt.finish(err) @@ -1084,13 +1106,7 @@ func (cs *clientStream) finish(err error) { if err == nil { cs.retryThrottler.successfulRPC() } - if channelz.IsOn() { - if err != nil { - cs.cc.incrCallsFailed() - } else { - cs.cc.incrCallsSucceeded() - } - } + endOfClientStream(cs.cc, err, cs.opts...) cs.cancel() } @@ -1134,6 +1150,10 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { a.decompressorV0 = nil a.decompressorV1 = encoding.GetCompressor(ct) } + // Validate that the compression method is acceptable for this call. + if !acceptedCompressorAllows(cs.callInfo.acceptedResponseCompressors, ct) { + return status.Errorf(codes.Internal, "grpc: peer compressed the response with %q which is not allowed by AcceptCompressors", ct) + } } else { // No compression is used; disable our decompressor. a.decompressorV0 = nil @@ -1479,6 +1499,10 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { as.decompressorV0 = nil as.decompressorV1 = encoding.GetCompressor(ct) } + // Validate that the compression method is acceptable for this call. + if !acceptedCompressorAllows(as.callInfo.acceptedResponseCompressors, ct) { + return status.Errorf(codes.Internal, "grpc: peer compressed the response with %q which is not allowed by AcceptCompressors", ct) + } } else { // No compression is used; disable our decompressor. as.decompressorV0 = nil diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/version.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/version.go index 9e6d018f..ff7840fd 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/version.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.77.0" +const Version = "1.78.0" diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 669133d0..c96e4483 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,7 +32,7 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 - f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + packed := false for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -108,7 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.EditionFeatures.IsPacked = true + packed = true case strings.HasPrefix(s, "def="): // The default tag is special in that everything afterwards is the // default regardless of the presence of commas. @@ -121,6 +121,13 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri tag = strings.TrimPrefix(tag[i:], ",") } + // Update EditionFeatures after the loop and after we know whether this is + // a proto2 or proto3 field. + f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + if packed { + f.L1.EditionFeatures.IsPacked = true + } + // The generator uses the group message name instead of the field name. // We obtain the real field name by lowercasing the group name. if f.L1.Kind == protoreflect.GroupKind { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 099b2bf4..9aa7a9bb 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -424,27 +424,34 @@ func (d *Decoder) parseFieldName() (tok Token, err error) { return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) } -// parseTypeName parses Any type URL or extension field name. The name is -// enclosed in [ and ] characters. The C++ parser does not handle many legal URL -// strings. This implementation is more liberal and allows for the pattern -// ^[-_a-zA-Z0-9]+([./][-_a-zA-Z0-9]+)*`). Whitespaces and comments are allowed -// in between [ ], '.', '/' and the sub names. +// parseTypeName parses an Any type URL or an extension field name. The name is +// enclosed in [ and ] characters. We allow almost arbitrary type URL prefixes, +// closely following the text-format spec [1,2]. We implement "ExtensionName | +// AnyName" as follows (with some exceptions for backwards compatibility): +// +// char = [-_a-zA-Z0-9] +// url_char = char | [.~!$&'()*+,;=] | "%", hex, hex +// +// Ident = char, { char } +// TypeName = Ident, { ".", Ident } ; +// UrlPrefix = url_char, { url_char | "/" } ; +// ExtensionName = "[", TypeName, "]" ; +// AnyName = "[", UrlPrefix, "/", TypeName, "]" ; +// +// Additionally, we allow arbitrary whitespace and comments between [ and ]. +// +// [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters +// [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-names func (d *Decoder) parseTypeName() (Token, error) { - startPos := len(d.orig) - len(d.in) // Use alias s to advance first in order to use d.in for error handling. - // Caller already checks for [ as first character. + // Caller already checks for [ as first character (d.in[0] == '['). s := consume(d.in[1:], 0) if len(s) == 0 { return Token{}, ErrUnexpectedEOF } + // Collect everything between [ and ] in name. var name []byte - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] - } - s = consume(s, 0) - var closed bool for len(s) > 0 && !closed { switch { @@ -452,23 +459,20 @@ func (d *Decoder) parseTypeName() (Token, error) { s = s[1:] closed = true - case s[0] == '/', s[0] == '.': - if len(name) > 0 && (name[len(name)-1] == '/' || name[len(name)-1] == '.') { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)+1]) - } + case s[0] == '/' || isTypeNameChar(s[0]) || isUrlExtraChar(s[0]): name = append(name, s[0]) - s = s[1:] - s = consume(s, 0) - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] + s = consume(s[1:], 0) + + // URL percent-encoded chars + case s[0] == '%': + if len(s) < 3 || !isHexChar(s[1]) || !isHexChar(s[2]) { + return Token{}, d.parseTypeNameError(s, 3) } - s = consume(s, 0) + name = append(name, s[0], s[1], s[2]) + s = consume(s[3:], 0) default: - return Token{}, d.newSyntaxError( - "invalid type URL/extension field name: %s", d.orig[startPos:len(d.orig)-len(s)+1]) + return Token{}, d.parseTypeNameError(s, 1) } } @@ -476,15 +480,38 @@ func (d *Decoder) parseTypeName() (Token, error) { return Token{}, ErrUnexpectedEOF } - // First character cannot be '.'. Last character cannot be '.' or '/'. - size := len(name) - if size == 0 || name[0] == '.' || name[size-1] == '.' || name[size-1] == '/' { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)]) + // Split collected name on last '/' into urlPrefix and typeName (if '/' is + // present). + typeName := name + if i := bytes.LastIndexByte(name, '/'); i != -1 { + urlPrefix := name[:i] + typeName = name[i+1:] + + // urlPrefix may be empty (for backwards compatibility). + // If non-empty, it must not start with '/'. + if len(urlPrefix) > 0 && urlPrefix[0] == '/' { + return Token{}, d.parseTypeNameError(s, 0) + } } + // typeName must not be empty (note: "" splits to [""]) and all identifier + // parts must not be empty. + for _, ident := range bytes.Split(typeName, []byte{'.'}) { + if len(ident) == 0 { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + // typeName must not contain any percent-encoded or special URL chars. + for _, b := range typeName { + if b == '%' || (b != '.' && isUrlExtraChar(b)) { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + startPos := len(d.orig) - len(d.in) + endPos := len(d.orig) - len(s) d.in = s - endPos := len(d.orig) - len(d.in) d.consume(0) return Token{ @@ -496,16 +523,32 @@ func (d *Decoder) parseTypeName() (Token, error) { }, nil } +func (d *Decoder) parseTypeNameError(s []byte, numUnconsumedChars int) error { + return d.newSyntaxError( + "invalid type URL/extension field name: %s", + d.in[:len(d.in)-len(s)+min(numUnconsumedChars, len(s))], + ) +} + +func isHexChar(b byte) bool { + return ('0' <= b && b <= '9') || + ('a' <= b && b <= 'f') || + ('A' <= b && b <= 'F') +} + func isTypeNameChar(b byte) bool { - return (b == '-' || b == '_' || + return b == '-' || b == '_' || ('0' <= b && b <= '9') || ('a' <= b && b <= 'z') || - ('A' <= b && b <= 'Z')) + ('A' <= b && b <= 'Z') } -func isWhiteSpace(b byte) bool { +// isUrlExtraChar complements isTypeNameChar with extra characters that we allow +// in URLs but not in type names. Note that '/' is not included so that it can +// be treated specially. +func isUrlExtraChar(b byte) bool { switch b { - case ' ', '\n', '\r', '\t': + case '.', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=': return true default: return false diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index dbcf90b8..c775e583 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -32,6 +32,7 @@ const ( EditionProto3 Edition = 999 Edition2023 Edition = 1000 Edition2024 Edition = 1001 + EditionUnstable Edition = 9999 EditionUnsupported Edition = 100000 ) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index dd31faae..78f02b1b 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -330,7 +330,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.DescriptorProto_Options_field_number: - md.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -356,27 +355,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L2.Options = md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Message, rawOptions) } -func (md *Message) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.MessageOptions_MapEntry_field_number: - md.L1.IsMapEntry = protowire.DecodeBool(v) - case genid.MessageOptions_MessageSetWireFormat_field_number: - md.L1.IsMessageSet = protowire.DecodeBool(v) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } -} - func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 950a6a32..65aaf4d2 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,7 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 Edition_EDITION_99997_TEST_ONLY_enum_value = 99997 diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index 229c6980..4a3bf393 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -113,6 +113,9 @@ func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalO } func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } @@ -170,6 +173,9 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo } func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/decode.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/decode.go index e0dd21fa..1228b5c8 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -102,8 +102,7 @@ var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() - opts.depth-- - if opts.depth < 0 { + if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if flags.ProtoLegacy && mi.isMessageSet { diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/validate.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/validate.go index 7b2995dd..99a1eb95 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/validate.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/impl/validate.go @@ -68,9 +68,13 @@ func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out pr if in.Resolver == nil { in.Resolver = protoregistry.GlobalTypes } + if in.Depth == 0 { + in.Depth = protowire.DefaultRecursionLimit + } o, st := mi.validate(in.Buf, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, + depth: in.Depth, }) if o.initialized { out.Flags |= protoiface.UnmarshalInitialized @@ -257,6 +261,9 @@ func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmars states[0].typ = validationTypeGroup states[0].endGroup = groupTag } + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } initialized := true start := len(b) State: @@ -451,6 +458,13 @@ State: mi: vi.mi, tail: b, }) + if vi.typ == validationTypeMessage || + vi.typ == validationTypeGroup || + vi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State case validationTypeRepeatedVarint: @@ -499,6 +513,9 @@ State: mi: vi.mi, endGroup: num, }) + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } continue State case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem: typeid, v, n, err := messageset.ConsumeFieldValue(b, false) @@ -521,6 +538,13 @@ State: mi: xvi.mi, tail: b[n:], }) + if xvi.typ == validationTypeMessage || + xvi.typ == validationTypeGroup || + xvi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State } @@ -547,12 +571,14 @@ State: switch st.typ { case validationTypeMessage, validationTypeGroup: numRequiredFields = int(st.mi.numRequiredFields) + opts.depth++ case validationTypeMap: // If this is a map field with a message value that contains // required fields, require that the value be present. if st.mi != nil && st.mi.numRequiredFields > 0 { numRequiredFields = 1 } + opts.depth++ } // If there are more than 64 required fields, this check will // always fail and we will report that the message is potentially diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/version/version.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/version/version.go index 77de0f23..763fd828 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 10 + Patch = 11 PreRelease = "" ) diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/proto/decode.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/proto/decode.go index 4cbf1aea..889d8511 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/proto/decode.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/proto/decode.go @@ -121,9 +121,8 @@ func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out proto out, err = methods.Unmarshal(in) } else { - o.RecursionLimit-- - if o.RecursionLimit < 0 { - return out, errors.New("exceeded max recursion depth") + if o.RecursionLimit--; o.RecursionLimit < 0 { + return out, errRecursionDepth } err = o.unmarshalMessageSlow(b, m) } @@ -220,6 +219,9 @@ func (o UnmarshalOptions) unmarshalSingular(b []byte, wtyp protowire.Type, m pro } func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv protoreflect.Map, fd protoreflect.FieldDescriptor) (n int, err error) { + if o.RecursionLimit--; o.RecursionLimit < 0 { + return 0, errRecursionDepth + } if wtyp != protowire.BytesType { return 0, errUnknown } @@ -305,3 +307,5 @@ func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv proto var errUnknown = errors.New("BUG: internal error (unknown)") var errDecode = errors.New("cannot parse invalid wire-format data") + +var errRecursionDepth = errors.New("exceeded maximum recursion depth") diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 4eacb523..0b23faa9 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -69,6 +69,8 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + // A placeholder edition for developing and testing unscheduled features. + Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be // used or relied on outside of tests. Edition_EDITION_1_TEST_ONLY Edition = 1 @@ -91,6 +93,7 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", 99997: "EDITION_99997_TEST_ONLY", @@ -105,6 +108,7 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, "EDITION_99997_TEST_ONLY": 99997, @@ -4793,11 +4797,11 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x18EnumValueDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x02 \x01(\x05R\x06number\x12;\n" + - "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xa7\x01\n" + + "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xb5\x01\n" + "\x16ServiceDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12>\n" + "\x06method\x18\x02 \x03(\v2&.google.protobuf.MethodDescriptorProtoR\x06method\x129\n" + - "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptions\"\x89\x02\n" + + "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptionsJ\x04\b\x04\x10\x05R\x06stream\"\x89\x02\n" + "\x15MethodDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + "\n" + @@ -5033,14 +5037,15 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xa7\x02\n" + + "\x05ALIAS\x10\x02*\xbe\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x17\n" + + "\fEDITION_2024\x10\xe9\a\x12\x15\n" + + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + "\x17EDITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n" + diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 06d584c1..484c21fd 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -172,13 +172,14 @@ import ( // ) to obtain a formatter capable of generating timestamps in this format. type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. + // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + // be between -315576000000 and 315576000000 inclusive (which corresponds to + // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 + // Non-negative fractions of a second at nanosecond resolution. This field is + // the nanosecond portion of the duration, not an alternative to seconds. + // Negative second values with fractions must still have non-negative nanos + // values that count forward in time. Must be between 0 and 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields diff --git a/ci/resources/stemcell-version-bump/vendor/modules.txt b/ci/resources/stemcell-version-bump/vendor/modules.txt index 347044fd..88bd5801 100644 --- a/ci/resources/stemcell-version-bump/vendor/modules.txt +++ b/ci/resources/stemcell-version-bump/vendor/modules.txt @@ -7,7 +7,7 @@ cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.17.0 +# cloud.google.com/go/auth v0.18.0 ## explicit; go 1.24.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials @@ -37,8 +37,8 @@ cloud.google.com/go/compute/metadata ## explicit; go 1.24.0 cloud.google.com/go/iam cloud.google.com/go/iam/apiv1/iampb -# cloud.google.com/go/monitoring v1.24.2 -## explicit; go 1.23.0 +# cloud.google.com/go/monitoring v1.24.3 +## explicit; go 1.24.0 cloud.google.com/go/monitoring/apiv3/v2 cloud.google.com/go/monitoring/apiv3/v2/monitoringpb cloud.google.com/go/monitoring/internal @@ -162,8 +162,8 @@ github.com/google/uuid ## explicit; go 1.23.0 github.com/googleapis/enterprise-certificate-proxy/client github.com/googleapis/enterprise-certificate-proxy/client/util -# github.com/googleapis/gax-go/v2 v2.15.0 -## explicit; go 1.23.0 +# github.com/googleapis/gax-go/v2 v2.16.0 +## explicit; go 1.24.0 github.com/googleapis/gax-go/v2 github.com/googleapis/gax-go/v2/apierror github.com/googleapis/gax-go/v2/apierror/internal/proto @@ -256,7 +256,7 @@ go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop -# golang.org/x/crypto v0.45.0 +# golang.org/x/crypto v0.46.0 ## explicit; go 1.24.0 golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -265,7 +265,7 @@ golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/hkdf golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 -# golang.org/x/net v0.47.0 +# golang.org/x/net v0.48.0 ## explicit; go 1.24.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -274,7 +274,7 @@ golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.33.0 +# golang.org/x/oauth2 v0.34.0 ## explicit; go 1.24.0 golang.org/x/oauth2 golang.org/x/oauth2/authhandler @@ -286,16 +286,16 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.18.0 +# golang.org/x/sync v0.19.0 ## explicit; go 1.24.0 golang.org/x/sync/semaphore -# golang.org/x/sys v0.38.0 +# golang.org/x/sys v0.39.0 ## explicit; go 1.24.0 golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/text v0.31.0 +# golang.org/x/text v0.32.0 ## explicit; go 1.24.0 golang.org/x/text/secure/bidirule golang.org/x/text/transform @@ -304,13 +304,14 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.14.0 ## explicit; go 1.24.0 golang.org/x/time/rate -# google.golang.org/api v0.257.0 +# google.golang.org/api v0.259.0 ## explicit; go 1.24.0 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport google.golang.org/api/iamcredentials/v1 google.golang.org/api/internal google.golang.org/api/internal/cert +google.golang.org/api/internal/credentialstype google.golang.org/api/internal/gensupport google.golang.org/api/internal/impersonate google.golang.org/api/internal/third_party/uritemplates @@ -321,13 +322,13 @@ google.golang.org/api/storage/v1 google.golang.org/api/transport google.golang.org/api/transport/grpc google.golang.org/api/transport/http -# google.golang.org/genproto v0.0.0-20250922171735-9219d122eba9 +# google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/type/calendarperiod google.golang.org/genproto/googleapis/type/date google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/googleapis/type/timeofday -# google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba +# google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations @@ -336,12 +337,12 @@ google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/label google.golang.org/genproto/googleapis/api/metric google.golang.org/genproto/googleapis/api/monitoredres -# google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.77.0 +# google.golang.org/grpc v1.78.0 ## explicit; go 1.24.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -475,6 +476,7 @@ google.golang.org/grpc/internal/xds/xdsclient/xdslbregistry google.golang.org/grpc/internal/xds/xdsclient/xdslbregistry/converter google.golang.org/grpc/internal/xds/xdsclient/xdsresource google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version +google.golang.org/grpc/internal/xds/xdsdepmgr google.golang.org/grpc/keepalive google.golang.org/grpc/mem google.golang.org/grpc/metadata @@ -496,7 +498,7 @@ google.golang.org/grpc/xds google.golang.org/grpc/xds/bootstrap google.golang.org/grpc/xds/csds google.golang.org/grpc/xds/googledirectpath -# google.golang.org/protobuf v1.36.10 +# google.golang.org/protobuf v1.36.11 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext From 850436159091f3b685c7a385ba69092e937dd48b Mon Sep 17 00:00:00 2001 From: Jochen Ehret Date: Wed, 14 Jan 2026 15:48:30 +0100 Subject: [PATCH 2/2] Replace deprecated WithCredentialsJSON function --- ci/resources/stemcell-version-bump/resource/gcs_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/resources/stemcell-version-bump/resource/gcs_client.go b/ci/resources/stemcell-version-bump/resource/gcs_client.go index e846a185..7db3cbb1 100644 --- a/ci/resources/stemcell-version-bump/resource/gcs_client.go +++ b/ci/resources/stemcell-version-bump/resource/gcs_client.go @@ -14,7 +14,7 @@ type GCSClient struct { } func NewGCSClient(jsonKey string) (GCSClient, error) { - client, err := storage.NewClient(context.TODO(), option.WithCredentialsJSON([]byte(jsonKey))) + client, err := storage.NewClient(context.TODO(), option.WithAuthCredentialsJSON(option.ServiceAccount, []byte(jsonKey))) if err != nil { return GCSClient{}, fmt.Errorf("failed to create GCS storage client: %w", err) }