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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_output
/cluster-storage-operator

# Temporary Build Files
build/_output
Expand Down
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
FROM alpine:3.6
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder
WORKDIR /go/src/github.com/openshift/cluster-storage-operator
COPY . .
RUN make build

RUN adduser -D cluster-storage-operator
FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
COPY --from=builder /go/src/github.com/openshift/cluster-storage-operator/cluster-storage-operator /usr/bin/
COPY manifests /manifests
RUN useradd cluster-storage-operator
USER cluster-storage-operator

COPY deploy/deployment.yaml /manifests/deployment.yaml
COPY deploy/roles.yaml /manifests/roles.yaml
COPY deploy/image-references /manifests/image-references

ADD build/_output/bin/cluster-storage-operator /usr/local/bin/cluster-storage-operator
ENTRYPOINT ["/usr/bin/cluster-storage-operator"]
LABEL io.openshift.release.operator true
LABEL io.k8s.display-name="OpenShift cluster-storage-operator" \
io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of cluster storage components." \
maintainer="Matthew Wong <mawong@redhat.com>"
8 changes: 8 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ required = [
"k8s.io/code-generator/cmd/informer-gen",
"k8s.io/code-generator/cmd/openapi-gen",
"k8s.io/gengo/args",
"github.com/jteeuwen/go-bindata",
]

[[override]]
Expand Down Expand Up @@ -45,6 +46,11 @@ required = [
branch = "master" #osdk_branch_annotation
# version = "=v0.1.0" #osdk_version_annotation

[[constraint]]
name="github.com/jteeuwen/go-bindata"
# Current working master
revision = "6025e8de665b31fa74ab1a66f2cddd8c0abf887e"

[prune]
go-tests = true
non-go = true
Expand All @@ -54,6 +60,10 @@ required = [
name = "k8s.io/code-generator"
non-go = false

[[prune.project]]
name="github.com/jteeuwen/go-bindata"
unused-packages = false

[[constraint]]
name = "github.com/openshift/installer"
branch = "master"
Expand Down
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
IMG ?= openshift/origin-cluster-storage-operator:latest

PACKAGE=github.com/openshift/cluster-storage-operator
MAIN_PACKAGE=$(PACKAGE)/cmd/cluster-storage-operator

BIN=$(lastword $(subst /, ,$(MAIN_PACKAGE)))

ENVVAR=GOOS=linux CGO_ENABLED=0
GOOS=linux
GO_BUILD_RECIPE=GOOS=$(GOOS) go build -o $(BIN) $(MAIN_PACKAGE)

BINDATA=pkg/generated/bindata.go
GOBINDATA_BIN=$(GOPATH)/bin/go-bindata

all: build

build: generate
operator-sdk build quay.io/openshift/cluster-storage-operator
$(GO_BUILD_RECIPE)

generate: $(GOBINDATA_BIN)
go-bindata -nometadata -pkg generated -o $(BINDATA) manifests/...
$(GOBINDATA_BIN) -nometadata -pkg generated -o $(BINDATA) assets/...

$(GOBINDATA_BIN):
go get -u github.com/jteeuwen/go-bindata/...
go build -o $(GOBINDATA_BIN) ./vendor/github.com/jteeuwen/go-bindata/go-bindata

test:
go test ./pkg/...
Expand All @@ -20,5 +31,9 @@ verify:
hack/verify-gometalinter.sh
hack/verify-govet.sh

container: build test verify
docker build . -t $(IMG)

clean:
rm -rf build/_output
go clean
rm -f $(BIN)
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions deploy/crds/cluster_v1alpha1_clusterstorage_crd.yaml

This file was deleted.

1 change: 1 addition & 0 deletions deploy/crds/cluster_v1alpha1_clusterstorage_crd.yaml
36 changes: 0 additions & 36 deletions deploy/operator.yaml

This file was deleted.

131 changes: 0 additions & 131 deletions deploy/roles.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions manifests/00-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-cluster-storage-operator
13 changes: 13 additions & 0 deletions manifests/01-cluster-config-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-storage-operator
namespace: kube-system
subjects:
- kind: ServiceAccount
name: cluster-storage-operator
namespace: openshift-cluster-storage-operator
roleRef:
kind: Role
name: cluster-storage-operator
apiGroup: rbac.authorization.k8s.io
14 changes: 14 additions & 0 deletions manifests/01-cluster-config-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-storage-operator
namespace: kube-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- watch
- list
12 changes: 12 additions & 0 deletions manifests/01-cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-storage-operator
subjects:
- kind: ServiceAccount
name: cluster-storage-operator
namespace: openshift-cluster-storage-operator
roleRef:
kind: ClusterRole
name: cluster-storage-operator
apiGroup: rbac.authorization.k8s.io
17 changes: 17 additions & 0 deletions manifests/01-cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-storage-operator
rules:
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- get
- watch
- list
- create
- delete
- patch
- update
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cluster-storage-operator
namespace: openshift-cluster-storage-operator
subjects:
- kind: ServiceAccount
name: cluster-storage-operator
Expand Down
Loading