Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
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 .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17

- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16.2'
go-version: '1.17.11'
- name: Run go tidy
run: make tidy && git diff --exit-code && test -z "$(git ls-files --exclude-standard --others | tee /dev/fd/2)"
- name: Run go test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.16.2 as builder
FROM golang:1.17.11 as builder

WORKDIR /workspace
COPY . /workspace
Expand Down
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ OPERATOR_IMAGE ?= storageos/api-manager:test
# Image URL for manifest image.
MANIFESTS_IMAGE ?= storageos/api-manager-manifests:test

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

CONTROLLER_RUNTIME_VERSION=0.8.3
CONTROLLER_TOOLS_VERSION=0.4.1
KUSTOMIZE_VERSION=3.8.7
CONTROLLER_TOOLS_VERSION=0.9.0
KUSTOMIZE_VERSION=4.5.5
# Set the shell as a workaround for the issue
# https://github.com/operator-framework/operator-sdk/issues/4203
SHELL=bash
Expand Down Expand Up @@ -43,7 +40,7 @@ help: ## Display this help.
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName="storageos-api-manager" webhook paths="./..." output:crd:artifacts:config=config/crd/bases output:webhook:artifacts:config=config/webhook/bases output:rbac:artifacts:config=config/rbac/bases
$(CONTROLLER_GEN) crd paths=./api/... rbac:roleName="storageos-api-manager" webhook paths="./..." output:crd:artifacts:config=config/crd/bases output:webhook:artifacts:config=config/webhook/bases output:rbac:artifacts:config=config/rbac/bases

generate: controller-gen mockgen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down Expand Up @@ -110,12 +107,16 @@ controller-gen: ## Download controller-gen locally if necessary.

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v$(KUSTOMIZE_VERSION))
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v$(KUSTOMIZE_VERSION))

HUSKY = $(shell pwd)/bin/husky
.PHONY: husky
husky: ## Download husky locally if necessary.
$(call go-get-tool,$(HUSKY),github.com/automation-co/husky@v0.2.5)

.PHONY: mockgen
mockgen: ## Installs mockgen locally if necessary.
go install github.com/golang/mock/mockgen@v1.6.0

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand All @@ -131,11 +132,6 @@ rm -rf $$TMP_DIR ;\
}
endef


# Install mockgen
mockgen:
go install github.com/golang/mock/mockgen@v1.5.0

# Create local secret, required for `run` target.
secret: .secret .secret/username .secret/password
.secret:
Expand Down
9 changes: 1 addition & 8 deletions config/crd/bases/api.storageos.com_nodes.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: nodes.api.storageos.com
spec:
Expand Down Expand Up @@ -97,9 +96,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions config/crd/bases/api.storageos.com_volumes.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: volumes.api.storageos.com
spec:
Expand Down Expand Up @@ -242,9 +241,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
1 change: 0 additions & 1 deletion config/rbac/bases/role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
1 change: 0 additions & 1 deletion config/webhook/bases/manifests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
Expand Down
19 changes: 9 additions & 10 deletions controllers/fencer/mocks/mock_node_fencer.go

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

2 changes: 1 addition & 1 deletion controllers/fencer/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
)

// NodeFencer provides access to nodes and the volumes running on them.
//go:generate mockgen -destination=mocks/mock_node_fencer.go -package=mocks . NodeFencer
//go:generate mockgen -build_flags=--mod=vendor -source=reconciler.go -destination=mocks/mock_node_fencer.go -package=mocks . NodeFencer
type NodeFencer interface {
ListNodes(ctx context.Context) ([]client.Object, error)
GetVolume(ctx context.Context, key client.ObjectKey) (storageos.Object, error)
Expand Down
20 changes: 10 additions & 10 deletions controllers/namespace-delete/mocks/mock_namespace_deleter.go

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

2 changes: 1 addition & 1 deletion controllers/namespace-delete/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

//NamespaceDeleter provides access to removing namespaces from StorageOS.
//go:generate mockgen -build_flags=--mod=vendor -destination=mocks/mock_namespace_deleter.go -package=mocks . NamespaceDeleter
//go:generate mockgen -build_flags=--mod=vendor -source=reconciler.go -destination=mocks/mock_namespace_deleter.go -package=mocks . NamespaceDeleter
type NamespaceDeleter interface {
DeleteNamespace(ctx context.Context, key client.ObjectKey) error
ListNamespaces(ctx context.Context) ([]storageos.Object, error)
Expand Down
19 changes: 9 additions & 10 deletions controllers/node-delete/mocks/mock_node_deleter.go

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

2 changes: 1 addition & 1 deletion controllers/node-delete/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

//NodeDeleter provides access to removing nodes from StorageOS.
//go:generate mockgen -build_flags=--mod=vendor -destination=mocks/mock_node_deleter.go -package=mocks . NodeDeleter
//go:generate mockgen -build_flags=--mod=vendor -source=reconciler.go -destination=mocks/mock_node_deleter.go -package=mocks . NodeDeleter
type NodeDeleter interface {
DeleteNode(ctx context.Context, key client.ObjectKey) error
ListNodes(ctx context.Context) ([]client.Object, error)
Expand Down
22 changes: 11 additions & 11 deletions controllers/node-label/mocks/mock_node_labeller.go

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

2 changes: 1 addition & 1 deletion controllers/node-label/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

// NodeLabeller provides access to update node labels.
//go:generate mockgen -build_flags=--mod=vendor -destination=mocks/mock_node_labeller.go -package=mocks . NodeLabeller
//go:generate mockgen -build_flags=--mod=vendor -source=reconciler.go -destination=mocks/mock_node_labeller.go -package=mocks . NodeLabeller
type NodeLabeller interface {
EnsureNodeLabels(ctx context.Context, key client.ObjectKey, labels map[string]string) error
NodeObjects(ctx context.Context) (map[client.ObjectKey]storageos.Object, error)
Expand Down
Loading