Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit f8e5fba

Browse files
feat: add kubernetes_resource field docs: update API annotation (#119)
* feat: add `kubernetes_resource` field docs: update API annotation PiperOrigin-RevId: 423151400 Source-Link: googleapis/googleapis@6f4ad75 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7d0abacb329defdcb47cb0f6b2335864349440ca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2QwYWJhY2IzMjlkZWZkY2I0N2NiMGY2YjIzMzU4NjQzNDk0NDBjYSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent abbe9c9 commit f8e5fba

11 files changed

Lines changed: 1328 additions & 45 deletions

File tree

protos/google/cloud/gkehub/v1/membership.proto

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ syntax = "proto3";
1616

1717
package google.cloud.gkehub.v1;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/field_behavior.proto";
2021
import "google/api/resource.proto";
2122
import "google/protobuf/timestamp.proto";
22-
import "google/api/annotations.proto";
2323

2424
option csharp_namespace = "Google.Cloud.GkeHub.V1";
2525
option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/v1;gkehub";
@@ -110,13 +110,92 @@ message MembershipEndpoint {
110110

111111
// Output only. Useful Kubernetes-specific metadata.
112112
KubernetesMetadata kubernetes_metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
113+
114+
// Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
115+
// registered cluster, in the steady state. These resources:
116+
//
117+
// * Ensure that the cluster is exclusively registered to one and only one
118+
// Hub Membership.
119+
// * Propagate Workload Pool Information available in the Membership
120+
// Authority field.
121+
// * Ensure proper initial configuration of default Hub Features.
122+
KubernetesResource kubernetes_resource = 3 [(google.api.field_behavior) = OPTIONAL];
123+
}
124+
125+
// KubernetesResource contains the YAML manifests and configuration for
126+
// Membership Kubernetes resources in the cluster. After CreateMembership or
127+
// UpdateMembership, these resources should be re-applied in the cluster.
128+
message KubernetesResource {
129+
// Input only. The YAML representation of the Membership CR. This field is ignored for GKE
130+
// clusters where Hub can read the CR directly.
131+
//
132+
// Callers should provide the CR that is currently present in the cluster
133+
// during CreateMembership or UpdateMembership, or leave this field empty if
134+
// none exists. The CR manifest is used to validate the cluster has not been
135+
// registered with another Membership.
136+
string membership_cr_manifest = 1 [(google.api.field_behavior) = INPUT_ONLY];
137+
138+
// Output only. Additional Kubernetes resources that need to be applied to the cluster
139+
// after Membership creation, and after every update.
140+
//
141+
// This field is only populated in the Membership returned from a successful
142+
// long-running operation from CreateMembership or UpdateMembership. It is not
143+
// populated during normal GetMembership or ListMemberships requests. To get
144+
// the resource manifest after the initial registration, the caller should
145+
// make a UpdateMembership call with an empty field mask.
146+
repeated ResourceManifest membership_resources = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
147+
148+
// Output only. The Kubernetes resources for installing the GKE Connect agent
149+
//
150+
// This field is only populated in the Membership returned from a successful
151+
// long-running operation from CreateMembership or UpdateMembership. It is not
152+
// populated during normal GetMembership or ListMemberships requests. To get
153+
// the resource manifest after the initial registration, the caller should
154+
// make a UpdateMembership call with an empty field mask.
155+
repeated ResourceManifest connect_resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
156+
157+
// Optional. Options for Kubernetes resource generation.
158+
ResourceOptions resource_options = 4 [(google.api.field_behavior) = OPTIONAL];
159+
}
160+
161+
// ResourceOptions represent options for Kubernetes resource generation.
162+
message ResourceOptions {
163+
// Optional. The Connect agent version to use for connect_resources. Defaults to the
164+
// latest GKE Connect version. The version must be a currently supported
165+
// version, obsolete versions will be rejected.
166+
string connect_version = 1 [(google.api.field_behavior) = OPTIONAL];
167+
168+
// Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
169+
// CustomResourceDefinition resources.
170+
// This option should be set for clusters with Kubernetes apiserver versions
171+
// <1.16.
172+
bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL];
173+
174+
// Optional. Major version of the Kubernetes cluster. This is only used to determine
175+
// which version to use for the CustomResourceDefinition resources,
176+
// `apiextensions/v1beta1` or`apiextensions/v1`.
177+
string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL];
178+
}
179+
180+
// ResourceManifest represents a single Kubernetes resource to be applied to
181+
// the cluster.
182+
message ResourceManifest {
183+
// YAML manifest of the resource.
184+
string manifest = 1;
185+
186+
// Whether the resource provided in the manifest is `cluster_scoped`.
187+
// If unset, the manifest is assumed to be namespace scoped.
188+
//
189+
// This field is used for REST mapping when applying the resource in a
190+
// cluster.
191+
bool cluster_scoped = 2;
113192
}
114193

115194
// GkeCluster contains information specific to GKE clusters.
116195
message GkeCluster {
117196
// Immutable. Self-link of the GCP resource for the GKE cluster. For example:
118197
//
119-
// //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
198+
// //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
120199
//
121200
// Zonal clusters are also supported.
122201
string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];

