Skip to content

Commit

Permalink
Add ExposedPorts message and remove Target and GlobalPort
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Nov 5, 2021
1 parent 5454cac commit a30a1bf
Show file tree
Hide file tree
Showing 49 changed files with 855 additions and 777 deletions.
2 changes: 1 addition & 1 deletion components/content-service-api/go/blobs.pb.go

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

2 changes: 1 addition & 1 deletion components/content-service-api/go/content.pb.go

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

2 changes: 1 addition & 1 deletion components/content-service-api/go/headless-log.pb.go

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

2 changes: 1 addition & 1 deletion components/content-service-api/go/ideplugin.pb.go

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

2 changes: 1 addition & 1 deletion components/content-service-api/go/initializer.pb.go

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

2 changes: 1 addition & 1 deletion components/content-service-api/go/workspace.pb.go

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

8 changes: 7 additions & 1 deletion components/content-service-api/typescript/src/blobs_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.contentservice.DeleteRequest', null, global);
goog.exportSymbol('proto.contentservice.DeleteRequest.NameCase', null, global);
Expand Down
8 changes: 7 additions & 1 deletion components/content-service-api/typescript/src/content_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.contentservice.DeleteUserContentRequest', null, global);
goog.exportSymbol('proto.contentservice.DeleteUserContentResponse', null, global);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.contentservice.ListLogsRequest', null, global);
goog.exportSymbol('proto.contentservice.ListLogsResponse', null, global);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.ideplugin.PluginDownloadURLRequest', null, global);
goog.exportSymbol('proto.ideplugin.PluginDownloadURLResponse', null, global);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.contentservice.CloneTargetMode', null, global);
goog.exportSymbol('proto.contentservice.CompositeInitializer', null, global);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

goog.exportSymbol('proto.contentservice.DeleteWorkspaceRequest', null, global);
goog.exportSymbol('proto.contentservice.DeleteWorkspaceResponse', null, global);
Expand Down
2 changes: 0 additions & 2 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,6 @@ type WorkspaceInstanceConditions struct {
FirstUserActivity string `json:"firstUserActivity,omitempty"`
NeededImageBuild bool `json:"neededImageBuild,omitempty"`
PullingImages bool `json:"pullingImages,omitempty"`
ServiceExists bool `json:"serviceExists,omitempty"`
Timeout string `json:"timeout,omitempty"`
}

