Skip to content

Commit

Permalink
Remove field ServiceExists
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Oct 30, 2021
1 parent 1244dc4 commit 6be68b6
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 152 deletions.
1 change: 0 additions & 1 deletion components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,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
3 changes: 0 additions & 3 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
4 changes: 2 additions & 2 deletions components/ws-manager-api/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ message WorkspaceConditions {
// pulling_images marks if the workspace is currently pulling its images. This condition can only be set during PhaseCreating
WorkspaceConditionBool pulling_images = 3;

// service_exists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist.
WorkspaceConditionBool service_exists = 4;
// DEPRECATED service_exists denotes if the workspace theia-/ports- services exist. This condition will be true if either of the two services exist.
reserved 4;

// snapshot contains a snapshot URL if a snapshot was produced prior to shutting the workspace down. This condition is only used for headless workspaces.
string snapshot = 5;
Expand Down
156 changes: 71 additions & 85 deletions components/ws-manager-api/go/core.pb.go

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions components/ws-manager-api/typescript/src/core_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,6 @@ export class WorkspaceConditions extends jspb.Message {
setTimeout(value: string): WorkspaceConditions;
getPullingImages(): WorkspaceConditionBool;
setPullingImages(value: WorkspaceConditionBool): WorkspaceConditions;
getServiceExists(): WorkspaceConditionBool;
setServiceExists(value: WorkspaceConditionBool): WorkspaceConditions;
getSnapshot(): string;
setSnapshot(value: string): WorkspaceConditions;
getFinalBackupComplete(): WorkspaceConditionBool;
Expand Down Expand Up @@ -736,7 +734,6 @@ export namespace WorkspaceConditions {
failed: string,
timeout: string,
pullingImages: WorkspaceConditionBool,
serviceExists: WorkspaceConditionBool,
snapshot: string,
finalBackupComplete: WorkspaceConditionBool,
deployed: WorkspaceConditionBool,
Expand Down
30 changes: 0 additions & 30 deletions components/ws-manager-api/typescript/src/core_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5612,7 +5612,6 @@ proto.wsman.WorkspaceConditions.toObject = function(includeInstance, msg) {
failed: jspb.Message.getFieldWithDefault(msg, 1, ""),
timeout: jspb.Message.getFieldWithDefault(msg, 2, ""),
pullingImages: jspb.Message.getFieldWithDefault(msg, 3, 0),
serviceExists: jspb.Message.getFieldWithDefault(msg, 4, 0),
snapshot: jspb.Message.getFieldWithDefault(msg, 5, ""),
finalBackupComplete: jspb.Message.getFieldWithDefault(msg, 6, 0),
deployed: jspb.Message.getFieldWithDefault(msg, 7, 0),
Expand Down Expand Up @@ -5668,10 +5667,6 @@ proto.wsman.WorkspaceConditions.deserializeBinaryFromReader = function(msg, read
var value = /** @type {!proto.wsman.WorkspaceConditionBool} */ (reader.readEnum());
msg.setPullingImages(value);
break;
case 4:
var value = /** @type {!proto.wsman.WorkspaceConditionBool} */ (reader.readEnum());
msg.setServiceExists(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setSnapshot(value);
Expand Down Expand Up @@ -5751,13 +5746,6 @@ proto.wsman.WorkspaceConditions.serializeBinaryToWriter = function(message, writ
f
);
}
f = message.getServiceExists();
if (f !== 0.0) {
writer.writeEnum(
4,
f
);
}
f = message.getSnapshot();
if (f.length > 0) {
writer.writeString(
Expand Down Expand Up @@ -5865,24 +5853,6 @@ proto.wsman.WorkspaceConditions.prototype.setPullingImages = function(value) {
};


/**
* optional WorkspaceConditionBool service_exists = 4;
* @return {!proto.wsman.WorkspaceConditionBool}
*/
proto.wsman.WorkspaceConditions.prototype.getServiceExists = function() {
return /** @type {!proto.wsman.WorkspaceConditionBool} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};


/**
* @param {!proto.wsman.WorkspaceConditionBool} value
* @return {!proto.wsman.WorkspaceConditions} returns this
*/
proto.wsman.WorkspaceConditions.prototype.setServiceExists = function(value) {
return jspb.Message.setProto3EnumField(this, 4, value);
};


/**
* optional string snapshot = 5;
* @return {string}
Expand Down
2 changes: 1 addition & 1 deletion components/ws-manager-bridge-api/go/cluster-service.pb.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

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

goog.exportSymbol('proto.workspacemanagerbridge.AdmissionConstraint', null, global);
goog.exportSymbol('proto.workspacemanagerbridge.AdmissionConstraint.ConstraintCase', null, global);
Expand Down
27 changes: 2 additions & 25 deletions components/ws-manager/pkg/manager/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"

wsk8s "github.com/gitpod-io/gitpod/common-go/kubernetes"
"github.com/gitpod-io/gitpod/common-go/log"
Expand Down Expand Up @@ -52,9 +51,8 @@ func init() {

// workspaceObjects contains all Kubernetes objects required to compute the status of a workspace
type workspaceObjects struct {
Pod *corev1.Pod `json:"pod"`
TheiaService *corev1.Service `json:"theiaService,omitempty"`
Events []corev1.Event `json:"events,omitempty"`
Pod *corev1.Pod `json:"pod"`
Events []corev1.Event `json:"events,omitempty"`
}

// GetOWI produces the owner, workspace, instance tripple that we use for tracing and logging
Expand Down Expand Up @@ -157,19 +155,6 @@ func (m *Manager) completeWorkspaceObjects(ctx context.Context, wso *workspaceOb
return xerrors.Errorf("completeWorkspaceObjects: need either pod or lifecycle independent state")
}

if wso.TheiaService == nil {
servicePrefix := wso.Pod.Annotations[servicePrefixAnnotation]
var service corev1.Service
err := m.Clientset.Get(ctx, types.NamespacedName{Namespace: m.Config.Namespace, Name: getTheiaServiceName(servicePrefix)}, &service)
if err == nil {
wso.TheiaService = &service
}

if !isKubernetesObjNotFoundError(err) && err != nil {
return xerrors.Errorf("completeWorkspaceObjects: %w", err)
}
}

// find pod events - this only makes sense if we still have a pod
if wso.Pod != nil {
if wso.Events == nil && wso.Pod != nil {
Expand Down Expand Up @@ -282,14 +267,6 @@ func (m *Manager) getWorkspaceStatus(wso workspaceObjects) (*api.WorkspaceStatus

status.Spec.ExposedPorts = extractExposedPorts(wso.Pod).Ports

var serviceExists api.WorkspaceConditionBool
if wso.TheiaService != nil {
serviceExists = api.WorkspaceConditionBool_TRUE
} else {
serviceExists = api.WorkspaceConditionBool_FALSE
}
status.Conditions.ServiceExists = serviceExists

if wso.Pod == nil {
status.Conditions.Deployed = api.WorkspaceConditionBool_FALSE
} else {
Expand Down
1 change: 0 additions & 1 deletion dev/gpctl/cmd/workspaces-describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Conditions:
{{- if not (eq .Conditions.Failed "") }} Failed: {{ .Conditions.Failed }}{{ end }}
{{- if not (eq .Conditions.Timeout "") }} Timeout: {{ .Conditions.Timeout }}{{ end }}
PullingImages: {{ .Conditions.PullingImages }}
ServiceExists: {{ .Conditions.ServiceExists }}
Deployed: {{ .Conditions.Deployed }}
FinalBackupComplete: {{ .Conditions.FinalBackupComplete }}
Spec:
Expand Down

0 comments on commit 6be68b6

Please sign in to comment.