Skip to content

Commit 7d3f447

Browse files
Fix dockerfile paths with relative decorators (#20365)
1 parent 177367e commit 7d3f447

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

components/server/src/workspace/config-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class ConfigProvider {
260260
}
261261
const repoHost = hostContext.services;
262262
const lastDockerFileSha = await repoHost.fileProvider
263-
.getLastChangeRevision(repository, revisionOrTagOrBranch, user, dockerFilePath)
263+
.getLastChangeRevision(repository, revisionOrTagOrBranch, user, path.normalize(dockerFilePath))
264264
.catch((e) => {
265265
if (e instanceof RevisionNotFoundError) {
266266
return ImageFileRevisionMissing;

components/server/src/workspace/image-source-provider.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
import { injectable, inject } from "inversify";
8+
import { createHash } from "crypto";
9+
import path from "path";
810
import { HostContextProvider } from "../auth/host-context-provider";
911
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
1012
import {
@@ -18,7 +20,6 @@ import {
1820
User,
1921
AdditionalContentContext,
2022
} from "@gitpod/gitpod-protocol";
21-
import { createHash } from "crypto";
2223
import { ImageFileRevisionMissing, RevisionNotFoundError } from "../repohost";
2324

2425
@injectable()
@@ -45,7 +46,12 @@ export class ImageSourceProvider {
4546
throw new Error(`Cannot fetch workspace image source for host: ${repository.host}`);
4647
}
4748
const lastDockerFileSha = await hostContext.services.fileProvider
48-
.getLastChangeRevision(repository, imgcfg.externalSource.revision, user, imgcfg.file)
49+
.getLastChangeRevision(
50+
repository,
51+
imgcfg.externalSource.revision,
52+
user,
53+
path.normalize(imgcfg.file),
54+
)
4955
.catch((e) => {
5056
if (e instanceof RevisionNotFoundError) {
5157
return ImageFileRevisionMissing;
@@ -76,7 +82,7 @@ export class ImageSourceProvider {
7682
throw new Error(`Cannot fetch workspace image source for host: ${context.repository.host}`);
7783
}
7884
const lastDockerFileSha = await hostContext.services.fileProvider
79-
.getLastChangeRevision(context.repository, context.revision, user, imgcfg.file)
85+
.getLastChangeRevision(context.repository, context.revision, user, path.normalize(imgcfg.file))
8086
.catch((e) => {
8187
if (e instanceof RevisionNotFoundError) {
8288
return ImageFileRevisionMissing;

0 commit comments

Comments
 (0)