protos/google/cloud/gkehub/v1/service.proto

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import "google/api/resource.proto";
2323
import "google/cloud/gkehub/v1/feature.proto";
2424
import "google/cloud/gkehub/v1/membership.proto";
2525
import "google/longrunning/operations.proto";
26+
import "google/protobuf/empty.proto";
2627
import "google/protobuf/field_mask.proto";
2728
import "google/protobuf/timestamp.proto";
2829

@@ -325,7 +326,12 @@ message DeleteMembershipRequest {
325326
message UpdateMembershipRequest {
326327
// Required. The Membership resource name in the format
327328
// `projects/*/locations/*/memberships/*`.
328-
string name = 1 [(google.api.field_behavior) = REQUIRED];
329+
string name = 1 [
330+
(google.api.field_behavior) = REQUIRED,
331+
(google.api.resource_reference) = {
332+
type: "gkehub.googleapis.com/Membership"
333+
}
334+
];
329335

330336
// Required. Mask of fields to update.
331337
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
@@ -362,7 +368,12 @@ message UpdateMembershipRequest {
362368
message GenerateConnectManifestRequest {
363369
// Required. The Membership resource name the Agent will associate with, in the format
364370
// `projects/*/locations/*/memberships/*`.
365-
string name = 1 [(google.api.field_behavior) = REQUIRED];
371+
string name = 1 [
372+
(google.api.field_behavior) = REQUIRED,
373+
(google.api.resource_reference) = {
374+
type: "gkehub.googleapis.com/Membership"
375+
}
376+
];
366377

367378
// Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
368379
//
@@ -423,9 +434,13 @@ message TypeMeta {
423434

424435
// Request message for `GkeHub.ListFeatures` method.
425436
message ListFeaturesRequest {
426-
// The parent (project and location) where the Features will be listed.
437+
// Required. The parent (project and location) where the Features will be listed.
427438
// Specified in the format `projects/*/locations/*`.
428-
string parent = 1;
439+
string parent = 1 [
440+
(google.api.resource_reference) = {
441+
child_type: "gkehub.googleapis.com/Feature"
442+
}
443+
];
429444

430445
// When requesting a 'page' of resources, `page_size` specifies number of
431446
// resources to return. If unspecified or set to 0, all resources will
@@ -473,16 +488,24 @@ message ListFeaturesResponse {
473488

474489
// Request message for `GkeHub.GetFeature` method.
475490
message GetFeatureRequest {
476-
// The Feature resource name in the format
491+
// Required. The Feature resource name in the format
477492
// `projects/*/locations/*/features/*`
478-
string name = 1;
493+
string name = 1 [
494+
(google.api.resource_reference) = {
495+
type: "gkehub.googleapis.com/Feature"
496+
}
497+
];
479498
}
480499

481500
// Request message for the `GkeHub.CreateFeature` method.
482501
message CreateFeatureRequest {
483-
// The parent (project and location) where the Feature will be created.
502+
// Required. The parent (project and location) where the Feature will be created.
484503
// Specified in the format `projects/*/locations/*`.
485-
string parent = 1;
504+
string parent = 1 [
505+
(google.api.resource_reference) = {
506+
child_type: "gkehub.googleapis.com/Feature"
507+
}
508+
];
486509

487510
// The ID of the feature to create.
488511
string feature_id = 2;
@@ -503,14 +526,18 @@ message CreateFeatureRequest {
503526
//
504527
// The request ID must be a valid UUID with the exception that zero UUID is
505528
// not supported (00000000-0000-0000-0000-000000000000).
506-
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
529+
string request_id = 4;
507530
}
508531

509532
// Request message for `GkeHub.DeleteFeature` method.
510533
message DeleteFeatureRequest {
511-
// The Feature resource name in the format
534+
// Required. The Feature resource name in the format
512535
// `projects/*/locations/*/features/*`.
513-
string name = 1;
536+
string name = 1 [
537+
(google.api.resource_reference) = {
538+
type: "gkehub.googleapis.com/Feature"
539+
}
540+
];
514541

515542
// If set to true, the delete will ignore any outstanding resources for
516543
// this Feature (that is, `FeatureState.has_resources` is set to true). These
@@ -535,9 +562,13 @@ message DeleteFeatureRequest {
535562

536563
// Request message for `GkeHub.UpdateFeature` method.
537564
message UpdateFeatureRequest {
538-
// The Feature resource name in the format
565+
// Required. The Feature resource name in the format
539566
// `projects/*/locations/*/features/*`.
540-
string name = 1;
567+
string name = 1 [
568+
(google.api.resource_reference) = {
569+
type: "gkehub.googleapis.com/Feature"
570+
}
571+
];
541572

542573
// Mask of fields to update.
543574
google.protobuf.FieldMask update_mask = 2;
@@ -565,7 +596,7 @@ message UpdateFeatureRequest {
565596
//
566597
// The request ID must be a valid UUID with the exception that zero UUID is
567598
// not supported (00000000-0000-0000-0000-000000000000).
568-
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
599+
string request_id = 4;
569600
}
570601

571602
// Represents the metadata of the long-running operation.

0 commit comments

Comments
 (0)