Skip to content

Commit

Permalink
fix assigned address to remove netmask, update nomad example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Aug 29, 2023
1 parent d6a0646 commit ec8b364
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions examples/nomad/nomad.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ resource "nomad_cluster" "dev" {
client_config = resource.template.nomad_config.destination
consul_config = resource.template.consul_config.destination

image {
name = "shipyardrun/nomad:1.6.1.dev"
}

datacenter = variable.datacenter

network {
Expand Down
6 changes: 5 additions & 1 deletion pkg/config/resources/container/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path"
"strings"
"time"

htypes "github.com/jumppad-labs/hclconfig/types"
Expand Down Expand Up @@ -242,8 +243,11 @@ func (c *Provider) internalCreate(sidecar bool) error {
for _, n := range dc {
for i, net := range c.config.Networks {
if net.ID == n.ID {
// remove the netmask
ip,_,_ := strings.Cut(n.IPAddress, "/")

// set the assigned address and name
c.config.Networks[i].AssignedAddress = n.IPAddress
c.config.Networks[i].AssignedAddress = ip
c.config.Networks[i].Name = n.Name
}
}
Expand Down

0 comments on commit ec8b364

Please sign in to comment.