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

Install CSI driver #3

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/conf/commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"action",
"api",
"bundle",
"csi",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation

"ci",
"console",
"controllers",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v2
with:
Expand All @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
go-version: '1.19'

- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v2
with:
Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.17 as builder
FROM golang:1.19 as builder

WORKDIR /workspace

Expand All @@ -10,12 +10,14 @@ COPY go.mod go.sum ./
COPY vendor/ vendor/

# Copy the project source
COPY main.go Makefile ./
COPY main.go Makefile images.yaml ./
COPY hack/ hack/
COPY api/ api/
COPY controllers/ controllers/
COPY config/ config/

COPY csi/ csi/
COPY pkg/ pkg/
COPY templates/ templates/
# Run tests and linting
RUN make go-test

Expand All @@ -27,6 +29,7 @@ RUN make go-build
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/images.yaml /etc/ocs-client-operator/images.yaml
USER 65532:65532

ENTRYPOINT ["/manager"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ lint: ## Run golangci-lint against code.
docker run --rm -v $(PROJECT_DIR):/app:Z -w /app $(GO_LINT_IMG) golangci-lint run ./...

godeps-update: ## Run go mod tidy & vendor
go mod tidy -compat=1.17 && go mod vendor
go mod tidy && go mod vendor

test-setup: godeps-update generate fmt vet ## Run setup targets for tests

Expand All @@ -64,6 +64,7 @@ e2e-test: ginkgo ## TODO: Run end to end functional tests.
##@ Build

build: container-build ## Build manager binary
go build -o ./bin/manager main.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing a local build after the container build? Best I remember, the use of a local go build should not be part of the default build procedure, we should always be using the container build unless the developer has a specific reason they need to do the local build during development.

Beyond this, there's already a go-build make target below that uses ./hack/go.build.sh to run the actual go build command.


go-build: ## Run go build against code.
@GOBIN=${GOBIN} ./hack/go-build.sh
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the odf v1alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=odf.openshift.io
// Package v1alpha1 contains API Schema definitions for the ocs v1alpha1 API group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason for changing the group name? This is technically part of ODF.

// +kubebuilder:object:generate=true
// +groupName=ocs.openshift.io
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "odf.openshift.io", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "ocs.openshift.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
145 changes: 145 additions & 0 deletions bundle/manifests/ocs-client-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,146 @@ spec:
spec:
clusterPermissions:
- rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- delete
- update
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- delete
- get
- update
- apiGroups:
- ""
resources:
- serviceaccounts/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- create
- delete
- get
- update
- apiGroups:
- apps
resources:
- daemonsets/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- update
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
verbs:
- bind
- create
- delete
- escalate
- get
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings/finalizers
verbs:
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
verbs:
- bind
- create
- delete
- escalate
- get
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles/finalizers
verbs:
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- bind
- create
- delete
- escalate
- get
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings/finalizers
verbs:
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
verbs:
- bind
- create
- delete
- escalate
- get
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles/finalizers
verbs:
- update
- apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
verbs:
- create
- get
- patch
- update
- watch
- apiGroups:
- storage.k8s.io
resources:
- csidrivers
verbs:
- create
- delete
- get
- update
- apiGroups:
- authentication.k8s.io
resources:
Expand Down Expand Up @@ -77,6 +217,11 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/ocs-dev/ocs-client-operator:latest
livenessProbe:
httpGet:
Expand Down
5 changes: 5 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ spec:
- --leader-elect
image: controller:latest
name: manager
env:
- name: OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
apiservicedefinitions: {}
customresourcedefinitions: {}
description: foo
displayName: OpenShift Data Foundation Client
displayName: OpenShift Data Foundation Client Operator
icon:
- base64data: ""
mediatype: ""
Expand Down
Loading