Skip to content

Commit

Permalink
Merge develop into master 1.10.0 (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbel Nathan authored Jul 26, 2022
1 parent 85cc3c3 commit 6f6f9af
Show file tree
Hide file tree
Showing 214 changed files with 8,852 additions and 22,152 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

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

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -34,14 +34,14 @@ help: ## Display this help.

manifests: controller-gen kustomize## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=ibm-block-csi-operator webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(KUSTOMIZE) build config/crd/ -o config/crd/bases/csi.ibm.com_ibmblockcsis.yaml
hack/update_labels_in_crd.sh

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

CONTROLLER_GEN = controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)

KUSTOMIZE = kustomize
kustomize: ## Download kustomize locally if necessary.
Expand Down Expand Up @@ -75,9 +75,15 @@ build-unit-tests-image:
run-unit-tests:
$(run_unit_tests_image) make test

KUBERNETES_VERSION=1.23.1
.PHONY: test
test: check-generated-manifests update
ginkgo -r -v -skipPackage tests
ifeq (s390x, $(shell hack/get-arch.sh))
ginkgo -r -v -skipPackage envtest
else
export KUBEBUILDER_ASSETS=$(shell setup-envtest use -p path ${KUBERNETES_VERSION});\
ginkgo -r -v
endif

.PHONY: update
update: kustomize
Expand Down
14 changes: 7 additions & 7 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file details additional third party software license agreements
and third party notices and information that are required
to be reproduced for the following programs:

Operator for IBM Block Storage CSI Driver version 1.9.0
Operator for IBM Block Storage CSI Driver version 1.10.0



Expand Down Expand Up @@ -2276,7 +2276,7 @@ End of GNU GPL Version 3.0 License

===========================================================================
END OF TERMS AND CONDITIONS FOR SEPARATELY LICENSED CODE for Operator for
IBM Block Storage CSI Driver version 1.9.0
IBM Block Storage CSI Driver version 1.10.0
===========================================================================


Expand All @@ -2287,7 +2287,7 @@ IBM Block Storage CSI Driver version 1.9.0

GNU GPL and / or LGPL Source Code for:

Operator for IBM Block Storage CSI Driver 1.9.0
Operator for IBM Block Storage CSI Driver 1.10.0

===========================================================================

Expand All @@ -2306,7 +2306,7 @@ General Public License 2.0.
Red Hat Universal Base Image 8

Source code to any of the above-listed packages distributed with
Operator for IBM Block Storage CSI Driver 1.9.0 is available at the
Operator for IBM Block Storage CSI Driver 1.10.0 is available at the
website below, when a URL is provided, or by sending a request to the
following address or email:

Expand Down Expand Up @@ -2335,7 +2335,7 @@ General Public License 3.0.
Red Hat Universal Base Image 8

Source code to any of the above-listed packages distributed with
Operator for IBM Block Storage CSI Driver 1.9.0 is available at the
Operator for IBM Block Storage CSI Driver 1.10.0 is available at the
website below, when a URL is provided, or by sending a request to the
following address or email:

Expand Down Expand Up @@ -2363,7 +2363,7 @@ under the GNU Lesser General Public License 3.0.
Prometheus version 1.8.2

Source code to any of the above-listed packages distributed with
Operator for IBM Block Storage CSI Driver 1.9.0 is available at the
Operator for IBM Block Storage CSI Driver 1.10.0 is available at the
website below, when a URL is provided, or by sending a request to the
following address or email:

Expand Down Expand Up @@ -5160,6 +5160,6 @@ END OF thrift NOTICES AND INFORMATION

===========================================================================
END OF NOTICES AND INFORMATION FOR Operator for IBM Block
Storage CSI Driver 1.9.0
Storage CSI Driver 1.10.0
===========================================================================

