Skip to content

Commit 39137e5

Browse files
committed
Address Copilot's comments
1 parent e9f25d6 commit 39137e5

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

e2e/multi-cluster/offline_cluster_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ func checkReadyCondition(g Gomega, out, msg, status string) {
155155
g.Expect(err).ToNot(HaveOccurred())
156156

157157
var readyCond *genericcondition.GenericCondition
158-
for _, c := range conds {
158+
for i, c := range conds {
159159
if c.Type == "Ready" {
160-
readyCond = &c
160+
readyCond = &conds[i]
161161
}
162162
}
163163

internal/cmd/controller/clustermonitor/monitor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ func UpdateOfflineBundleDeployments(ctx context.Context, c client.Client, thresh
110110
if err := c.Get(ctx, nsn, t); err != nil {
111111
return err
112112
}
113-
t.Status = bd.Status
114113

115-
orig := bd.DeepCopy()
114+
orig := t.DeepCopy()
116115

117116
// Any information about resources living in an offline cluster is likely to be
118117
// outdated.
@@ -129,7 +128,12 @@ func UpdateOfflineBundleDeployments(ctx context.Context, c client.Client, thresh
129128

130129
statusPatch := client.MergeFrom(orig)
131130

132-
if patchData, err := statusPatch.Data(t); err != nil || string(patchData) != "{}" {
131+
patchData, err := statusPatch.Data(t)
132+
if err != nil {
133+
return err
134+
}
135+
136+
if string(patchData) != "{}" {
133137
return c.Status().Patch(ctx, t, statusPatch)
134138
}
135139

internal/cmd/controller/clustermonitor/monitor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func Test_Run(t *testing.T) {
457457
b *v1alpha1.BundleDeployment, //nolint: staticcheck
458458
opts ...client.GetOption,
459459
) error {
460-
b = &bd //nolint: ineffassign,staticcheck // the value is used by the implementation, not directly by the tests.
460+
*b = bd //nolint: ineffassign,staticcheck // the value is used by the implementation, not directly by the tests.
461461

462462
return nil
463463
},

0 commit comments

Comments
 (0)