Skip to content

Commit

Permalink
fix bugs in daemon backend
Browse files Browse the repository at this point in the history
most fields already populated from json.
remove default lotus image tag from form
  • Loading branch information
ognots committed Jul 20, 2021
1 parent e799292 commit d49c364
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
18 changes: 5 additions & 13 deletions controller/daemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,11 @@ func (c *Controller) newDaemonHandler(w http.ResponseWriter, r *http.Request) {
}
regionid := mux.Vars(r)["regionid"]
daemon.Region = regionid
helmchartversion := mux.Vars(r)["helmchartversion"]
daemon.HelmChartVersion = helmchartversion
helmchartrepourl := mux.Vars(r)["helmchartrepourl"]
daemon.HelmChartRepoUrl = helmchartrepourl
lotusdockerrepo := mux.Vars(r)["lotusdockerrepo"]
daemon.LotusDockerRepo = "coryschwartz/lotus"
if lotusdockerrepo != "" {
daemon.LotusDockerRepo = lotusdockerrepo
}
lotusdockertag := mux.Vars(r)["lotusdockertag"]
daemon.LotusDockerTag = "sidecar"
if lotusdockertag != "" {
daemon.LotusDockerTag = lotusdockertag
if daemon.LotusDockerRepo == "" {
daemon.LotusDockerRepo = "coryschwartz/lotus"
}
if daemon.LotusDockerTag == "" {
daemon.LotusDockerTag = "sidecar"
}
// generate random values if they aren't already setup
daemonDefaults(daemon)
Expand Down
3 changes: 3 additions & 0 deletions controller/spawn/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func (s *KubernetesSpawner) Spawn(d *Daemon) error {
}
client := action.NewInstall(actionConfig)
client.ChartPathOptions.RepoURL = "https://filecoin-project.github.io/helm-charts"
if d.HelmChartRepoUrl != "" {
client.ChartPathOptions.RepoURL = d.HelmChartRepoUrl
}
if d.HelmChartVersion != "" {
client.ChartPathOptions.Version = d.HelmChartVersion
}
Expand Down
12 changes: 6 additions & 6 deletions controller/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,21 @@ <h2 class="accordion-header" id="headingBotCreate">
</div>
<div style="padding: 20px; background: #EEE; margin: 20px 0;">
<h4>Deployment Parameters</h3>
<div id="botHelmChartRepoUrl">
<label for="newBotHelmChartRepoUrl" class="form-label">Helm chart repo URL for lotus-bundle (optional)</label>
<input class="form-control" type="text" id="newBotHelmChartRepoUrl" value="">
</div>
<div id="botHelmChartVersion">
<label for="newBotHelmChartVersion" class="form-label">Helm chart version of lotus-bundle. Leave blank to use latest</label>
<input class="form-control" type="text" id="newBotHelmChartVersion" value="0.0.4">
</div>
<div id="botHelmChartRepoUrl">
<label for="newBotHelmChartRepoUrl" class="form-label">Helm chart repo URL for lotus-bundle (optional)</label>
<input class="form-control" type="text" id="newBotHelmChartRepoUrl" value="">
</div>
<div id="botLotusDockerRepo">
<label for="newBotLotusDockerRepo" class="form-label">Lotus Docker Image (optional)</label>
<input class="form-control" type="text" id="newBotLotusDockerRepo" value="">
</div>
<div id="botLotusDockerTag">
<label for="newBotLotusDockerTag" class="form-label">Lotus Docker Image Tag</label>
<input class="form-control" type="text" id="newBotLotusDockerTag" value="v1.10.0">
<label for="newBotLotusDockerTag" class="form-label">Lotus Docker Image Tag (optional)</label>
<input class="form-control" type="text" id="newBotLotusDockerTag" value="">
</div>
</div>
<div id="addbot">
Expand Down

0 comments on commit d49c364

Please sign in to comment.