Skip to content

Commit

Permalink
adding init
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyas220 <[email protected]>
  • Loading branch information
Shreyas220 committed Oct 13, 2021
1 parent 699a204 commit d71e4b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ COPY app_mesh/ app_mesh/
# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags="-w -s -X main.version=$VERSION -X main.gitsha=$GIT_COMMITSHA" -a -o meshery-app-mesh main.go

FROM alpine:3.14 as jsonschema-util
RUN apk add --no-cache curl
WORKDIR /
RUN curl -LO https://github.com/layer5io/kubeopenapi-jsonschema/releases/download/v0.1.0/kubeopenapi-jsonschema
RUN chmod +x /kubeopenapi-jsonschema

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base
Expand All @@ -24,6 +30,5 @@ ENV DISTRO="debian"
ENV GOARCH="amd64"
ENV SERVICE_ADDR="meshery-app-mesh"
ENV MESHERY_SERVER="http://meshery:9081"
COPY templates/ ./templates
COPY --from=builder /build/meshery-app-mesh .
ENTRYPOINT ["/meshery-app-mesh"]
1 change: 1 addition & 0 deletions app_mesh/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (appMesh *AppMesh) installAppMesh(del bool, version, namespace string) (str
appMesh.Log.Debug(fmt.Sprintf("Requested action is delete: %v", del))
appMesh.Log.Debug(fmt.Sprintf("Requested action is in namespace: %s", namespace))

appMesh.Log.Info(fmt.Sprintf("Requested install of version: %s", version))
st := status.Installing
if del {
st = status.Removing
Expand Down
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ func isDebug() bool {
return os.Getenv("DEBUG") == "true"
}

// creates the ~/.meshery directory
func init() {
err := os.MkdirAll(path.Join(config.RootPath(), "bin"), 0750)
if err != nil {
fmt.Println(err)
os.Exit(0)
}
}

// main is the entrypoint of the adaptor
func main() {

Expand Down

0 comments on commit d71e4b2

Please sign in to comment.