mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
feat(beta): adding v1 CRD for ZFS-LocalPV
Moving the CRDs to stable v1 version. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
307861282a
commit
472fd603ac
28 changed files with 426 additions and 48 deletions
2
Makefile
2
Makefile
|
|
@ -133,7 +133,7 @@ SRC_PKG := github.com/openebs/zfs-localpv/pkg
|
||||||
# code generation for custom resources
|
# code generation for custom resources
|
||||||
.PHONY: kubegen
|
.PHONY: kubegen
|
||||||
kubegen: kubegendelete deepcopy-install clientset-install lister-install informer-install
|
kubegen: kubegendelete deepcopy-install clientset-install lister-install informer-install
|
||||||
@GEN_SRC=openebs.io/zfs/v1alpha1 make deepcopy clientset lister informer
|
@GEN_SRC=openebs.io/zfs/v1 make deepcopy clientset lister informer
|
||||||
|
|
||||||
# deletes generated code by codegen
|
# deletes generated code by codegen
|
||||||
.PHONY: kubegendelete
|
.PHONY: kubegendelete
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
#set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
|
@ -28,9 +28,7 @@ then
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
|
$CONTROLLER_GEN crd:trivialVersions=false,preserveUnknownFields=false paths=./pkg/apis/... output:crd:artifacts:config=deploy/yamls
|
||||||
|
|
||||||
$CONTROLLER_GEN crd:trivialVersions=true,preserveUnknownFields=false paths=${SCRIPT_ROOT}/pkg/apis/openebs.io/zfs/v1alpha1 output:crd:artifacts:config=deploy/yamls
|
|
||||||
|
|
||||||
## create the the crd yamls
|
## create the the crd yamls
|
||||||
|
|
||||||
|
|
@ -74,7 +72,17 @@ echo '# This manifest is autogenerated via `make manifests` command
|
||||||
# with associated CRs & RBAC rules.
|
# with associated CRs & RBAC rules.
|
||||||
' > deploy/zfs-operator.yaml
|
' > deploy/zfs-operator.yaml
|
||||||
|
|
||||||
cat deploy/yamls/namespace.yaml deploy/yamls/zfsvolume-crd.yaml deploy/yamls/zfssnapshot-crd.yaml deploy/yamls/zfs-driver.yaml >> deploy/zfs-operator.yaml
|
# Add namespace creation to the Operator yaml
|
||||||
|
cat deploy/yamls/namespace.yaml >> deploy/zfs-operator.yaml
|
||||||
|
|
||||||
|
# Add ZFSVolume v1alpha1 and v1 CRDs to the Operator yaml
|
||||||
|
cat deploy/yamls/zfsvolume-crd.yaml >> deploy/zfs-operator.yaml
|
||||||
|
|
||||||
|
# Add ZFSSnapshot v1alpha1 and v1 CRDs to the Operator yaml
|
||||||
|
cat deploy/yamls/zfssnapshot-crd.yaml >> deploy/zfs-operator.yaml
|
||||||
|
|
||||||
|
# Add the driver deployment to the Operator
|
||||||
|
cat deploy/yamls/zfs-driver.yaml >> deploy/zfs-operator.yaml
|
||||||
|
|
||||||
# To use your own boilerplate text use:
|
# To use your own boilerplate text use:
|
||||||
# --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt
|
# --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt
|
||||||
|
|
|
||||||
1
changelogs/unreleased/140-pawanpraka1
Normal file
1
changelogs/unreleased/140-pawanpraka1
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
adding v1 CRD for ZFS-LocalPV
|
||||||
|
|
@ -191,11 +191,14 @@ spec:
|
||||||
- spec
|
- spec
|
||||||
- status
|
- status
|
||||||
type: object
|
type: object
|
||||||
version: v1alpha1
|
version: v1
|
||||||
versions:
|
versions:
|
||||||
- name: v1alpha1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
- name: v1alpha1
|
||||||
|
served: true
|
||||||
|
storage: false
|
||||||
status:
|
status:
|
||||||
acceptedNames:
|
acceptedNames:
|
||||||
kind: ""
|
kind: ""
|
||||||
|
|
|
||||||
|
|
@ -224,11 +224,14 @@ spec:
|
||||||
required:
|
required:
|
||||||
- spec
|
- spec
|
||||||
type: object
|
type: object
|
||||||
version: v1alpha1
|
version: v1
|
||||||
versions:
|
versions:
|
||||||
- name: v1alpha1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
- name: v1alpha1
|
||||||
|
served: true
|
||||||
|
storage: false
|
||||||
status:
|
status:
|
||||||
acceptedNames:
|
acceptedNames:
|
||||||
kind: ""
|
kind: ""
|
||||||
|
|
|
||||||
|
|
@ -245,11 +245,14 @@ spec:
|
||||||
required:
|
required:
|
||||||
- spec
|
- spec
|
||||||
type: object
|
type: object
|
||||||
version: v1alpha1
|
version: v1
|
||||||
versions:
|
versions:
|
||||||
- name: v1alpha1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
- name: v1alpha1
|
||||||
|
served: true
|
||||||
|
storage: false
|
||||||
status:
|
status:
|
||||||
acceptedNames:
|
acceptedNames:
|
||||||
kind: ""
|
kind: ""
|
||||||
|
|
@ -449,11 +452,14 @@ spec:
|
||||||
- spec
|
- spec
|
||||||
- status
|
- status
|
||||||
type: object
|
type: object
|
||||||
version: v1alpha1
|
version: v1
|
||||||
versions:
|
versions:
|
||||||
- name: v1alpha1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
- name: v1alpha1
|
||||||
|
served: true
|
||||||
|
storage: false
|
||||||
status:
|
status:
|
||||||
acceptedNames:
|
acceptedNames:
|
||||||
kind: ""
|
kind: ""
|
||||||
|
|
|
||||||
21
pkg/apis/openebs.io/zfs/v1/doc.go
Normal file
21
pkg/apis/openebs.io/zfs/v1/doc.go
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The OpenEBS Authors
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen=package,register
|
||||||
|
|
||||||
|
// Package v1 is the API version
|
||||||
|
// +groupName=zfs.openebs.io
|
||||||
|
package v1
|
||||||
79
pkg/apis/openebs.io/zfs/v1/register.go
Normal file
79
pkg/apis/openebs.io/zfs/v1/register.go
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The OpenEBS Authors
|
||||||
|
|
||||||
|
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"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SchemeGroupVersion is group version used
|
||||||
|
// to register custom resources
|
||||||
|
//
|
||||||
|
// NOTE:
|
||||||
|
// This variable name should not be changed
|
||||||
|
var SchemeGroupVersion = schema.GroupVersion{
|
||||||
|
Group: "zfs.openebs.io",
|
||||||
|
Version: "v1",
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resource takes an unqualified resource and
|
||||||
|
// returns a Group qualified GroupResource
|
||||||
|
func Resource(resource string) schema.GroupResource {
|
||||||
|
return SchemeGroupVersion.
|
||||||
|
WithResource(resource).
|
||||||
|
GroupResource()
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// SchemeBuilder is the scheme builder
|
||||||
|
// with scheme init functions to run
|
||||||
|
// for this API package
|
||||||
|
SchemeBuilder runtime.SchemeBuilder
|
||||||
|
|
||||||
|
localSchemeBuilder = &SchemeBuilder
|
||||||
|
|
||||||
|
// AddToScheme is a global function that
|
||||||
|
// registers this API group & version to
|
||||||
|
// a scheme
|
||||||
|
AddToScheme = localSchemeBuilder.AddToScheme
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// We only register manually written functions
|
||||||
|
// here. This registration of generated functions
|
||||||
|
// takes place in the generated files.
|
||||||
|
//
|
||||||
|
// NOTE:
|
||||||
|
// This separation makes the code compile even
|
||||||
|
// when the generated files are missing.
|
||||||
|
localSchemeBuilder.Register(addKnownTypes)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adds the list of known types to api.Scheme.
|
||||||
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
|
scheme.AddKnownTypes(
|
||||||
|
SchemeGroupVersion,
|
||||||
|
&ZFSVolume{},
|
||||||
|
&ZFSVolumeList{},
|
||||||
|
&ZFSSnapshot{},
|
||||||
|
&ZFSSnapshotList{},
|
||||||
|
)
|
||||||
|
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
52
pkg/apis/openebs.io/zfs/v1/zfssnapshot.go
Normal file
52
pkg/apis/openebs.io/zfs/v1/zfssnapshot.go
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The OpenEBS Authors
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// +genclient
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
// +resource:path=zfssnapshot
|
||||||
|
|
||||||
|
// ZFSSnapshot represents a ZFS Snapshot of the zfsvolume
|
||||||
|
// +kubebuilder:storageversion
|
||||||
|
// +kubebuilder:object:root=true
|
||||||
|
// +kubebuilder:resource:scope=Namespaced,shortName=zfssnap
|
||||||
|
type ZFSSnapshot struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
|
Spec VolumeInfo `json:"spec"`
|
||||||
|
Status SnapStatus `json:"status"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
// +resource:path=zfssnapshots
|
||||||
|
|
||||||
|
// ZFSSnapshotList is a list of ZFSSnapshot resources
|
||||||
|
type ZFSSnapshotList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
metav1.ListMeta `json:"metadata"`
|
||||||
|
|
||||||
|
Items []ZFSSnapshot `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SnapStatus struct {
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
}
|
||||||
205
pkg/apis/openebs.io/zfs/v1/zfsvolume.go
Normal file
205
pkg/apis/openebs.io/zfs/v1/zfsvolume.go
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The OpenEBS Authors
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// +genclient
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
// +resource:path=zfsvolume
|
||||||
|
|
||||||
|
// ZFSVolume represents a ZFS based volume
|
||||||
|
// +kubebuilder:object:root=true
|
||||||
|
// +kubebuilder:storageversion
|
||||||
|
// +kubebuilder:resource:scope=Namespaced,shortName=zfsvol;zv
|
||||||
|
// +kubebuilder:printcolumn:name="ZPool",type=string,JSONPath=`.spec.poolName`,description="ZFS Pool where the volume is created"
|
||||||
|
// +kubebuilder:printcolumn:name="Node",type=string,JSONPath=`.spec.ownerNodeID`,description="Node where the volume is created"
|
||||||
|
// +kubebuilder:printcolumn:name="Size",type=string,JSONPath=`.spec.capacity`,description="Size of the volume"
|
||||||
|
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,description="Status of the volume"
|
||||||
|
// +kubebuilder:printcolumn:name="Filesystem",type=string,JSONPath=`.spec.fsType`,description="filesystem created on the volume"
|
||||||
|
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of the volume"
|
||||||
|
type ZFSVolume struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
|
Spec VolumeInfo `json:"spec"`
|
||||||
|
Status VolStatus `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MountInfo contains the volume related info
|
||||||
|
// for all types of volumes in ZFSVolume
|
||||||
|
type MountInfo struct {
|
||||||
|
// FSType of a volume will specify the
|
||||||
|
// format type - ext4(default), xfs of PV
|
||||||
|
FSType string `json:"fsType"`
|
||||||
|
|
||||||
|
// AccessMode of a volume will hold the
|
||||||
|
// access mode of the volume
|
||||||
|
AccessModes []string `json:"accessModes"`
|
||||||
|
|
||||||
|
// MountPath of the volume will hold the
|
||||||
|
// path on which the volume is mounted
|
||||||
|
// on that node
|
||||||
|
MountPath string `json:"mountPath"`
|
||||||
|
|
||||||
|
// MountOptions specifies the options with
|
||||||
|
// which mount needs to be attempted
|
||||||
|
MountOptions []string `json:"mountOptions"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
// +resource:path=zfsvolumes
|
||||||
|
|
||||||
|
// ZFSVolumeList is a list of ZFSVolume resources
|
||||||
|
type ZFSVolumeList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
metav1.ListMeta `json:"metadata"`
|
||||||
|
|
||||||
|
Items []ZFSVolume `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// VolumeInfo defines ZFS volume parameters for all modes in which
|
||||||
|
// ZFS volumes can be created like - ZFS volume with filesystem,
|
||||||
|
// ZFS Volume exposed as zfs or ZFS volume exposed as raw block device.
|
||||||
|
// Some of the parameters can be only set during creation time
|
||||||
|
// (as specified in the details of the parameter), and a few are editable.
|
||||||
|
// In case of Cloned volumes, the parameters are assigned the same values
|
||||||
|
// as the source volume.
|
||||||
|
type VolumeInfo struct {
|
||||||
|
|
||||||
|
// OwnerNodeID is the Node ID where the ZPOOL is running which is where
|
||||||
|
// the volume has been provisioned.
|
||||||
|
// OwnerNodeID can not be edited after the volume has been provisioned.
|
||||||
|
// +kubebuilder:validation:MinLength=1
|
||||||
|
// +kubebuilder:validation:Required
|
||||||
|
OwnerNodeID string `json:"ownerNodeID"`
|
||||||
|
|
||||||
|
// poolName specifies the name of the pool where the volume has been created.
|
||||||
|
// PoolName can not be edited after the volume has been provisioned.
|
||||||
|
// +kubebuilder:validation:Required
|
||||||
|
// +kubebuilder:validation:MinLength=1
|
||||||
|
PoolName string `json:"poolName"`
|
||||||
|
|
||||||
|
// SnapName specifies the name of the snapshot where the volume has been cloned from.
|
||||||
|
// Snapname can not be edited after the volume has been provisioned.
|
||||||
|
SnapName string `json:"snapname,omitempty"`
|
||||||
|
|
||||||
|
// Capacity of the volume
|
||||||
|
// +kubebuilder:validation:Required
|
||||||
|
// +kubebuilder:validation:MinLength=1
|
||||||
|
Capacity string `json:"capacity"`
|
||||||
|
|
||||||
|
// Specifies a suggested block size for files in the file system.
|
||||||
|
// The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
|
||||||
|
// RecordSize property can be edited after the volume has been created.
|
||||||
|
// Changing the file system's recordsize affects only files created afterward; existing files are unaffected.
|
||||||
|
// Default Value: 128k.
|
||||||
|
// +kubebuilder:validation:MinLength=1
|
||||||
|
RecordSize string `json:"recordsize,omitempty"`
|
||||||
|
|
||||||
|
// VolBlockSize specifies the block size for the zvol.
|
||||||
|
// The volsize can only be set to a multiple of volblocksize, and cannot be zero.
|
||||||
|
// VolBlockSize can not be edited after the volume has been provisioned.
|
||||||
|
// Default Value: 8k.
|
||||||
|
// +kubebuilder:validation:MinLength=1
|
||||||
|
VolBlockSize string `json:"volblocksize,omitempty"`
|
||||||
|
|
||||||
|
// Compression specifies the block-level compression algorithm to be applied to the ZFS Volume.
|
||||||
|
// The value "on" indicates ZFS to use the default compression algorithm. The default compression
|
||||||
|
// algorithm used by ZFS will be either lzjb or, if the lz4_compress feature is enabled, lz4.
|
||||||
|
// Compression property can be edited after the volume has been created. The change will only
|
||||||
|
// be applied to the newly-written data. For instance, if the Volume was created with "off" and
|
||||||
|
// the next day the compression was modified to "on", the data written prior to setting "on" will
|
||||||
|
// not be compressed.
|
||||||
|
// Default Value: off.
|
||||||
|
// +kubebuilder:validation:Pattern="^(on|off|lzjb|gzip|gzip-[1-9]|zle|lz4)$"
|
||||||
|
Compression string `json:"compression,omitempty"`
|
||||||
|
|
||||||
|
// Deduplication is the process for removing redundant data at the block level,
|
||||||
|
// reducing the total amount of data stored. If a file system has the dedup property
|
||||||
|
// enabled, duplicate data blocks are removed synchronously.
|
||||||
|
// The result is that only unique data is stored and common components are shared among files.
|
||||||
|
// Deduplication can consume significant processing power (CPU) and memory as well as generate additional disk IO.
|
||||||
|
// Before creating a pool with deduplication enabled, ensure that you have planned your hardware
|
||||||
|
// requirements appropriately and implemented appropriate recovery practices, such as regular backups.
|
||||||
|
// As an alternative to deduplication consider using compression=lz4, as a less resource-intensive alternative.
|
||||||
|
// should be enabled on the zvol.
|
||||||
|
// Dedup property can be edited after the volume has been created.
|
||||||
|
// Default Value: off.
|
||||||
|
// +kubebuilder:validation:Enum=on;off
|
||||||
|
Dedup string `json:"dedup,omitempty"`
|
||||||
|
|
||||||
|
// Enabling the encryption feature allows for the creation of
|
||||||
|
// encrypted filesystems and volumes. ZFS will encrypt file and zvol data,
|
||||||
|
// file attributes, ACLs, permission bits, directory listings, FUID mappings,
|
||||||
|
// and userused / groupused data. ZFS will not encrypt metadata related to the
|
||||||
|
// pool structure, including dataset and snapshot names, dataset hierarchy,
|
||||||
|
// properties, file size, file holes, and deduplication tables
|
||||||
|
// (though the deduplicated data itself is encrypted).
|
||||||
|
// Default Value: off.
|
||||||
|
// +kubebuilder:validation:Pattern="^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$"
|
||||||
|
Encryption string `json:"encryption,omitempty"`
|
||||||
|
|
||||||
|
// KeyLocation is the location of key for the encryption
|
||||||
|
KeyLocation string `json:"keylocation,omitempty"`
|
||||||
|
|
||||||
|
// KeyFormat specifies format of the encryption key
|
||||||
|
// The supported KeyFormats are passphrase, raw, hex.
|
||||||
|
// +kubebuilder:validation:Enum=passphrase;raw;hex
|
||||||
|
KeyFormat string `json:"keyformat,omitempty"`
|
||||||
|
|
||||||
|
// ThinProvision describes whether space reservation for the source volume is required or not.
|
||||||
|
// The value "yes" indicates that volume should be thin provisioned and "no" means thick provisioning of the volume.
|
||||||
|
// If thinProvision is set to "yes" then volume can be provisioned even if the ZPOOL does not
|
||||||
|
// have the enough capacity.
|
||||||
|
// If thinProvision is set to "no" then volume can be provisioned only if the ZPOOL has enough
|
||||||
|
// capacity and capacity required by volume can be reserved.
|
||||||
|
// ThinProvision can not be modified once volume has been provisioned.
|
||||||
|
// Default Value: no.
|
||||||
|
// +kubebuilder:validation:Enum=yes;no
|
||||||
|
ThinProvision string `json:"thinProvision,omitempty"`
|
||||||
|
|
||||||
|
// volumeType determines whether the volume is of type "DATASET" or "ZVOL".
|
||||||
|
// If fstype provided in the storageclass is "zfs", a volume of type dataset will be created.
|
||||||
|
// If "ext4", "ext3", "ext2" or "xfs" is mentioned as fstype
|
||||||
|
// in the storageclass, then a volume of type zvol will be created, which will be
|
||||||
|
// further formatted as the fstype provided in the storageclass.
|
||||||
|
// VolumeType can not be modified once volume has been provisioned.
|
||||||
|
// +kubebuilder:validation:Required
|
||||||
|
// +kubebuilder:validation:Enum=ZVOL;DATASET
|
||||||
|
VolumeType string `json:"volumeType"`
|
||||||
|
|
||||||
|
// FsType specifies filesystem type for the zfs volume/dataset.
|
||||||
|
// If FsType is provided as "zfs", then the driver will create a
|
||||||
|
// ZFS dataset, formatting is not required as underlying filesystem is ZFS anyway.
|
||||||
|
// If FsType is ext2, ext3, ext4 or xfs, then the driver will create a ZVOL and
|
||||||
|
// format the volume accordingly.
|
||||||
|
// FsType can not be modified once volume has been provisioned.
|
||||||
|
// Default Value: ext4.
|
||||||
|
FsType string `json:"fsType,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VolStatus struct {
|
||||||
|
// State specifies the current state of the volume provisioning request.
|
||||||
|
// The state "Pending" means that the volume creation request has not
|
||||||
|
// processed yet. The state "Ready" means that the volume has been created
|
||||||
|
// and it is ready for the use.
|
||||||
|
// +kubebuilder:validation:Enum=Pending;Ready
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
package snapbuilder
|
package snapbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/common/errors"
|
"github.com/openebs/zfs-localpv/pkg/common/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
package snapbuilder
|
package snapbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListBuilder enables building an instance of
|
// ListBuilder enables building an instance of
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ package snapbuilder
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
client "github.com/openebs/zfs-localpv/pkg/common/kubernetes/client"
|
client "github.com/openebs/zfs-localpv/pkg/common/kubernetes/client"
|
||||||
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
@ -140,7 +140,7 @@ func defaultGet(
|
||||||
name, namespace string,
|
name, namespace string,
|
||||||
opts metav1.GetOptions,
|
opts metav1.GetOptions,
|
||||||
) (*apis.ZFSSnapshot, error) {
|
) (*apis.ZFSSnapshot, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSSnapshots(namespace).
|
ZFSSnapshots(namespace).
|
||||||
Get(name, opts)
|
Get(name, opts)
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ func defaultList(
|
||||||
namespace string,
|
namespace string,
|
||||||
opts metav1.ListOptions,
|
opts metav1.ListOptions,
|
||||||
) (*apis.ZFSSnapshotList, error) {
|
) (*apis.ZFSSnapshotList, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSSnapshots(namespace).
|
ZFSSnapshots(namespace).
|
||||||
List(opts)
|
List(opts)
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +166,7 @@ func defaultDel(
|
||||||
) error {
|
) error {
|
||||||
deletePropagation := metav1.DeletePropagationForeground
|
deletePropagation := metav1.DeletePropagationForeground
|
||||||
opts.PropagationPolicy = &deletePropagation
|
opts.PropagationPolicy = &deletePropagation
|
||||||
err := cli.ZfsV1alpha1().
|
err := cli.ZfsV1().
|
||||||
ZFSSnapshots(namespace).
|
ZFSSnapshots(namespace).
|
||||||
Delete(name, opts)
|
Delete(name, opts)
|
||||||
return err
|
return err
|
||||||
|
|
@ -179,7 +179,7 @@ func defaultCreate(
|
||||||
vol *apis.ZFSSnapshot,
|
vol *apis.ZFSSnapshot,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (*apis.ZFSSnapshot, error) {
|
) (*apis.ZFSSnapshot, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSSnapshots(namespace).
|
ZFSSnapshots(namespace).
|
||||||
Create(vol)
|
Create(vol)
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +191,7 @@ func defaultUpdate(
|
||||||
vol *apis.ZFSSnapshot,
|
vol *apis.ZFSSnapshot,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (*apis.ZFSSnapshot, error) {
|
) (*apis.ZFSSnapshot, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSSnapshots(namespace).
|
ZFSSnapshots(namespace).
|
||||||
Update(vol)
|
Update(vol)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
package snapbuilder
|
package snapbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ZFSSnapshot is a wrapper over
|
// ZFSSnapshot is a wrapper over
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
package volbuilder
|
package volbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/common/errors"
|
"github.com/openebs/zfs-localpv/pkg/common/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
package volbuilder
|
package volbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListBuilder enables building an instance of
|
// ListBuilder enables building an instance of
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ package volbuilder
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
client "github.com/openebs/zfs-localpv/pkg/common/kubernetes/client"
|
client "github.com/openebs/zfs-localpv/pkg/common/kubernetes/client"
|
||||||
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
@ -140,7 +140,7 @@ func defaultGet(
|
||||||
name, namespace string,
|
name, namespace string,
|
||||||
opts metav1.GetOptions,
|
opts metav1.GetOptions,
|
||||||
) (*apis.ZFSVolume, error) {
|
) (*apis.ZFSVolume, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSVolumes(namespace).
|
ZFSVolumes(namespace).
|
||||||
Get(name, opts)
|
Get(name, opts)
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +152,7 @@ func defaultList(
|
||||||
namespace string,
|
namespace string,
|
||||||
opts metav1.ListOptions,
|
opts metav1.ListOptions,
|
||||||
) (*apis.ZFSVolumeList, error) {
|
) (*apis.ZFSVolumeList, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSVolumes(namespace).
|
ZFSVolumes(namespace).
|
||||||
List(opts)
|
List(opts)
|
||||||
}
|
}
|
||||||
|
|
@ -166,7 +166,7 @@ func defaultDel(
|
||||||
) error {
|
) error {
|
||||||
deletePropagation := metav1.DeletePropagationForeground
|
deletePropagation := metav1.DeletePropagationForeground
|
||||||
opts.PropagationPolicy = &deletePropagation
|
opts.PropagationPolicy = &deletePropagation
|
||||||
err := cli.ZfsV1alpha1().
|
err := cli.ZfsV1().
|
||||||
ZFSVolumes(namespace).
|
ZFSVolumes(namespace).
|
||||||
Delete(name, opts)
|
Delete(name, opts)
|
||||||
return err
|
return err
|
||||||
|
|
@ -179,7 +179,7 @@ func defaultCreate(
|
||||||
vol *apis.ZFSVolume,
|
vol *apis.ZFSVolume,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (*apis.ZFSVolume, error) {
|
) (*apis.ZFSVolume, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSVolumes(namespace).
|
ZFSVolumes(namespace).
|
||||||
Create(vol)
|
Create(vol)
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +191,7 @@ func defaultUpdate(
|
||||||
vol *apis.ZFSVolume,
|
vol *apis.ZFSVolume,
|
||||||
namespace string,
|
namespace string,
|
||||||
) (*apis.ZFSVolume, error) {
|
) (*apis.ZFSVolume, error) {
|
||||||
return cli.ZfsV1alpha1().
|
return cli.ZfsV1().
|
||||||
ZFSVolumes(namespace).
|
ZFSVolumes(namespace).
|
||||||
Update(vol)
|
Update(vol)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
package volbuilder
|
package volbuilder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ZFSVolume is a wrapper over
|
// ZFSVolume is a wrapper over
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package driver
|
||||||
import (
|
import (
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/builder/volbuilder"
|
"github.com/openebs/zfs-localpv/pkg/builder/volbuilder"
|
||||||
k8sapi "github.com/openebs/zfs-localpv/pkg/client/k8s/v1alpha1"
|
k8sapi "github.com/openebs/zfs-localpv/pkg/client/k8s/v1alpha1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/mgmt/snapshot"
|
"github.com/openebs/zfs-localpv/pkg/mgmt/snapshot"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
||||||
openebsScheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
|
openebsScheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
|
||||||
informers "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions"
|
informers "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions"
|
||||||
listers "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1alpha1"
|
listers "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/kubernetes/scheme"
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
|
|
@ -85,14 +85,14 @@ func (cb *SnapControllerBuilder) withOpenEBSClient(cs clientset.Interface) *Snap
|
||||||
|
|
||||||
// withSnapLister fills snap lister to controller object.
|
// withSnapLister fills snap lister to controller object.
|
||||||
func (cb *SnapControllerBuilder) withSnapLister(sl informers.SharedInformerFactory) *SnapControllerBuilder {
|
func (cb *SnapControllerBuilder) withSnapLister(sl informers.SharedInformerFactory) *SnapControllerBuilder {
|
||||||
snapInformer := sl.Zfs().V1alpha1().ZFSSnapshots()
|
snapInformer := sl.Zfs().V1().ZFSSnapshots()
|
||||||
cb.SnapController.snapLister = snapInformer.Lister()
|
cb.SnapController.snapLister = snapInformer.Lister()
|
||||||
return cb
|
return cb
|
||||||
}
|
}
|
||||||
|
|
||||||
// withSnapSynced adds object sync information in cache to controller object.
|
// withSnapSynced adds object sync information in cache to controller object.
|
||||||
func (cb *SnapControllerBuilder) withSnapSynced(sl informers.SharedInformerFactory) *SnapControllerBuilder {
|
func (cb *SnapControllerBuilder) withSnapSynced(sl informers.SharedInformerFactory) *SnapControllerBuilder {
|
||||||
snapInformer := sl.Zfs().V1alpha1().ZFSSnapshots()
|
snapInformer := sl.Zfs().V1().ZFSSnapshots()
|
||||||
cb.SnapController.snapSynced = snapInformer.Informer().HasSynced
|
cb.SnapController.snapSynced = snapInformer.Informer().HasSynced
|
||||||
return cb
|
return cb
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ func (cb *SnapControllerBuilder) withRecorder(ks kubernetes.Interface) *SnapCont
|
||||||
|
|
||||||
// withEventHandler adds event handlers controller object.
|
// withEventHandler adds event handlers controller object.
|
||||||
func (cb *SnapControllerBuilder) withEventHandler(cvcInformerFactory informers.SharedInformerFactory) *SnapControllerBuilder {
|
func (cb *SnapControllerBuilder) withEventHandler(cvcInformerFactory informers.SharedInformerFactory) *SnapControllerBuilder {
|
||||||
cvcInformer := cvcInformerFactory.Zfs().V1alpha1().ZFSSnapshots()
|
cvcInformer := cvcInformerFactory.Zfs().V1().ZFSSnapshots()
|
||||||
// Set up an event handler for when Snap resources change
|
// Set up an event handler for when Snap resources change
|
||||||
cvcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
cvcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||||
AddFunc: cb.SnapController.addSnap,
|
AddFunc: cb.SnapController.addSnap,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
|
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
|
||||||
k8serror "k8s.io/apimachinery/pkg/api/errors"
|
k8serror "k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/util/runtime"
|
"k8s.io/apimachinery/pkg/util/runtime"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
|
||||||
openebsScheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
|
openebsScheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
|
||||||
informers "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions"
|
informers "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions"
|
||||||
listers "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1alpha1"
|
listers "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/kubernetes/scheme"
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
|
|
@ -85,14 +85,14 @@ func (cb *ZVControllerBuilder) withOpenEBSClient(cs clientset.Interface) *ZVCont
|
||||||
|
|
||||||
// withZVLister fills zv lister to controller object.
|
// withZVLister fills zv lister to controller object.
|
||||||
func (cb *ZVControllerBuilder) withZVLister(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
func (cb *ZVControllerBuilder) withZVLister(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||||
zvInformer := sl.Zfs().V1alpha1().ZFSVolumes()
|
zvInformer := sl.Zfs().V1().ZFSVolumes()
|
||||||
cb.ZVController.zvLister = zvInformer.Lister()
|
cb.ZVController.zvLister = zvInformer.Lister()
|
||||||
return cb
|
return cb
|
||||||
}
|
}
|
||||||
|
|
||||||
// withZVSynced adds object sync information in cache to controller object.
|
// withZVSynced adds object sync information in cache to controller object.
|
||||||
func (cb *ZVControllerBuilder) withZVSynced(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
func (cb *ZVControllerBuilder) withZVSynced(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||||
zvInformer := sl.Zfs().V1alpha1().ZFSVolumes()
|
zvInformer := sl.Zfs().V1().ZFSVolumes()
|
||||||
cb.ZVController.zvSynced = zvInformer.Informer().HasSynced
|
cb.ZVController.zvSynced = zvInformer.Informer().HasSynced
|
||||||
return cb
|
return cb
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ func (cb *ZVControllerBuilder) withRecorder(ks kubernetes.Interface) *ZVControll
|
||||||
|
|
||||||
// withEventHandler adds event handlers controller object.
|
// withEventHandler adds event handlers controller object.
|
||||||
func (cb *ZVControllerBuilder) withEventHandler(cvcInformerFactory informers.SharedInformerFactory) *ZVControllerBuilder {
|
func (cb *ZVControllerBuilder) withEventHandler(cvcInformerFactory informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||||
cvcInformer := cvcInformerFactory.Zfs().V1alpha1().ZFSVolumes()
|
cvcInformer := cvcInformerFactory.Zfs().V1().ZFSVolumes()
|
||||||
// Set up an event handler for when ZV resources change
|
// Set up an event handler for when ZV resources change
|
||||||
cvcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
cvcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||||
AddFunc: cb.ZVController.addZV,
|
AddFunc: cb.ZVController.addZV,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
|
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
|
||||||
k8serror "k8s.io/apimachinery/pkg/api/errors"
|
k8serror "k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/util/runtime"
|
"k8s.io/apimachinery/pkg/util/runtime"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
"k8s.io/kubernetes/pkg/util/mount"
|
"k8s.io/kubernetes/pkg/util/mount"
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ package zfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"k8s.io/kubernetes/pkg/util/mount"
|
"k8s.io/kubernetes/pkg/util/mount"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/builder/snapbuilder"
|
"github.com/openebs/zfs-localpv/pkg/builder/snapbuilder"
|
||||||
"github.com/openebs/zfs-localpv/pkg/builder/volbuilder"
|
"github.com/openebs/zfs-localpv/pkg/builder/volbuilder"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// zfs related constants
|
// zfs related constants
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import (
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
|
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||||
"github.com/openebs/zfs-localpv/pkg/zfs"
|
"github.com/openebs/zfs-localpv/pkg/zfs"
|
||||||
"github.com/openebs/zfs-localpv/tests/container"
|
"github.com/openebs/zfs-localpv/tests/container"
|
||||||
"github.com/openebs/zfs-localpv/tests/deploy"
|
"github.com/openebs/zfs-localpv/tests/deploy"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue