Skip to content

Commit

Permalink
[SAPBTPCFS-15469] Update Service Instance on change of 'parametersFro…
Browse files Browse the repository at this point in the history
…m' secret
  • Loading branch information
I065450 committed Dec 18, 2024
1 parent ba0e3f2 commit ece2c30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/serviceinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ func (r *ServiceInstanceReconciler) buildSMRequestParameters(ctx context.Context
}

//sync instance labels
for key := range serviceInstance.Labels {
for key, value := range serviceInstance.Labels {
if strings.HasPrefix(key, common.InstanceSecretRefLabel) {
if secretName, ok := instanceLabels[key]; !ok {
instanceLabelsChanged = true
Expand All @@ -576,7 +576,7 @@ func (r *ServiceInstanceReconciler) buildSMRequestParameters(ctx context.Context
}
} else {
// this label not related to secrets, add it
instanceLabels[key] = serviceInstance.Labels[key]
instanceLabels[key] = value
}
}
if instanceLabelsChanged {
Expand Down
2 changes: 1 addition & 1 deletion controllers/serviceinstance_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ var _ = Describe("ServiceInstance controller", func() {
Expect(k8sClient.Update(ctx, paramsSecret)).To(Succeed())
Expect(fakeClient.UpdateInstanceCallCount()).To(Equal(0))
})
FIt("should not update instance with the secret change after removing SubscribeToSecretChanges", func() {
It("should not update instance with the secret change after removing SubscribeToSecretChanges", func() {
instanceSpec.SubscribeToSecretChanges = pointer.Bool(true)
serviceInstance = createInstance(ctx, fakeInstanceName, instanceSpec, nil, true)
smInstance, _, _, _, _, _ := fakeClient.ProvisionArgsForCall(0)
Expand Down

0 comments on commit ece2c30

Please sign in to comment.