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

Bug 2276056: [release-4.16] Syncing latest changes from main #147

Merged
merged 51 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ada0dd7
controllers: pr issue fix
bernerhat Jan 23, 2024
6c778ae
godeps: updates ocs-operator dep
raaizik Apr 1, 2024
d7091e0
Merge pull request #126 from raaizik/export-name-deps
openshift-merge-bot[bot] Apr 1, 2024
9cebafc
makefile: allow images to be build using both podman and docker
rewantsoni Mar 13, 2024
4ca642e
makefile: update makefile so that operator can be built on all arch/os
rewantsoni Mar 13, 2024
10d598f
makefile: update opm version to 1.20.0
rewantsoni Mar 13, 2024
2d67dda
makefile: ignore idea folder from IntelliJ
rewantsoni Mar 13, 2024
8d3ef8b
makefile: run go-test as a subtarget of container build
rewantsoni Mar 13, 2024
b7bebdd
makefile: remove depricated linters and omit :Z
rewantsoni Mar 13, 2024
9807312
makefile: add --platform flag to build images for linux/amd64
rewantsoni Mar 13, 2024
05f59b7
makefile: move to filebased catalog source
rewantsoni Mar 13, 2024
4e6b703
makefile: update setup envtest to latest version
rewantsoni Mar 13, 2024
224d681
Merge pull request #110 from rewantsoni/mac
openshift-merge-bot[bot] Apr 3, 2024
c99ef2f
Merge pull request #64 from bernerhat/BZ-2251308
openshift-merge-bot[bot] Apr 3, 2024
4a78be3
controllers: implement ocs-client-operator auto upgrade
leelavg Mar 24, 2024
c8bacee
bundle: set correct name for updating rbac proxy image
leelavg Apr 4, 2024
f07b6a7
Merge pull request #120 from leelavg/5496-auto-upgrade
openshift-merge-bot[bot] Apr 4, 2024
0da9452
Merge pull request #129 from leelavg/update-csv
openshift-merge-bot[bot] Apr 4, 2024
0ed8b7b
bundle: update bundle w/ bumping version
leelavg Apr 4, 2024
18969c7
Merge pull request #131 from leelavg/update-bundle
openshift-merge-bot[bot] Apr 4, 2024
b27e92b
bundle: update csi-addons dependency
leelavg Apr 4, 2024
1083b74
Merge pull request #132 from leelavg/update-csi-addons
openshift-merge-bot[bot] Apr 4, 2024
015252a
controllers: handle csi drivers and scc deletion
bernerhat Feb 19, 2024
4d55c5b
Merge pull request #80 from bernerhat/csi-drivers-deletion
openshift-merge-bot[bot] Apr 16, 2024
75cb56c
api: setting clusterName
raaizik Apr 1, 2024
cfe102c
Merge pull request #127 from raaizik/export-name
openshift-merge-bot[bot] Apr 16, 2024
7ef2bdf
controllers: handle csi drivers and scc deletion
bernerhat Feb 19, 2024
06b826a
Merge pull request #81 from bernerhat/deletion-safegaurd
openshift-merge-bot[bot] Apr 16, 2024
c73cd6b
controllers: reconcile webhook service and deletion of webhook
leelavg Apr 16, 2024
e1db953
Merge pull request #140 from leelavg/remove-hook
openshift-merge-bot[bot] Apr 16, 2024
7db151a
api: change storageclient from namespace to cluster scoped
leelavg Apr 5, 2024
0bb0bcb
controllers: update storageclient_controller for clusterscope change
leelavg Apr 5, 2024
c73bfde
api: update storageclaim api to refer storageclient at clusterscope
leelavg Apr 5, 2024
2bb8a39
controllers: update storageclaim_controller for clusterscope change
leelavg Apr 5, 2024
2e4ce0b
controllers: update status reporter for clusterscoped change
leelavg Apr 5, 2024
72f43f1
bundle: update bundle to make storageclient clusterscoped
leelavg Apr 16, 2024
c893ec3
controllers: remove auto created storageclaims
leelavg Apr 16, 2024
05917a6
Merge pull request #133 from leelavg/scl-clusterscope
openshift-merge-bot[bot] Apr 17, 2024
605e812
godeps: update ocs-operator dependency for proto changes
leelavg Apr 17, 2024
e6b3fa1
controllers: rename storageclassclaim to storageclaim in gRPC methods
leelavg Apr 8, 2024
7cd3a79
controllers: use updated method for setting client name in heartbeat
leelavg Apr 5, 2024
42be557
Merge pull request #136 from leelavg/storageclaim-grpc
openshift-merge-bot[bot] Apr 17, 2024
4f46620
controllers: fix rbac, controllers, bundle, Makefile
leelavg Apr 18, 2024
6d2997d
Merge pull request #144 from leelavg/tested-fixes
openshift-merge-bot[bot] Apr 18, 2024
cf84a55
api: remove storageclassclaim api & migration controller
leelavg Apr 19, 2024
00598f9
Merge pull request #146 from leelavg/remove-classclaim
openshift-merge-bot[bot] Apr 21, 2024
c97c896
godeps: update ocs-operator deps for newer storageType enum
leelavg Apr 19, 2024
7db3302
controllers: use updated storageType enum
leelavg Apr 19, 2024
bf5478e
api: make value of storageclaim type case insensitive
leelavg Apr 19, 2024
44f5a68
bundle: update CRD field and latest changes
leelavg Apr 22, 2024
29394b2
Merge pull request #145 from leelavg/rename-claim-type
openshift-merge-bot[bot] Apr 22, 2024
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
bin/
testbin/

