Skip to content

Commit b08150c

Browse files
authored
fix(gkeconnect): service only supports REST endpoint (#14897)
1 parent e750718 commit b08150c

31 files changed

+363
-512
lines changed
-47.1 KB
Binary file not shown.

ci/cloudbuild/builds/quickstart-cmake.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ readonly SED_ARGS=(
4747
# The vcpkg maintainers introduced an `rpc` feature to just compile
4848
# `grpc-common`.
4949
-e '/^rpc$/d'
50+
# TODO:(#14896) Skip gkeconnect as it transitions from grpc to REST transport.
51+
-e '/^gkeconnect/d'
5052
)
5153
mapfile -t features < <(
5254
env -C "${vcpkg_dir}" ./vcpkg search google-cloud-cpp |

cmake/GoogleCloudCppFeatures.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ macro (google_cloud_cpp_enable_cleanup)
376376
OR (bigquerycontrol IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
377377
OR (compute IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
378378
OR (experimental-bigquery_rest IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
379+
OR (gkeconnect IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
379380
OR (oauth2 IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
380381
OR (opentelemetry IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
381382
OR (sql IN_LIST GOOGLE_CLOUD_CPP_ENABLE)

generator/generator_config.textproto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,8 @@ service {
25182518
product_path: "google/cloud/gkeconnect/gateway/v1"
25192519
initial_copyright_year: "2024"
25202520
retryable_status_codes: ["kUnavailable"]
2521+
generate_rest_transport: true
2522+
generate_grpc_transport: false
25212523
}
25222524
25232525
service {

google/cloud/gkeconnect/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ googleapis_deps = [
2626

2727
cc_gapic_library(
2828
name = "gkeconnect",
29+
additional_deps = [
30+
"//google/cloud:google_cloud_cpp_rest_internal",
31+
"//google/cloud:google_cloud_cpp_rest_protobuf_internal",
32+
],
2933
googleapis_deps = googleapis_deps,
3034
service_dirs = service_dirs,
3135
)

google/cloud/gkeconnect/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
include(GoogleCloudCppLibrary)
1818

1919
google_cloud_cpp_add_gapic_library(gkeconnect "Connect Gateway API"
20-
SERVICE_DIRS "gateway/v1/")
20+
REST_TRANSPORT SERVICE_DIRS "gateway/v1/")
2121

2222
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
2323
add_executable(gkeconnect_quickstart "quickstart/quickstart.cc")

google/cloud/gkeconnect/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ this library.
2020

2121
```cc
2222
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_client.h"
23+
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_rest_connection.h"
2324
#include "google/cloud/location.h"
2425
#include <iostream>
2526

@@ -34,7 +35,7 @@ int main(int argc, char* argv[]) try {
3435

3536
namespace gkeconnect = ::google::cloud::gkeconnect_gateway_v1;
3637
auto client = gkeconnect::GatewayControlClient(
37-
gkeconnect::MakeGatewayControlConnection());
38+
gkeconnect::MakeGatewayControlConnectionRest());
3839

3940
google::cloud::gkeconnect::gateway::v1::GenerateCredentialsRequest request;
4041
request.set_name(location.FullName() + "/memberships/" + argv[3]);

google/cloud/gkeconnect/gateway/v1/gateway_control_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CLIENT_H
2020
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GKECONNECT_GATEWAY_V1_GATEWAY_CONTROL_CLIENT_H
2121

22-
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h"
22+
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_rest_connection.h"
2323
#include "google/cloud/future.h"
2424
#include "google/cloud/options.h"
2525
#include "google/cloud/polling_policy.h"

google/cloud/gkeconnect/gateway/v1/gateway_control_connection.cc

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h"
2020
#include "google/cloud/gkeconnect/gateway/v1/gateway_control_options.h"
21-
#include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_connection_impl.h"
2221
#include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_option_defaults.h"
23-
#include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_stub_factory.h"
2422
#include "google/cloud/gkeconnect/gateway/v1/internal/gateway_control_tracing_connection.h"
2523
#include "google/cloud/background_threads.h"
2624
#include "google/cloud/common_options.h"
@@ -43,24 +41,6 @@ GatewayControlConnection::GenerateCredentials(
4341
return Status(StatusCode::kUnimplemented, "not implemented");
4442
}
4543

46-
std::shared_ptr<GatewayControlConnection> MakeGatewayControlConnection(
47-
Options options) {
48-
internal::CheckExpectedOptions<CommonOptionList, GrpcOptionList,
49-
UnifiedCredentialsOptionList,
50-
GatewayControlPolicyOptionList>(options,
51-
__func__);
52-
options = gkeconnect_gateway_v1_internal::GatewayControlDefaultOptions(
53-
std::move(options));
54-
auto background = internal::MakeBackgroundThreadsFactory(options)();
55-
auto auth = internal::CreateAuthenticationStrategy(background->cq(), options);
56-
auto stub = gkeconnect_gateway_v1_internal::CreateDefaultGatewayControlStub(
57-
std::move(auth), options);
58-
return gkeconnect_gateway_v1_internal::MakeGatewayControlTracingConnection(
59-
std::make_shared<
60-
gkeconnect_gateway_v1_internal::GatewayControlConnectionImpl>(
61-
std::move(background), std::move(stub), std::move(options)));
62-
}
63-
6444
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
6545
} // namespace gkeconnect_gateway_v1
6646
} // namespace cloud

google/cloud/gkeconnect/gateway/v1/gateway_control_connection.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -188,30 +188,6 @@ class GatewayControlConnection {
188188
request);
189189
};
190190

191-
/**
192-
* A factory function to construct an object of type `GatewayControlConnection`.
193-
*
194-
* The returned connection object should not be used directly; instead it
195-
* should be passed as an argument to the constructor of GatewayControlClient.
196-
*
197-
* The optional @p options argument may be used to configure aspects of the
198-
* returned `GatewayControlConnection`. Expected options are any of the types in
199-
* the following option lists:
200-
*
201-
* - `google::cloud::CommonOptionList`
202-
* - `google::cloud::GrpcOptionList`
203-
* - `google::cloud::UnifiedCredentialsOptionList`
204-
* - `google::cloud::gkeconnect_gateway_v1::GatewayControlPolicyOptionList`
205-
*
206-
* @note Unexpected options will be ignored. To log unexpected options instead,
207-
* set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
208-
*
209-
* @param options (optional) Configure the `GatewayControlConnection` created by
210-
* this function.
211-
*/
212-
std::shared_ptr<GatewayControlConnection> MakeGatewayControlConnection(
213-
Options options = {});
214-
215191
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
216192
} // namespace gkeconnect_gateway_v1
217193
} // namespace cloud

0 commit comments

Comments
 (0)