diff --git a/components/dashboard/src/data/workspaces/default-workspace-image-query.ts b/components/dashboard/src/data/workspaces/default-workspace-image-query.ts index d74a2dc808c1f3..20e2b04cc5f051 100644 --- a/components/dashboard/src/data/workspaces/default-workspace-image-query.ts +++ b/components/dashboard/src/data/workspaces/default-workspace-image-query.ts @@ -6,14 +6,14 @@ import { useQuery } from "@tanstack/react-query"; import { getGitpodService } from "../../service/service"; +import { GetDefaultWorkspaceImageResult } from "@gitpod/gitpod-protocol"; -export const useDefaultWorkspaceImageQuery = () => { - return useQuery({ - queryKey: ["default-workspace-image"], +export const useDefaultWorkspaceImageQuery = (workspaceId?: string) => { + return useQuery({ + queryKey: ["default-workspace-image", { workspaceId }], staleTime: 1000 * 60 * 10, // 10 minute queryFn: async () => { - const image = await getGitpodService().server.getDefaultWorkspaceImage(); - return image; + return await getGitpodService().server.getDefaultWorkspaceImage({ workspaceId }); }, }); }; diff --git a/components/dashboard/src/start/StartPage.tsx b/components/dashboard/src/start/StartPage.tsx index c4700bda8f2047..eaaf8eba6b3f6c 100644 --- a/components/dashboard/src/start/StartPage.tsx +++ b/components/dashboard/src/start/StartPage.tsx @@ -12,6 +12,7 @@ import { useDocumentTitle } from "../hooks/use-document-title"; import gitpodIcon from "../icons/gitpod.svg"; import { gitpodHostUrl } from "../service/service"; import { VerifyModal } from "./VerifyModal"; +import { useDefaultWorkspaceImageQuery } from "../data/workspaces/default-workspace-image-query"; export enum StartPhase { Checking = 0, @@ -81,6 +82,7 @@ export interface StartPageProps { title?: string; children?: React.ReactNode; showLatestIdeWarning?: boolean; + workspaceId: string; } export interface StartWorkspaceError { @@ -90,7 +92,7 @@ export interface StartWorkspaceError { } export function StartPage(props: StartPageProps) { - const { phase, error } = props; + const { phase, error, workspaceId } = props; let title = props.title || getPhaseTitle(phase, error); useDocumentTitle("Starting"); return ( @@ -114,19 +116,11 @@ export function StartPage(props: StartPageProps) { )} {error && } {props.children} - {props.showLatestIdeWarning && ( - - This workspace is configured with the latest release (unstable) for the editor.{" "} - - Change Preferences - - - )} + ); @@ -139,3 +133,34 @@ function StartError(props: { error: StartWorkspaceError }) { } return

{error.message}

; } + +function WarningView(props: { workspaceId?: string; showLatestIdeWarning?: boolean; error?: StartWorkspaceError }) { + const { data: imageInfo } = useDefaultWorkspaceImageQuery(props.workspaceId); + let useWarning: "latestIde" | "orgImage" | undefined = props.showLatestIdeWarning ? "latestIde" : undefined; + if (props.error && props.workspaceId && imageInfo?.source === "organization") { + useWarning = "orgImage"; + } + return ( +
+ {useWarning === "latestIde" && ( + + This workspace is configured with the latest release (unstable) for the editor.{" "} + + Change Preferences + + + )} + {useWarning === "orgImage" && ( + + Could not use workspace image? Try a different workspace image + in the yaml configuration or check the default workspace image in organization settings. + + )} +
+ ); +} diff --git a/components/dashboard/src/start/StartWorkspace.tsx b/components/dashboard/src/start/StartWorkspace.tsx index 8f8291279e8570..f89c7da9cd01f2 100644 --- a/components/dashboard/src/start/StartWorkspace.tsx +++ b/components/dashboard/src/start/StartWorkspace.tsx @@ -501,7 +501,7 @@ export default class StartWorkspace extends React.Component +
{/* TODO(gpl) These classes are copied around in Start-/CreateWorkspace. This should properly go somewhere central. */} @@ -627,7 +627,7 @@ export default class StartWorkspace extends React.Component +
{/* TODO(gpl) These classes are copied around in Start-/CreateWorkspace. This should properly go somewhere central. */} @@ -718,6 +718,7 @@ export default class StartWorkspace extends React.Component {statusMessage} @@ -778,7 +779,7 @@ function ImageBuildView(props: ImageBuildViewProps) { }, []); return ( - + }> diff --git a/components/dashboard/src/teams/TeamSettings.tsx b/components/dashboard/src/teams/TeamSettings.tsx index a3db0758520a25..e139e341f6ba34 100644 --- a/components/dashboard/src/teams/TeamSettings.tsx +++ b/components/dashboard/src/teams/TeamSettings.tsx @@ -172,7 +172,7 @@ export default function TeamSettingsPage() { function OrgSettingsForm(props: { org?: OrganizationInfo }) { const { org } = props; const { data: settings, isLoading } = useOrgSettingsQuery(); - const { data: globalDefaultImage } = useDefaultWorkspaceImageQuery(); + const { data: imageInfo } = useDefaultWorkspaceImageQuery(); const updateTeamSettings = useUpdateOrgSettingsMutation(); const [showImageEditModal, setShowImageEditModal] = useState(false); @@ -229,14 +229,14 @@ function OrgSettingsForm(props: { org?: OrganizationInfo }) { setShowImageEditModal(true)} /> {showImageEditModal && ( setShowImageEditModal(false)} /> )} @@ -276,10 +276,7 @@ function WorkspaceImageButton(props: { const image = props.settings?.defaultWorkspaceImage ?? props.defaultWorkspaceImage ?? ""; const descList = useMemo(() => { - const arr: ReactNode[] = []; - if (!props.settings?.defaultWorkspaceImage) { - arr.push(Default image); - } + const arr: ReactNode[] = [Default image]; if (props.disabled) { arr.push( <> @@ -288,7 +285,7 @@ function WorkspaceImageButton(props: { ); } return arr; - }, [props.settings, props.disabled]); + }, [props.disabled]); const renderedDescription = useMemo(() => { return Children.toArray(descList).reduce((acc: ReactNode[], child, index) => { @@ -304,7 +301,7 @@ function WorkspaceImageButton(props: {
-
+
@@ -312,12 +309,16 @@ function WorkspaceImageButton(props: { {parseDockerImage(image).repository}  ·  - - {parseDockerImage(image).tag} - + {parseDockerImage(image).tag}
{!props.disabled && ( - )} diff --git a/components/gitpod-protocol/go/gitpod-service.go b/components/gitpod-protocol/go/gitpod-service.go index d5fc9e7c2b677f..a1fd4e8c3c32b0 100644 --- a/components/gitpod-protocol/go/gitpod-service.go +++ b/components/gitpod-protocol/go/gitpod-service.go @@ -96,6 +96,8 @@ type APIInterface interface { // Organization GetOrgSettings(ctx context.Context, orgID string) (*OrganizationSettings, error) + GetDefaultWorkspaceImage(ctx context.Context, params *GetDefaultWorkspaceImageParams) (res *GetDefaultWorkspaceImageResult, err error) + // Projects CreateProject(ctx context.Context, options *CreateProjectOptions) (*Project, error) DeleteProject(ctx context.Context, projectID string) error @@ -242,6 +244,9 @@ const ( // FunctionGetOrgSettings is the name of the getOrgSettings function FunctionGetOrgSettings FunctionName = "getOrgSettings" + // FunctionGetDefaultWorkspaceImage is the name of the getDefaultWorkspaceImage function + FunctionGetDefaultWorkspaceImage FunctionName = "getDefaultWorkspaceImage" + // Projects FunctionCreateProject FunctionName = "createProject" FunctionDeleteProject FunctionName = "deleteProject" @@ -1488,6 +1493,19 @@ func (gp *APIoverJSONRPC) GetOrgSettings(ctx context.Context, orgID string) (res return } +func (gp *APIoverJSONRPC) GetDefaultWorkspaceImage(ctx context.Context, params *GetDefaultWorkspaceImageParams) (res *GetDefaultWorkspaceImageResult, err error) { + if gp == nil { + err = errNotConnected + return + } + var _params []interface{} + + _params = append(_params, params) + + err = gp.C.Call(ctx, string(FunctionGetDefaultWorkspaceImage), _params, &res) + return +} + func (gp *APIoverJSONRPC) CreateProject(ctx context.Context, options *CreateProjectOptions) (res *Project, err error) { if gp == nil { err = errNotConnected @@ -2369,3 +2387,19 @@ type IDEClient struct { // InstallationSteps to install the client on user machine. InstallationSteps []string `json:"installationSteps,omitempty"` } + +type GetDefaultWorkspaceImageParams struct { + WorkspaceID string `json:"workspaceId,omitempty"` +} + +type WorkspaceImageSource string + +const ( + WorkspaceImageSourceInstallation WorkspaceImageSource = "installation" + WorkspaceImageSourceOrganization WorkspaceImageSource = "organization" +) + +type GetDefaultWorkspaceImageResult struct { + Image string `json:"image,omitempty"` + Source WorkspaceImageSource `json:"source,omitempty"` +} diff --git a/components/gitpod-protocol/go/mock.go b/components/gitpod-protocol/go/mock.go index eec20966199ea8..dd907add3a580b 100644 --- a/components/gitpod-protocol/go/mock.go +++ b/components/gitpod-protocol/go/mock.go @@ -849,6 +849,21 @@ func (mr *MockAPIInterfaceMockRecorder) GetOrgSettings(ctx, orgID interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrgSettings", reflect.TypeOf((*MockAPIInterface)(nil).GetOrgSettings), ctx, orgID) } +// GetDefaultWorkspaceImage mocks base method. +func (m *MockAPIInterface) GetDefaultWorkspaceImage(ctx context.Context, params *GetDefaultWorkspaceImageParams) (*GetDefaultWorkspaceImageResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDefaultWorkspaceImage", ctx) + ret0, _ := ret[0].(*GetDefaultWorkspaceImageResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDefaultWorkspaceImage indicates an expected call of GetDefaultWorkspaceImage. +func (mr *MockAPIInterfaceMockRecorder) GetDefaultWorkspaceImage(ctx, params *GetDefaultWorkspaceImageParams) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultWorkspaceImage", reflect.TypeOf((*MockAPIInterface)(nil).GetDefaultWorkspaceImage), ctx, params) +} + // ResetGenericInvite mocks base method. func (m *MockAPIInterface) ResetGenericInvite(ctx context.Context, teamID string) (*TeamMembershipInvite, error) { m.ctrl.T.Helper() diff --git a/components/gitpod-protocol/src/gitpod-service.ts b/components/gitpod-protocol/src/gitpod-service.ts index 466aab0210dddd..5ca937ca914636 100644 --- a/components/gitpod-protocol/src/gitpod-service.ts +++ b/components/gitpod-protocol/src/gitpod-service.ts @@ -173,7 +173,7 @@ export interface GitpodServer extends JsonRpcServer, AdminServer, getOrgAuthProviders(params: GitpodServer.GetOrgAuthProviderParams): Promise; deleteOrgAuthProvider(params: GitpodServer.DeleteOrgAuthProviderParams): Promise; - getDefaultWorkspaceImage(): Promise; + getDefaultWorkspaceImage(params: GetDefaultWorkspaceImageParams): Promise; // Dedicated, Dedicated, Dedicated getOnboardingState(): Promise; @@ -280,6 +280,20 @@ export interface RateLimiterError { retryAfter: number; } +export interface GetDefaultWorkspaceImageParams { + // filter with workspaceId (actually we will find with organizationId, and it's a real time finding) + workspaceId?: string; +} + +export type DefaultImageSource = + | "installation" // Source installation means the image comes from Gitpod instance install config + | "organization"; // Source organization means the image comes from Organization settings + +export interface GetDefaultWorkspaceImageResult { + image: string; + source: DefaultImageSource; +} + export interface CreateProjectParams { name: string; /** @deprecated unused */ diff --git a/components/public-api-server/pkg/apiv1/workspace.go b/components/public-api-server/pkg/apiv1/workspace.go index a6b8c9d500bea9..9f929d0a526cc2 100644 --- a/components/public-api-server/pkg/apiv1/workspace.go +++ b/components/public-api-server/pkg/apiv1/workspace.go @@ -357,6 +357,32 @@ func (s *WorkspaceService) ListWorkspaceClasses(ctx context.Context, req *connec ), nil } +func (s *WorkspaceService) GetDefaultWorkspaceImage(ctx context.Context, req *connect.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect.Response[v1.GetDefaultWorkspaceImageResponse], error) { + conn, err := getConnection(ctx, s.connectionPool) + if err != nil { + return nil, err + } + wsImage, err := conn.GetDefaultWorkspaceImage(ctx, &protocol.GetDefaultWorkspaceImageParams{ + WorkspaceID: req.Msg.GetWorkspaceId(), + }) + if err != nil { + log.Extract(ctx).WithError(err).Error("Failed to get default workspace image.") + return nil, proxy.ConvertError(err) + } + + source := v1.GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_UNSPECIFIED + if wsImage.Source == protocol.WorkspaceImageSourceInstallation { + source = v1.GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_INSTALLATION + } else if wsImage.Source == protocol.WorkspaceImageSourceOrganization { + source = v1.GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_ORGANIZATION + } + + return connect.NewResponse(&v1.GetDefaultWorkspaceImageResponse{ + Image: wsImage.Image, + Source: source, + }), nil +} + func getLimitFromPagination(pagination *v1.Pagination) (int, error) { const ( defaultLimit = 20 diff --git a/components/public-api/gitpod/experimental/v1/workspaces.proto b/components/public-api/gitpod/experimental/v1/workspaces.proto index 92751cb53b5726..d71d5b50422a3d 100644 --- a/components/public-api/gitpod/experimental/v1/workspaces.proto +++ b/components/public-api/gitpod/experimental/v1/workspaces.proto @@ -43,6 +43,9 @@ service WorkspacesService { // ListWorkspaceClasses enumerates all available workspace classes. rpc ListWorkspaceClasses(ListWorkspaceClassesRequest) returns (ListWorkspaceClassesResponse) {} + + // GetDefaultWorkspaceImage returns the default workspace image from different sources. + rpc GetDefaultWorkspaceImage(GetDefaultWorkspaceImageRequest) returns (GetDefaultWorkspaceImageResponse) {} } message ListWorkspacesRequest { @@ -433,3 +436,25 @@ message WorkspaceClass { // is_default indicates if this workspace class is the default one bool is_default = 4; } + +message GetDefaultWorkspaceImageRequest { + optional string workspace_id = 1; +} + +message GetDefaultWorkspaceImageResponse { + enum ImageSource { + IMAGE_SOURCE_UNSPECIFIED = 0; + + // IMAGE_SOURCE_INSTALLATION means the image from Gitpod instance install config + IMAGE_SOURCE_INSTALLATION = 1; + + // IMAGE_SOURCE_ORGANIZATION means the image from Organization settings + IMAGE_SOURCE_ORGANIZATION = 2; + } + + // image is the image ref + string image = 1; + + // source is the source of the image + ImageSource source = 2; +} diff --git a/components/public-api/go/experimental/v1/dummy.pb.go b/components/public-api/go/experimental/v1/dummy.pb.go index 56f43f3d85f584..069a5c82cba9db 100644 --- a/components/public-api/go/experimental/v1/dummy.pb.go +++ b/components/public-api/go/experimental/v1/dummy.pb.go @@ -28,8 +28,6 @@ type SayHelloRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` } func (x *SayHelloRequest) Reset() { @@ -64,13 +62,6 @@ func (*SayHelloRequest) Descriptor() ([]byte, []int) { return file_gitpod_experimental_v1_dummy_proto_rawDescGZIP(), []int{0} } -func (x *SayHelloRequest) GetGreeting() string { - if x != nil { - return x.Greeting - } - return "" -} - type SayHelloResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -123,8 +114,7 @@ type LotsOfRepliesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` - PreviousCount int32 `protobuf:"varint,2,opt,name=previous_count,json=previousCount,proto3" json:"previous_count,omitempty"` + PreviousCount int32 `protobuf:"varint,1,opt,name=previous_count,json=previousCount,proto3" json:"previous_count,omitempty"` } func (x *LotsOfRepliesRequest) Reset() { @@ -159,13 +149,6 @@ func (*LotsOfRepliesRequest) Descriptor() ([]byte, []int) { return file_gitpod_experimental_v1_dummy_proto_rawDescGZIP(), []int{2} } -func (x *LotsOfRepliesRequest) GetGreeting() string { - if x != nil { - return x.Greeting - } - return "" -} - func (x *LotsOfRepliesRequest) GetPreviousCount() int32 { if x != nil { return x.PreviousCount @@ -234,42 +217,38 @@ var file_gitpod_experimental_v1_dummy_proto_rawDesc = []byte{ 0x0a, 0x22, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, - 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0x2d, 0x0a, 0x0f, - 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x28, 0x0a, 0x10, 0x53, - 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x72, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x59, 0x0a, 0x14, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x22, 0x43, 0x0a, 0x15, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, - 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xdd, 0x01, 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, - 0x6c, 0x6f, 0x12, 0x27, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, - 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x79, 0x48, - 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, - 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x46, 0x5a, 0x44, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0x11, 0x0a, 0x0f, + 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x28, 0x0a, 0x10, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x3d, 0x0a, 0x14, 0x4c, 0x6f, 0x74, + 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x43, 0x0a, 0x15, 0x4c, 0x6f, 0x74, 0x73, + 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xdd, 0x01, + 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, + 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x27, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, + 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x79, + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, + 0x0d, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x2c, + 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x74, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x46, 0x5a, + 0x44, 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, 0x63, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go b/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go index 4c3e6ec2e40d00..8c8bcebf2ac817 100644 --- a/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go +++ b/components/public-api/go/experimental/v1/v1connect/workspaces.connect.go @@ -56,6 +56,8 @@ type WorkspacesServiceClient interface { UpdatePort(context.Context, *connect_go.Request[v1.UpdatePortRequest]) (*connect_go.Response[v1.UpdatePortResponse], error) // ListWorkspaceClasses enumerates all available workspace classes. ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) + // GetDefaultWorkspaceImage returns the default workspace image from different sources. + GetDefaultWorkspaceImage(context.Context, *connect_go.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect_go.Response[v1.GetDefaultWorkspaceImageResponse], error) } // NewWorkspacesServiceClient constructs a client for the gitpod.experimental.v1.WorkspacesService @@ -118,21 +120,27 @@ func NewWorkspacesServiceClient(httpClient connect_go.HTTPClient, baseURL string baseURL+"/gitpod.experimental.v1.WorkspacesService/ListWorkspaceClasses", opts..., ), + getDefaultWorkspaceImage: connect_go.NewClient[v1.GetDefaultWorkspaceImageRequest, v1.GetDefaultWorkspaceImageResponse]( + httpClient, + baseURL+"/gitpod.experimental.v1.WorkspacesService/GetDefaultWorkspaceImage", + opts..., + ), } } // workspacesServiceClient implements WorkspacesServiceClient. type workspacesServiceClient struct { - listWorkspaces *connect_go.Client[v1.ListWorkspacesRequest, v1.ListWorkspacesResponse] - getWorkspace *connect_go.Client[v1.GetWorkspaceRequest, v1.GetWorkspaceResponse] - streamWorkspaceStatus *connect_go.Client[v1.StreamWorkspaceStatusRequest, v1.StreamWorkspaceStatusResponse] - getOwnerToken *connect_go.Client[v1.GetOwnerTokenRequest, v1.GetOwnerTokenResponse] - createAndStartWorkspace *connect_go.Client[v1.CreateAndStartWorkspaceRequest, v1.CreateAndStartWorkspaceResponse] - startWorkspace *connect_go.Client[v1.StartWorkspaceRequest, v1.StartWorkspaceResponse] - stopWorkspace *connect_go.Client[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse] - deleteWorkspace *connect_go.Client[v1.DeleteWorkspaceRequest, v1.DeleteWorkspaceResponse] - updatePort *connect_go.Client[v1.UpdatePortRequest, v1.UpdatePortResponse] - listWorkspaceClasses *connect_go.Client[v1.ListWorkspaceClassesRequest, v1.ListWorkspaceClassesResponse] + listWorkspaces *connect_go.Client[v1.ListWorkspacesRequest, v1.ListWorkspacesResponse] + getWorkspace *connect_go.Client[v1.GetWorkspaceRequest, v1.GetWorkspaceResponse] + streamWorkspaceStatus *connect_go.Client[v1.StreamWorkspaceStatusRequest, v1.StreamWorkspaceStatusResponse] + getOwnerToken *connect_go.Client[v1.GetOwnerTokenRequest, v1.GetOwnerTokenResponse] + createAndStartWorkspace *connect_go.Client[v1.CreateAndStartWorkspaceRequest, v1.CreateAndStartWorkspaceResponse] + startWorkspace *connect_go.Client[v1.StartWorkspaceRequest, v1.StartWorkspaceResponse] + stopWorkspace *connect_go.Client[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse] + deleteWorkspace *connect_go.Client[v1.DeleteWorkspaceRequest, v1.DeleteWorkspaceResponse] + updatePort *connect_go.Client[v1.UpdatePortRequest, v1.UpdatePortResponse] + listWorkspaceClasses *connect_go.Client[v1.ListWorkspaceClassesRequest, v1.ListWorkspaceClassesResponse] + getDefaultWorkspaceImage *connect_go.Client[v1.GetDefaultWorkspaceImageRequest, v1.GetDefaultWorkspaceImageResponse] } // ListWorkspaces calls gitpod.experimental.v1.WorkspacesService.ListWorkspaces. @@ -185,6 +193,11 @@ func (c *workspacesServiceClient) ListWorkspaceClasses(ctx context.Context, req return c.listWorkspaceClasses.CallUnary(ctx, req) } +// GetDefaultWorkspaceImage calls gitpod.experimental.v1.WorkspacesService.GetDefaultWorkspaceImage. +func (c *workspacesServiceClient) GetDefaultWorkspaceImage(ctx context.Context, req *connect_go.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect_go.Response[v1.GetDefaultWorkspaceImageResponse], error) { + return c.getDefaultWorkspaceImage.CallUnary(ctx, req) +} + // WorkspacesServiceHandler is an implementation of the gitpod.experimental.v1.WorkspacesService // service. type WorkspacesServiceHandler interface { @@ -213,6 +226,8 @@ type WorkspacesServiceHandler interface { UpdatePort(context.Context, *connect_go.Request[v1.UpdatePortRequest]) (*connect_go.Response[v1.UpdatePortResponse], error) // ListWorkspaceClasses enumerates all available workspace classes. ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) + // GetDefaultWorkspaceImage returns the default workspace image from different sources. + GetDefaultWorkspaceImage(context.Context, *connect_go.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect_go.Response[v1.GetDefaultWorkspaceImageResponse], error) } // NewWorkspacesServiceHandler builds an HTTP handler from the service implementation. It returns @@ -272,6 +287,11 @@ func NewWorkspacesServiceHandler(svc WorkspacesServiceHandler, opts ...connect_g svc.ListWorkspaceClasses, opts..., )) + mux.Handle("/gitpod.experimental.v1.WorkspacesService/GetDefaultWorkspaceImage", connect_go.NewUnaryHandler( + "/gitpod.experimental.v1.WorkspacesService/GetDefaultWorkspaceImage", + svc.GetDefaultWorkspaceImage, + opts..., + )) return "/gitpod.experimental.v1.WorkspacesService/", mux } @@ -317,3 +337,7 @@ func (UnimplementedWorkspacesServiceHandler) UpdatePort(context.Context, *connec func (UnimplementedWorkspacesServiceHandler) ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.WorkspacesService.ListWorkspaceClasses is not implemented")) } + +func (UnimplementedWorkspacesServiceHandler) GetDefaultWorkspaceImage(context.Context, *connect_go.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect_go.Response[v1.GetDefaultWorkspaceImageResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.WorkspacesService.GetDefaultWorkspaceImage is not implemented")) +} diff --git a/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go b/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go index a5dffb4a5bd2ca..649f286f1daccc 100644 --- a/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go +++ b/components/public-api/go/experimental/v1/v1connect/workspaces.proxy.connect.go @@ -108,3 +108,13 @@ func (s *ProxyWorkspacesServiceHandler) ListWorkspaceClasses(ctx context.Context return connect_go.NewResponse(resp), nil } + +func (s *ProxyWorkspacesServiceHandler) GetDefaultWorkspaceImage(ctx context.Context, req *connect_go.Request[v1.GetDefaultWorkspaceImageRequest]) (*connect_go.Response[v1.GetDefaultWorkspaceImageResponse], error) { + resp, err := s.Client.GetDefaultWorkspaceImage(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} diff --git a/components/public-api/go/experimental/v1/workspaces.pb.go b/components/public-api/go/experimental/v1/workspaces.pb.go index 2ee32a9838aead..5662b705ef0f52 100644 --- a/components/public-api/go/experimental/v1/workspaces.pb.go +++ b/components/public-api/go/experimental/v1/workspaces.pb.go @@ -275,6 +275,57 @@ func (WorkspaceInstanceStatus_Phase) EnumDescriptor() ([]byte, []int) { return file_gitpod_experimental_v1_workspaces_proto_rawDescGZIP(), []int{22, 0} } +type GetDefaultWorkspaceImageResponse_ImageSource int32 + +const ( + GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_UNSPECIFIED GetDefaultWorkspaceImageResponse_ImageSource = 0 + // IMAGE_SOURCE_INSTALLATION means the image from Gitpod instance install config + GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_INSTALLATION GetDefaultWorkspaceImageResponse_ImageSource = 1 + // IMAGE_SOURCE_ORGANIZATION means the image from Organization settings + GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_ORGANIZATION GetDefaultWorkspaceImageResponse_ImageSource = 2 +) + +// Enum value maps for GetDefaultWorkspaceImageResponse_ImageSource. +var ( + GetDefaultWorkspaceImageResponse_ImageSource_name = map[int32]string{ + 0: "IMAGE_SOURCE_UNSPECIFIED", + 1: "IMAGE_SOURCE_INSTALLATION", + 2: "IMAGE_SOURCE_ORGANIZATION", + } + GetDefaultWorkspaceImageResponse_ImageSource_value = map[string]int32{ + "IMAGE_SOURCE_UNSPECIFIED": 0, + "IMAGE_SOURCE_INSTALLATION": 1, + "IMAGE_SOURCE_ORGANIZATION": 2, + } +) + +func (x GetDefaultWorkspaceImageResponse_ImageSource) Enum() *GetDefaultWorkspaceImageResponse_ImageSource { + p := new(GetDefaultWorkspaceImageResponse_ImageSource) + *p = x + return p +} + +func (x GetDefaultWorkspaceImageResponse_ImageSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GetDefaultWorkspaceImageResponse_ImageSource) Descriptor() protoreflect.EnumDescriptor { + return file_gitpod_experimental_v1_workspaces_proto_enumTypes[4].Descriptor() +} + +func (GetDefaultWorkspaceImageResponse_ImageSource) Type() protoreflect.EnumType { + return &file_gitpod_experimental_v1_workspaces_proto_enumTypes[4] +} + +func (x GetDefaultWorkspaceImageResponse_ImageSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GetDefaultWorkspaceImageResponse_ImageSource.Descriptor instead. +func (GetDefaultWorkspaceImageResponse_ImageSource) EnumDescriptor() ([]byte, []int) { + return file_gitpod_experimental_v1_workspaces_proto_rawDescGZIP(), []int{32, 0} +} + type ListWorkspacesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2175,6 +2226,110 @@ func (x *WorkspaceClass) GetIsDefault() bool { return false } +type GetDefaultWorkspaceImageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WorkspaceId *string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3,oneof" json:"workspace_id,omitempty"` +} + +func (x *GetDefaultWorkspaceImageRequest) Reset() { + *x = GetDefaultWorkspaceImageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDefaultWorkspaceImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDefaultWorkspaceImageRequest) ProtoMessage() {} + +func (x *GetDefaultWorkspaceImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDefaultWorkspaceImageRequest.ProtoReflect.Descriptor instead. +func (*GetDefaultWorkspaceImageRequest) Descriptor() ([]byte, []int) { + return file_gitpod_experimental_v1_workspaces_proto_rawDescGZIP(), []int{31} +} + +func (x *GetDefaultWorkspaceImageRequest) GetWorkspaceId() string { + if x != nil && x.WorkspaceId != nil { + return *x.WorkspaceId + } + return "" +} + +type GetDefaultWorkspaceImageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // image is the image ref + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + // source is the source of the image + Source GetDefaultWorkspaceImageResponse_ImageSource `protobuf:"varint,2,opt,name=source,proto3,enum=gitpod.experimental.v1.GetDefaultWorkspaceImageResponse_ImageSource" json:"source,omitempty"` +} + +func (x *GetDefaultWorkspaceImageResponse) Reset() { + *x = GetDefaultWorkspaceImageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDefaultWorkspaceImageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDefaultWorkspaceImageResponse) ProtoMessage() {} + +func (x *GetDefaultWorkspaceImageResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDefaultWorkspaceImageResponse.ProtoReflect.Descriptor instead. +func (*GetDefaultWorkspaceImageResponse) Descriptor() ([]byte, []int) { + return file_gitpod_experimental_v1_workspaces_proto_rawDescGZIP(), []int{32} +} + +func (x *GetDefaultWorkspaceImageResponse) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *GetDefaultWorkspaceImageResponse) GetSource() GetDefaultWorkspaceImageResponse_ImageSource { + if x != nil { + return x.Source + } + return GetDefaultWorkspaceImageResponse_IMAGE_SOURCE_UNSPECIFIED +} + // GitProvider describes the git provider type WorkspaceContext_GitProvider struct { state protoimpl.MessageState @@ -2190,7 +2345,7 @@ type WorkspaceContext_GitProvider struct { func (x *WorkspaceContext_GitProvider) Reset() { *x = WorkspaceContext_GitProvider{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[31] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2203,7 +2358,7 @@ func (x *WorkspaceContext_GitProvider) String() string { func (*WorkspaceContext_GitProvider) ProtoMessage() {} func (x *WorkspaceContext_GitProvider) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[31] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2246,7 +2401,7 @@ type WorkspaceContext_Repository struct { func (x *WorkspaceContext_Repository) Reset() { *x = WorkspaceContext_Repository{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[32] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2259,7 +2414,7 @@ func (x *WorkspaceContext_Repository) String() string { func (*WorkspaceContext_Repository) ProtoMessage() {} func (x *WorkspaceContext_Repository) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[32] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2304,7 +2459,7 @@ type WorkspaceContext_Git struct { func (x *WorkspaceContext_Git) Reset() { *x = WorkspaceContext_Git{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[33] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2317,7 +2472,7 @@ func (x *WorkspaceContext_Git) String() string { func (*WorkspaceContext_Git) ProtoMessage() {} func (x *WorkspaceContext_Git) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[33] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2370,7 +2525,7 @@ type WorkspaceContext_Prebuild struct { func (x *WorkspaceContext_Prebuild) Reset() { *x = WorkspaceContext_Prebuild{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[34] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2383,7 +2538,7 @@ func (x *WorkspaceContext_Prebuild) String() string { func (*WorkspaceContext_Prebuild) ProtoMessage() {} func (x *WorkspaceContext_Prebuild) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[34] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2425,7 +2580,7 @@ type WorkspaceContext_Snapshot struct { func (x *WorkspaceContext_Snapshot) Reset() { *x = WorkspaceContext_Snapshot{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[35] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2438,7 +2593,7 @@ func (x *WorkspaceContext_Snapshot) String() string { func (*WorkspaceContext_Snapshot) ProtoMessage() {} func (x *WorkspaceContext_Snapshot) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[35] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2482,7 +2637,7 @@ type WorkspaceInstanceStatus_Conditions struct { func (x *WorkspaceInstanceStatus_Conditions) Reset() { *x = WorkspaceInstanceStatus_Conditions{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[36] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2495,7 +2650,7 @@ func (x *WorkspaceInstanceStatus_Conditions) String() string { func (*WorkspaceInstanceStatus_Conditions) ProtoMessage() {} func (x *WorkspaceInstanceStatus_Conditions) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[36] + mi := &file_gitpod_experimental_v1_workspaces_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2874,7 +3029,29 @@ var file_gitpod_experimental_v1_workspaces_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2a, 0x5a, 0x0a, 0x0a, 0x50, 0x6f, 0x72, 0x74, 0x50, 0x6f, 0x6c, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x5a, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x88, 0x01, 0x01, + 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x22, 0x81, 0x02, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x5c, 0x0a, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x44, 0x2e, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x69, 0x0a, 0x0b, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x49, 0x4d, 0x41, + 0x47, 0x45, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4d, 0x41, 0x47, 0x45, + 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, + 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x5a, 0x0a, 0x0a, 0x50, 0x6f, 0x72, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, @@ -2893,7 +3070,7 @@ var file_gitpod_experimental_v1_workspaces_proto_rawDesc = []byte{ 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x56, 0x45, 0x52, 0x59, 0x4f, 0x4e, 0x45, - 0x10, 0x02, 0x32, 0xc3, 0x09, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x10, 0x02, 0x32, 0xd5, 0x0a, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, @@ -2969,12 +3146,21 @@ var file_gitpod_experimental_v1_workspaces_proto_rawDesc = []byte{ 0x1a, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x46, 0x5a, 0x44, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, - 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8f, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, + 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, + 0x6e, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x46, 0x5a, 0x44, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, + 0x67, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2989,112 +3175,118 @@ func file_gitpod_experimental_v1_workspaces_proto_rawDescGZIP() []byte { return file_gitpod_experimental_v1_workspaces_proto_rawDescData } -var file_gitpod_experimental_v1_workspaces_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_gitpod_experimental_v1_workspaces_proto_msgTypes = make([]protoimpl.MessageInfo, 37) +var file_gitpod_experimental_v1_workspaces_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_gitpod_experimental_v1_workspaces_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_gitpod_experimental_v1_workspaces_proto_goTypes = []interface{}{ - (PortPolicy)(0), // 0: gitpod.experimental.v1.PortPolicy - (PortProtocol)(0), // 1: gitpod.experimental.v1.PortProtocol - (AdmissionLevel)(0), // 2: gitpod.experimental.v1.AdmissionLevel - (WorkspaceInstanceStatus_Phase)(0), // 3: gitpod.experimental.v1.WorkspaceInstanceStatus.Phase - (*ListWorkspacesRequest)(nil), // 4: gitpod.experimental.v1.ListWorkspacesRequest - (*ListWorkspacesResponse)(nil), // 5: gitpod.experimental.v1.ListWorkspacesResponse - (*GetWorkspaceRequest)(nil), // 6: gitpod.experimental.v1.GetWorkspaceRequest - (*GetWorkspaceResponse)(nil), // 7: gitpod.experimental.v1.GetWorkspaceResponse - (*StreamWorkspaceStatusRequest)(nil), // 8: gitpod.experimental.v1.StreamWorkspaceStatusRequest - (*StreamWorkspaceStatusResponse)(nil), // 9: gitpod.experimental.v1.StreamWorkspaceStatusResponse - (*GetOwnerTokenRequest)(nil), // 10: gitpod.experimental.v1.GetOwnerTokenRequest - (*GetOwnerTokenResponse)(nil), // 11: gitpod.experimental.v1.GetOwnerTokenResponse - (*CreateAndStartWorkspaceRequest)(nil), // 12: gitpod.experimental.v1.CreateAndStartWorkspaceRequest - (*CreateAndStartWorkspaceResponse)(nil), // 13: gitpod.experimental.v1.CreateAndStartWorkspaceResponse - (*StartWorkspaceRequest)(nil), // 14: gitpod.experimental.v1.StartWorkspaceRequest - (*StartWorkspaceResponse)(nil), // 15: gitpod.experimental.v1.StartWorkspaceResponse - (*StopWorkspaceRequest)(nil), // 16: gitpod.experimental.v1.StopWorkspaceRequest - (*StopWorkspaceResponse)(nil), // 17: gitpod.experimental.v1.StopWorkspaceResponse - (*DeleteWorkspaceRequest)(nil), // 18: gitpod.experimental.v1.DeleteWorkspaceRequest - (*DeleteWorkspaceResponse)(nil), // 19: gitpod.experimental.v1.DeleteWorkspaceResponse - (*ListWorkspaceClassesRequest)(nil), // 20: gitpod.experimental.v1.ListWorkspaceClassesRequest - (*ListWorkspaceClassesResponse)(nil), // 21: gitpod.experimental.v1.ListWorkspaceClassesResponse - (*Workspace)(nil), // 22: gitpod.experimental.v1.Workspace - (*WorkspaceStatus)(nil), // 23: gitpod.experimental.v1.WorkspaceStatus - (*WorkspaceContext)(nil), // 24: gitpod.experimental.v1.WorkspaceContext - (*WorkspaceInstance)(nil), // 25: gitpod.experimental.v1.WorkspaceInstance - (*WorkspaceInstanceStatus)(nil), // 26: gitpod.experimental.v1.WorkspaceInstanceStatus - (*Port)(nil), // 27: gitpod.experimental.v1.Port - (*StartWorkspaceSpec)(nil), // 28: gitpod.experimental.v1.StartWorkspaceSpec - (*IDESettings)(nil), // 29: gitpod.experimental.v1.IDESettings - (*PortSpec)(nil), // 30: gitpod.experimental.v1.PortSpec - (*UpdatePortRequest)(nil), // 31: gitpod.experimental.v1.UpdatePortRequest - (*UpdatePortResponse)(nil), // 32: gitpod.experimental.v1.UpdatePortResponse - (*GitStatus)(nil), // 33: gitpod.experimental.v1.GitStatus - (*WorkspaceClass)(nil), // 34: gitpod.experimental.v1.WorkspaceClass - (*WorkspaceContext_GitProvider)(nil), // 35: gitpod.experimental.v1.WorkspaceContext.GitProvider - (*WorkspaceContext_Repository)(nil), // 36: gitpod.experimental.v1.WorkspaceContext.Repository - (*WorkspaceContext_Git)(nil), // 37: gitpod.experimental.v1.WorkspaceContext.Git - (*WorkspaceContext_Prebuild)(nil), // 38: gitpod.experimental.v1.WorkspaceContext.Prebuild - (*WorkspaceContext_Snapshot)(nil), // 39: gitpod.experimental.v1.WorkspaceContext.Snapshot - (*WorkspaceInstanceStatus_Conditions)(nil), // 40: gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions - (*Pagination)(nil), // 41: gitpod.experimental.v1.Pagination - (*fieldmaskpb.FieldMask)(nil), // 42: google.protobuf.FieldMask - (*timestamppb.Timestamp)(nil), // 43: google.protobuf.Timestamp + (PortPolicy)(0), // 0: gitpod.experimental.v1.PortPolicy + (PortProtocol)(0), // 1: gitpod.experimental.v1.PortProtocol + (AdmissionLevel)(0), // 2: gitpod.experimental.v1.AdmissionLevel + (WorkspaceInstanceStatus_Phase)(0), // 3: gitpod.experimental.v1.WorkspaceInstanceStatus.Phase + (GetDefaultWorkspaceImageResponse_ImageSource)(0), // 4: gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.ImageSource + (*ListWorkspacesRequest)(nil), // 5: gitpod.experimental.v1.ListWorkspacesRequest + (*ListWorkspacesResponse)(nil), // 6: gitpod.experimental.v1.ListWorkspacesResponse + (*GetWorkspaceRequest)(nil), // 7: gitpod.experimental.v1.GetWorkspaceRequest + (*GetWorkspaceResponse)(nil), // 8: gitpod.experimental.v1.GetWorkspaceResponse + (*StreamWorkspaceStatusRequest)(nil), // 9: gitpod.experimental.v1.StreamWorkspaceStatusRequest + (*StreamWorkspaceStatusResponse)(nil), // 10: gitpod.experimental.v1.StreamWorkspaceStatusResponse + (*GetOwnerTokenRequest)(nil), // 11: gitpod.experimental.v1.GetOwnerTokenRequest + (*GetOwnerTokenResponse)(nil), // 12: gitpod.experimental.v1.GetOwnerTokenResponse + (*CreateAndStartWorkspaceRequest)(nil), // 13: gitpod.experimental.v1.CreateAndStartWorkspaceRequest + (*CreateAndStartWorkspaceResponse)(nil), // 14: gitpod.experimental.v1.CreateAndStartWorkspaceResponse + (*StartWorkspaceRequest)(nil), // 15: gitpod.experimental.v1.StartWorkspaceRequest + (*StartWorkspaceResponse)(nil), // 16: gitpod.experimental.v1.StartWorkspaceResponse + (*StopWorkspaceRequest)(nil), // 17: gitpod.experimental.v1.StopWorkspaceRequest + (*StopWorkspaceResponse)(nil), // 18: gitpod.experimental.v1.StopWorkspaceResponse + (*DeleteWorkspaceRequest)(nil), // 19: gitpod.experimental.v1.DeleteWorkspaceRequest + (*DeleteWorkspaceResponse)(nil), // 20: gitpod.experimental.v1.DeleteWorkspaceResponse + (*ListWorkspaceClassesRequest)(nil), // 21: gitpod.experimental.v1.ListWorkspaceClassesRequest + (*ListWorkspaceClassesResponse)(nil), // 22: gitpod.experimental.v1.ListWorkspaceClassesResponse + (*Workspace)(nil), // 23: gitpod.experimental.v1.Workspace + (*WorkspaceStatus)(nil), // 24: gitpod.experimental.v1.WorkspaceStatus + (*WorkspaceContext)(nil), // 25: gitpod.experimental.v1.WorkspaceContext + (*WorkspaceInstance)(nil), // 26: gitpod.experimental.v1.WorkspaceInstance + (*WorkspaceInstanceStatus)(nil), // 27: gitpod.experimental.v1.WorkspaceInstanceStatus + (*Port)(nil), // 28: gitpod.experimental.v1.Port + (*StartWorkspaceSpec)(nil), // 29: gitpod.experimental.v1.StartWorkspaceSpec + (*IDESettings)(nil), // 30: gitpod.experimental.v1.IDESettings + (*PortSpec)(nil), // 31: gitpod.experimental.v1.PortSpec + (*UpdatePortRequest)(nil), // 32: gitpod.experimental.v1.UpdatePortRequest + (*UpdatePortResponse)(nil), // 33: gitpod.experimental.v1.UpdatePortResponse + (*GitStatus)(nil), // 34: gitpod.experimental.v1.GitStatus + (*WorkspaceClass)(nil), // 35: gitpod.experimental.v1.WorkspaceClass + (*GetDefaultWorkspaceImageRequest)(nil), // 36: gitpod.experimental.v1.GetDefaultWorkspaceImageRequest + (*GetDefaultWorkspaceImageResponse)(nil), // 37: gitpod.experimental.v1.GetDefaultWorkspaceImageResponse + (*WorkspaceContext_GitProvider)(nil), // 38: gitpod.experimental.v1.WorkspaceContext.GitProvider + (*WorkspaceContext_Repository)(nil), // 39: gitpod.experimental.v1.WorkspaceContext.Repository + (*WorkspaceContext_Git)(nil), // 40: gitpod.experimental.v1.WorkspaceContext.Git + (*WorkspaceContext_Prebuild)(nil), // 41: gitpod.experimental.v1.WorkspaceContext.Prebuild + (*WorkspaceContext_Snapshot)(nil), // 42: gitpod.experimental.v1.WorkspaceContext.Snapshot + (*WorkspaceInstanceStatus_Conditions)(nil), // 43: gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions + (*Pagination)(nil), // 44: gitpod.experimental.v1.Pagination + (*fieldmaskpb.FieldMask)(nil), // 45: google.protobuf.FieldMask + (*timestamppb.Timestamp)(nil), // 46: google.protobuf.Timestamp } var file_gitpod_experimental_v1_workspaces_proto_depIdxs = []int32{ - 41, // 0: gitpod.experimental.v1.ListWorkspacesRequest.pagination:type_name -> gitpod.experimental.v1.Pagination - 42, // 1: gitpod.experimental.v1.ListWorkspacesRequest.field_mask:type_name -> google.protobuf.FieldMask - 22, // 2: gitpod.experimental.v1.ListWorkspacesResponse.result:type_name -> gitpod.experimental.v1.Workspace - 22, // 3: gitpod.experimental.v1.GetWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace - 23, // 4: gitpod.experimental.v1.StreamWorkspaceStatusResponse.result:type_name -> gitpod.experimental.v1.WorkspaceStatus - 28, // 5: gitpod.experimental.v1.CreateAndStartWorkspaceRequest.start_spec:type_name -> gitpod.experimental.v1.StartWorkspaceSpec - 22, // 6: gitpod.experimental.v1.StartWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace - 22, // 7: gitpod.experimental.v1.StopWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace - 34, // 8: gitpod.experimental.v1.ListWorkspaceClassesResponse.result:type_name -> gitpod.experimental.v1.WorkspaceClass - 24, // 9: gitpod.experimental.v1.Workspace.context:type_name -> gitpod.experimental.v1.WorkspaceContext - 23, // 10: gitpod.experimental.v1.Workspace.status:type_name -> gitpod.experimental.v1.WorkspaceStatus - 25, // 11: gitpod.experimental.v1.WorkspaceStatus.instance:type_name -> gitpod.experimental.v1.WorkspaceInstance - 37, // 12: gitpod.experimental.v1.WorkspaceContext.git:type_name -> gitpod.experimental.v1.WorkspaceContext.Git - 38, // 13: gitpod.experimental.v1.WorkspaceContext.prebuild:type_name -> gitpod.experimental.v1.WorkspaceContext.Prebuild - 39, // 14: gitpod.experimental.v1.WorkspaceContext.snapshot:type_name -> gitpod.experimental.v1.WorkspaceContext.Snapshot - 43, // 15: gitpod.experimental.v1.WorkspaceInstance.created_at:type_name -> google.protobuf.Timestamp - 26, // 16: gitpod.experimental.v1.WorkspaceInstance.status:type_name -> gitpod.experimental.v1.WorkspaceInstanceStatus + 44, // 0: gitpod.experimental.v1.ListWorkspacesRequest.pagination:type_name -> gitpod.experimental.v1.Pagination + 45, // 1: gitpod.experimental.v1.ListWorkspacesRequest.field_mask:type_name -> google.protobuf.FieldMask + 23, // 2: gitpod.experimental.v1.ListWorkspacesResponse.result:type_name -> gitpod.experimental.v1.Workspace + 23, // 3: gitpod.experimental.v1.GetWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace + 24, // 4: gitpod.experimental.v1.StreamWorkspaceStatusResponse.result:type_name -> gitpod.experimental.v1.WorkspaceStatus + 29, // 5: gitpod.experimental.v1.CreateAndStartWorkspaceRequest.start_spec:type_name -> gitpod.experimental.v1.StartWorkspaceSpec + 23, // 6: gitpod.experimental.v1.StartWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace + 23, // 7: gitpod.experimental.v1.StopWorkspaceResponse.result:type_name -> gitpod.experimental.v1.Workspace + 35, // 8: gitpod.experimental.v1.ListWorkspaceClassesResponse.result:type_name -> gitpod.experimental.v1.WorkspaceClass + 25, // 9: gitpod.experimental.v1.Workspace.context:type_name -> gitpod.experimental.v1.WorkspaceContext + 24, // 10: gitpod.experimental.v1.Workspace.status:type_name -> gitpod.experimental.v1.WorkspaceStatus + 26, // 11: gitpod.experimental.v1.WorkspaceStatus.instance:type_name -> gitpod.experimental.v1.WorkspaceInstance + 40, // 12: gitpod.experimental.v1.WorkspaceContext.git:type_name -> gitpod.experimental.v1.WorkspaceContext.Git + 41, // 13: gitpod.experimental.v1.WorkspaceContext.prebuild:type_name -> gitpod.experimental.v1.WorkspaceContext.Prebuild + 42, // 14: gitpod.experimental.v1.WorkspaceContext.snapshot:type_name -> gitpod.experimental.v1.WorkspaceContext.Snapshot + 46, // 15: gitpod.experimental.v1.WorkspaceInstance.created_at:type_name -> google.protobuf.Timestamp + 27, // 16: gitpod.experimental.v1.WorkspaceInstance.status:type_name -> gitpod.experimental.v1.WorkspaceInstanceStatus 3, // 17: gitpod.experimental.v1.WorkspaceInstanceStatus.phase:type_name -> gitpod.experimental.v1.WorkspaceInstanceStatus.Phase - 40, // 18: gitpod.experimental.v1.WorkspaceInstanceStatus.conditions:type_name -> gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions + 43, // 18: gitpod.experimental.v1.WorkspaceInstanceStatus.conditions:type_name -> gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions 2, // 19: gitpod.experimental.v1.WorkspaceInstanceStatus.admission:type_name -> gitpod.experimental.v1.AdmissionLevel - 27, // 20: gitpod.experimental.v1.WorkspaceInstanceStatus.ports:type_name -> gitpod.experimental.v1.Port - 33, // 21: gitpod.experimental.v1.WorkspaceInstanceStatus.git_status:type_name -> gitpod.experimental.v1.GitStatus + 28, // 20: gitpod.experimental.v1.WorkspaceInstanceStatus.ports:type_name -> gitpod.experimental.v1.Port + 34, // 21: gitpod.experimental.v1.WorkspaceInstanceStatus.git_status:type_name -> gitpod.experimental.v1.GitStatus 0, // 22: gitpod.experimental.v1.Port.policy:type_name -> gitpod.experimental.v1.PortPolicy 1, // 23: gitpod.experimental.v1.Port.protocol:type_name -> gitpod.experimental.v1.PortProtocol - 29, // 24: gitpod.experimental.v1.StartWorkspaceSpec.ide_settings:type_name -> gitpod.experimental.v1.IDESettings + 30, // 24: gitpod.experimental.v1.StartWorkspaceSpec.ide_settings:type_name -> gitpod.experimental.v1.IDESettings 0, // 25: gitpod.experimental.v1.PortSpec.policy:type_name -> gitpod.experimental.v1.PortPolicy 1, // 26: gitpod.experimental.v1.PortSpec.protocol:type_name -> gitpod.experimental.v1.PortProtocol - 30, // 27: gitpod.experimental.v1.UpdatePortRequest.port:type_name -> gitpod.experimental.v1.PortSpec - 36, // 28: gitpod.experimental.v1.WorkspaceContext.Git.repository:type_name -> gitpod.experimental.v1.WorkspaceContext.Repository - 35, // 29: gitpod.experimental.v1.WorkspaceContext.Git.provider:type_name -> gitpod.experimental.v1.WorkspaceContext.GitProvider - 37, // 30: gitpod.experimental.v1.WorkspaceContext.Prebuild.original_context:type_name -> gitpod.experimental.v1.WorkspaceContext.Git - 43, // 31: gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions.first_user_activity:type_name -> google.protobuf.Timestamp - 4, // 32: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:input_type -> gitpod.experimental.v1.ListWorkspacesRequest - 6, // 33: gitpod.experimental.v1.WorkspacesService.GetWorkspace:input_type -> gitpod.experimental.v1.GetWorkspaceRequest - 8, // 34: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:input_type -> gitpod.experimental.v1.StreamWorkspaceStatusRequest - 10, // 35: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:input_type -> gitpod.experimental.v1.GetOwnerTokenRequest - 12, // 36: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:input_type -> gitpod.experimental.v1.CreateAndStartWorkspaceRequest - 14, // 37: gitpod.experimental.v1.WorkspacesService.StartWorkspace:input_type -> gitpod.experimental.v1.StartWorkspaceRequest - 16, // 38: gitpod.experimental.v1.WorkspacesService.StopWorkspace:input_type -> gitpod.experimental.v1.StopWorkspaceRequest - 18, // 39: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:input_type -> gitpod.experimental.v1.DeleteWorkspaceRequest - 31, // 40: gitpod.experimental.v1.WorkspacesService.UpdatePort:input_type -> gitpod.experimental.v1.UpdatePortRequest - 20, // 41: gitpod.experimental.v1.WorkspacesService.ListWorkspaceClasses:input_type -> gitpod.experimental.v1.ListWorkspaceClassesRequest - 5, // 42: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:output_type -> gitpod.experimental.v1.ListWorkspacesResponse - 7, // 43: gitpod.experimental.v1.WorkspacesService.GetWorkspace:output_type -> gitpod.experimental.v1.GetWorkspaceResponse - 9, // 44: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:output_type -> gitpod.experimental.v1.StreamWorkspaceStatusResponse - 11, // 45: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:output_type -> gitpod.experimental.v1.GetOwnerTokenResponse - 13, // 46: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:output_type -> gitpod.experimental.v1.CreateAndStartWorkspaceResponse - 15, // 47: gitpod.experimental.v1.WorkspacesService.StartWorkspace:output_type -> gitpod.experimental.v1.StartWorkspaceResponse - 17, // 48: gitpod.experimental.v1.WorkspacesService.StopWorkspace:output_type -> gitpod.experimental.v1.StopWorkspaceResponse - 19, // 49: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:output_type -> gitpod.experimental.v1.DeleteWorkspaceResponse - 32, // 50: gitpod.experimental.v1.WorkspacesService.UpdatePort:output_type -> gitpod.experimental.v1.UpdatePortResponse - 21, // 51: gitpod.experimental.v1.WorkspacesService.ListWorkspaceClasses:output_type -> gitpod.experimental.v1.ListWorkspaceClassesResponse - 42, // [42:52] is the sub-list for method output_type - 32, // [32:42] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 31, // 27: gitpod.experimental.v1.UpdatePortRequest.port:type_name -> gitpod.experimental.v1.PortSpec + 4, // 28: gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.source:type_name -> gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.ImageSource + 39, // 29: gitpod.experimental.v1.WorkspaceContext.Git.repository:type_name -> gitpod.experimental.v1.WorkspaceContext.Repository + 38, // 30: gitpod.experimental.v1.WorkspaceContext.Git.provider:type_name -> gitpod.experimental.v1.WorkspaceContext.GitProvider + 40, // 31: gitpod.experimental.v1.WorkspaceContext.Prebuild.original_context:type_name -> gitpod.experimental.v1.WorkspaceContext.Git + 46, // 32: gitpod.experimental.v1.WorkspaceInstanceStatus.Conditions.first_user_activity:type_name -> google.protobuf.Timestamp + 5, // 33: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:input_type -> gitpod.experimental.v1.ListWorkspacesRequest + 7, // 34: gitpod.experimental.v1.WorkspacesService.GetWorkspace:input_type -> gitpod.experimental.v1.GetWorkspaceRequest + 9, // 35: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:input_type -> gitpod.experimental.v1.StreamWorkspaceStatusRequest + 11, // 36: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:input_type -> gitpod.experimental.v1.GetOwnerTokenRequest + 13, // 37: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:input_type -> gitpod.experimental.v1.CreateAndStartWorkspaceRequest + 15, // 38: gitpod.experimental.v1.WorkspacesService.StartWorkspace:input_type -> gitpod.experimental.v1.StartWorkspaceRequest + 17, // 39: gitpod.experimental.v1.WorkspacesService.StopWorkspace:input_type -> gitpod.experimental.v1.StopWorkspaceRequest + 19, // 40: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:input_type -> gitpod.experimental.v1.DeleteWorkspaceRequest + 32, // 41: gitpod.experimental.v1.WorkspacesService.UpdatePort:input_type -> gitpod.experimental.v1.UpdatePortRequest + 21, // 42: gitpod.experimental.v1.WorkspacesService.ListWorkspaceClasses:input_type -> gitpod.experimental.v1.ListWorkspaceClassesRequest + 36, // 43: gitpod.experimental.v1.WorkspacesService.GetDefaultWorkspaceImage:input_type -> gitpod.experimental.v1.GetDefaultWorkspaceImageRequest + 6, // 44: gitpod.experimental.v1.WorkspacesService.ListWorkspaces:output_type -> gitpod.experimental.v1.ListWorkspacesResponse + 8, // 45: gitpod.experimental.v1.WorkspacesService.GetWorkspace:output_type -> gitpod.experimental.v1.GetWorkspaceResponse + 10, // 46: gitpod.experimental.v1.WorkspacesService.StreamWorkspaceStatus:output_type -> gitpod.experimental.v1.StreamWorkspaceStatusResponse + 12, // 47: gitpod.experimental.v1.WorkspacesService.GetOwnerToken:output_type -> gitpod.experimental.v1.GetOwnerTokenResponse + 14, // 48: gitpod.experimental.v1.WorkspacesService.CreateAndStartWorkspace:output_type -> gitpod.experimental.v1.CreateAndStartWorkspaceResponse + 16, // 49: gitpod.experimental.v1.WorkspacesService.StartWorkspace:output_type -> gitpod.experimental.v1.StartWorkspaceResponse + 18, // 50: gitpod.experimental.v1.WorkspacesService.StopWorkspace:output_type -> gitpod.experimental.v1.StopWorkspaceResponse + 20, // 51: gitpod.experimental.v1.WorkspacesService.DeleteWorkspace:output_type -> gitpod.experimental.v1.DeleteWorkspaceResponse + 33, // 52: gitpod.experimental.v1.WorkspacesService.UpdatePort:output_type -> gitpod.experimental.v1.UpdatePortResponse + 22, // 53: gitpod.experimental.v1.WorkspacesService.ListWorkspaceClasses:output_type -> gitpod.experimental.v1.ListWorkspaceClassesResponse + 37, // 54: gitpod.experimental.v1.WorkspacesService.GetDefaultWorkspaceImage:output_type -> gitpod.experimental.v1.GetDefaultWorkspaceImageResponse + 44, // [44:55] is the sub-list for method output_type + 33, // [33:44] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name } func init() { file_gitpod_experimental_v1_workspaces_proto_init() } @@ -3477,7 +3669,7 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceContext_GitProvider); i { + switch v := v.(*GetDefaultWorkspaceImageRequest); i { case 0: return &v.state case 1: @@ -3489,7 +3681,7 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceContext_Repository); i { + switch v := v.(*GetDefaultWorkspaceImageResponse); i { case 0: return &v.state case 1: @@ -3501,7 +3693,7 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceContext_Git); i { + switch v := v.(*WorkspaceContext_GitProvider); i { case 0: return &v.state case 1: @@ -3513,7 +3705,7 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceContext_Prebuild); i { + switch v := v.(*WorkspaceContext_Repository); i { case 0: return &v.state case 1: @@ -3525,7 +3717,7 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceContext_Snapshot); i { + switch v := v.(*WorkspaceContext_Git); i { case 0: return &v.state case 1: @@ -3537,6 +3729,30 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { } } file_gitpod_experimental_v1_workspaces_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceContext_Prebuild); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_experimental_v1_workspaces_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceContext_Snapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_experimental_v1_workspaces_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorkspaceInstanceStatus_Conditions); i { case 0: return &v.state @@ -3558,14 +3774,15 @@ func file_gitpod_experimental_v1_workspaces_proto_init() { (*WorkspaceContext_Prebuild_)(nil), (*WorkspaceContext_Snapshot_)(nil), } - file_gitpod_experimental_v1_workspaces_proto_msgTypes[36].OneofWrappers = []interface{}{} + file_gitpod_experimental_v1_workspaces_proto_msgTypes[31].OneofWrappers = []interface{}{} + file_gitpod_experimental_v1_workspaces_proto_msgTypes[38].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_experimental_v1_workspaces_proto_rawDesc, - NumEnums: 4, - NumMessages: 37, + NumEnums: 5, + NumMessages: 39, NumExtensions: 0, NumServices: 1, }, diff --git a/components/public-api/go/experimental/v1/workspaces_grpc.pb.go b/components/public-api/go/experimental/v1/workspaces_grpc.pb.go index 30b683d8ddd42e..962b3a8b55a71c 100644 --- a/components/public-api/go/experimental/v1/workspaces_grpc.pb.go +++ b/components/public-api/go/experimental/v1/workspaces_grpc.pb.go @@ -51,6 +51,8 @@ type WorkspacesServiceClient interface { UpdatePort(ctx context.Context, in *UpdatePortRequest, opts ...grpc.CallOption) (*UpdatePortResponse, error) // ListWorkspaceClasses enumerates all available workspace classes. ListWorkspaceClasses(ctx context.Context, in *ListWorkspaceClassesRequest, opts ...grpc.CallOption) (*ListWorkspaceClassesResponse, error) + // GetDefaultWorkspaceImage returns the default workspace image from different sources. + GetDefaultWorkspaceImage(ctx context.Context, in *GetDefaultWorkspaceImageRequest, opts ...grpc.CallOption) (*GetDefaultWorkspaceImageResponse, error) } type workspacesServiceClient struct { @@ -174,6 +176,15 @@ func (c *workspacesServiceClient) ListWorkspaceClasses(ctx context.Context, in * return out, nil } +func (c *workspacesServiceClient) GetDefaultWorkspaceImage(ctx context.Context, in *GetDefaultWorkspaceImageRequest, opts ...grpc.CallOption) (*GetDefaultWorkspaceImageResponse, error) { + out := new(GetDefaultWorkspaceImageResponse) + err := c.cc.Invoke(ctx, "/gitpod.experimental.v1.WorkspacesService/GetDefaultWorkspaceImage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // WorkspacesServiceServer is the server API for WorkspacesService service. // All implementations must embed UnimplementedWorkspacesServiceServer // for forward compatibility @@ -203,6 +214,8 @@ type WorkspacesServiceServer interface { UpdatePort(context.Context, *UpdatePortRequest) (*UpdatePortResponse, error) // ListWorkspaceClasses enumerates all available workspace classes. ListWorkspaceClasses(context.Context, *ListWorkspaceClassesRequest) (*ListWorkspaceClassesResponse, error) + // GetDefaultWorkspaceImage returns the default workspace image from different sources. + GetDefaultWorkspaceImage(context.Context, *GetDefaultWorkspaceImageRequest) (*GetDefaultWorkspaceImageResponse, error) mustEmbedUnimplementedWorkspacesServiceServer() } @@ -240,6 +253,9 @@ func (UnimplementedWorkspacesServiceServer) UpdatePort(context.Context, *UpdateP func (UnimplementedWorkspacesServiceServer) ListWorkspaceClasses(context.Context, *ListWorkspaceClassesRequest) (*ListWorkspaceClassesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListWorkspaceClasses not implemented") } +func (UnimplementedWorkspacesServiceServer) GetDefaultWorkspaceImage(context.Context, *GetDefaultWorkspaceImageRequest) (*GetDefaultWorkspaceImageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDefaultWorkspaceImage not implemented") +} func (UnimplementedWorkspacesServiceServer) mustEmbedUnimplementedWorkspacesServiceServer() {} // UnsafeWorkspacesServiceServer may be embedded to opt out of forward compatibility for this service. @@ -436,6 +452,24 @@ func _WorkspacesService_ListWorkspaceClasses_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +func _WorkspacesService_GetDefaultWorkspaceImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDefaultWorkspaceImageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkspacesServiceServer).GetDefaultWorkspaceImage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.experimental.v1.WorkspacesService/GetDefaultWorkspaceImage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkspacesServiceServer).GetDefaultWorkspaceImage(ctx, req.(*GetDefaultWorkspaceImageRequest)) + } + return interceptor(ctx, in, info, handler) +} + // WorkspacesService_ServiceDesc is the grpc.ServiceDesc for WorkspacesService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -479,6 +513,10 @@ var WorkspacesService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListWorkspaceClasses", Handler: _WorkspacesService_ListWorkspaceClasses_Handler, }, + { + MethodName: "GetDefaultWorkspaceImage", + Handler: _WorkspacesService_GetDefaultWorkspaceImage_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/components/public-api/typescript/src/gitpod/experimental/v1/dummy_pb.ts b/components/public-api/typescript/src/gitpod/experimental/v1/dummy_pb.ts index 7f3f712efc15ab..92a7d3e3604b4f 100644 --- a/components/public-api/typescript/src/gitpod/experimental/v1/dummy_pb.ts +++ b/components/public-api/typescript/src/gitpod/experimental/v1/dummy_pb.ts @@ -16,11 +16,6 @@ import {Message, proto3} from "@bufbuild/protobuf"; * @generated from message gitpod.experimental.v1.SayHelloRequest */ export class SayHelloRequest extends Message { - /** - * @generated from field: string greeting = 1; - */ - greeting = ""; - constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -29,7 +24,6 @@ export class SayHelloRequest extends Message { static readonly runtime = proto3; static readonly typeName = "gitpod.experimental.v1.SayHelloRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "greeting", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SayHelloRequest { @@ -91,12 +85,7 @@ export class SayHelloResponse extends Message { */ export class LotsOfRepliesRequest extends Message { /** - * @generated from field: string greeting = 1; - */ - greeting = ""; - - /** - * @generated from field: int32 previous_count = 2; + * @generated from field: int32 previous_count = 1; */ previousCount = 0; @@ -108,8 +97,7 @@ export class LotsOfRepliesRequest extends Message { static readonly runtime = proto3; static readonly typeName = "gitpod.experimental.v1.LotsOfRepliesRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "greeting", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "previous_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 1, name: "previous_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LotsOfRepliesRequest { diff --git a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts index cd65613f93d136..9333b4b2c02a5e 100644 --- a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts +++ b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_connectweb.ts @@ -9,7 +9,7 @@ /* eslint-disable */ /* @ts-nocheck */ -import {CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, GetOwnerTokenRequest, GetOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspaceClassesRequest, ListWorkspaceClassesResponse, ListWorkspacesRequest, ListWorkspacesResponse, StartWorkspaceRequest, StartWorkspaceResponse, StopWorkspaceRequest, StopWorkspaceResponse, StreamWorkspaceStatusRequest, StreamWorkspaceStatusResponse, UpdatePortRequest, UpdatePortResponse} from "./workspaces_pb.js"; +import {CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, GetDefaultWorkspaceImageRequest, GetDefaultWorkspaceImageResponse, GetOwnerTokenRequest, GetOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspaceClassesRequest, ListWorkspaceClassesResponse, ListWorkspacesRequest, ListWorkspacesResponse, StartWorkspaceRequest, StartWorkspaceResponse, StopWorkspaceRequest, StopWorkspaceResponse, StreamWorkspaceStatusRequest, StreamWorkspaceStatusResponse, UpdatePortRequest, UpdatePortResponse} from "./workspaces_pb.js"; import {MethodKind} from "@bufbuild/protobuf"; /** @@ -131,5 +131,16 @@ export const WorkspacesService = { O: ListWorkspaceClassesResponse, kind: MethodKind.Unary, }, + /** + * GetDefaultWorkspaceImage returns the default workspace image from different sources. + * + * @generated from rpc gitpod.experimental.v1.WorkspacesService.GetDefaultWorkspaceImage + */ + getDefaultWorkspaceImage: { + name: "GetDefaultWorkspaceImage", + I: GetDefaultWorkspaceImageRequest, + O: GetDefaultWorkspaceImageResponse, + kind: MethodKind.Unary, + }, } } as const; diff --git a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_pb.ts b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_pb.ts index 8af2eed41b7d90..536c08ce394391 100644 --- a/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_pb.ts +++ b/components/public-api/typescript/src/gitpod/experimental/v1/workspaces_pb.ts @@ -2024,3 +2024,117 @@ export class WorkspaceClass extends Message { return proto3.util.equals(WorkspaceClass, a, b); } } + +/** + * @generated from message gitpod.experimental.v1.GetDefaultWorkspaceImageRequest + */ +export class GetDefaultWorkspaceImageRequest extends Message { + /** + * @generated from field: optional string workspace_id = 1; + */ + workspaceId?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime = proto3; + static readonly typeName = "gitpod.experimental.v1.GetDefaultWorkspaceImageRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDefaultWorkspaceImageRequest { + return new GetDefaultWorkspaceImageRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDefaultWorkspaceImageRequest { + return new GetDefaultWorkspaceImageRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDefaultWorkspaceImageRequest { + return new GetDefaultWorkspaceImageRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDefaultWorkspaceImageRequest | PlainMessage | undefined, b: GetDefaultWorkspaceImageRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDefaultWorkspaceImageRequest, a, b); + } +} + +/** + * @generated from message gitpod.experimental.v1.GetDefaultWorkspaceImageResponse + */ +export class GetDefaultWorkspaceImageResponse extends Message { + /** + * image is the image ref + * + * @generated from field: string image = 1; + */ + image = ""; + + /** + * source is the source of the image + * + * @generated from field: gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.ImageSource source = 2; + */ + source = GetDefaultWorkspaceImageResponse_ImageSource.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime = proto3; + static readonly typeName = "gitpod.experimental.v1.GetDefaultWorkspaceImageResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "source", kind: "enum", T: proto3.getEnumType(GetDefaultWorkspaceImageResponse_ImageSource) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDefaultWorkspaceImageResponse { + return new GetDefaultWorkspaceImageResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDefaultWorkspaceImageResponse { + return new GetDefaultWorkspaceImageResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDefaultWorkspaceImageResponse { + return new GetDefaultWorkspaceImageResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetDefaultWorkspaceImageResponse | PlainMessage | undefined, b: GetDefaultWorkspaceImageResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDefaultWorkspaceImageResponse, a, b); + } +} + +/** + * @generated from enum gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.ImageSource + */ +export enum GetDefaultWorkspaceImageResponse_ImageSource { + /** + * @generated from enum value: IMAGE_SOURCE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * IMAGE_SOURCE_INSTALLATION means the image from Gitpod instance install config + * + * @generated from enum value: IMAGE_SOURCE_INSTALLATION = 1; + */ + INSTALLATION = 1, + + /** + * IMAGE_SOURCE_ORGANIZATION means the image from Organization settings + * + * @generated from enum value: IMAGE_SOURCE_ORGANIZATION = 2; + */ + ORGANIZATION = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(GetDefaultWorkspaceImageResponse_ImageSource) +proto3.util.setEnumType(GetDefaultWorkspaceImageResponse_ImageSource, "gitpod.experimental.v1.GetDefaultWorkspaceImageResponse.ImageSource", [ + { no: 0, name: "IMAGE_SOURCE_UNSPECIFIED" }, + { no: 1, name: "IMAGE_SOURCE_INSTALLATION" }, + { no: 2, name: "IMAGE_SOURCE_ORGANIZATION" }, +]); diff --git a/components/server/src/api/workspaces.ts b/components/server/src/api/workspaces.ts index b5760f28030515..0b629fae7ea552 100644 --- a/components/server/src/api/workspaces.ts +++ b/components/server/src/api/workspaces.ts @@ -27,6 +27,8 @@ import { UpdatePortResponse, ListWorkspaceClassesRequest, ListWorkspaceClassesResponse, + GetDefaultWorkspaceImageRequest, + GetDefaultWorkspaceImageResponse, } from "@gitpod/public-api/lib/gitpod/experimental/v1"; @injectable() @@ -71,4 +73,8 @@ export class APIWorkspacesService implements ServiceImpl { throw new ConnectError("unimplemented", Code.Unimplemented); } + + async getDefaultWorkspaceImage(req: GetDefaultWorkspaceImageRequest): Promise { + throw new ConnectError("unimplemented", Code.Unimplemented); + } } diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 878ef3970eeaab..fc3d01c7d39170 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -68,6 +68,8 @@ import { WorkspaceInstanceRepoStatus, GetProviderRepositoriesParams, SuggestedRepository, + GetDefaultWorkspaceImageParams, + GetDefaultWorkspaceImageResult, } from "@gitpod/gitpod-protocol"; import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; import { @@ -2518,10 +2520,26 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { return this.organizationService.updateSettings(user.id, orgId, settings); } - async getDefaultWorkspaceImage(ctx: TraceContextWithSpan): Promise { - const userId = this.userID; - traceAPIParams(ctx, { userId }); - return this.config.workspaceDefaults.workspaceImage; + async getDefaultWorkspaceImage( + ctx: TraceContextWithSpan, + params: GetDefaultWorkspaceImageParams, + ): Promise { + const user = await this.checkAndBlockUser("getDefaultWorkspaceImage"); + traceAPIParams(ctx, { params, userId: user.id }); + if (params.workspaceId) { + const workspace = await this.getWorkspace(ctx, params.workspaceId); + const orgSettings = await this.organizationService.getSettings(user.id, workspace.workspace.organizationId); + if (orgSettings.defaultWorkspaceImage) { + return { + image: orgSettings.defaultWorkspaceImage, + source: "organization", + }; + } + } + return { + image: this.config.workspaceDefaults.workspaceImage, + source: "installation", + }; } public async getTeamProjects(ctx: TraceContext, teamId: string): Promise { diff --git a/components/server/src/workspace/workspace-service.ts b/components/server/src/workspace/workspace-service.ts index 7f756900cb6f35..39f55f7364b888 100644 --- a/components/server/src/workspace/workspace-service.ts +++ b/components/server/src/workspace/workspace-service.ts @@ -901,7 +901,7 @@ export class WorkspaceService { public async resolveBaseImage(ctx: TraceContext, user: User, imageRef: string) { try { - return this.workspaceStarter.resolveBaseImage(ctx, user, imageRef); + return await this.workspaceStarter.resolveBaseImage(ctx, user, imageRef); } catch (e) { // we could map proper response message according to e.code // see https://github.com/gitpod-io/gitpod/blob/ef95e6f3ca0bf314c40da1b83251423c2208d175/components/image-builder-mk3/pkg/orchestrator/orchestrator_test.go#L178 diff --git a/components/supervisor/pkg/serverapi/publicapi.go b/components/supervisor/pkg/serverapi/publicapi.go index c8eede34d7f80e..330615ab963674 100644 --- a/components/supervisor/pkg/serverapi/publicapi.go +++ b/components/supervisor/pkg/serverapi/publicapi.go @@ -34,6 +34,7 @@ type APIInterface interface { OpenPort(ctx context.Context, port *gitpod.WorkspaceInstancePort) (res *gitpod.WorkspaceInstancePort, err error) UpdateGitStatus(ctx context.Context, status *gitpod.WorkspaceInstanceRepoStatus) (err error) WorkspaceUpdates(ctx context.Context) (<-chan *gitpod.WorkspaceInstance, error) + GetDefaultWorkspaceImage(ctx context.Context) (string, error) // Metrics RegisterMetrics(registry *prometheus.Registry) error @@ -302,6 +303,36 @@ func (s *Service) OpenPort(ctx context.Context, port *gitpod.WorkspaceInstancePo return port, nil } +func (s *Service) GetDefaultWorkspaceImage(ctx context.Context) (image string, err error) { + startTime := time.Now() + usePublicApi := s.usePublicAPI(ctx) + defer func() { + s.apiMetrics.ProcessMetrics(usePublicApi, "GetDefaultWorkspaceImage", nil, startTime) + }() + if s == nil { + return "", errNotConnected + } + workspaceID := s.cfg.WorkspaceID + if !usePublicApi { + resp, err := s.gitpodService.GetDefaultWorkspaceImage(ctx, &gitpod.GetDefaultWorkspaceImageParams{ + WorkspaceID: workspaceID, + }) + if err != nil { + return "", err + } + return resp.Image, nil + } + service := v1.NewWorkspacesServiceClient(s.publicAPIConn) + resp, err := service.GetDefaultWorkspaceImage(ctx, &v1.GetDefaultWorkspaceImageRequest{ + WorkspaceId: &workspaceID, + }) + if err != nil { + log.WithField("method", "GetDefaultWorkspaceImage").WithError(err).Error("failed to call PublicAPI") + return "", err + } + return resp.Image, nil +} + // onWorkspaceUpdates listen to server and public API workspaceUpdates and publish to subscribers once Service created. func (s *Service) onWorkspaceUpdates(ctx context.Context) { errChan := make(chan error) diff --git a/components/supervisor/pkg/supervisor/services.go b/components/supervisor/pkg/supervisor/services.go index 3b6bfaf40774ac..2afef392ecdfab 100644 --- a/components/supervisor/pkg/supervisor/services.go +++ b/components/supervisor/pkg/supervisor/services.go @@ -27,6 +27,7 @@ import ( csapi "github.com/gitpod-io/gitpod/content-service/api" "github.com/gitpod-io/gitpod/supervisor/api" "github.com/gitpod-io/gitpod/supervisor/pkg/ports" + "github.com/gitpod-io/gitpod/supervisor/pkg/serverapi" ) // RegisterableService can register a service. @@ -641,8 +642,9 @@ func (rt *remoteTokenProvider) GetToken(ctx context.Context, req *api.GetTokenRe // InfoService implements the api.InfoService. type InfoService struct { - cfg *Config - ContentState ContentState + cfg *Config + ContentState ContentState + GitpodService serverapi.APIInterface api.UnimplementedInfoServiceServer } @@ -658,11 +660,14 @@ func (is *InfoService) RegisterREST(mux *runtime.ServeMux, grpcEndpoint string) } // WorkspaceInfo provides information about the workspace. -func (is *InfoService) WorkspaceInfo(context.Context, *api.WorkspaceInfoRequest) (*api.WorkspaceInfoResponse, error) { - defaultWorkspaceImage := is.cfg.DefaultWorkspaceImage - if defaultWorkspaceImage == "" { +func (is *InfoService) WorkspaceInfo(ctx context.Context, req *api.WorkspaceInfoRequest) (*api.WorkspaceInfoResponse, error) { + defaultWorkspaceImage, err := is.GitpodService.GetDefaultWorkspaceImage(ctx) + if err != nil { // TODO: delete-me, added for compatibility before server is deployed / rollback - defaultWorkspaceImage = "gitpod/workspace-full:latest" + defaultWorkspaceImage = is.cfg.DefaultWorkspaceImage + if defaultWorkspaceImage == "" { + defaultWorkspaceImage = "gitpod/workspace-full:latest" + } } resp := &api.WorkspaceInfoResponse{ CheckoutLocation: is.cfg.RepoRoot, diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index 917aadfbf454ce..87a09edd38480e 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -383,7 +383,7 @@ func Run(options ...RunOption) { termMuxSrv, RegistrableTokenService{Service: tokenService}, notificationService, - &InfoService{cfg: cfg, ContentState: cstate}, + &InfoService{cfg: cfg, ContentState: cstate, GitpodService: gitpodService}, &ControlService{portsManager: portMgmt}, &portService{portsManager: portMgmt}, }