Skip to content

Commit

Permalink
allow topology key without application label (#390)
Browse files Browse the repository at this point in the history
Signed-off-by: kmova <[email protected]>
  • Loading branch information
kmova authored and Amit Kumar Das committed Jul 13, 2018
1 parent 58254da commit 0baf02c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions orchprovider/k8s/v1/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,17 @@ func (k *k8sOrchestrator) createReplicaDeployment(volProProfile volProfile.Volum
//Depending on the topology key, additional label selectors may be required.
if replicaTopoKeyDomainLV != "" && replicaTopoKeyTypeLV != "" {
replicaTopoKey = replicaTopoKeyDomainLV + "/" + replicaTopoKeyTypeLV
//TODO : We are assuming here that the topology keys depend on
// the application label.
repAntiAffinityLabelSpec[string(v1.ApplicationSelectorKey)] = appLV
//There are two scenarios for specifying custom topology keys:
//(a) Deploy the application using a statefulset where application has single replica
// In this case, an application label to use as key is specified.
//(b) Deploy the replicas of a single application need to be spread out.
// In this case, there is no need to specify a seperate the application label.
// Use the auto generated id.
if appLV != "" {
repAntiAffinityLabelSpec[string(v1.ApplicationSelectorKey)] = appLV
} else {
repAntiAffinityLabelSpec[string(v1.VSMSelectorKey)] = vsm
}
} else {
//For host based anti-affinity, use the vsm name additional label
repAntiAffinityLabelSpec[string(v1.VSMSelectorKey)] = vsm
Expand Down

0 comments on commit 0baf02c

Please sign in to comment.