Skip to content

Commit

Permalink
Merge pull request #51 from wanjunlei/master
Browse files Browse the repository at this point in the history
add adapter sink
  • Loading branch information
Benjamin Huo authored Dec 3, 2020
2 parents 4f23c94 + b1d87b1 commit bd11c0f
Show file tree
Hide file tree
Showing 22 changed files with 1,109 additions and 29 deletions.
27 changes: 27 additions & 0 deletions adapter/sink/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

FROM golang:1.13 as notification-adapter

COPY cmd/main.go /
COPY cmd/types.go /
WORKDIR /
ENV GOPROXY=https://goproxy.io
RUN CGO_ENABLED=0 GO111MODULE=on go build -i -ldflags '-w -s' -o notification-adapter main.go types.go

FROM alpine:3.9

COPY --from=notification-adapter /notification-adapter /usr/local/bin/

RUN adduser -D -g kubesphere -u 1002 kubesphere && \
chown -R kubesphere:kubesphere /usr/local/bin/notification-adapter && \
apk add libcap && \
setcap 'CAP_NET_BIND_SERVICE=+ep' /usr/local/bin/notification-adapter

USER kubesphere
CMD ["sh"]
24 changes: 24 additions & 0 deletions adapter/sink/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

IMG ?= kubespheredev/notification-adapter:v0.1.0
AMD64 ?= -amd64

all: docker-build

# Build kube-audit-operator binary
notification-adapter:
go build -o notification-adapter cmd/main.go

# Build the docker image
docker-build:
docker buildx build --platform linux/amd64,linux/arm64 --push -f Dockerfile -t ${IMG} .

# Build the docker image for arm64
docker-build-amd64:
docker build -f Dockerfile -t ${IMG}${AMD64} .

# Push the docker image
push-amd64:
docker push ${IMG}${AMD64}
3 changes: 3 additions & 0 deletions adapter/sink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# notification-adapter

Notification-adapter receive notifications from notifcation manager and export with the socket.
Loading

0 comments on commit bd11c0f

Please sign in to comment.