diff --git a/chart/templates/db-migrations-job.yaml b/chart/templates/db-migrations-job.yaml index cf333990d43883..48c03269d91e54 100644 --- a/chart/templates/db-migrations-job.yaml +++ b/chart/templates/db-migrations-job.yaml @@ -43,6 +43,8 @@ spec: - name: db-migrations image: "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" .Values "comp" $.Values.components.dbMigrations) }}" env: + - name: INSTALLATION_SHORTNAME + value: "{{ $.Values.installation.shortname }}" - name: "DB_USERNAME" value: "{{ $.Values.db.username }}" - name: "DB_PASSWORD" diff --git a/components/gitpod-db/src/typeorm/entity/db-workspace-cluster.ts b/components/gitpod-db/src/typeorm/entity/db-workspace-cluster.ts index 24499430ccaf74..29ee618ef0c70a 100644 --- a/components/gitpod-db/src/typeorm/entity/db-workspace-cluster.ts +++ b/components/gitpod-db/src/typeorm/entity/db-workspace-cluster.ts @@ -13,6 +13,12 @@ export class DBWorkspaceCluster implements WorkspaceCluster { @PrimaryColumn() name: string; + @PrimaryColumn({ + default: '', + }) + /** This column is going to replace 'govern' in the near future. During the transition period - and to ease transition/reduce x-team dependencies - we make this part of the PK. */ + governedBy: string; + @Column({ type: "varchar", length: 255, @@ -58,6 +64,7 @@ export class DBWorkspaceCluster implements WorkspaceCluster { maxScore: number; @Column() + /** @deprecated */ govern: boolean; @Column({ diff --git a/components/gitpod-db/src/typeorm/migration/1645797755961-GovernedBy.ts b/components/gitpod-db/src/typeorm/migration/1645797755961-GovernedBy.ts new file mode 100644 index 00000000000000..bf467f769771f0 --- /dev/null +++ b/components/gitpod-db/src/typeorm/migration/1645797755961-GovernedBy.ts @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2022 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +import { MigrationInterface, QueryRunner } from "typeorm"; +import { columnExists } from "./helper/helper"; + +export class GovernedBy1645797755961 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + if (!process.env.INSTALLATION_SHORTNAME) { + throw new Error("Migration requires `INSTALLATION_SHORTNAME` to be set!"); + } + + const TABLE_NAME = "d_b_workspace_cluster"; + const COLUMN_NAME = "governedBy"; + + if (!(await columnExists(queryRunner, TABLE_NAME, COLUMN_NAME))) { + await queryRunner.query(`ALTER TABLE ${TABLE_NAME} ADD COLUMN ${COLUMN_NAME} varchar(255) NOT NULL DEFAULT ''`); + } + + await queryRunner.query(`UPDATE TABLE ${TABLE_NAME} SET governedBy = '${process.env.INSTALLATION_SHORTNAME}' WHERE govern = TRUE`); + await queryRunner.query(`ALTER TABLE ${TABLE_NAME} DROP PRIMARY KEY, ADD PRIMARY KEY(name, ${COLUMN_NAME})`); + } + + public async down(queryRunner: QueryRunner): Promise { + } +} diff --git a/components/gitpod-db/src/typeorm/workspace-cluster-db-impl.ts b/components/gitpod-db/src/typeorm/workspace-cluster-db-impl.ts index 4efdd9c349c65e..2902d037d84b65 100644 --- a/components/gitpod-db/src/typeorm/workspace-cluster-db-impl.ts +++ b/components/gitpod-db/src/typeorm/workspace-cluster-db-impl.ts @@ -4,9 +4,9 @@ * See License-AGPL.txt in the project root for license information. */ - import { Repository, EntityManager, DeepPartial } from "typeorm"; - import { injectable, inject } from "inversify"; - import { TypeORM } from "./typeorm"; +import { Repository, EntityManager, DeepPartial } from "typeorm"; +import { injectable, inject } from "inversify"; +import { TypeORM } from "./typeorm"; import { WorkspaceClusterDB } from "../workspace-cluster-db"; import { DBWorkspaceCluster } from "./entity/db-workspace-cluster"; import { WorkspaceCluster, WorkspaceClusterFilter, WorkspaceClusterWoTLS } from "@gitpod/gitpod-protocol/lib/workspace-cluster"; @@ -48,6 +48,7 @@ import { WorkspaceCluster, WorkspaceClusterFilter, WorkspaceClusterWoTLS } from maxScore: 0, state: "available", govern: false, + governedBy: "", admissionConstraints: [], }; @@ -61,8 +62,8 @@ import { WorkspaceCluster, WorkspaceClusterFilter, WorkspaceClusterWoTLS } from if (predicate.minScore !== undefined) { qb = qb.andWhere("wsc.score >= :minScore", predicate); } - if (predicate.govern !== undefined) { - qb = qb.andWhere("wsc.govern = :govern", predicate); + if (predicate.governedBy !== undefined) { + qb = qb.andWhere("wsc.governedBy = :governedBy", predicate); } if (predicate.url !== undefined) { qb = qb.andWhere("wsc.url = :url", predicate); diff --git a/components/gitpod-protocol/src/workspace-cluster.ts b/components/gitpod-protocol/src/workspace-cluster.ts index 7e158080d71390..c3d3152d078098 100644 --- a/components/gitpod-protocol/src/workspace-cluster.ts +++ b/components/gitpod-protocol/src/workspace-cluster.ts @@ -11,8 +11,7 @@ import { PermissionName } from './permission'; export interface WorkspaceCluster { // Name of the workspace cluster. - // This is the string set in each - // Must be identical to the installationShortname of the cluster it represents! + // This is the string that is set to every WorkspaceInstance.region field name: string; // URL of the cluster's ws-manager API @@ -31,8 +30,12 @@ export interface WorkspaceCluster { score: number; // True if this bridge should control this cluster + /** @deprecated */ govern: boolean; + /** Contains the application cluster's installationShortname (e.g., eu01) that is in charge to govern this cluster */ + governedBy: string; + // An optional set of constraints that limit who can start workspaces on the cluster admissionConstraints?: AdmissionConstraint[]; } @@ -99,6 +102,6 @@ export interface WorkspaceClusterDB { */ findFiltered(predicate: DeepPartial): Promise; } -export interface WorkspaceClusterFilter extends Pick { +export interface WorkspaceClusterFilter extends Pick { minScore: number; } \ No newline at end of file diff --git a/components/ws-manager-api/typescript/src/client-provider.spec.ts b/components/ws-manager-api/typescript/src/client-provider.spec.ts index 5a718550cf65f0..6f23a9d434e999 100644 --- a/components/ws-manager-api/typescript/src/client-provider.spec.ts +++ b/components/ws-manager-api/typescript/src/client-provider.spec.ts @@ -27,19 +27,19 @@ class TestClientProvider { c.bind(WorkspaceManagerClientProviderCompositeSource).toSelf().inSingletonScope(); c.bind(WorkspaceManagerClientProviderSource).toDynamicValue((): WorkspaceManagerClientProviderSource => { const cluster: WorkspaceCluster[] = [ - { name: "c1", govern: true, maxScore: 100, score: 0, state: "cordoned", url: "", admissionConstraints: [] }, - { name: "c2", govern: true, maxScore: 100, score: 50, state: "cordoned", url: "", admissionConstraints: [] }, - { name: "c3", govern: false, maxScore: 100, score: 50, state: "cordoned", url: "", admissionConstraints: [] }, - { name: "a1", govern: true, maxScore: 100, score: 0, state: "available", url: "", admissionConstraints: [] }, - { name: "a2", govern: true, maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [] }, - { name: "a3", govern: false, maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [] }, + { name: "c1", govern: true, governedBy: "app1", maxScore: 100, score: 0, state: "cordoned", url: "", admissionConstraints: [] }, + { name: "c2", govern: true, governedBy: "app1", maxScore: 100, score: 50, state: "cordoned", url: "", admissionConstraints: [] }, + { name: "c3", govern: false, governedBy: "app1", maxScore: 100, score: 50, state: "cordoned", url: "", admissionConstraints: [] }, + { name: "a1", govern: true, governedBy: "app1", maxScore: 100, score: 0, state: "available", url: "", admissionConstraints: [] }, + { name: "a2", govern: true, governedBy: "app1", maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [] }, + { name: "a3", govern: false, governedBy: "app1", maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [] }, { - name: "con1", govern: true, maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [ + name: "con1", govern: true, governedBy: "app1", maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [ { type: "has-permission", permission: "new-workspace-cluster" }, ] }, { - name: "con2", govern: true, maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [ + name: "con2", govern: true, governedBy: "app1", maxScore: 100, score: 50, state: "available", url: "", admissionConstraints: [ { type: "has-permission", permission: "monitor" }, // This is meant to representent a permission that does not take special predence (cmp. constraints.ts) ] }, diff --git a/components/ws-manager-bridge-api/cluster-service.proto b/components/ws-manager-bridge-api/cluster-service.proto index 6a6068d5cc9a9d..bb0db4b0166ce6 100644 --- a/components/ws-manager-bridge-api/cluster-service.proto +++ b/components/ws-manager-bridge-api/cluster-service.proto @@ -25,6 +25,8 @@ message RegisterRequest { // DEPRECATED // repeated AdmissionPreference admission_preference = 6; reserved 6; + + optional string governed_by = 7; } message RegisterResponse {} @@ -38,6 +40,7 @@ message TlsConfig { message RegistrationHints { Preferability perfereability = 1; bool cordoned = 2; + // DEPRECATED bool govern = 3; } @@ -67,6 +70,7 @@ message ClusterStatus { ClusterState state = 3; int32 score = 4; int32 max_score = 5; + // DEPRECATED bool governed = 6; repeated AdmissionConstraint admission_constraint = 7; bool static = 8; @@ -74,6 +78,8 @@ message ClusterStatus { // DEPRECATED // repeated AdmissionPreference admission_preference = 9; reserved 9; + + string governed_by = 10; } enum ClusterState { diff --git a/components/ws-manager-bridge-api/go/cluster-service.pb.go b/components/ws-manager-bridge-api/go/cluster-service.pb.go index ff7c71c90ac8c8..a8a1e59ca8db27 100644 --- a/components/ws-manager-bridge-api/go/cluster-service.pb.go +++ b/components/ws-manager-bridge-api/go/cluster-service.pb.go @@ -135,6 +135,7 @@ type RegisterRequest struct { Tls *TlsConfig `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` Hints *RegistrationHints `protobuf:"bytes,4,opt,name=hints,proto3" json:"hints,omitempty"` AdmissionConstraints []*AdmissionConstraint `protobuf:"bytes,5,rep,name=admission_constraints,json=admissionConstraints,proto3" json:"admission_constraints,omitempty"` + GovernedBy *string `protobuf:"bytes,7,opt,name=governed_by,json=governedBy,proto3,oneof" json:"governed_by,omitempty"` } func (x *RegisterRequest) Reset() { @@ -204,6 +205,13 @@ func (x *RegisterRequest) GetAdmissionConstraints() []*AdmissionConstraint { return nil } +func (x *RegisterRequest) GetGovernedBy() string { + if x != nil && x.GovernedBy != nil { + return *x.GovernedBy + } + return "" +} + type RegisterResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -312,7 +320,8 @@ type RegistrationHints struct { Perfereability Preferability `protobuf:"varint,1,opt,name=perfereability,proto3,enum=workspacemanagerbridge.Preferability" json:"perfereability,omitempty"` Cordoned bool `protobuf:"varint,2,opt,name=cordoned,proto3" json:"cordoned,omitempty"` - Govern bool `protobuf:"varint,3,opt,name=govern,proto3" json:"govern,omitempty"` + // DEPRECATED + Govern bool `protobuf:"varint,3,opt,name=govern,proto3" json:"govern,omitempty"` } func (x *RegistrationHints) Reset() { @@ -481,14 +490,16 @@ type ClusterStatus struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - State ClusterState `protobuf:"varint,3,opt,name=state,proto3,enum=workspacemanagerbridge.ClusterState" json:"state,omitempty"` - Score int32 `protobuf:"varint,4,opt,name=score,proto3" json:"score,omitempty"` - MaxScore int32 `protobuf:"varint,5,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + State ClusterState `protobuf:"varint,3,opt,name=state,proto3,enum=workspacemanagerbridge.ClusterState" json:"state,omitempty"` + Score int32 `protobuf:"varint,4,opt,name=score,proto3" json:"score,omitempty"` + MaxScore int32 `protobuf:"varint,5,opt,name=max_score,json=maxScore,proto3" json:"max_score,omitempty"` + // DEPRECATED Governed bool `protobuf:"varint,6,opt,name=governed,proto3" json:"governed,omitempty"` AdmissionConstraint []*AdmissionConstraint `protobuf:"bytes,7,rep,name=admission_constraint,json=admissionConstraint,proto3" json:"admission_constraint,omitempty"` Static bool `protobuf:"varint,8,opt,name=static,proto3" json:"static,omitempty"` + GovernedBy string `protobuf:"bytes,10,opt,name=governed_by,json=governedBy,proto3" json:"governed_by,omitempty"` } func (x *ClusterStatus) Reset() { @@ -579,6 +590,13 @@ func (x *ClusterStatus) GetStatic() bool { return false } +func (x *ClusterStatus) GetGovernedBy() string { + if x != nil { + return x.GovernedBy + } + return "" +} + type UpdateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1057,7 +1075,7 @@ var file_cluster_service_proto_rawDesc = []byte{ 0x0a, 0x15, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x22, - 0x95, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0xcb, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x33, 0x0a, 0x03, 0x74, 0x6c, 0x73, @@ -1074,139 +1092,144 @@ var file_cluster_service_proto_rawDesc = []byte{ 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x14, 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, - 0x73, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x09, 0x54, - 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x63, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x63, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x96, 0x01, 0x0a, - 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x6e, - 0x74, 0x73, 0x12, 0x4d, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x72, 0x65, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x52, 0x0e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x72, 0x65, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, - 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x22, 0x90, 0x03, 0x0a, 0x13, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x6c, 0x0a, - 0x13, 0x68, 0x61, 0x73, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, - 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x11, 0x68, 0x61, 0x73, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x62, 0x0a, 0x0e, 0x68, - 0x61, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, - 0x2e, 0x48, 0x61, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x0d, 0x68, 0x61, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x26, 0x0a, 0x0e, 0x68, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x2e, 0x0a, 0x12, 0x68, 0x61, 0x73, 0x5f, 0x6d, - 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x10, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x10, 0x0a, 0x0e, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x1a, 0x2f, 0x0a, 0x0d, 0x48, 0x61, 0x73, - 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x0a, 0x0a, 0x63, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x22, 0xbe, 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x24, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, - 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x12, 0x5e, 0x0a, 0x14, 0x61, - 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, - 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x12, 0x24, 0x0a, 0x0b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x65, 0x64, 0x42, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x67, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x12, 0x0a, + 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3f, 0x0a, 0x09, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, + 0x0a, 0x02, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x63, 0x61, 0x12, 0x10, + 0x0a, 0x03, 0x63, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x4d, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x66, + 0x65, 0x72, 0x65, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x25, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x72, 0x65, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, + 0x6e, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, + 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x22, 0x90, 0x03, 0x0a, 0x13, + 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x12, 0x6c, 0x0a, 0x13, 0x68, 0x61, 0x73, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3a, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x2e, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x11, + 0x68, 0x61, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, + 0x77, 0x12, 0x62, 0x0a, 0x0e, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, - 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x63, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0xec, 0x01, 0x0a, 0x0d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, - 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x73, - 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x61, - 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, 0x6e, - 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x64, - 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x66, 0x0a, 0x14, 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, - 0x72, 0x61, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x13, 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x42, 0x0a, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0x7a, 0x0a, 0x19, 0x4d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, - 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x03, 0x61, 0x64, 0x64, 0x12, 0x4b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, - 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x11, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x0c, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x37, 0x0a, 0x0d, 0x50, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, - 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x10, 0x01, - 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x6f, 0x6e, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x10, 0x02, 0x2a, 0x46, 0x0a, 0x0c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0c, - 0x0a, 0x08, 0x43, 0x4f, 0x52, 0x44, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, - 0x44, 0x52, 0x41, 0x49, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x32, 0x88, 0x03, 0x0a, 0x0e, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, - 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x2e, 0x48, 0x61, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x68, 0x61, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x68, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0c, 0x68, 0x61, 0x73, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x2e, 0x0a, + 0x12, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x10, 0x68, 0x61, 0x73, + 0x4d, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x10, 0x0a, + 0x0e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x1a, + 0x2f, 0x0a, 0x0d, 0x48, 0x61, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x42, 0x0c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x22, 0xdf, + 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, + 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, + 0x64, 0x12, 0x5e, 0x0a, 0x14, 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x61, 0x64, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x42, 0x79, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, + 0x22, 0xec, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1d, + 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, + 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, 0x6e, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x00, 0x52, 0x08, 0x63, 0x6f, 0x72, 0x64, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x66, 0x0a, 0x14, 0x61, + 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x13, + 0x61, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, + 0x7a, 0x0a, 0x19, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x64, 0x64, 0x12, 0x4b, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x64, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, + 0x11, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, + 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x4d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2a, 0x37, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x6f, 0x6e, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x10, 0x02, 0x2a, 0x46, 0x0a, 0x0c, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, + 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x52, 0x44, 0x4f, 0x4e, 0x45, + 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x52, 0x41, 0x49, 0x4e, 0x49, 0x4e, 0x47, 0x10, + 0x03, 0x32, 0x88, 0x03, 0x0a, 0x0e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x27, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, - 0x67, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, - 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x67, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x25, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x65, 0x0a, 0x0a, 0x44, 0x65, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2d, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x65, 0x0a, 0x0a, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, + 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x23, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x2d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2d, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1456,6 +1479,7 @@ func file_cluster_service_proto_init() { } } } + file_cluster_service_proto_msgTypes[0].OneofWrappers = []interface{}{} file_cluster_service_proto_msgTypes[4].OneofWrappers = []interface{}{ (*AdmissionConstraint_HasFeaturePreview)(nil), (*AdmissionConstraint_HasPermission_)(nil), diff --git a/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.d.ts b/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.d.ts index 78e22d68015016..a72b567b8da50c 100644 --- a/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.d.ts +++ b/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.d.ts @@ -32,6 +32,11 @@ export class RegisterRequest extends jspb.Message { setAdmissionConstraintsList(value: Array): RegisterRequest; addAdmissionConstraints(value?: AdmissionConstraint, index?: number): AdmissionConstraint; + hasGovernedBy(): boolean; + clearGovernedBy(): void; + getGovernedBy(): string | undefined; + setGovernedBy(value: string): RegisterRequest; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): RegisterRequest.AsObject; static toObject(includeInstance: boolean, msg: RegisterRequest): RegisterRequest.AsObject; @@ -49,6 +54,7 @@ export namespace RegisterRequest { tls?: TlsConfig.AsObject, hints?: RegistrationHints.AsObject, admissionConstraintsList: Array, + governedBy?: string, } } @@ -231,6 +237,8 @@ export class ClusterStatus extends jspb.Message { addAdmissionConstraint(value?: AdmissionConstraint, index?: number): AdmissionConstraint; getStatic(): boolean; setStatic(value: boolean): ClusterStatus; + getGovernedBy(): string; + setGovernedBy(value: string): ClusterStatus; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ClusterStatus.AsObject; @@ -252,6 +260,7 @@ export namespace ClusterStatus { governed: boolean, admissionConstraintList: Array, pb_static: boolean, + governedBy: string, } } diff --git a/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.js b/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.js index 52ca3b8d2e726c..35164d5bf7b53f 100644 --- a/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.js +++ b/components/ws-manager-bridge-api/typescript/src/cluster-service_pb.js @@ -405,7 +405,8 @@ proto.workspacemanagerbridge.RegisterRequest.toObject = function(includeInstance tls: (f = msg.getTls()) && proto.workspacemanagerbridge.TlsConfig.toObject(includeInstance, f), hints: (f = msg.getHints()) && proto.workspacemanagerbridge.RegistrationHints.toObject(includeInstance, f), admissionConstraintsList: jspb.Message.toObjectList(msg.getAdmissionConstraintsList(), - proto.workspacemanagerbridge.AdmissionConstraint.toObject, includeInstance) + proto.workspacemanagerbridge.AdmissionConstraint.toObject, includeInstance), + governedBy: jspb.Message.getFieldWithDefault(msg, 7, "") }; if (includeInstance) { @@ -465,6 +466,10 @@ proto.workspacemanagerbridge.RegisterRequest.deserializeBinaryFromReader = funct reader.readMessage(value,proto.workspacemanagerbridge.AdmissionConstraint.deserializeBinaryFromReader); msg.addAdmissionConstraints(value); break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setGovernedBy(value); + break; default: reader.skipField(); break; @@ -532,6 +537,13 @@ proto.workspacemanagerbridge.RegisterRequest.serializeBinaryToWriter = function( proto.workspacemanagerbridge.AdmissionConstraint.serializeBinaryToWriter ); } + f = /** @type {string} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeString( + 7, + f + ); + } }; @@ -683,6 +695,42 @@ proto.workspacemanagerbridge.RegisterRequest.prototype.clearAdmissionConstraints }; +/** + * optional string governed_by = 7; + * @return {string} + */ +proto.workspacemanagerbridge.RegisterRequest.prototype.getGovernedBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.workspacemanagerbridge.RegisterRequest} returns this + */ +proto.workspacemanagerbridge.RegisterRequest.prototype.setGovernedBy = function(value) { + return jspb.Message.setField(this, 7, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.workspacemanagerbridge.RegisterRequest} returns this + */ +proto.workspacemanagerbridge.RegisterRequest.prototype.clearGovernedBy = function() { + return jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.workspacemanagerbridge.RegisterRequest.prototype.hasGovernedBy = function() { + return jspb.Message.getField(this, 7) != null; +}; + + @@ -1768,7 +1816,8 @@ proto.workspacemanagerbridge.ClusterStatus.toObject = function(includeInstance, governed: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), admissionConstraintList: jspb.Message.toObjectList(msg.getAdmissionConstraintList(), proto.workspacemanagerbridge.AdmissionConstraint.toObject, includeInstance), - pb_static: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) + pb_static: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + governedBy: jspb.Message.getFieldWithDefault(msg, 10, "") }; if (includeInstance) { @@ -1838,6 +1887,10 @@ proto.workspacemanagerbridge.ClusterStatus.deserializeBinaryFromReader = functio var value = /** @type {boolean} */ (reader.readBool()); msg.setStatic(value); break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setGovernedBy(value); + break; default: reader.skipField(); break; @@ -1924,6 +1977,13 @@ proto.workspacemanagerbridge.ClusterStatus.serializeBinaryToWriter = function(me f ); } + f = message.getGovernedBy(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } }; @@ -2091,6 +2151,24 @@ proto.workspacemanagerbridge.ClusterStatus.prototype.setStatic = function(value) }; +/** + * optional string governed_by = 10; + * @return {string} + */ +proto.workspacemanagerbridge.ClusterStatus.prototype.getGovernedBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.workspacemanagerbridge.ClusterStatus} returns this + */ +proto.workspacemanagerbridge.ClusterStatus.prototype.setGovernedBy = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + /** * Oneof group definitions for this message. Each group defines the field diff --git a/components/ws-manager-bridge/src/bridge.ts b/components/ws-manager-bridge/src/bridge.ts index e3ade2936f101d..b0d420c5c6b86e 100644 --- a/components/ws-manager-bridge/src/bridge.ts +++ b/components/ws-manager-bridge/src/bridge.ts @@ -32,7 +32,7 @@ function toBool(b: WorkspaceConditionBool | undefined): boolean | undefined { return b === WorkspaceConditionBool.TRUE; } -export type WorkspaceClusterInfo = Pick; +export type WorkspaceClusterInfo = Pick; @injectable() export class WorkspaceManagerBridge implements Disposable { @@ -63,7 +63,7 @@ export class WorkspaceManagerBridge implements Disposable { protected cluster: WorkspaceClusterInfo; public start(cluster: WorkspaceClusterInfo, clientProvider: ClientProvider) { - const logPayload = { name: cluster.name, url: cluster.url, govern: cluster.govern }; + const logPayload = { name: cluster.name, url: cluster.url, governedBy: cluster.governedBy }; log.info(`starting bridge to cluster...`, logPayload); this.cluster = cluster; @@ -74,7 +74,7 @@ export class WorkspaceManagerBridge implements Disposable { .catch(err => log.error("cannot start status update handler", err)); }; - if (cluster.govern) { + if (cluster.governedBy === this.config.installation) { // notify servers and _update the DB_ startStatusUpdateHandler(true); @@ -85,7 +85,7 @@ export class WorkspaceManagerBridge implements Disposable { } log.debug(`starting controller: ${cluster.name}`, logPayload); this.startController(clientProvider, controllerInterval, this.config.controllerMaxDisconnectSeconds); - } else { + } else if (cluster.governedBy !== "") { // _DO NOT_ update the DB (another bridge is responsible for that) // Still, listen to all updates, generate/derive new state and distribute it locally! startStatusUpdateHandler(false); @@ -94,6 +94,8 @@ export class WorkspaceManagerBridge implements Disposable { const updateEmulator = this.preparingUpdateEmulatorFactory() as PreparingUpdateEmulator; this.disposables.push(updateEmulator); updateEmulator.start(cluster.name); + } else { + // case governedBy === "": a state that we'll only have during a transition period for backwards-compatibilities sake } log.info(`started bridge to cluster.`, logPayload); } diff --git a/components/ws-manager-bridge/src/cluster-service-server.ts b/components/ws-manager-bridge/src/cluster-service-server.ts index d08c40b68a8172..b7cad71bd4e5df 100644 --- a/components/ws-manager-bridge/src/cluster-service-server.ts +++ b/components/ws-manager-bridge/src/cluster-service-server.ts @@ -90,12 +90,18 @@ export class ClusterService implements IClusterServiceServer { // store the ws-manager into the database let perfereability = Preferability.NONE; + let governedBy = ''; // defaults to empty for transition period for backwards compatibility reasons let govern = false; let state: WorkspaceClusterState = "available"; if (req.hints) { perfereability = req.hints.perfereability; - if (req.hints.govern) { - govern = req.hints.govern; + if (req.governedBy) { + governedBy = req.governedBy; + govern = this.config.installation === req.governedBy; + } else if (req.hints.govern) { + // deprecated + governedBy = this.config.installation; + govern = true; } state = mapCordoned(req.hints.cordoned); } @@ -123,6 +129,7 @@ export class ClusterService implements IClusterServiceServer { score, maxScore: 100, govern, + governedBy, tls, admissionConstraints, }; @@ -284,6 +291,7 @@ function convertToGRPC(ws: WorkspaceClusterWoTLS): ClusterStatus { clusterStatus.setScore(ws.score); clusterStatus.setMaxScore(ws.maxScore); clusterStatus.setGoverned(ws.govern); + clusterStatus.setGovernedBy(ws.governedBy); ws.admissionConstraints?.forEach(c => { const constraint = new GRPCAdmissionConstraint(); switch (c.type) { diff --git a/install/installer/pkg/common/render.go b/install/installer/pkg/common/render.go index 3ebd48903b0cac..7f146647bf124a 100644 --- a/install/installer/pkg/common/render.go +++ b/install/installer/pkg/common/render.go @@ -62,8 +62,10 @@ type GeneratedValues struct { type RenderContext struct { VersionManifest versions.Manifest Config config.Config - Namespace string - Values GeneratedValues + // InstallationShortname establishes the "identity" of the (application) cluster. + InstallationShortname string + Namespace string + Values GeneratedValues experimentalConfig *experimental.Config } @@ -123,10 +125,11 @@ func NewRenderContext(cfg config.Config, versionManifest versions.Manifest, name cfg.Experimental = nil ctx := &RenderContext{ - Config: cfg, - VersionManifest: versionManifest, - Namespace: namespace, - experimentalConfig: us, + Config: cfg, + VersionManifest: versionManifest, + Namespace: namespace, + InstallationShortname: "default", // TODO(gpl): we're tied to "default" here because that's what we put into static bridges in the past + experimentalConfig: us, } err := ctx.generateValues() diff --git a/install/installer/pkg/components/database/init/job.go b/install/installer/pkg/components/database/init/job.go index 4feda70b099b1d..e6034f190fd1bb 100644 --- a/install/installer/pkg/components/database/init/job.go +++ b/install/installer/pkg/components/database/init/job.go @@ -8,6 +8,7 @@ package init import ( "fmt" + "github.com/gitpod-io/gitpod/installer/pkg/cluster" "github.com/gitpod-io/gitpod/installer/pkg/common" @@ -51,6 +52,12 @@ func job(ctx *common.RenderContext) ([]runtime.Object, error) { ImagePullPolicy: corev1.PullIfNotPresent, Env: common.MergeEnv( common.DatabaseEnv(&ctx.Config), + []corev1.EnvVar{ + { + Name: "INSTALLATION_SHORTNAME", + Value: ctx.InstallationShortname, + }, + }, ), Command: []string{ "sh", diff --git a/install/installer/pkg/components/server/configmap.go b/install/installer/pkg/components/server/configmap.go index 81734d56872cce..b116de7bd1f3d7 100644 --- a/install/installer/pkg/components/server/configmap.go +++ b/install/installer/pkg/components/server/configmap.go @@ -29,8 +29,8 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { scfg := ConfigSerialized{ Version: ctx.VersionManifest.Version, HostURL: fmt.Sprintf("https://%s", ctx.Config.Domain), - InstallationShortname: ctx.Namespace, // todo(sje): is this needed? - Stage: "production", // todo(sje): is this needed? + InstallationShortname: ctx.InstallationShortname, + Stage: "production", // todo(sje): is this needed? LicenseFile: license, WorkspaceHeartbeat: WorkspaceHeartbeat{ IntervalSeconds: 60, diff --git a/install/installer/pkg/components/server/deployment.go b/install/installer/pkg/components/server/deployment.go index e8144ee71f2e38..f2b865dda47180 100644 --- a/install/installer/pkg/components/server/deployment.go +++ b/install/installer/pkg/components/server/deployment.go @@ -32,7 +32,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { } // Convert to a JSON string - fc, err := common.ToJSONString(wsmanagerbridge.WSManagerList()) + fc, err := common.ToJSONString(wsmanagerbridge.WSManagerList(ctx)) if err != nil { return nil, fmt.Errorf("failed to marshal server.WorkspaceManagerList config: %w", err) } diff --git a/install/installer/pkg/components/ws-manager-bridge/configmap.go b/install/installer/pkg/components/ws-manager-bridge/configmap.go index 3bb7e863ac9334..0762b630783e2c 100644 --- a/install/installer/pkg/components/ws-manager-bridge/configmap.go +++ b/install/installer/pkg/components/ws-manager-bridge/configmap.go @@ -16,7 +16,7 @@ import ( func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { wsmbcfg := Configuration{ - Installation: "", + Installation: ctx.InstallationShortname, WSClusterDBReconcileIntervalSeconds: 60, ControllerIntervalSeconds: 60, ControllerMaxDisconnectSeconds: 150, @@ -31,7 +31,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { UnknownPhaseSeconds: 600, }, EmulatePreparingIntervalSeconds: 10, - StaticBridges: WSManagerList(), + StaticBridges: WSManagerList(ctx), } fc, err := common.ToJSONString(wsmbcfg) diff --git a/install/installer/pkg/components/ws-manager-bridge/objects.go b/install/installer/pkg/components/ws-manager-bridge/objects.go index b2a0ed032ffc11..f5c9adfc52dbed 100644 --- a/install/installer/pkg/components/ws-manager-bridge/objects.go +++ b/install/installer/pkg/components/ws-manager-bridge/objects.go @@ -18,9 +18,9 @@ var Objects = common.CompositeRenderFunc( common.DefaultServiceAccount(Component), ) -func WSManagerList() []WorkspaceCluster { +func WSManagerList(ctx *common.RenderContext) []WorkspaceCluster { return []WorkspaceCluster{{ - Name: "default", + Name: ctx.InstallationShortname, URL: fmt.Sprintf("dns:///%s:%d", wsmanager.Component, wsmanager.RPCPort), TLS: WorkspaceClusterTLS{ Authority: "/ws-manager-client-tls-certs/ca.crt",