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

Commit

Permalink
Merge pull request #15 from kmova/annotate-pv-#942
Browse files Browse the repository at this point in the history
Make the user links configurable
  • Loading branch information
Amit Kumar Das authored Nov 28, 2017
2 parents 93a05fb + c28fd0a commit bf25c9f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions openebs/openebs-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,23 @@ func (p *openEBSProvisioner) Provision(options controller.VolumeOptions) (*v1.Pe
userLinks := make([]string, 0)
localMonitoringURL := os.Getenv("OPENEBS_MONITOR_URL")
if localMonitoringURL != "" {
userLinks = append(userLinks, "\"monitor\":\""+localMonitoringURL+"\"")
localMonitorLinkName := os.Getenv("OPENEBS_MONITOR_LINK_NAME")
if localMonitorLinkName == "" {
localMonitorLinkName = "monitor"
}
localMonitorVolKey := os.Getenv("OPENEBS_MONITOR_VOLKEY")
if localMonitorVolKey != "" {
localMonitoringURL += localMonitorVolKey + "=" + options.PVName
}
userLinks = append(userLinks, "\""+localMonitorLinkName+"\":\""+localMonitoringURL+"\"")
}
mayaPortalURL := os.Getenv("MAYA_PORTAL_URL")
if mayaPortalURL != "" {
userLinks = append(userLinks, "\"maya\":\""+mayaPortalURL+"\"")
mayaPortalLinkName := os.Getenv("MAYA_PORTAL_LINK_NAME")
if mayaPortalLinkName == "" {
mayaPortalLinkName = "maya"
}
userLinks = append(userLinks, "\""+mayaPortalLinkName+"\":\""+mayaPortalURL+"\"")
}
if len(userLinks) > 0 {
volAnnotations["alpha.dashboard.kubernetes.io/links"] = "{" + strings.Join(userLinks, ",") + "}"
Expand Down

0 comments on commit bf25c9f

Please sign in to comment.