Skip to content

Commit

Permalink
feat: added support for k8s_version field
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Google APIs authored and copybara-github committed Feb 23, 2022
1 parent 5a1add9 commit 97cf70e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
24 changes: 17 additions & 7 deletions google/cloud/gkehub/v1alpha2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ java_gapic_library(
service_yaml = "gkehub_v1alpha2.yaml",
test_deps = [
":gkehub_java_grpc",
"//google/cloud/location:location_java_grpc",
],
deps = [
":gkehub_java_proto",
"//google/api:api_java_proto",
"//google/cloud/location:location_java_grpc",
"//google/cloud/location:location_java_proto",
],
)

Expand All @@ -99,9 +96,6 @@ java_gapic_assembly_gradle_pkg(
":gkehub_java_grpc",
":gkehub_java_proto",
":gkehub_proto",
"//google/cloud/location:location_java_grpc",
"//google/cloud/location:location_java_proto",
"//google/cloud/location:location_proto",
],
)

Expand Down Expand Up @@ -345,4 +339,20 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# Put your C++ rules here
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)

cc_proto_library(
name = "gkehub_cc_proto",
deps = [":gkehub_proto"],
)

cc_grpc_library(
name = "gkehub_cc_grpc",
srcs = [":gkehub_proto"],
grpc_only = True,
deps = [":gkehub_cc_proto"],
)
13 changes: 10 additions & 3 deletions google/cloud/gkehub/v1alpha2/membership.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -305,6 +305,11 @@ message ResourceOptions {
// This option should be set for clusters with Kubernetes apiserver versions
// <1.16.
bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL];

// Major version of the Kubernetes cluster. This is only used to determine
// which version to use for the CustomResourceDefinition resources,
// `apiextensions/v1beta1` or`apiextensions/v1`.
string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL];
}

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

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

// Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
//
Expand Down

0 comments on commit 97cf70e

Please sign in to comment.