17 changes: 17 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,21 @@ resources:
kind: IBMBlockCSI
path: github.com/IBM/ibm-block-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ibm.com
group: csi
kind: HostDefiner
path: github.com/IBM/ibm-block-csi-operator/api/v1
version: v1
- api:
crdVersion: v1
controller: true
domain: ibm.com
group: csi
kind: HostDefinition
path: github.com/IBM/ibm-block-csi-operator/api/v1
version: v1
version: "3"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Operator for IBM block storage CSI driver
# IBM block storage CSI driver operator
The Container Storage Interface (CSI) Driver for IBM block storage systems enables container orchestrators such as Kubernetes to manage the life cycle of persistent storage.

This is the official operator to deploy and manage IBM block storage CSI driver.
Expand Down
26 changes: 26 additions & 0 deletions api/v1/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright 2022 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package v1

type DriverPhase string

const (
DriverPhaseNone DriverPhase = ""
DriverPhaseCreating DriverPhase = "Creating"
DriverPhaseRunning DriverPhase = "Running"
DriverPhaseFailed DriverPhase = "Failed"
)
89 changes: 89 additions & 0 deletions api/v1/hostdefiner_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Copyright 2022 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package v1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// HostDefinerSpec defines the desired state of HostDefiner
type HostDefinerSpec struct {
HostDefiner IBMBlockHostDefinerSpec `json:"hostDefiner"`

ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
}

// IBMBlockHostDefinerSpec defines the observed state of HostDefiner
type IBMBlockHostDefinerSpec struct {
Repository string `json:"repository"`
Tag string `json:"tag"`

// +kubebuilder:validation:Optional
Prefix string `json:"prefix"`
// +kubebuilder:validation:Optional
ConnectivityType string `json:"connectivityType"`
// +kubebuilder:validation:Optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
// +kubebuilder:validation:Optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// +kubebuilder:validation:Optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default:=true
AllowDelete bool `json:"allowDelete,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default:=false
DynamicNodeLabeling bool `json:"dynamicNodeLabeling,omitempty"`
}

// HostDefinerStatus defines the observed state of HostDefiner
type HostDefinerStatus struct {
Phase DriverPhase `json:"phase"`
HostDefinerReady bool `json:"hostDefinerReady"`

// Version is the current driver version
Version string `json:"version"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// HostDefiner is the Schema for the hostdefiners API
type HostDefiner struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec HostDefinerSpec `json:"spec,omitempty"`
Status HostDefinerStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// HostDefinerList contains a list of HostDefiner
type HostDefinerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HostDefiner `json:"items"`
}

func init() {
SchemeBuilder.Register(&HostDefiner{}, &HostDefinerList{})
}
75 changes: 75 additions & 0 deletions api/v1/hostdefinition_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* Copyright 2019 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// HostDefinitionSpec defines the desired state of HostDefinition
type HostDefinitionSpec struct {
HostDefinition Definition `json:"hostDefinition"`
}

// Definition defines the observed state of HostDefinition
type Definition struct {
NodeName string `json:"nodeName"`

// +kubebuilder:validation:Optional
SecretName string `json:"secretName"`
// +kubebuilder:validation:Optional
SecretNamespace string `json:"secretNamespace"`
// +kubebuilder:validation:Optional
NodeId string `json:"nodeId"`
}

// HostDefinitionStatus defines the status of the host definition on the storage
type HostDefinitionStatus struct {
Phase DriverPhase `json:"phase"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster

// HostDefinition is the Schema for the hostdefinitions API
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.hostDefinition.nodeName`
type HostDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec HostDefinitionSpec `json:"spec,omitempty"`
Status HostDefinitionStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// HostDefinitionList contains a list of HostDefinition
type HostDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HostDefinition `json:"items"`
}

func init() {
SchemeBuilder.Register(&HostDefinition{}, &HostDefinitionList{})
}
9 changes: 0 additions & 9 deletions api/v1/ibmblockcsi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type DriverPhase string

const (
DriverPhaseNone DriverPhase = ""
DriverPhaseCreating DriverPhase = "Creating"
DriverPhaseRunning DriverPhase = "Running"
DriverPhaseFailed DriverPhase = "Failed"
)

type CSISidecar struct {
// The name of the csi sidecar image
Name string `json:"name"`
Expand Down
Loading

0 comments on commit 6f6f9af

Please sign in to comment.