Skip to content

Commit e78658b

Browse files
committed
ensure volume snapshot naming consistency
1 parent a1749c1 commit e78658b

File tree

61 files changed

+403
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+403
-410
lines changed

components/content-service-api/go/initializer.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/content-service-api/initializer.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ message PrebuildInitializer {
124124
// FromBackupInitializer initializes content from a previously made backup
125125
message FromBackupInitializer {
126126
string checkout_location = 1;
127-
bool from_snapshot_volume = 2;
127+
bool from_volume_snapshot = 2;
128128
}
129129

130130
// GitStatus describes the current Git working copy status, akin to a combination of "git status" and "git branch"

components/content-service-api/typescript/src/initializer_pb.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ export namespace PrebuildInitializer {
300300
export class FromBackupInitializer extends jspb.Message {
301301
getCheckoutLocation(): string;
302302
setCheckoutLocation(value: string): FromBackupInitializer;
303-
getFromSnapshotVolume(): boolean;
304-
setFromSnapshotVolume(value: boolean): FromBackupInitializer;
303+
getFromVolumeSnapshot(): boolean;
304+
setFromVolumeSnapshot(value: boolean): FromBackupInitializer;
305305

306306
serializeBinary(): Uint8Array;
307307
toObject(includeInstance?: boolean): FromBackupInitializer.AsObject;
@@ -316,7 +316,7 @@ export class FromBackupInitializer extends jspb.Message {
316316
export namespace FromBackupInitializer {
317317
export type AsObject = {
318318
checkoutLocation: string,
319-
fromSnapshotVolume: boolean,
319+
fromVolumeSnapshot: boolean,
320320
}
321321
}
322322

components/content-service-api/typescript/src/initializer_pb.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,7 @@ proto.contentservice.FromBackupInitializer.prototype.toObject = function(opt_inc
23232323
proto.contentservice.FromBackupInitializer.toObject = function(includeInstance, msg) {
23242324
var f, obj = {
23252325
checkoutLocation: jspb.Message.getFieldWithDefault(msg, 1, ""),
2326-
fromSnapshotVolume: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
2326+
fromVolumeSnapshot: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
23272327
};
23282328

23292329
if (includeInstance) {
@@ -2366,7 +2366,7 @@ proto.contentservice.FromBackupInitializer.deserializeBinaryFromReader = functio
23662366
break;
23672367
case 2:
23682368
var value = /** @type {boolean} */ (reader.readBool());
2369-
msg.setFromSnapshotVolume(value);
2369+
msg.setFromVolumeSnapshot(value);
23702370
break;
23712371
default:
23722372
reader.skipField();
@@ -2404,7 +2404,7 @@ proto.contentservice.FromBackupInitializer.serializeBinaryToWriter = function(me
24042404
f
24052405
);
24062406
}
2407-
f = message.getFromSnapshotVolume();
2407+
f = message.getFromVolumeSnapshot();
24082408
if (f) {
24092409
writer.writeBool(
24102410
2,
@@ -2433,10 +2433,10 @@ proto.contentservice.FromBackupInitializer.prototype.setCheckoutLocation = funct
24332433

24342434

24352435
/**
2436-
* optional bool from_snapshot_volume = 2;
2436+
* optional bool from_volume_snapshot = 2;
24372437
* @return {boolean}
24382438
*/
2439-
proto.contentservice.FromBackupInitializer.prototype.getFromSnapshotVolume = function() {
2439+
proto.contentservice.FromBackupInitializer.prototype.getFromVolumeSnapshot = function() {
24402440
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
24412441
};
24422442

@@ -2445,7 +2445,7 @@ proto.contentservice.FromBackupInitializer.prototype.getFromSnapshotVolume = fun
24452445
* @param {boolean} value
24462446
* @return {!proto.contentservice.FromBackupInitializer} returns this
24472447
*/
2448-
proto.contentservice.FromBackupInitializer.prototype.setFromSnapshotVolume = function(value) {
2448+
proto.contentservice.FromBackupInitializer.prototype.setFromVolumeSnapshot = function(value) {
24492449
return jspb.Message.setProto3BooleanField(this, 2, value);
24502450
};
24512451

components/content-service/pkg/initializer/initializer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,18 @@ func newFromBackupInitializer(loc string, rs storage.DirectDownloader, req *csap
173173
return &fromBackupInitializer{
174174
Location: loc,
175175
RemoteStorage: rs,
176-
FromSnapshotVolume: req.FromSnapshotVolume,
176+
FromVolumeSnapshot: req.FromVolumeSnapshot,
177177
}, nil
178178
}
179179

180180
type fromBackupInitializer struct {
181181
Location string
182182
RemoteStorage storage.DirectDownloader
183-
FromSnapshotVolume bool
183+
FromVolumeSnapshot bool
184184
}
185185

186186
func (bi *fromBackupInitializer) Run(ctx context.Context, mappings []archive.IDMapping) (src csapi.WorkspaceInitSource, err error) {
187-
if bi.FromSnapshotVolume {
187+
if bi.FromVolumeSnapshot {
188188
return csapi.WorkspaceInitFromBackup, nil
189189
}
190190

components/content-service/pkg/layer/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (s *Provider) GetContentLayerPVC(ctx context.Context, owner, workspaceID st
269269
return l, manifest, nil
270270
}
271271

272-
if initializer.GetBackup() != nil && initializer.GetBackup().FromSnapshotVolume {
272+
if initializer.GetBackup() != nil && initializer.GetBackup().FromVolumeSnapshot {
273273
layer, err = contentDescriptorToLayerPVC([]byte{})
274274
if err != nil {
275275
return nil, nil, err

components/gitpod-protocol/src/wsready.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License-AGPL.txt in the project root for license information.
55
*/
66

7-
// generated using github.com/32leaves/bel on 2022-05-10 18:14:25.691876738 +0000 UTC m=+0.006851101
7+
// generated using github.com/32leaves/bel on 2022-05-18 18:19:49.011672619 +0000 UTC m=+0.006607361
88
// DO NOT MODIFY
99

1010
export enum WorkspaceInitSource {

components/server/src/workspace/workspace-starter.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ import {
8686
StartWorkspaceRequest,
8787
WorkspaceMetadata,
8888
WorkspaceType,
89-
PvcSnapshotVolumeInfo,
89+
PvcVolumeSnapshotInfo,
9090
} from "@gitpod/ws-manager/lib/core_pb";
9191
import * as crypto from "crypto";
9292
import { inject, injectable } from "inversify";
@@ -1266,13 +1266,13 @@ export class WorkspaceStarter {
12661266
}
12671267
}
12681268

1269-
let volumeSnapshotInfo = new PvcSnapshotVolumeInfo();
1269+
let volumeSnapshotInfo = new PvcVolumeSnapshotInfo();
12701270
const volumeSnapshots = await this.workspaceDb
12711271
.trace(traceCtx)
12721272
.findVolumeSnapshotById(lastValidWorkspaceInstanceId);
12731273
if (volumeSnapshots !== undefined) {
1274-
volumeSnapshotInfo.setSnapshotVolumeName(volumeSnapshots.id);
1275-
volumeSnapshotInfo.setSnapshotVolumeHandle(volumeSnapshots.volumeHandle);
1274+
volumeSnapshotInfo.setVolumeSnapshotName(volumeSnapshots.id);
1275+
volumeSnapshotInfo.setVolumeSnapshotHandle(volumeSnapshots.volumeHandle);
12761276
}
12771277

12781278
const initializerPromise = this.createInitializer(
@@ -1313,7 +1313,7 @@ export class WorkspaceStarter {
13131313
spec.setTimeout(this.userService.workspaceTimeoutToDuration(await userTimeoutPromise));
13141314
}
13151315
spec.setAdmission(admissionLevel);
1316-
spec.setVolumeSnapshot(volumeSnapshotInfo);
1316+
spec.setPvcVolumeSnapshot(volumeSnapshotInfo);
13171317
return spec;
13181318
}
13191319

@@ -1442,7 +1442,7 @@ export class WorkspaceStarter {
14421442
if (CommitContext.is(context)) {
14431443
backup.setCheckoutLocation(context.checkoutLocation || "");
14441444
}
1445-
backup.setFromSnapshotVolume(hasVolumeSnapshot);
1445+
backup.setFromVolumeSnapshot(hasVolumeSnapshot);
14461446
result.setBackup(backup);
14471447
} else if (SnapshotContext.is(context)) {
14481448
const snapshot = new SnapshotInitializer();

components/ws-manager-api/core.proto

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ enum PortVisibility {
337337
PORT_VISIBILITY_PUBLIC = 1;
338338
}
339339

340-
// PvcSnapshotVolumeInfo defines snapshot volume information
341-
message PvcSnapshotVolumeInfo {
342-
// snapshot_volume_name is the name of snapshot volume
343-
string snapshot_volume_name = 1;
340+
// VolumeSnapshotInfo defines volume snapshot information
341+
message VolumeSnapshotInfo {
342+
// volume_snapshot_name is the name of volume snapshot
343+
string volume_snapshot_name = 1;
344344

345-
// snapshot_volume_handle is a handle that is used to restore snapshot volume
346-
string snapshot_volume_handle = 2;
345+
// volume_snapshot_handle is a handle that is used to restore volume snapshot
346+
string volume_snapshot_handle = 2;
347347
}
348348

349349
// WorkspaceCondition gives more detailed information as to the state of the workspace. Which condition actually
@@ -383,8 +383,8 @@ message WorkspaceConditions {
383383
// stopped_by_request is true if the workspace was stopped using a StopWorkspace call
384384
WorkspaceConditionBool stopped_by_request = 11;
385385

386-
// pvc_snapshot_volume contains info about snapshot volume that was used to save persistent volume
387-
PvcSnapshotVolumeInfo pvc_snapshot_volume = 12;
386+
// volume_snapshot contains info about volume snapshot that was used to save persistent volume
387+
VolumeSnapshotInfo volume_snapshot = 12;
388388
}
389389

390390
// WorkspaceConditionBool is a trinary bool: true/false/empty
@@ -512,8 +512,8 @@ message StartWorkspaceSpec {
512512
// Class denotes the class of the workspace we ought to start
513513
string class = 13;
514514

515-
// volume_snapshot_id to use to restore PVC from, if set
516-
PvcSnapshotVolumeInfo volume_snapshot = 14;
515+
// volume_snapshot to use to restore PVC from, if set
516+
VolumeSnapshotInfo volume_snapshot = 14;
517517
}
518518

519519
// WorkspaceFeatureFlag enable non-standard behaviour in workspaces

0 commit comments

Comments
 (0)