Skip to content

Commit 97cf70e

Browse files
Google APIscopybara-github
authored andcommitted
feat: added support for k8s_version field
docs: k8s_version field is not part of resource_options struct Clients now generate the V1 or V1beta1 CRD based on Kubernetes server version. PiperOrigin-RevId: 430496281
1 parent 5a1add9 commit 97cf70e

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

google/cloud/gkehub/v1alpha2/BUILD.bazel

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,10 @@ java_gapic_library(
7373
service_yaml = "gkehub_v1alpha2.yaml",
7474
test_deps = [
7575
":gkehub_java_grpc",
76-
"//google/cloud/location:location_java_grpc",
7776
],
7877
deps = [
7978
":gkehub_java_proto",
8079
"//google/api:api_java_proto",
81-
"//google/cloud/location:location_java_grpc",
82-
"//google/cloud/location:location_java_proto",
8380
],
8481
)
8582

@@ -99,9 +96,6 @@ java_gapic_assembly_gradle_pkg(
9996
":gkehub_java_grpc",
10097
":gkehub_java_proto",
10198
":gkehub_proto",
102-
"//google/cloud/location:location_java_grpc",
103-
"//google/cloud/location:location_java_proto",
104-
"//google/cloud/location:location_proto",
10599
],
106100
)
107101

@@ -345,4 +339,20 @@ csharp_gapic_assembly_pkg(
345339
##############################################################################
346340
# C++
347341
##############################################################################
348-
# Put your C++ rules here
342+
load(
343+
"@com_google_googleapis_imports//:imports.bzl",
344+
"cc_grpc_library",
345+
"cc_proto_library",
346+
)
347+
348+
cc_proto_library(
349+
name = "gkehub_cc_proto",
350+
deps = [":gkehub_proto"],
351+
)
352+
353+
cc_grpc_library(
354+
name = "gkehub_cc_grpc",
355+
srcs = [":gkehub_proto"],
356+
grpc_only = True,
357+
deps = [":gkehub_cc_proto"],
358+
)

google/cloud/gkehub/v1alpha2/membership.proto

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -305,6 +305,11 @@ message ResourceOptions {
305305
// This option should be set for clusters with Kubernetes apiserver versions
306306
// <1.16.
307307
bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL];
308+
309+
// Major version of the Kubernetes cluster. This is only used to determine
310+
// which version to use for the CustomResourceDefinition resources,
311+
// `apiextensions/v1beta1` or`apiextensions/v1`.
312+
string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL];
308313
}
309314

310315
// GkeCluster contains information specific to GKE clusters.
@@ -562,7 +567,8 @@ message DeleteMembershipRequest {
562567
message UpdateMembershipRequest {
563568
// Required. The Membership resource name in the format
564569
// `projects/*/locations/*/memberships/*`.
565-
string name = 1 [(google.api.field_behavior) = REQUIRED];
570+
string name = 1 [
571+
(google.api.field_behavior) = REQUIRED];
566572

567573
// Required. Mask of fields to update.
568574
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
@@ -584,7 +590,8 @@ message UpdateMembershipRequest {
584590
message GenerateConnectManifestRequest {
585591
// Required. The Membership resource name the Agent will associate with, in the format
586592
// `projects/*/locations/*/memberships/*`.
587-
string name = 1 [(google.api.field_behavior) = REQUIRED];
593+
string name = 1 [
594+
(google.api.field_behavior) = REQUIRED];
588595

589596
// Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
590597
//

0 commit comments

Comments
 (0)