Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Commit 7862ba6

Browse files
author
kmova
committed
feat(jiva): env to enable/disable replica patch
In some cases, users would like to disable setting the patch on jiva replica. These are clusters which guarantee that only one node is out of the cluster at any given time and when it comes back, it can come back with an new hostname, making the replica deployment unschedulable. The setting can be controlled via ENV variable. Note: The patch application was being done in the volume read operation and hence can't be passed via storage class at the moment. Signed-off-by: kmova <[email protected]>
1 parent 1440431 commit 7862ba6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

openebs/pkg/volume/v1alpha1/volume.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,16 @@ func (v CASVolume) ReadVolume(vname, namespace, storageclass string, obj interfa
150150
return err
151151
}
152152

153+
patchJivaReplicaWithNodeAffinity := os.Getenv("OPENEBS_IO_JIVA_PATCH_NODE_AFFINITY")
154+
if patchJivaReplicaWithNodeAffinity == "" {
155+
patchJivaReplicaWithNodeAffinity = "enabled"
156+
}
157+
153158
req.Header.Set("namespace", namespace)
154159
// passing storageclass info as a request header which will extracted by the
155160
// Maya-apiserver to get the CAS template name
156161
req.Header.Set(string(v1alpha1.StorageClassHeaderKey), storageclass)
157-
req.Header.Set(string(v1alpha1.IsPatchJivaReplicaNodeAffinityHeader), "enabled")
162+
req.Header.Set(string(v1alpha1.IsPatchJivaReplicaNodeAffinityHeader), patchJivaReplicaWithNodeAffinity)
158163

159164
c := &http.Client{
160165
Timeout: timeout,

0 commit comments

Comments
 (0)