Skip to content

Commit

Permalink
Merge pull request #4 from 0xt3j4s/main
Browse files Browse the repository at this point in the history
Minor Fixes
  • Loading branch information
Daniel-GrunbergerCA committed Nov 21, 2023
2 parents 63476f6 + 16d929c commit 8987527
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-created.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: pull_request_created
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches:
- 'main'
branches:
- 'main'
paths-ignore:
- '*.md'
- '*.yaml'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr-merged.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: build
name: pr-merged
on:
pull_request_target:
types: [closed]
branches:
- 'main'
paths-ignore:
- '**.md' ### Ignore running when README.MD changed.
- '**.yaml' ### Ignore running when YAML files changed.
- '.github/workflows/*' ### Ignore running when files under path: .github/workflows/* changed.

jobs:
Expand All @@ -18,9 +19,9 @@ jobs:
pull-requests: read
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-merged.yaml@main
with:
IMAGE_NAME: quay.io/${{ github.repository_owner }}/kubescape-exporter
IMAGE_NAME: quay.io/${{ github.repository_owner }}/prometheus-exporter
IMAGE_TAG: v0.1.${{ github.run_number }}
COMPONENT_NAME: kubescapeExporter
COMPONENT_NAME: prometheus-exporter
CGO_ENABLED: 0
GO111MODULE: "on"
BUILD_PLATFORM: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
KUBECONFIG

# Built Binary File
kubescape-exporter
prometheus-exporter

# Data stored by Grafana
data
9 changes: 5 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder

ENV GO111MODULE=on \
CGO_ENABLED=0
CGO_ENABLED=0 \
GOPROXY=https://proxy.golang.org,direct

# Set the working directory inside the container
WORKDIR /work

RUN --mount=target=. \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/kubescape-exporter .
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/prometheus-exporter .

FROM gcr.io/distroless/static-debian11:nonroot

# Copy the Pre-built binary file from the previous stage
COPY --from=builder /out/kubescape-exporter /usr/bin/kubescape-exporter
COPY --from=builder /out/prometheus-exporter /usr/bin/prometheus-exporter

# Entry Point
ENTRYPOINT [ "kubescape-exporter" ]
ENTRYPOINT [ "prometheus-exporter" ]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/yrs147/kubescape-exporter
module github.com/kubescape/prometheus-exporter

go 1.20

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/kubescape/go-logger"
"github.com/kubescape/go-logger/helpers"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/yrs147/kubescape-exporter/api"
"github.com/yrs147/kubescape-exporter/metrics"
"github.com/kubescape/prometheus-exporter/api"
"github.com/kubescape/prometheus-exporter/metrics"
"k8s.io/client-go/util/homedir"
)

Expand Down

0 comments on commit 8987527

Please sign in to comment.