catalog
catalog.Dockerfile

# Created by https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,git
# Edit at https://www.toptal.com/developers/gitignore?templates=go,vim,visualstudiocode,git

Expand Down Expand Up @@ -74,6 +77,9 @@ tags
# Local History for Visual Studio Code
.history/

### IntelliJ ###
.idea

# Built Visual Studio Code Extensions
*.vsix

Expand Down
3 changes: 0 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ run:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- ineffassign
- staticcheck
- structcheck
- unused
- varcheck
- revive
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ COPY controllers/ controllers/
COPY config/ config/
COPY pkg/ pkg/
COPY service/ service/
# Run tests and linting
RUN make go-test

# Build
RUN make go-build
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include hack/make-project-vars.mk
include hack/make-tools.mk
include hack/make-bundle-vars.mk


# Setting SHELL to bash allows bash commands to be executed by recipes.
# This is a requirement for 'setup-envtest.sh' in the test target.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
Expand Down Expand Up @@ -55,15 +54,15 @@ vet: ## Run go vet against code.
go vet ./...

lint: ## Run golangci-lint against code.
docker run --rm -v $(PROJECT_DIR):/app:Z -w /app $(GO_LINT_IMG) golangci-lint run ./...
$(IMAGE_BUILD_CMD) run --rm -v $(PROJECT_DIR):/app -w /app $(GO_LINT_IMG) golangci-lint run ./...

godeps-update: ## Run go mod tidy & vendor
go mod tidy && go mod vendor

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

go-test: ## Run go test against code.
./hack/go-test.sh
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(BIN_DIR) -p path)" go test -coverprofile cover.out `go list ./... | grep -v "e2e"`

test: test-setup go-test ## Run go unit tests.

Expand All @@ -82,11 +81,11 @@ go-build: ## Run go build against code.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

container-build: test-setup ## Build container image with the manager.
docker build -t ${IMG} .
container-build: test ## Build container image with the manager.
$(IMAGE_BUILD_CMD) build --platform="linux/amd64" -t ${IMG} .

container-push: ## Push container image with the manager.
docker push ${IMG}
$(IMAGE_BUILD_CMD) push ${IMG}

##@ Deployment

