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

Commit

Permalink
feat(jiva): env to enable/disable replica patch
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kmova committed Dec 5, 2020
1 parent 1440431 commit 7862ba6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openebs/pkg/volume/v1alpha1/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,16 @@ func (v CASVolume) ReadVolume(vname, namespace, storageclass string, obj interfa
return err
}

patchJivaReplicaWithNodeAffinity := os.Getenv("OPENEBS_IO_JIVA_PATCH_NODE_AFFINITY")
if patchJivaReplicaWithNodeAffinity == "" {
patchJivaReplicaWithNodeAffinity = "enabled"
}

req.Header.Set("namespace", namespace)
// passing storageclass info as a request header which will extracted by the
// Maya-apiserver to get the CAS template name
req.Header.Set(string(v1alpha1.StorageClassHeaderKey), storageclass)
req.Header.Set(string(v1alpha1.IsPatchJivaReplicaNodeAffinityHeader), "enabled")
req.Header.Set(string(v1alpha1.IsPatchJivaReplicaNodeAffinityHeader), patchJivaReplicaWithNodeAffinity)

c := &http.Client{
Timeout: timeout,
Expand Down

0 comments on commit 7862ba6

Please sign in to comment.