Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ plugins:
- HACK
- XXX
- BUG
exclude_patterns:
# Exclude `context.T O D O()` false positives
- "internal/configurationmanagers/kubernetes/"
- "internal/providers/kubernetessecrets/"
- "test/providers/kubernetessecrets/"

# ---------------
# Commonly-used languages - run time is minimal and all of these will work
Expand Down Expand Up @@ -188,3 +193,5 @@ plugins:
# commented if no files to exclude as an empty array will error
exclude_patterns:
- ".gitignore"
# Exclude autogenerated code
- "pkg/k8sclient/"
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Uninstall old go
- run: brew uninstall [email protected]
# Install go1.16
- run: brew install [email protected]
# Add go1.16 to PATH
- run: echo "/usr/local/opt/[email protected]/bin" >> $GITHUB_PATH
# Get go version
- run: go version
# Fix go1.16 module bug (https://github.com/golang/go/issues/44129#issuecomment-865249631)
- run: go env -w GOFLAGS=-mod=mod
# Download go modules
- run: go mod download
# Run keychain tests
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-buster as secretless-builder
FROM golang:1.16-buster as secretless-builder
MAINTAINER CyberArk Software Ltd.
LABEL builder="secretless-builder"

Expand All @@ -23,6 +23,7 @@ ENV GOOS=linux \
COPY go.mod go.sum /secretless/
COPY third_party/ /secretless/third_party

RUN go env -w GOFLAGS=-mod=mod
RUN go mod download

# secretless source files
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-buster as secretless-builder
FROM golang:1.16-buster as secretless-builder
MAINTAINER CyberArk Software Ltd.
LABEL builder="secretless-builder"

Expand All @@ -23,6 +23,7 @@ ENV GOOS=linux \
COPY go.mod go.sum /secretless/
COPY third_party/ /secretless/third_party

RUN go env -w GOFLAGS=-mod=mod
RUN go mod download

# Compile Delve (for debugging)
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-buster
FROM golang:1.16-buster
MAINTAINER CyberArk Software Ltd.

# On CyberArk dev laptops, golang module dependencies are downloaded with a
Expand Down Expand Up @@ -53,6 +53,7 @@ RUN go get -u github.com/jstemmer/go-junit-report && \
COPY go.mod go.sum /secretless/
COPY third_party/ /secretless/third_party

RUN go env -w GOFLAGS=-mod=mod
RUN go mod download

# TODO: all the stuff below this line is not needed
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-alpine
FROM golang:1.16-alpine
MAINTAINER CyberArk Software Ltd.
LABEL id="secretless-test-runner"

Expand All @@ -24,6 +24,7 @@ RUN apk add -u curl \
COPY go.mod go.sum /secretless/
COPY third_party/ /secretless/third_party

RUN go env -w GOFLAGS=-mod=mod
RUN go mod download

# go-junit-report => Convert go test output to junit xml
Expand Down
11 changes: 4 additions & 7 deletions bin/Dockerfile.codegen
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM golang:1.12.5
FROM golang:1.16

WORKDIR /

ENV GO111MODULE=on

RUN git clone --depth 1 \
-b fix-runners \
https://github.com/conjurinc/code-generator.git && \
cd /code-generator && \
./build_generators && \
cp -r dist/* /usr/local/bin
ARG K8S_PKG_TAG

RUN git clone --depth 1 --branch ${K8S_PKG_TAG} https://github.com/kubernetes/code-generator.git

WORKDIR /secretless
15 changes: 11 additions & 4 deletions bin/codegen
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ TOPLEVEL_DIR="$CURRENT_DIR/.."
PROJECT_MODULE="github.com/cyberark/secretless-broker"
IMAGE_NAME="secretless-codegen-builder"

echo "Pre-cleaning..."
rm -rf "$TOPLEVEL_DIR/github.com"
K8S_PKG_TAG="$(go list -m -f '{{ .Version }}' k8s.io/client-go)"

echo "Building codegen Docker image..."
docker build -f "${CURRENT_DIR}/Dockerfile.codegen" \
--build-arg K8S_PKG_TAG="${K8S_PKG_TAG}" \
-t "${IMAGE_NAME}" \
"${TOPLEVEL_DIR}"

echo "Pre-cleaning..."
docker run --rm \
-v "${TOPLEVEL_DIR}:/secretless" \
"${IMAGE_NAME}" /bin/bash -c "rm -rf github.com"

runner_cmd="/code-generator/generate-groups.sh all \
$PROJECT_MODULE/pkg/k8sclient \
$PROJECT_MODULE/pkg/apis \
Expand All @@ -25,12 +30,14 @@ docker run --rm \
-t \
-e GOPATH="" \
-v "${TOPLEVEL_DIR}:/secretless" \
"${IMAGE_NAME}" "$runner_cmd"
"${IMAGE_NAME}" /bin/bash -c "$runner_cmd"

echo "Moving the code in the right places..."
cp -r "$TOPLEVEL_DIR/$PROJECT_MODULE/pkg" "$TOPLEVEL_DIR"

echo "Removing temp files..."
rm -rf "$TOPLEVEL_DIR/github.com"
docker run --rm \
-v "${TOPLEVEL_DIR}:/secretless" \
"${IMAGE_NAME}" /bin/bash -c "rm -rf github.com"

echo "Code-gen done!"
36 changes: 13 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/cyberark/secretless-broker

require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Microsoft/go-winio v0.4.17 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/aws/aws-sdk-go v1.15.79
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/codegangsta/cli v1.20.0
Expand All @@ -15,43 +15,33 @@ require (
github.com/docker/docker v1.4.2-0.20191231165639-e6f6c35b7902
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/fsnotify/fsnotify v1.4.9
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hashicorp/vault/api v1.0.2
github.com/heptiolabs/healthcheck v0.0.0-20180807145615-6ff867650f40
github.com/imdario/mergo v0.3.8 // indirect
github.com/joho/godotenv v1.2.0
github.com/json-iterator/go v1.1.8 // indirect
github.com/keybase/go-keychain v0.0.0-20201121013009-976c83ec27a6
github.com/kr/pretty v0.2.1 // indirect
github.com/lib/pq v0.0.0-20180123210206-19c8e9ad0095
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.2.1
github.com/prometheus/client_golang v1.2.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337
github.com/spf13/pflag v1.0.5 // indirect
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/objx v0.2.0 // indirect
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f
golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 // indirect
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/yaml.v2 v2.2.3
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gotest.tools v2.2.0+incompatible // indirect
k8s.io/api v0.0.0-20180712090710-2d6f90ab1293
k8s.io/apiextensions-apiserver v0.0.0-20180808065829-408db4a50408
k8s.io/apimachinery v0.0.0-20180621070125-103fd098999d
k8s.io/client-go v0.0.0-20180806134042-1f13a808da65
k8s.io/api v0.22.3
k8s.io/apiextensions-apiserver v0.22.3
k8s.io/apimachinery v0.22.3
k8s.io/client-go v0.22.3
)

replace github.com/denisenkom/go-mssqldb => ./third_party/go-mssqldb
Expand All @@ -60,4 +50,4 @@ replace github.com/denisenkom/go-mssqldb => ./third_party/go-mssqldb
// This is our fix:
replace honnef.co/go/tools => github.com/dominikh/go-tools v0.0.1-2019.2.3

go 1.15
go 1.16
Loading