Skip to content
Permalink
Browse files

Migrate to using kubebuilder. (#41)

* Migrate to using kubebuilder.

Note that the authorization server use case is a bit tricky as
kubebuilder assumes that the Kubernetes API Server is available.
To circumvent this, I kept a portion of the old webhook server
code to function as a standalone server.

Most of the new files are generated by kubebuilder, as is the
directory structure. This includes the Dockerfile and Makefile.

Also, secrets should be automatically generated by the server
and the webhooks automatically registered (in the non-standalone
case).

Apologies for the massive change but there wasn't a gradual way
to do this.

Signed-off-by: Max Smythe <smythe@google.com>

* Tweak Docker repo. Fix Flags.

Signed-off-by: Max Smythe <smythe@google.com>

* Fix location of video link in README.

Signed-off-by: Max Smythe <smythe@google.com>

* Fix newline spacing in README.

Signed-off-by: Max Smythe <smythe@google.com>
  • Loading branch information...
maxsmythe authored and rite2nikhil committed Feb 1, 2019
1 parent d5df0ef commit a9d974ff9adb11e4b3cd87d9d232390e2857861e
@@ -1,3 +1,28 @@

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

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

!vendor/**/zz_generated.*

# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
@@ -0,0 +1,17 @@
# Build the manager binary
FROM golang:1.10.3 as builder

# Copy in the go src
WORKDIR /go/src/github.com/open-policy-agent/kubernetes-policy-controller
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/open-policy-agent/kubernetes-policy-controller/cmd/manager

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/open-policy-agent/kubernetes-policy-controller/manager .
ENTRYPOINT ["./manager"]

0 comments on commit a9d974f

Please sign in to comment.
You can’t perform that action at this time.