Skip to content

Commit

Permalink
add PVC feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sagor999 authored and roboquat committed Apr 5, 2022
1 parent da28f0c commit 5a62315
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 80 deletions.
6 changes: 5 additions & 1 deletion components/gitpod-protocol/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export interface UserFeatureSettings {
* The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
* If they don't we'll break things during workspace startup.
*/
export const WorkspaceFeatureFlags = { full_workspace_backup: undefined, fixed_resources: undefined };
export const WorkspaceFeatureFlags = {
full_workspace_backup: undefined,
fixed_resources: undefined,
persistent_volume_claim: undefined,
};
export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;

export interface EnvVarWithValue {
Expand Down
5 changes: 4 additions & 1 deletion components/server/src/workspace/config-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ export class ConfigProvider {
*/
delete config._featureFlags;
if (!!user.featureFlags) {
const workspacePersistedFlags: NamedWorkspaceFeatureFlag[] = ["full_workspace_backup"];
const workspacePersistedFlags: NamedWorkspaceFeatureFlag[] = [
"full_workspace_backup",
"persistent_volume_claim",
];
config._featureFlags = workspacePersistedFlags.filter((f) =>
(user.featureFlags!.permanentWSFeatureFlags || []).includes(f),
);
Expand Down
3 changes: 3 additions & 0 deletions components/ws-manager-api/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ enum WorkspaceFeatureFlag {

// Was used for UserNamespace
reserved 6;

// PERSISTENT_VOLUME_CLAIM feature flag for enabling PVC\Snapshot feature support
PERSISTENT_VOLUME_CLAIM = 7;
}

// GitSpec configures the Git available within the workspace
Expand Down
152 changes: 79 additions & 73 deletions components/ws-manager-api/go/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/ws-manager-api/go/core_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/ws-manager-api/go/mock/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/ws-manager-api/typescript/src/core_grpc_pb.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
* 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.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/ws-manager-api/typescript/src/core_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
* 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.
*/
Expand Down
1 change: 1 addition & 0 deletions components/ws-manager-api/typescript/src/core_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ export enum WorkspaceFeatureFlag {
NOOP = 0,
FULL_WORKSPACE_BACKUP = 4,
FIXED_RESOURCES = 5,
PERSISTENT_VOLUME_CLAIM = 7,
}

export enum WorkspaceType {
Expand Down
3 changes: 2 additions & 1 deletion components/ws-manager-api/typescript/src/core_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7991,7 +7991,8 @@ proto.wsman.WorkspacePhase = {
proto.wsman.WorkspaceFeatureFlag = {
NOOP: 0,
FULL_WORKSPACE_BACKUP: 4,
FIXED_RESOURCES: 5
FIXED_RESOURCES: 5,
PERSISTENT_VOLUME_CLAIM: 7
};

/**
Expand Down

0 comments on commit 5a62315

Please sign in to comment.