Expand Down Expand Up @@ -117,7 +116,8 @@ bundle: manifests kustomize operator-sdk yq ## Generate bundle manifests and met
rm -rf ./bundle
$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/console && $(KUSTOMIZE) edit set image ocs-client-operator-console=$(OCS_CLIENT_CONSOLE_IMG)
cd config/console && $(KUSTOMIZE) edit set image ocs-client-operator-console=$(OCS_CLIENT_CONSOLE_IMG) && \
$(KUSTOMIZE) edit set nameprefix $(OPERATOR_NAMEPREFIX)
cd config/default && \
$(KUSTOMIZE) edit set image kube-rbac-proxy=$(RBAC_PROXY_IMG) && \
$(KUSTOMIZE) edit set namespace $(OPERATOR_NAMESPACE) && \
Expand All @@ -128,27 +128,27 @@ bundle: manifests kustomize operator-sdk yq ## Generate bundle manifests and met
--patch '[{"op": "replace", "path": "/spec/replaces", "value": "$(REPLACES)"}]'
$(KUSTOMIZE) build $(MANIFEST_PATH) | sed "s|STATUS_REPORTER_IMAGE_VALUE|$(IMG)|g" | awk '{print}'| \
$(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) --extra-service-accounts="$$($(KUSTOMIZE) build $(MANIFEST_PATH) | $(YQ) 'select(.kind == "ServiceAccount") | .metadata.name' -N | paste -sd "," -)"
sed -i "s|packageName:.*|packageName: ${CSI_ADDONS_PACKAGE_NAME}|g" "config/metadata/dependencies.yaml"
sed -i "s|version:.*|version: "${CSI_ADDONS_PACKAGE_VERSION}"|g" "config/metadata/dependencies.yaml"
yq -i '.dependencies[0].value.packageName = "'${CSI_ADDONS_PACKAGE_NAME}'"' config/metadata/dependencies.yaml
yq -i '.dependencies[0].value.version = "'${CSI_ADDONS_PACKAGE_VERSION}'"' config/metadata/dependencies.yaml
cp config/metadata/* bundle/metadata/
$(OPERATOR_SDK) bundle validate ./bundle

.PHONY: bundle-build
bundle-build: bundle ## Build the bundle image.
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
$(IMAGE_BUILD_CMD) build --platform="linux/amd64" -f bundle.Dockerfile -t $(BUNDLE_IMG) .

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
docker push $(BUNDLE_IMG)
$(IMAGE_BUILD_CMD) push $(BUNDLE_IMG)

# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
.PHONY: catalog-build
catalog-build: opm ## Build a catalog image.
$(OPM) index add --permissive --container-tool docker --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT)
./hack/build-catalog.sh

# Push the catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
docker push $(CATALOG_IMG)
$(IMAGE_BUILD_CMD) push $(CATALOG_IMG)
8 changes: 0 additions & 8 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ resources:
kind: StorageClient
path: github.com/red-hat-storage/ocs-client-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: openshift.io
group: ocs
kind: StorageClassClaim
path: github.com/red-hat-storage/ocs-client-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
Expand Down
18 changes: 6 additions & 12 deletions api/v1alpha1/storageclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,21 @@ type StorageClaimStatus struct {
Phase storageClaimState `json:"phase,omitempty"`
}

type StorageClientNamespacedName struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}

// StorageClaimSpec defines the desired state of StorageClaim
type StorageClaimSpec struct {
//+kubebuilder:validation:Enum=block;sharedfile
Type string `json:"type"`
EncryptionMethod string `json:"encryptionMethod,omitempty"`
StorageProfile string `json:"storageProfile,omitempty"`
StorageClient *StorageClientNamespacedName `json:"storageClient"`
//+kubebuilder:validation:XValidation:rule="self.lowerAscii()=='block'||self.lowerAscii()=='sharedfile'",message="value should be either 'sharedfile' or 'block'"
Type string `json:"type"`
EncryptionMethod string `json:"encryptionMethod,omitempty"`
StorageProfile string `json:"storageProfile,omitempty"`
StorageClient string `json:"storageClient"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:printcolumn:name="StorageType",type="string",JSONPath=".spec.type"
//+kubebuilder:printcolumn:name="StorageProfile",type="string",JSONPath=".spec.storageProfile"
//+kubebuilder:printcolumn:name="StorageClientName",type="string",JSONPath=".spec.storageClient.name"
//+kubebuilder:printcolumn:name="StorageClientNamespace",type="string",JSONPath=".spec.storageClient.namespace"
//+kubebuilder:printcolumn:name="StorageClientName",type="string",JSONPath=".spec.storageClient"
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

// StorageClaim is the Schema for the storageclaims API
Expand Down
89 changes: 0 additions & 89 deletions api/v1alpha1/storageclassclaim_types.go

This file was deleted.

1 change: 1 addition & 0 deletions api/v1alpha1/storageclient_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type StorageClientStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
//+kubebuilder:printcolumn:name="consumer",type="string",JSONPath=".status.id"

Expand Down
Loading
Loading