Skip to content

Commit e67be3f

Browse files
committedFeb 11, 2025
[server] Introduce project.settings.enableDockerdAuthentication and expose it on the API
Tool: gitpod/catfood.gitpod.cloud
1 parent 765c348 commit e67be3f

File tree

11 files changed

+663
-327
lines changed

11 files changed

+663
-327
lines changed
 

Diff for: ‎components/gitpod-protocol/src/protocol.ts

+20
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,26 @@ export namespace EnvVar {
280280
export function is(data: any): data is EnvVar {
281281
return data.hasOwnProperty("name") && data.hasOwnProperty("value");
282282
}
283+
284+
/**
285+
* Extracts the "host:credentials" pairs from the GITPOD_IMAGE_AUTH environment variable.
286+
* @param envVars
287+
* @returns A map of host to credentials
288+
*/
289+
export function getGitpodImageAuth(envVars: EnvVarWithValue[]): Map<string, string> {
290+
const res = new Map<string, string>();
291+
const imageAuth = envVars.find((e) => e.name === EnvVar.GITPOD_IMAGE_AUTH_ENV_VAR_NAME);
292+
if (!imageAuth) {
293+
return res;
294+
}
295+
296+
(imageAuth.value || "")
297+
.split(",")
298+
.map((e) => e.trim().split(":"))
299+
.filter((e) => e.length == 2)
300+
.forEach((e) => res.set(e[0], e[1]));
301+
return res;
302+
}
283303
}
284304

285305
export namespace UserEnvVar {

Diff for: ‎components/gitpod-protocol/src/teams-projects-protocol.ts

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export interface ProjectSettings {
2828
restrictedWorkspaceClasses?: string[];
2929

3030
restrictedEditorNames?: string[];
31+
32+
/**
33+
* Enable automatic authentication for docker daemon with all credentials specified in GITPOD_IMAGE_AUTH
34+
*/
35+
enableDockerdAuthentication?: boolean;
3136
}
3237
export namespace PrebuildSettings {
3338
export type BranchStrategy = "default-branch" | "all-branches" | "matched-branches";

Diff for: ‎components/public-api/gitpod/v1/configuration.proto

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ message WorkspaceSettings {
5252
string workspace_class = 1;
5353
repeated string restricted_workspace_classes = 2;
5454
repeated string restricted_editor_names = 3;
55+
// Enable automatic authentication for docker daemon with all credentials specified in GITPOD_IMAGE_AUTH
56+
bool enable_dockerd_authentication = 4;
5557
}
5658

5759
service ConfigurationService {
@@ -131,6 +133,9 @@ message UpdateConfigurationRequest {
131133
repeated string restricted_editor_names = 4;
132134
// Specifies whether restricted_editor_names should be updated.
133135
optional bool update_restricted_editor_names = 5;
136+
137+
// Enable automatic authentication for docker daemon with all credentials specified in GITPOD_IMAGE_AUTH
138+
optional bool enable_dockerd_authentication = 6;
134139
}
135140
string configuration_id = 1;
136141
optional string name = 2;

Diff for: ‎components/public-api/go/v1/configuration.pb.go

+235-206
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.