FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

cleanup(quickstart): gkeconnect quickstart use correct inputs by cuiy0006 · Pull Request #14666 · googleapis/google-cloud-cpp · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cc  (1) .md  (1) .txt  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 7 additions & 2 deletions google/cloud/gkeconnect/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
google_cloud_cpp_add_common_options(gkeconnect_quickstart)
add_test(
NAME gkeconnect_quickstart
COMMAND cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
$<TARGET_FILE:gkeconnect_quickstart> GOOGLE_CLOUD_PROJECT)
COMMAND
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
$<TARGET_FILE:gkeconnect_quickstart> GOOGLE_CLOUD_PROJECT
GOOGLE_CLOUD_CPP_TEST_REGION
# use GOOGLE_CLOUD_CPP_BIGTABLE_TEST_INSTANCE_ID as input
# membership-id. we don't expect it to be valid.
GOOGLE_CLOUD_CPP_BIGTABLE_TEST_INSTANCE_ID)
set_tests_properties(
gkeconnect_quickstart
PROPERTIES
Expand Down
9 changes: 6 additions & 3 deletions google/cloud/gkeconnect/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ this library.
#include <iostream>

int main(int argc, char* argv[]) try {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " name\n";
if (argc != 4) {
std::cerr << "Usage: " << argv[0]
<< " project-id location-id membership-id\n";
return 1;
}

auto const location = google::cloud::Location(argv[1], argv[2]);

namespace gkeconnect = ::google::cloud::gkeconnect_gateway_v1;
auto client = gkeconnect::GatewayControlClient(
gkeconnect::MakeGatewayControlConnection());

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

auto response = client.GenerateCredentials(request);
if (!response) throw std::move(response).status();
Expand Down
9 changes: 6 additions & 3 deletions google/cloud/gkeconnect/quickstart/quickstart.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
#include <iostream>

int main(int argc, char* argv[]) try {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " name\n";
if (argc != 4) {
std::cerr << "Usage: " << argv[0]
<< " project-id location-id membership-id\n";
return 1;
}

auto const location = google::cloud::Location(argv[1], argv[2]);

namespace gkeconnect = ::google::cloud::gkeconnect_gateway_v1;
auto client = gkeconnect::GatewayControlClient(
gkeconnect::MakeGatewayControlConnection());

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

auto response = client.GenerateCredentials(request);
if (!response) throw std::move(response).status();
Expand Down

Back | FazBrowse Home | New Git URL