Skip to content

Commit

Permalink
Merge branch 'develop' into feature/snet-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
i-hate-nicknames committed Jul 8, 2021
2 parents bd371e4 + a663372 commit 6bb7875
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.git
bin
skywire
ci_scripts
Expand Down
3 changes: 1 addition & 2 deletions docker/images/visor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ ARG BUILDINFO_LDFLAGS
ARG CGO_ENABLED=0
ENV CGO_ENABLED=${CGO_ENABLED} \
GOOS=linux \
GOARCH=amd64 \
GO111MODULE=on

COPY . /skywire

WORKDIR /skywire

RUN apk add --no-cache make && \
RUN apk add --no-cache make git && \
sh -c /skywire/docker/images/visor/install-preq.sh && \
make host-apps && \
make build-deploy && \
Expand Down
16 changes: 8 additions & 8 deletions docker/images/visor/install-preq.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/sh

if type apt > /dev/null; then
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
if type apt >/dev/null; then
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates &&
rm -rf /var/lib/apt/lists/*
fi

if type apk > /dev/null; then
apk update
apk add --no-cache ca-certificates openssl iproute2 bash
update-ca-certificates --fresh
if type apk >/dev/null; then
apk update
apk add --no-cache ca-certificates openssl iproute2 bash
update-ca-certificates --fresh
fi
3 changes: 1 addition & 2 deletions pkg/transport/network/addrresolver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,9 @@ func (c *httpClient) Close() error {
if err := c.sudphConn.Close(); err != nil {
c.log.WithError(err).Errorf("Failed to close SUDPH")
}
close(c.closed)
}

close(c.closed)

return nil
}

Expand Down
11 changes: 11 additions & 0 deletions pkg/visor/visorconfig/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func parseV1(cc *Common, raw []byte) (*V1, error) {
if err := conf.ensureKeys(); err != nil {
return nil, fmt.Errorf("%v: %w", ErrInvalidSK, err)
}
conf = ensureAppDisc(conf)
conf = updateUrls(conf)
conf.Version = V1Name
return conf, conf.flush(conf)
Expand Down Expand Up @@ -158,6 +159,16 @@ func parseV0(cc *Common, raw []byte) (*V1, error) {

return conf, conf.flush(conf)
}

func ensureAppDisc(conf *V1) *V1 {
if conf.Launcher.Discovery == nil {
conf.Launcher.Discovery = &V1AppDisc{
ServiceDisc: skyenv.DefaultServiceDiscAddr,
}
}
return conf
}

func updateUrls(conf *V1) *V1 {
if conf.Dmsg.Discovery == skyenv.OldDefaultDmsgDiscAddr {
conf.Dmsg.Discovery = skyenv.DefaultDmsgDiscAddr
Expand Down

0 comments on commit 6bb7875

Please sign in to comment.