Expand Down Expand Up @@ -1795,7 +1794,6 @@ type GetWorkspaceTimeoutResult struct {
// WorkspaceInstancePort is the WorkspaceInstancePort message type
type WorkspaceInstancePort struct {
Port float64 `json:"port,omitempty"`
TargetPort float64 `json:"targetPort,omitempty"`
URL string `json:"url,omitempty"`
Visibility string `json:"visibility,omitempty"`
}
Expand Down
6 changes: 0 additions & 6 deletions components/gitpod-protocol/src/workspace-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ export interface WorkspaceInstanceConditions {
// PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
pullingImages?: boolean

// ServiceExists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist.
serviceExists?: boolean

// deployed marks that a workspace instance was sent/deployed at a workspace manager
deployed?: boolean;

Expand Down Expand Up @@ -164,9 +161,6 @@ export interface WorkspaceInstancePort {
// The outward-facing port number
port: number;

// An optional inward-facing port number. If not present we'll use port.
targetPort?: number;

// The visiblity of this port. Optional for backwards compatibility.
visibility?: PortVisibility;

Expand Down
2 changes: 1 addition & 1 deletion components/gitpod-protocol/src/wsready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See License-AGPL.txt in the project root for license information.
*/

// generated using github.com/32leaves/bel on 2021-10-28 22:18:05.015278404 +0000 UTC m=+0.005187484
// generated using github.com/32leaves/bel on 2021-11-04 12:16:53.917570766 +0000 UTC m=+0.006002884
// DO NOT MODIFY

export enum WorkspaceInitSource {
Expand Down
2 changes: 1 addition & 1 deletion components/image-builder-api/go/imgbuilder.pb.go

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

8 changes: 7 additions & 1 deletion components/image-builder-api/typescript/src/imgbuilder_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));

var content$service$api_initializer_pb = require('@gitpod/content-service/lib');
goog.object.extend(proto, content$service$api_initializer_pb);
Expand Down
2 changes: 1 addition & 1 deletion components/local-app-api/go/localapp.pb.go

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

2 changes: 1 addition & 1 deletion components/registry-facade-api/go/imagespec.pb.go

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

2 changes: 1 addition & 1 deletion components/registry-facade-api/go/provider.pb.go

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

6 changes: 0 additions & 6 deletions components/server/ee/src/graphql/graphql-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ export type WorkspaceInstanceConditions = {
* condition can only be set during PhaseCreating
*/
pullingImages?: Maybe<Scalars['Boolean']>;
/**
* ServiceExists denotes if the workspace theia-/ports- services exist. This
* condition will be true if either of the two services exist.
*/
serviceExists?: Maybe<Scalars['Boolean']>;
/** deployed marks that a workspace instance was sent/deployed at a workspace manager */
deployed?: Maybe<Scalars['Boolean']>;
/** Whether the workspace start triggered an image build */
Expand Down Expand Up @@ -401,7 +396,6 @@ export type WorkspaceInstanceConditionsResolvers<ContextType = Context, ParentTy
failed?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>,
timeout?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>,
pullingImages?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>,
serviceExists?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>,
deployed?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>,
neededImageBuild?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>,
firstUserActivity?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>,
Expand Down
12 changes: 0 additions & 12 deletions components/server/ee/src/graphql/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1070,18 +1070,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "serviceExists",
"description": " ServiceExists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist. ",
"args": [],
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "deployed",
"description": " deployed marks that a workspace instance was sent/deployed at a workspace manager ",
Expand Down
3 changes: 0 additions & 3 deletions components/server/ee/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ type WorkspaceInstanceConditions {
""" PullingImages marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating """
pullingImages: Boolean

""" ServiceExists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist. """
serviceExists: Boolean

""" deployed marks that a workspace instance was sent/deployed at a workspace manager """
deployed: Boolean

Expand Down
6 changes: 0 additions & 6 deletions components/server/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,6 @@ export class GitpodServerImpl<Client extends GitpodClient, Server extends Gitpod
const status = desc.getStatus()!;
const ports = status.getSpec()!.getExposedPortsList().map(p => <WorkspaceInstancePort>{
port: p.getPort(),
targetPort: p.getTarget(),
url: p.getUrl(),
visibility: this.portVisibilityFromProto(p.getVisibility())
});
Expand Down Expand Up @@ -1063,11 +1062,6 @@ export class GitpodServerImpl<Client extends GitpodClient, Server extends Gitpod
req.setId(runningInstance.id);
const spec = new PortSpec();
spec.setPort(port.port);
if (!!port.targetPort) {
spec.setTarget(port.targetPort);
} else {
spec.setTarget(port.port);
}
spec.setVisibility(this.portVisibilityToProto(port.visibility))
req.setSpec(spec);
req.setExpose(true);
Expand Down
3 changes: 0 additions & 3 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,7 @@ export class WorkspaceStarter {
portIndex.add(p.port);

const spec = new PortSpec();
let target = p.port;

spec.setPort(p.port);
spec.setTarget(target);
spec.setVisibility(p.visibility == 'public' ? PortVisibility.PORT_VISIBILITY_PUBLIC : PortVisibility.PORT_VISIBILITY_PRIVATE);
return spec;
}).filter(spec => !!spec) as PortSpec[];
Expand Down
2 changes: 1 addition & 1 deletion components/supervisor-api/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ message ExposePortRequest {
// local port
uint32 port = 1;
// external port if missing the the same as port
uint32 target_port = 2;
reserved 2;
}
message ExposePortResponse {}
Loading

0 comments on commit a30a1bf

Please sign in to comment.