Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8s1.14 #292

Merged
merged 33 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f4bf694
Migrate libraries, no manifest/Makefile work
maxsmythe Nov 5, 2019
2888bd8
Migration to Kubebuilder V2 that works on desktop build
maxsmythe Nov 6, 2019
7b6cc43
Use http submodule repo
maxsmythe Nov 6, 2019
ed9adf4
Fix e2e tests
maxsmythe Nov 6, 2019
3c7d786
fix e2e tests
maxsmythe Nov 6, 2019
1e384bf
Restore --pull flag in docker-build
maxsmythe Nov 7, 2019
b46dce0
Use unstructured to inject CA cert to avoid clobbering unknown fields
maxsmythe Nov 7, 2019
4df5adc
Fix encoding error + nits
maxsmythe Nov 7, 2019
2f89077
retrieve crd manifests from vendor cache
maxsmythe Nov 8, 2019
22878a6
Fix nits
maxsmythe Nov 8, 2019
3aa4e59
Fix location of CRD yaml in ConstraintTemplate test
maxsmythe Nov 8, 2019
ac0b75c
Use vendor directory exclusively for builds, cache making of controll…
maxsmythe Nov 8, 2019
411189d
More -mod vendor flags set
maxsmythe Nov 8, 2019
7084a6c
-mod vendor not necessary for go fmt
maxsmythe Nov 8, 2019
65e6c65
Switch to distroless
maxsmythe Nov 8, 2019
bd7c5cb
remove extra parenthesis
maxsmythe Nov 8, 2019
3c3f725
More build fixing
maxsmythe Nov 8, 2019
ad1d197
Gomodules was disabled
maxsmythe Nov 8, 2019
c3711bf
Need to copy go.mod
maxsmythe Nov 8, 2019
29af827
Forgot copy destination
maxsmythe Nov 8, 2019
e14a1c0
Use committed version of framework; move manifest to gatekeeper_kubeb…
maxsmythe Nov 12, 2019
f4bf141
Missed some files
maxsmythe Nov 12, 2019
c1e4bba
Cert deadlines moved to constants
maxsmythe Nov 12, 2019
be6ad32
Avoid storing e2e commands in variables. This enables more legible lo…
maxsmythe Nov 12, 2019
d7b671c
Double e2e test timeouts
maxsmythe Nov 12, 2019
ac7a533
Do not allow kubectl update to clobber cert in validatingwebhookconfi…
maxsmythe Nov 13, 2019
aa8dd32
update comments
maxsmythe Nov 13, 2019
3f6e45d
Fix grammar on comment
maxsmythe Nov 13, 2019
8c67c45
Simplify CA cert injection into validating WH into a pure reconcile loop
maxsmythe Nov 13, 2019
3363394
Fix nits
maxsmythe Nov 13, 2019
afaf5a1
Fix nits, unreachable code
maxsmythe Nov 13, 2019
8c27acb
Fix nits
maxsmythe Nov 14, 2019
ee135e9
check for key membership in map
maxsmythe Nov 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bin
*.out

# Manager image patch file
overlays/dev/manager_image_patch.yaml
config/overlays/dev/manager_image_patch.yaml

# Kubernetes Generated files - skip generated files, except for vendored files

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: required
language: go
go_import_path: github.com/open-policy-agent/gatekeeper
go:
- "1.12.x"
- "1.13.x"

services:
- docker
Expand All @@ -18,7 +18,7 @@ jobs:
- make patch-image IMG=gatekeeper-e2e:latest USE_LOCAL_IMG=true
- make deploy
- make test-e2e
- echo -e '\n\n======= manager logs =======\n\n' && kubectl logs -n gatekeeper-system gatekeeper-controller-manager-0 manager
- echo -e '\n\n======= manager logs =======\n\n' && kubectl logs -n gatekeeper-system -l control-plane=controller-manager
deploy:
- provider: script
skip_cleanup: true
Expand Down
27 changes: 12 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Build the manager binary
FROM golang:1.12.9 as builder
FROM golang:1.13.3 as builder

# Copy in the go src
WORKDIR /go/src/github.com/open-policy-agent/gatekeeper
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/
COPY main.go main.go
COPY api/ api/
COPY go.mod .

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/open-policy-agent/gatekeeper/cmd/manager
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod vendor -a -o manager main.go

# Copy the controller-manager into a thin image
FROM ubuntu:latest
# 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/static:nonroot
WORKDIR /
COPY --from=builder /go/src/github.com/open-policy-agent/gatekeeper/manager .
USER nonroot:nonroot

# Update image and add a non-root user
RUN apt update && apt upgrade -y \
&& useradd -rm -u 1000 -U manager

WORKDIR /home/manager/
COPY --chown=manager:manager --from=builder /go/src/github.com/open-policy-agent/gatekeeper/manager .

USER 1000

ENTRYPOINT ["./manager"]
ENTRYPOINT ["/manager"]
20 changes: 8 additions & 12 deletions Dockerfile_ci
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
FROM ubuntu:latest

RUN apt update &&\
apt upgrade -y &&\
useradd -rm -u 1000 -U manager

WORKDIR /home/manager/
COPY --chown=manager:manager bin/manager .

USER 1000

ENTRYPOINT ["./manager"]
# 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/static:nonroot
WORKDIR /
COPY bin/manager .
USER nonroot:nonroot

ENTRYPOINT ["/manager"]
Loading