Skip to content

Commit fe55de2

Browse files
committed
2
1 parent 4b77b11 commit fe55de2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

components/ws-manager-api/go/crd/v1/workspace_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,22 @@ type PortSpec struct {
150150
Protocol PortProtocol `json:"protocol"`
151151
}
152152

153+
func (ps PortSpec) Equal(other PortSpec) bool {
154+
if ps.Port != other.Port {
155+
return false
156+
}
157+
158+
if ps.Visibility != other.Visibility {
159+
return false
160+
}
161+
162+
if ps.Protocol != other.Protocol {
163+
return false
164+
}
165+
166+
return true
167+
}
168+
153169
// WorkspaceStatus defines the observed state of Workspace
154170
type WorkspaceStatus struct {
155171
PodStarts int `json:"podStarts"`

components/ws-manager-mk2/controllers/subscriber_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
config "github.com/gitpod-io/gitpod/ws-manager/api/config"
2424
workspacev1 "github.com/gitpod-io/gitpod/ws-manager/api/crd/v1"
25+
"github.com/google/go-cmp/cmp"
2526
)
2627

2728
func NewSubscriberReconciler(c client.Client, cfg *config.Configuration) (*SubscriberReconciler, error) {
@@ -87,7 +88,7 @@ func (r *SubscriberReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Ma
8788
old := e.ObjectOld.(*workspacev1.Workspace)
8889
new := e.ObjectNew.(*workspacev1.Workspace)
8990

90-
if !equality.Semantic.DeepDerivative(old.Spec.Ports, new.Spec.Ports) {
91+
if !cmp.Equal(old.Spec.Ports, new.Spec.Ports) {
9192
return true
9293
}
9394

0 commit comments

Comments
 (0)