Skip to content

Commit 5182222

Browse files
authored
Merge pull request #303 from rkpattnaik780/nb_label_3
fix: remove replace from go.mod file
2 parents e0af1a6 + 5b2857f commit 5182222

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

components/common/reconcilehelper/util.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@ func CopyStatefulSetFields(from, to *appsv1.StatefulSet) bool {
122122

123123
if *from.Spec.Replicas != *to.Spec.Replicas {
124124
*to.Spec.Replicas = *from.Spec.Replicas
125-
// Copy the pod template labels, but reconcilation is not required
126-
// exclusively based on ths pod template labels
127-
if !reflect.DeepEqual(to.Spec.Template.ObjectMeta.Labels, from.Spec.Template.ObjectMeta.Labels) {
128-
to.Spec.Template.ObjectMeta.Labels = from.Spec.Template.ObjectMeta.Labels
129-
}
130125
requireUpdate = true
131126
}
132127

components/notebook-controller/controllers/notebook_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ func (r *NotebookReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
159159
log.Error(err, "error getting Statefulset")
160160
return ctrl.Result{}, err
161161
}
162+
163+
// Copy the pod template labels, but reconcilation is not required
164+
// exclusively based on ths pod template labels
165+
if *ss.Spec.Replicas != *foundStateful.Spec.Replicas {
166+
if !reflect.DeepEqual(foundStateful.Spec.Template.ObjectMeta.Labels, ss.Spec.Template.ObjectMeta.Labels) {
167+
foundStateful.Spec.Template.ObjectMeta.Labels = ss.Spec.Template.ObjectMeta.Labels
168+
}
169+
}
170+
162171
// Update the foundStateful object and write the result back if there are any changes
163172
if !justCreated && reconcilehelper.CopyStatefulSetFields(ss, foundStateful) {
164173
log.Info("Updating StatefulSet", "namespace", ss.Namespace, "name", ss.Name)

components/notebook-controller/go.mod

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ module github.com/kubeflow/kubeflow/components/notebook-controller
22

33
go 1.19
44

5-
// use our version of kubeflow/components/common module for reconcilehelper utility differences related to image-field reconciliation
6-
replace (
7-
github.com/kubeflow/kubeflow/components/common => ../common
8-
)
9-
105
require (
116
github.com/go-logr/logr v1.2.4
127
github.com/kubeflow/kubeflow/components/common v0.0.0-20220218084159-4ad0158e955e

0 commit comments

Comments
 (0)