Merge pull request #4918 from travisn/stable-types
Move types from rook.io/v1alpha2 to rook.io/v1
This commit is contained in:
108 files changed
+1261
-927
No files matched your search
@@ -23,7 +23,7 @@ cd "${scriptdir}/../../vendor/k8s.io/code-generator" && ./generate-groups.sh \
|
||||
all \
|
||||
github.com/rook/rook/pkg/client \
|
||||
github.com/rook/rook/pkg/apis \
|
||||
"rook.io:v1alpha2 ceph.rook.io:v1 cockroachdb.rook.io:v1alpha1 nfs.rook.io:v1alpha1 cassandra.rook.io:v1alpha1 edgefs.rook.io:v1 yugabytedb.rook.io:v1alpha1"
|
||||
"rook.io:v1 rook.io:v1alpha2 ceph.rook.io:v1 cockroachdb.rook.io:v1alpha1 nfs.rook.io:v1alpha1 cassandra.rook.io:v1alpha1 edgefs.rook.io:v1 yugabytedb.rook.io:v1alpha1"
|
||||
# this seems busted in the release-1.8 branch
|
||||
# --go-header-file ${SCRIPT_ROOT}/build/codegen/header.txt
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ limitations under the License.
|
||||
package cassandrarookio
|
||||
|
||||
const (
|
||||
// GroupName for the cassandra operator's CRDs
|
||||
GroupName = "cassandra.rook.io"
|
||||
// CustomResourceGroupName for the cassandra operator's CRDs
|
||||
CustomResourceGroupName = "cassandra.rook.io"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cassandrarookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cassandrarookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
@@ -59,7 +59,7 @@ type ClusterList struct {
|
||||
// ClusterSpec is the desired state for a Cassandra Cluster.
|
||||
type ClusterSpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations
|
||||
Annotations rookv1.Annotations
|
||||
// Version of Cassandra to use.
|
||||
Version string `json:"version"`
|
||||
// Repository to pull the image from.
|
||||
@@ -98,11 +98,11 @@ type RackSpec struct {
|
||||
// User-provided ConfigMap for jmx prometheus exporter
|
||||
JMXExporterConfigMapName *string `json:"jmxExporterConfigMapName,omitempty"`
|
||||
// Storage describes the underlying storage that Cassandra will consume.
|
||||
Storage rook.StorageScopeSpec `json:"storage"`
|
||||
Storage rookv1.StorageScopeSpec `json:"storage"`
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations
|
||||
Annotations rookv1.Annotations
|
||||
// Placement describes restrictions for the nodes Cassandra is scheduled on.
|
||||
Placement *rook.Placement `json:"placement,omitempty"`
|
||||
Placement *rookv1.Placement `json:"placement,omitempty"`
|
||||
// Resources the Cassandra Pods will use.
|
||||
Resources corev1.ResourceRequirements `json:"resources"`
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
v1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -91,7 +91,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(v1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -222,14 +222,14 @@ func (in *RackSpec) DeepCopyInto(out *RackSpec) {
|
||||
in.Storage.DeepCopyInto(&out.Storage)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(v1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Placement != nil {
|
||||
in, out := &in.Placement, &out.Placement
|
||||
*out = new(v1alpha2.Placement)
|
||||
*out = new(v1.Placement)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package cephrookio
|
||||
|
||||
const (
|
||||
GroupName = "ceph.rook.io"
|
||||
CustomResourceGroupName = "ceph.rook.io"
|
||||
)
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// GetMgrAnnotations returns the Annotations for the MGR service
|
||||
|
||||
@@ -19,7 +19,7 @@ package v1
|
||||
import (
|
||||
"testing"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -16,25 +16,25 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// GetMgrPlacement returns the placement for the MGR service
|
||||
func GetMgrPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetMgrPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyMgr])
|
||||
}
|
||||
|
||||
// GetMonPlacement returns the placement for the MON service
|
||||
func GetMonPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetMonPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyMon])
|
||||
}
|
||||
|
||||
// GetOSDPlacement returns the placement for the OSD service
|
||||
func GetOSDPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetOSDPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyOSD])
|
||||
}
|
||||
|
||||
// GetRBDMirrorPlacement returns the placement for the RBD mirrors
|
||||
func GetRBDMirrorPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetRBDMirrorPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyRBDMirror])
|
||||
}
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// GetMgrPriorityClassName returns the priority class name for the MGR service
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 The Rook Authors. All rights reserved.
|
||||
Copyright 2020 The Rook Authors. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@ 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 (
|
||||
@@ -29,7 +30,7 @@ const (
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cephrookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cephrookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
|
||||
@@ -21,9 +21,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
)
|
||||
|
||||
func TestClusterSpecMarshal(t *testing.T) {
|
||||
@@ -70,9 +69,9 @@ storage:
|
||||
Network: NetworkSpec{
|
||||
HostNetwork: true,
|
||||
},
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
UseAllNodes: false,
|
||||
Selection: rookalpha.Selection{
|
||||
Selection: rookv1.Selection{
|
||||
UseAllDevices: &useAllDevices,
|
||||
DeviceFilter: "^sd.",
|
||||
DevicePathFilter: "^/dev/disk/by-path/pci-.*",
|
||||
@@ -82,10 +81,10 @@ storage:
|
||||
"journalSizeMB": "1024",
|
||||
"databaseSizeMB": "1024",
|
||||
},
|
||||
Nodes: []rookalpha.Node{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: "node2",
|
||||
Selection: rookalpha.Selection{
|
||||
Selection: rookv1.Selection{
|
||||
DeviceFilter: "^foo*",
|
||||
DevicePathFilter: "^/dev/disk/by-id/.*foo.*",
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2018 The Rook Authors. All rights reserved.
|
||||
Copyright 2020 The Rook Authors. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,15 @@ 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 (
|
||||
"time"
|
||||
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
)
|
||||
|
||||
// ***************************************************************************
|
||||
@@ -54,22 +54,22 @@ type ClusterSpec struct {
|
||||
CephVersion CephVersionSpec `json:"cephVersion,omitempty"`
|
||||
|
||||
// A spec for available storage in the cluster and how it should be used
|
||||
Storage rook.StorageScopeSpec `json:"storage,omitempty"`
|
||||
Storage rookv1.StorageScopeSpec `json:"storage,omitempty"`
|
||||
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.AnnotationsSpec `json:"annotations,omitempty"`
|
||||
Annotations rookv1.AnnotationsSpec `json:"annotations,omitempty"`
|
||||
|
||||
// The placement-related configuration to pass to kubernetes (affinity, node selector, tolerations).
|
||||
Placement rook.PlacementSpec `json:"placement,omitempty"`
|
||||
Placement rookv1.PlacementSpec `json:"placement,omitempty"`
|
||||
|
||||
// Network related configuration
|
||||
Network NetworkSpec `json:"network,omitempty"`
|
||||
|
||||
// Resources set resource requests and limits
|
||||
Resources rook.ResourceSpec `json:"resources,omitempty"`
|
||||
Resources rookv1.ResourceSpec `json:"resources,omitempty"`
|
||||
|
||||
// PriorityClassNames sets priority classes on components
|
||||
PriorityClassNames rook.PriorityClassNamesSpec `json:"priorityClassNames,omitempty"`
|
||||
PriorityClassNames rookv1.PriorityClassNamesSpec `json:"priorityClassNames,omitempty"`
|
||||
|
||||
// The path on the host where config and data can be persisted.
|
||||
DataDirHostPath string `json:"dataDirHostPath,omitempty"`
|
||||
@@ -330,10 +330,10 @@ type MetadataServerSpec struct {
|
||||
ActiveStandby bool `json:"activeStandby"`
|
||||
|
||||
// The affinity to place the mds pods (default is to place on all available node) with a daemonset
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
|
||||
// The resource requirements for the rgw pods
|
||||
Resources v1.ResourceRequirements `json:"resources"`
|
||||
@@ -420,10 +420,10 @@ type GatewaySpec struct {
|
||||
SSLCertificateRef string `json:"sslCertificateRef"`
|
||||
|
||||
// The affinity to place the rgw pods (default is to place on any available node)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
|
||||
// The resource requirements for the rgw pods
|
||||
Resources v1.ResourceRequirements `json:"resources"`
|
||||
@@ -471,10 +471,10 @@ type GaneshaServerSpec struct {
|
||||
Active int `json:"active"`
|
||||
|
||||
// The affinity to place the ganesha pods
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
@@ -485,7 +485,7 @@ type GaneshaServerSpec struct {
|
||||
|
||||
// NetworkSpec for Ceph includes backward compatibility code
|
||||
type NetworkSpec struct {
|
||||
rook.NetworkSpec `json:",inline"`
|
||||
rookv1.NetworkSpec `json:",inline"`
|
||||
|
||||
// HostNetwork to enable host network
|
||||
HostNetwork bool `json:"hostNetwork"`
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookiov1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@@ -557,14 +557,14 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
in.Storage.DeepCopyInto(&out.Storage)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.AnnotationsSpec, len(*in))
|
||||
*out = make(rookiov1.AnnotationsSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal map[string]string
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
in, out := &val, &outVal
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -574,7 +574,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
}
|
||||
if in.Placement != nil {
|
||||
in, out := &in.Placement, &out.Placement
|
||||
*out = make(v1alpha2.PlacementSpec, len(*in))
|
||||
*out = make(rookiov1.PlacementSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
@@ -582,14 +582,14 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
in.Network.DeepCopyInto(&out.Network)
|
||||
if in.Resources != nil {
|
||||
in, out := &in.Resources, &out.Resources
|
||||
*out = make(v1alpha2.ResourceSpec, len(*in))
|
||||
*out = make(rookiov1.ResourceSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
if in.PriorityClassNames != nil {
|
||||
in, out := &in.PriorityClassNames, &out.PriorityClassNames
|
||||
*out = make(v1alpha2.PriorityClassNamesSpec, len(*in))
|
||||
*out = make(rookiov1.PriorityClassNamesSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -807,7 +807,7 @@ func (in *GaneshaServerSpec) DeepCopyInto(out *GaneshaServerSpec) {
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -832,7 +832,7 @@ func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) {
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -857,7 +857,7 @@ func (in *MetadataServerSpec) DeepCopyInto(out *MetadataServerSpec) {
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package cockroachdbrookio
|
||||
|
||||
const (
|
||||
GroupName = "cockroachdb.rook.io"
|
||||
CustomResourceGroupName = "cockroachdb.rook.io"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cockroachdbrookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: cockroachdbrookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -18,7 +18,7 @@ package v1alpha1
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
v1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -90,7 +90,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(v1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package edgefsrookio
|
||||
|
||||
const (
|
||||
GroupName = "edgefs.rook.io"
|
||||
CustomResourceGroupName = "edgefs.rook.io"
|
||||
)
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// GetPrepareAnnotations returns the Annotations for the prepare service
|
||||
|
||||
@@ -16,20 +16,20 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// GetMgrPlacement returns the placement for the MGR service
|
||||
func GetMgrPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetMgrPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyMgr])
|
||||
}
|
||||
|
||||
// GetTargetPlacement returns the placement for the Target service
|
||||
func GetTargetPlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetTargetPlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyTarget])
|
||||
}
|
||||
|
||||
// GetPreparePlacement returns the placement for the Host Prepare service
|
||||
func GetPreparePlacement(p rook.PlacementSpec) rook.Placement {
|
||||
func GetPreparePlacement(p rookv1.PlacementSpec) rookv1.Placement {
|
||||
return p.All().Merge(p[KeyPrepare])
|
||||
}
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: edgefsrookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: edgefsrookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -16,10 +16,11 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
"strconv"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -53,13 +53,13 @@ type ClusterList struct {
|
||||
}
|
||||
|
||||
type ClusterSpec struct {
|
||||
Storage rook.StorageScopeSpec `json:"storage,omitempty"`
|
||||
Storage rookv1.StorageScopeSpec `json:"storage,omitempty"`
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.AnnotationsSpec `json:"annotations,omitempty"`
|
||||
Annotations rookv1.AnnotationsSpec `json:"annotations,omitempty"`
|
||||
// The placement-related configuration to pass to kubernetes (affinity, node selector, tolerations).
|
||||
Placement rook.PlacementSpec `json:"placement,omitempty"`
|
||||
Network rook.NetworkSpec `json:"network,omitempty"`
|
||||
Dashboard DashboardSpec `json:"dashboard,omitempty"`
|
||||
Placement rookv1.PlacementSpec `json:"placement,omitempty"`
|
||||
Network rookv1.NetworkSpec `json:"network,omitempty"`
|
||||
Dashboard DashboardSpec `json:"dashboard,omitempty"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The path on the host where config and data can be persisted.
|
||||
@@ -117,9 +117,9 @@ type NFSList struct {
|
||||
// NFSSpec represent the spec of a pool
|
||||
type NFSSpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
// The affinity to place the NFS pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the NFS replicaset
|
||||
@@ -150,9 +150,9 @@ type S3List struct {
|
||||
// S3Spec represent the spec of a s3 service
|
||||
type S3Spec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
// The affinity to place the S3 pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the S3 replicaset
|
||||
@@ -196,7 +196,7 @@ type SWIFTList struct {
|
||||
// SWIFTSpec represent the spec of a swift service
|
||||
type SWIFTSpec struct {
|
||||
// The affinity to place the SWIFT pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the S3 replicaset
|
||||
@@ -238,9 +238,9 @@ type S3XList struct {
|
||||
// S3XSpec represent the spec of a s3 service
|
||||
type S3XSpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
// The affinity to place the S3X pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the S3X replicaset
|
||||
@@ -282,9 +282,9 @@ type ISCSIList struct {
|
||||
// ISCSISpec represent the spec of a iscsi service
|
||||
type ISCSISpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
// The affinity to place the ISCSI pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the ISCSI replicaset
|
||||
@@ -332,9 +332,9 @@ type ISGWConfig struct {
|
||||
// ISGWSpec represent the spec of a isgw service
|
||||
type ISGWSpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rook.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
// The affinity to place the ISGW pods (default is to place on any available nodes in EdgeFS running namespace)
|
||||
Placement rook.Placement `json:"placement"`
|
||||
Placement rookv1.Placement `json:"placement"`
|
||||
// Resources set resource requests and limits
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
// The number of pods in the ISGW replicaset
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookiov1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -258,14 +258,14 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
in.Storage.DeepCopyInto(&out.Storage)
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.AnnotationsSpec, len(*in))
|
||||
*out = make(rookiov1.AnnotationsSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal map[string]string
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
in, out := &val, &outVal
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -275,7 +275,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
|
||||
}
|
||||
if in.Placement != nil {
|
||||
in, out := &in.Placement, &out.Placement
|
||||
*out = make(v1alpha2.PlacementSpec, len(*in))
|
||||
*out = make(rookiov1.PlacementSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
@@ -438,7 +438,7 @@ func (in *ISCSISpec) DeepCopyInto(out *ISCSISpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -546,7 +546,7 @@ func (in *ISGWSpec) DeepCopyInto(out *ISGWSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -633,7 +633,7 @@ func (in *NFSSpec) DeepCopyInto(out *NFSSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -830,7 +830,7 @@ func (in *S3Spec) DeepCopyInto(out *S3Spec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
@@ -916,7 +916,7 @@ func (in *S3XSpec) DeepCopyInto(out *S3XSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(rookiov1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ limitations under the License.
|
||||
package nfsrookio
|
||||
|
||||
const (
|
||||
GroupName = "nfs.rook.io"
|
||||
CustomResourceGroupName = "nfs.rook.io"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: nfsrookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: nfsrookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
@@ -48,7 +48,7 @@ type NFSServerList struct {
|
||||
// NFSServerSpec represents the spec of NFS daemon
|
||||
type NFSServerSpec struct {
|
||||
// The annotations-related configuration to add/set on each Pod related object.
|
||||
Annotations rookalpha.Annotations `json:"annotations,omitempty"`
|
||||
Annotations rookv1.Annotations `json:"annotations,omitempty"`
|
||||
|
||||
// Replicas of the NFS daemon
|
||||
Replicas int `json:"replicas,omitempty"`
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
v1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -129,7 +129,7 @@ func (in *NFSServerSpec) DeepCopyInto(out *NFSServerSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(v1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package rookio
|
||||
|
||||
const (
|
||||
GroupName = "rook.io"
|
||||
CustomResourceGroupName = "rook.io"
|
||||
)
|
||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
+1
-1
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2018 The Rook Authors. All rights reserved.
|
||||
|
||||
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 v1 version of the rook.io API.
|
||||
// +groupName=rook.io
|
||||
package v1
|
||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
const (
|
||||
KeyAll = "all"
|
||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
// IsHost get whether to use host network provider
|
||||
func (net *NetworkSpec) IsHost() bool {
|
||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -13,10 +13,10 @@ 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 v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
func (p PlacementSpec) All() Placement {
|
||||
@@ -13,7 +13,7 @@ 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 v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
+1
-1
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
// All returns the priority class name defined for 'all' daemons in the Ceph cluster CRD.
|
||||
func (p PriorityClassNamesSpec) All() string {
|
||||
+1
-1
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 2016 The Rook Authors. All rights reserved.
|
||||
|
||||
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"
|
||||
|
||||
rookio "github.com/rook/rook/pkg/apis/rook.io"
|
||||
)
|
||||
|
||||
const (
|
||||
Version = "v1"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
// SchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The 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)
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
@@ -13,7 +13,7 @@ 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 v1alpha2
|
||||
package v1
|
||||
|
||||
// AnyUseAllDevices gets whether to use all devices
|
||||
func (s *StorageScopeSpec) AnyUseAllDevices() bool {
|
||||
@@ -13,7 +13,7 @@ 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 v1alpha2
|
||||
package v1
|
||||
|
||||
import (
|
||||
"testing"
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
Copyright 2018 The Rook Authors. All rights reserved.
|
||||
|
||||
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 (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// ************************************************************************************
|
||||
// IMPORTANT FOR CODE GENERATION
|
||||
// If any of the types with codegen tags in this file are updated, you will need to run
|
||||
// `make codegen` to generate the new types under the client/clientset folder.
|
||||
// ************************************************************************************
|
||||
|
||||
type StorageScopeSpec struct {
|
||||
Nodes []Node `json:"nodes,omitempty"`
|
||||
UseAllNodes bool `json:"useAllNodes,omitempty"`
|
||||
NodeCount int `json:"nodeCount,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
Selection
|
||||
VolumeSources []VolumeSource `json:"volumeSources,omitempty"`
|
||||
StorageClassDeviceSets []StorageClassDeviceSet `json:"storageClassDeviceSets"`
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
Selection
|
||||
}
|
||||
|
||||
type Device struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
FullPath string `json:"fullpath,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
|
||||
type Directory struct {
|
||||
Path string `json:"path,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
|
||||
type Selection struct {
|
||||
// Whether to consume all the storage devices found on a machine
|
||||
UseAllDevices *bool `json:"useAllDevices,omitempty"`
|
||||
// A regular expression to allow more fine-grained selection of devices on nodes across the cluster
|
||||
DeviceFilter string `json:"deviceFilter,omitempty"`
|
||||
// A regular expression to allow more fine-grained selection of devices with path names
|
||||
DevicePathFilter string `json:"devicePathFilter,omitempty"`
|
||||
// List of devices to use as storage devices
|
||||
Devices []Device `json:"devices,omitempty"`
|
||||
// List of host directories to use as storage
|
||||
Directories []Directory `json:"directories,omitempty"`
|
||||
// PersistentVolumeClaims to use as storage
|
||||
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
|
||||
}
|
||||
|
||||
type PlacementSpec map[KeyType]Placement
|
||||
|
||||
type Placement struct {
|
||||
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
|
||||
PodAffinity *v1.PodAffinity `json:"podAffinity,omitempty"`
|
||||
PodAntiAffinity *v1.PodAntiAffinity `json:"podAntiAffinity,omitempty"`
|
||||
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
|
||||
}
|
||||
|
||||
type ResourceSpec map[string]v1.ResourceRequirements
|
||||
|
||||
// PriorityClassNamesSpec is a map of priority class names to be assigned to components
|
||||
type PriorityClassNamesSpec map[KeyType]string
|
||||
|
||||
// NetworkSpec represents cluster network settings
|
||||
type NetworkSpec struct {
|
||||
// Provider is what provides network connectivity to the cluster e.g. "host" or "multus"
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// Selectors string values describe what networks will be used to connect the cluster.
|
||||
// Meanwhile the keys describe each network respective responsibilities or any metadata
|
||||
// storage provider decide.
|
||||
Selectors map[string]string `json:"selectors"`
|
||||
}
|
||||
|
||||
// KeyType
|
||||
type KeyType string
|
||||
|
||||
type AnnotationsSpec map[KeyType]Annotations
|
||||
|
||||
type Annotations map[string]string
|
||||
|
||||
type StorageClassDeviceSet struct {
|
||||
Name string `json:"name,omitempty"` // A unique identifier for the set
|
||||
Count int `json:"count,omitempty"` // Number of devices in this set
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"` // Requests/limits for the devices
|
||||
Placement Placement `json:"placement,omitempty"` // Placement constraints for the devices
|
||||
Config map[string]string `json:"config,omitempty"` // Provider-specific device configuration
|
||||
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` // List of PVC templates for the underlying storage devices
|
||||
Portable bool `json:"portable,omitempty"` // OSD portability across the hosts
|
||||
TuneSlowDeviceClass bool `json:"tuneDeviceClass,omitempty"` // TuneSlowDeviceClass Tune the OSD when running on a slow Device Class
|
||||
}
|
||||
|
||||
// VolumeSource is a volume source spec for Rook
|
||||
type VolumeSource struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
PersistentVolumeClaimSource v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaimSource,omitempty"`
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
Placement Placement `json:"placement,omitempty"`
|
||||
Config map[string]string `json:"config,omitempty"`
|
||||
Portable bool `json:"portable,omitempty"` // Portable OSD portability across the hosts
|
||||
TuneSlowDeviceClass bool `json:"tuneDeviceClass,omitempty"` // TuneSlowDeviceClass Tune the OSD when running on a slow Device Class
|
||||
Type string `json:"type,omitempty"` // Type represents the device type for an OSD, possible values are "data": the bluestore 'block' data and "metadata": the bluestore 'block.db' device
|
||||
CrushDeviceClass string `json:"crushDeviceClass,omitempty"` // CrushDeviceClass represents the crush device class for an OSD
|
||||
}
|
||||
@@ -0,0 +1,444 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in Annotations) DeepCopyInto(out *Annotations) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Annotations.
|
||||
func (in Annotations) DeepCopy() Annotations {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Annotations)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in AnnotationsSpec) DeepCopyInto(out *AnnotationsSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(AnnotationsSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal map[string]string
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
in, out := &val, &outVal
|
||||
*out = make(Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationsSpec.
|
||||
func (in AnnotationsSpec) DeepCopy() AnnotationsSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AnnotationsSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Device) DeepCopyInto(out *Device) {
|
||||
*out = *in
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
|
||||
func (in *Device) DeepCopy() *Device {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Device)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Directory) DeepCopyInto(out *Directory) {
|
||||
*out = *in
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Directory.
|
||||
func (in *Directory) DeepCopy() *Directory {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Directory)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) {
|
||||
*out = *in
|
||||
if in.Selectors != nil {
|
||||
in, out := &in.Selectors, &out.Selectors
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec.
|
||||
func (in *NetworkSpec) DeepCopy() *NetworkSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NetworkSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Node) DeepCopyInto(out *Node) {
|
||||
*out = *in
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.Selection.DeepCopyInto(&out.Selection)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
|
||||
func (in *Node) DeepCopy() *Node {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Node)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in NodesByName) DeepCopyInto(out *NodesByName) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(NodesByName, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesByName.
|
||||
func (in NodesByName) DeepCopy() NodesByName {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NodesByName)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Placement) DeepCopyInto(out *Placement) {
|
||||
*out = *in
|
||||
if in.NodeAffinity != nil {
|
||||
in, out := &in.NodeAffinity, &out.NodeAffinity
|
||||
*out = new(corev1.NodeAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAffinity != nil {
|
||||
in, out := &in.PodAffinity, &out.PodAffinity
|
||||
*out = new(corev1.PodAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAntiAffinity != nil {
|
||||
in, out := &in.PodAntiAffinity, &out.PodAntiAffinity
|
||||
*out = new(corev1.PodAntiAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Tolerations != nil {
|
||||
in, out := &in.Tolerations, &out.Tolerations
|
||||
*out = make([]corev1.Toleration, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
|
||||
func (in *Placement) DeepCopy() *Placement {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Placement)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in PlacementSpec) DeepCopyInto(out *PlacementSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(PlacementSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementSpec.
|
||||
func (in PlacementSpec) DeepCopy() PlacementSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PlacementSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in PriorityClassNamesSpec) DeepCopyInto(out *PriorityClassNamesSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(PriorityClassNamesSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityClassNamesSpec.
|
||||
func (in PriorityClassNamesSpec) DeepCopy() PriorityClassNamesSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityClassNamesSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in ResourceSpec) DeepCopyInto(out *ResourceSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(ResourceSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.
|
||||
func (in ResourceSpec) DeepCopy() ResourceSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Selection) DeepCopyInto(out *Selection) {
|
||||
*out = *in
|
||||
if in.UseAllDevices != nil {
|
||||
in, out := &in.UseAllDevices, &out.UseAllDevices
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Devices != nil {
|
||||
in, out := &in.Devices, &out.Devices
|
||||
*out = make([]Device, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Directories != nil {
|
||||
in, out := &in.Directories, &out.Directories
|
||||
*out = make([]Directory, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.VolumeClaimTemplates != nil {
|
||||
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
|
||||
*out = make([]corev1.PersistentVolumeClaim, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selection.
|
||||
func (in *Selection) DeepCopy() *Selection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Selection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassDeviceSet) DeepCopyInto(out *StorageClassDeviceSet) {
|
||||
*out = *in
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.VolumeClaimTemplates != nil {
|
||||
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
|
||||
*out = make([]corev1.PersistentVolumeClaim, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassDeviceSet.
|
||||
func (in *StorageClassDeviceSet) DeepCopy() *StorageClassDeviceSet {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageClassDeviceSet)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageScopeSpec) DeepCopyInto(out *StorageScopeSpec) {
|
||||
*out = *in
|
||||
if in.Nodes != nil {
|
||||
in, out := &in.Nodes, &out.Nodes
|
||||
*out = make([]Node, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.Selection.DeepCopyInto(&out.Selection)
|
||||
if in.VolumeSources != nil {
|
||||
in, out := &in.VolumeSources, &out.VolumeSources
|
||||
*out = make([]VolumeSource, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.StorageClassDeviceSets != nil {
|
||||
in, out := &in.StorageClassDeviceSets, &out.StorageClassDeviceSets
|
||||
*out = make([]StorageClassDeviceSet, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageScopeSpec.
|
||||
func (in *StorageScopeSpec) DeepCopy() *StorageScopeSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageScopeSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeSource) DeepCopyInto(out *VolumeSource) {
|
||||
*out = *in
|
||||
out.PersistentVolumeClaimSource = in.PersistentVolumeClaimSource
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSource.
|
||||
func (in *VolumeSource) DeepCopy() *VolumeSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
@@ -24,12 +24,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
CustomResourceGroup = "rook.io"
|
||||
Version = "v1alpha2"
|
||||
Version = "v1alpha2"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
@@ -27,74 +26,6 @@ import (
|
||||
// `make codegen` to generate the new types under the client/clientset folder.
|
||||
// ************************************************************************************
|
||||
|
||||
type StorageScopeSpec struct {
|
||||
Nodes []Node `json:"nodes,omitempty"`
|
||||
UseAllNodes bool `json:"useAllNodes,omitempty"`
|
||||
NodeCount int `json:"nodeCount,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
Selection
|
||||
VolumeSources []VolumeSource `json:"volumeSources,omitempty"`
|
||||
StorageClassDeviceSets []StorageClassDeviceSet `json:"storageClassDeviceSets"`
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
Selection
|
||||
}
|
||||
|
||||
type Device struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
FullPath string `json:"fullpath,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
|
||||
type Directory struct {
|
||||
Path string `json:"path,omitempty"`
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
|
||||
type Selection struct {
|
||||
// Whether to consume all the storage devices found on a machine
|
||||
UseAllDevices *bool `json:"useAllDevices,omitempty"`
|
||||
// A regular expression to allow more fine-grained selection of devices on nodes across the cluster
|
||||
DeviceFilter string `json:"deviceFilter,omitempty"`
|
||||
// A regular expression to allow more fine-grained selection of devices with path names
|
||||
DevicePathFilter string `json:"devicePathFilter,omitempty"`
|
||||
// List of devices to use as storage devices
|
||||
Devices []Device `json:"devices,omitempty"`
|
||||
// List of host directories to use as storage
|
||||
Directories []Directory `json:"directories,omitempty"`
|
||||
// PersistentVolumeClaims to use as storage
|
||||
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
|
||||
}
|
||||
|
||||
type PlacementSpec map[KeyType]Placement
|
||||
|
||||
type Placement struct {
|
||||
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
|
||||
PodAffinity *v1.PodAffinity `json:"podAffinity,omitempty"`
|
||||
PodAntiAffinity *v1.PodAntiAffinity `json:"podAntiAffinity,omitempty"`
|
||||
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
|
||||
}
|
||||
|
||||
type ResourceSpec map[string]v1.ResourceRequirements
|
||||
|
||||
// PriorityClassNamesSpec is a map of priority class names to be assigned to components
|
||||
type PriorityClassNamesSpec map[KeyType]string
|
||||
|
||||
// NetworkSpec represents cluster network settings
|
||||
type NetworkSpec struct {
|
||||
// Provider is what provides network connectivity to the cluster e.g. "host" or "multus"
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// Selectors string values describe what networks will be used to connect the cluster.
|
||||
// Meanwhile the keys describe each network respective responsibilities or any metadata
|
||||
// storage provider decide.
|
||||
Selectors map[string]string `json:"selectors"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:noStatus
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
@@ -121,34 +52,3 @@ type VolumeList struct {
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []Volume `json:"items"`
|
||||
}
|
||||
|
||||
// KeyType
|
||||
type KeyType string
|
||||
|
||||
type AnnotationsSpec map[KeyType]Annotations
|
||||
|
||||
type Annotations map[string]string
|
||||
|
||||
type StorageClassDeviceSet struct {
|
||||
Name string `json:"name,omitempty"` // A unique identifier for the set
|
||||
Count int `json:"count,omitempty"` // Number of devices in this set
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"` // Requests/limits for the devices
|
||||
Placement Placement `json:"placement,omitempty"` // Placement constraints for the devices
|
||||
Config map[string]string `json:"config,omitempty"` // Provider-specific device configuration
|
||||
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` // List of PVC templates for the underlying storage devices
|
||||
Portable bool `json:"portable,omitempty"` // OSD portability across the hosts
|
||||
TuneSlowDeviceClass bool `json:"tuneDeviceClass,omitempty"` // TuneSlowDeviceClass Tune the OSD when running on a slow Device Class
|
||||
}
|
||||
|
||||
// VolumeSource is a volume source spec for Rook
|
||||
type VolumeSource struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
PersistentVolumeClaimSource v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaimSource,omitempty"`
|
||||
Resources v1.ResourceRequirements `json:"resources,omitempty"`
|
||||
Placement Placement `json:"placement,omitempty"`
|
||||
Config map[string]string `json:"config,omitempty"`
|
||||
Portable bool `json:"portable,omitempty"` // Portable OSD portability across the hosts
|
||||
TuneSlowDeviceClass bool `json:"tuneDeviceClass,omitempty"` // TuneSlowDeviceClass Tune the OSD when running on a slow Device Class
|
||||
Type string `json:"type,omitempty"` // Type represents the device type for an OSD, possible values are "data": the bluestore 'block' data and "metadata": the bluestore 'block.db' device
|
||||
CrushDeviceClass string `json:"crushDeviceClass,omitempty"` // CrushDeviceClass represents the crush device class for an OSD
|
||||
}
|
||||
@@ -21,64 +21,9 @@ limitations under the License.
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in Annotations) DeepCopyInto(out *Annotations) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Annotations.
|
||||
func (in Annotations) DeepCopy() Annotations {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Annotations)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in AnnotationsSpec) DeepCopyInto(out *AnnotationsSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(AnnotationsSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal map[string]string
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
in, out := &val, &outVal
|
||||
*out = make(Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationsSpec.
|
||||
func (in AnnotationsSpec) DeepCopy() AnnotationsSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AnnotationsSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Attachment) DeepCopyInto(out *Attachment) {
|
||||
*out = *in
|
||||
@@ -95,345 +40,6 @@ func (in *Attachment) DeepCopy() *Attachment {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Device) DeepCopyInto(out *Device) {
|
||||
*out = *in
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
|
||||
func (in *Device) DeepCopy() *Device {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Device)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Directory) DeepCopyInto(out *Directory) {
|
||||
*out = *in
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Directory.
|
||||
func (in *Directory) DeepCopy() *Directory {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Directory)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) {
|
||||
*out = *in
|
||||
if in.Selectors != nil {
|
||||
in, out := &in.Selectors, &out.Selectors
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec.
|
||||
func (in *NetworkSpec) DeepCopy() *NetworkSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NetworkSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Node) DeepCopyInto(out *Node) {
|
||||
*out = *in
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.Selection.DeepCopyInto(&out.Selection)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
|
||||
func (in *Node) DeepCopy() *Node {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Node)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in NodesByName) DeepCopyInto(out *NodesByName) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(NodesByName, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesByName.
|
||||
func (in NodesByName) DeepCopy() NodesByName {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NodesByName)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Placement) DeepCopyInto(out *Placement) {
|
||||
*out = *in
|
||||
if in.NodeAffinity != nil {
|
||||
in, out := &in.NodeAffinity, &out.NodeAffinity
|
||||
*out = new(v1.NodeAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAffinity != nil {
|
||||
in, out := &in.PodAffinity, &out.PodAffinity
|
||||
*out = new(v1.PodAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAntiAffinity != nil {
|
||||
in, out := &in.PodAntiAffinity, &out.PodAntiAffinity
|
||||
*out = new(v1.PodAntiAffinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Tolerations != nil {
|
||||
in, out := &in.Tolerations, &out.Tolerations
|
||||
*out = make([]v1.Toleration, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
|
||||
func (in *Placement) DeepCopy() *Placement {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Placement)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in PlacementSpec) DeepCopyInto(out *PlacementSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(PlacementSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementSpec.
|
||||
func (in PlacementSpec) DeepCopy() PlacementSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PlacementSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in PriorityClassNamesSpec) DeepCopyInto(out *PriorityClassNamesSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(PriorityClassNamesSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityClassNamesSpec.
|
||||
func (in PriorityClassNamesSpec) DeepCopy() PriorityClassNamesSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PriorityClassNamesSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in ResourceSpec) DeepCopyInto(out *ResourceSpec) {
|
||||
{
|
||||
in := &in
|
||||
*out = make(ResourceSpec, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.
|
||||
func (in ResourceSpec) DeepCopy() ResourceSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return *out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Selection) DeepCopyInto(out *Selection) {
|
||||
*out = *in
|
||||
if in.UseAllDevices != nil {
|
||||
in, out := &in.UseAllDevices, &out.UseAllDevices
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.Devices != nil {
|
||||
in, out := &in.Devices, &out.Devices
|
||||
*out = make([]Device, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Directories != nil {
|
||||
in, out := &in.Directories, &out.Directories
|
||||
*out = make([]Directory, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.VolumeClaimTemplates != nil {
|
||||
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
|
||||
*out = make([]v1.PersistentVolumeClaim, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selection.
|
||||
func (in *Selection) DeepCopy() *Selection {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Selection)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassDeviceSet) DeepCopyInto(out *StorageClassDeviceSet) {
|
||||
*out = *in
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.VolumeClaimTemplates != nil {
|
||||
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
|
||||
*out = make([]v1.PersistentVolumeClaim, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassDeviceSet.
|
||||
func (in *StorageClassDeviceSet) DeepCopy() *StorageClassDeviceSet {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageClassDeviceSet)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageScopeSpec) DeepCopyInto(out *StorageScopeSpec) {
|
||||
*out = *in
|
||||
if in.Nodes != nil {
|
||||
in, out := &in.Nodes, &out.Nodes
|
||||
*out = make([]Node, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
in.Selection.DeepCopyInto(&out.Selection)
|
||||
if in.VolumeSources != nil {
|
||||
in, out := &in.VolumeSources, &out.VolumeSources
|
||||
*out = make([]VolumeSource, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.StorageClassDeviceSets != nil {
|
||||
in, out := &in.StorageClassDeviceSets, &out.StorageClassDeviceSets
|
||||
*out = make([]StorageClassDeviceSet, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageScopeSpec.
|
||||
func (in *StorageScopeSpec) DeepCopy() *StorageScopeSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageScopeSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Volume) DeepCopyInto(out *Volume) {
|
||||
*out = *in
|
||||
@@ -497,29 +103,3 @@ func (in *VolumeList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeSource) DeepCopyInto(out *VolumeSource) {
|
||||
*out = *in
|
||||
out.PersistentVolumeClaimSource = in.PersistentVolumeClaimSource
|
||||
in.Resources.DeepCopyInto(&out.Resources)
|
||||
in.Placement.DeepCopyInto(&out.Placement)
|
||||
if in.Config != nil {
|
||||
in, out := &in.Config, &out.Config
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSource.
|
||||
func (in *VolumeSource) DeepCopy() *VolumeSource {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeSource)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
@@ -16,5 +16,5 @@ limitations under the License.
|
||||
package yugabytedbrookio
|
||||
|
||||
const (
|
||||
GroupName = "yugabytedb.rook.io"
|
||||
CustomResourceGroupName = "yugabytedb.rook.io"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
// Group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: yugabytedbrookio.GroupName, Version: Version}
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: yugabytedbrookio.CustomResourceGroupName, Version: Version}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
)
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
@@ -21,7 +21,7 @@ limitations under the License.
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
v1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -145,7 +145,7 @@ func (in *YBClusterSpec) DeepCopyInto(out *YBClusterSpec) {
|
||||
*out = *in
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(v1alpha2.Annotations, len(*in))
|
||||
*out = make(v1.Annotations, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
cockroachdbv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/cockroachdb.rook.io/v1alpha1"
|
||||
edgefsv1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/edgefs.rook.io/v1"
|
||||
nfsv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/nfs.rook.io/v1alpha1"
|
||||
rookv1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha2"
|
||||
yugabytedbv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/yugabytedb.rook.io/v1alpha1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
@@ -38,6 +39,7 @@ type Interface interface {
|
||||
CockroachdbV1alpha1() cockroachdbv1alpha1.CockroachdbV1alpha1Interface
|
||||
EdgefsV1() edgefsv1.EdgefsV1Interface
|
||||
NfsV1alpha1() nfsv1alpha1.NfsV1alpha1Interface
|
||||
RookV1() rookv1.RookV1Interface
|
||||
RookV1alpha2() rookv1alpha2.RookV1alpha2Interface
|
||||
YugabytedbV1alpha1() yugabytedbv1alpha1.YugabytedbV1alpha1Interface
|
||||
}
|
||||
@@ -51,6 +53,7 @@ type Clientset struct {
|
||||
cockroachdbV1alpha1 *cockroachdbv1alpha1.CockroachdbV1alpha1Client
|
||||
edgefsV1 *edgefsv1.EdgefsV1Client
|
||||
nfsV1alpha1 *nfsv1alpha1.NfsV1alpha1Client
|
||||
rookV1 *rookv1.RookV1Client
|
||||
rookV1alpha2 *rookv1alpha2.RookV1alpha2Client
|
||||
yugabytedbV1alpha1 *yugabytedbv1alpha1.YugabytedbV1alpha1Client
|
||||
}
|
||||
@@ -80,6 +83,11 @@ func (c *Clientset) NfsV1alpha1() nfsv1alpha1.NfsV1alpha1Interface {
|
||||
return c.nfsV1alpha1
|
||||
}
|
||||
|
||||
// RookV1 retrieves the RookV1Client
|
||||
func (c *Clientset) RookV1() rookv1.RookV1Interface {
|
||||
return c.rookV1
|
||||
}
|
||||
|
||||
// RookV1alpha2 retrieves the RookV1alpha2Client
|
||||
func (c *Clientset) RookV1alpha2() rookv1alpha2.RookV1alpha2Interface {
|
||||
return c.rookV1alpha2
|
||||
@@ -126,6 +134,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.rookV1, err = rookv1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.rookV1alpha2, err = rookv1alpha2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -151,6 +163,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.cockroachdbV1alpha1 = cockroachdbv1alpha1.NewForConfigOrDie(c)
|
||||
cs.edgefsV1 = edgefsv1.NewForConfigOrDie(c)
|
||||
cs.nfsV1alpha1 = nfsv1alpha1.NewForConfigOrDie(c)
|
||||
cs.rookV1 = rookv1.NewForConfigOrDie(c)
|
||||
cs.rookV1alpha2 = rookv1alpha2.NewForConfigOrDie(c)
|
||||
cs.yugabytedbV1alpha1 = yugabytedbv1alpha1.NewForConfigOrDie(c)
|
||||
|
||||
@@ -166,6 +179,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.cockroachdbV1alpha1 = cockroachdbv1alpha1.New(c)
|
||||
cs.edgefsV1 = edgefsv1.New(c)
|
||||
cs.nfsV1alpha1 = nfsv1alpha1.New(c)
|
||||
cs.rookV1 = rookv1.New(c)
|
||||
cs.rookV1alpha2 = rookv1alpha2.New(c)
|
||||
cs.yugabytedbV1alpha1 = yugabytedbv1alpha1.New(c)
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ import (
|
||||
fakeedgefsv1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/edgefs.rook.io/v1/fake"
|
||||
nfsv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/nfs.rook.io/v1alpha1"
|
||||
fakenfsv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/nfs.rook.io/v1alpha1/fake"
|
||||
rookv1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1"
|
||||
fakerookv1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1/fake"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha2"
|
||||
fakerookv1alpha2 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha2/fake"
|
||||
yugabytedbv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/yugabytedb.rook.io/v1alpha1"
|
||||
@@ -108,6 +110,11 @@ func (c *Clientset) NfsV1alpha1() nfsv1alpha1.NfsV1alpha1Interface {
|
||||
return &fakenfsv1alpha1.FakeNfsV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// RookV1 retrieves the RookV1Client
|
||||
func (c *Clientset) RookV1() rookv1.RookV1Interface {
|
||||
return &fakerookv1.FakeRookV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// RookV1alpha2 retrieves the RookV1alpha2Client
|
||||
func (c *Clientset) RookV1alpha2() rookv1alpha2.RookV1alpha2Interface {
|
||||
return &fakerookv1alpha2.FakeRookV1alpha2{Fake: &c.Fake}
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
nfsv1alpha1 "github.com/rook/rook/pkg/apis/nfs.rook.io/v1alpha1"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
yugabytedbv1alpha1 "github.com/rook/rook/pkg/apis/yugabytedb.rook.io/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -42,6 +43,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
cockroachdbv1alpha1.AddToScheme,
|
||||
edgefsv1.AddToScheme,
|
||||
nfsv1alpha1.AddToScheme,
|
||||
rookv1.AddToScheme,
|
||||
rookv1alpha2.AddToScheme,
|
||||
yugabytedbv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
nfsv1alpha1 "github.com/rook/rook/pkg/apis/nfs.rook.io/v1alpha1"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
yugabytedbv1alpha1 "github.com/rook/rook/pkg/apis/yugabytedb.rook.io/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -42,6 +43,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
cockroachdbv1alpha1.AddToScheme,
|
||||
edgefsv1.AddToScheme,
|
||||
nfsv1alpha1.AddToScheme,
|
||||
rookv1.AddToScheme,
|
||||
rookv1alpha2.AddToScheme,
|
||||
yugabytedbv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeRookV1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeRookV1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Copyright The Kubernetes 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.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/client/clientset/versioned/scheme"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type RookV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
}
|
||||
|
||||
// RookV1Client is used to interact with features provided by the rook.io group.
|
||||
type RookV1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
// NewForConfig creates a new RookV1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*RookV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RookV1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new RookV1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *RookV1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new RookV1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *RookV1Client {
|
||||
return &RookV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *RookV1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -20,6 +20,7 @@ package attachment
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
)
|
||||
@@ -33,7 +34,7 @@ const (
|
||||
var VolumeResource = k8sutil.CustomResource{
|
||||
Name: CustomResourceName,
|
||||
Plural: CustomResourceNamePlural,
|
||||
Group: rookalpha.CustomResourceGroup,
|
||||
Group: rook.CustomResourceGroupName,
|
||||
Version: rookalpha.Version,
|
||||
Kind: reflect.TypeOf(rookalpha.Volume{}).Name(),
|
||||
}
|
||||
@@ -18,7 +18,10 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rook/rook/pkg/apis/cassandra.rook.io"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
cassandrarookio "github.com/rook/rook/pkg/apis/cassandra.rook.io"
|
||||
cassandrav1alpha1 "github.com/rook/rook/pkg/apis/cassandra.rook.io/v1alpha1"
|
||||
"github.com/rook/rook/pkg/operator/cassandra/constants"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
@@ -30,8 +33,6 @@ import (
|
||||
"k8s.io/client-go/kubernetes"
|
||||
appslisters "k8s.io/client-go/listers/apps/v1"
|
||||
corelisters "k8s.io/client-go/listers/core/v1"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// GetPodsForCluster returns the existing Pods for
|
||||
@@ -90,7 +91,7 @@ func VerifyOwner(obj, owner metav1.Object) error {
|
||||
// the provided Cluster Object
|
||||
func NewControllerRef(c *cassandrav1alpha1.Cluster) metav1.OwnerReference {
|
||||
return *metav1.NewControllerRef(c, schema.GroupVersionKind{
|
||||
Group: cassandrarookio.GroupName,
|
||||
Group: cassandrarookio.CustomResourceGroupName,
|
||||
Version: "v1alpha1",
|
||||
Kind: "Cluster",
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/daemon/ceph/client"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
@@ -322,8 +322,8 @@ func (c *cluster) doOrchestration(rookImage string, cephVersion cephver.CephVers
|
||||
func clusterChanged(oldCluster, newCluster cephv1.ClusterSpec, clusterRef *cluster) (bool, string) {
|
||||
|
||||
// sort the nodes by name then compare to see if there are changes
|
||||
sort.Sort(rookv1alpha2.NodesByName(oldCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1alpha2.NodesByName(newCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1.NodesByName(oldCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1.NodesByName(newCluster.Storage.Nodes))
|
||||
|
||||
// any change in the crd will trigger an orchestration
|
||||
if !reflect.DeepEqual(oldCluster, newCluster) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookfake "github.com/rook/rook/pkg/client/clientset/versioned/fake"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
@@ -151,17 +152,17 @@ func TestClusterDeleteFlexDisabled(t *testing.T) {
|
||||
func TestClusterChanged(t *testing.T) {
|
||||
// a new node added, should be a change
|
||||
old := cephv1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
},
|
||||
},
|
||||
}
|
||||
new := cephv1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -172,25 +173,25 @@ func TestClusterChanged(t *testing.T) {
|
||||
assert.Equal(t, 0, c.Spec.Mon.Count)
|
||||
|
||||
// a node was removed, should be a change
|
||||
old.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
old.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
new.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
new.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
changed, diff = clusterChanged(old, new, c)
|
||||
assert.True(t, changed)
|
||||
assert.NotEqual(t, diff, "")
|
||||
|
||||
// the nodes being in a different order should not be a change
|
||||
old.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
old.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
new.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
new.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
changed, diff = clusterChanged(old, new, c)
|
||||
assert.False(t, changed)
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/daemon/ceph/client"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
@@ -67,8 +67,8 @@ type Cluster struct {
|
||||
clusterInfo *cephconfig.ClusterInfo
|
||||
Namespace string
|
||||
Replicas int
|
||||
placement rookalpha.Placement
|
||||
annotations rookalpha.Annotations
|
||||
placement rookv1.Placement
|
||||
annotations rookv1.Annotations
|
||||
context *clusterd.Context
|
||||
dataDir string
|
||||
Network cephv1.NetworkSpec
|
||||
@@ -92,8 +92,8 @@ func New(
|
||||
context *clusterd.Context,
|
||||
namespace, rookVersion string,
|
||||
cephVersion cephv1.CephVersionSpec,
|
||||
placement rookalpha.Placement,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookv1.Placement,
|
||||
annotations rookv1.Annotations,
|
||||
network cephv1.NetworkSpec,
|
||||
dashboard cephv1.DashboardSpec,
|
||||
monitoringSpec cephv1.MonitoringSpec,
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
cephver "github.com/rook/rook/pkg/operator/ceph/version"
|
||||
@@ -62,8 +62,8 @@ func TestStartMGR(t *testing.T) {
|
||||
"ns",
|
||||
"myversion",
|
||||
cephv1.CephVersionSpec{},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{"my": "annotation"},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{"my": "annotation"},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.DashboardSpec{Enabled: true, SSL: true},
|
||||
cephv1.MonitoringSpec{Enabled: true, RulesNamespace: ""},
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
rookcephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/daemon/ceph/client"
|
||||
"github.com/rook/rook/pkg/operator/ceph/cluster/mon"
|
||||
"github.com/rook/rook/pkg/operator/ceph/config"
|
||||
@@ -313,7 +313,7 @@ func (c *Cluster) getPodLabels(daemonName string) map[string]string {
|
||||
|
||||
func (c *Cluster) applyPrometheusAnnotations(objectMeta *metav1.ObjectMeta) {
|
||||
if len(c.annotations) == 0 {
|
||||
t := rookalpha.Annotations{
|
||||
t := rookv1.Annotations{
|
||||
"prometheus.io/scrape": "true",
|
||||
"prometheus.io/port": strconv.Itoa(metricsPort),
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
"github.com/rook/rook/pkg/operator/ceph/config"
|
||||
@@ -42,8 +42,8 @@ func TestPodSpec(t *testing.T) {
|
||||
"ns",
|
||||
"rook/rook:myversion",
|
||||
cephv1.CephVersionSpec{Image: "ceph/ceph:myceph"},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.DashboardSpec{Port: 1234},
|
||||
cephv1.MonitoringSpec{},
|
||||
@@ -96,8 +96,8 @@ func TestServiceSpec(t *testing.T) {
|
||||
"ns",
|
||||
"myversion",
|
||||
cephv1.CephVersionSpec{},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.DashboardSpec{},
|
||||
cephv1.MonitoringSpec{},
|
||||
@@ -124,8 +124,8 @@ func TestHostNetwork(t *testing.T) {
|
||||
"ns",
|
||||
"myversion",
|
||||
cephv1.CephVersionSpec{},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{HostNetwork: true},
|
||||
cephv1.DashboardSpec{Port: 1234},
|
||||
cephv1.MonitoringSpec{},
|
||||
@@ -159,8 +159,8 @@ func TestHttpBindFix(t *testing.T) {
|
||||
"ns",
|
||||
"myversion",
|
||||
cephv1.CephVersionSpec{},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.DashboardSpec{Port: 1234},
|
||||
cephv1.MonitoringSpec{},
|
||||
@@ -195,8 +195,8 @@ func TestApplyPrometheusAnnotations(t *testing.T) {
|
||||
"ns",
|
||||
"myversion",
|
||||
cephv1.CephVersionSpec{},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.DashboardSpec{},
|
||||
cephv1.MonitoringSpec{},
|
||||
@@ -225,7 +225,7 @@ func TestApplyPrometheusAnnotations(t *testing.T) {
|
||||
// re-initialize "d"
|
||||
d = c.makeDeployment(&mgrTestConfig)
|
||||
|
||||
fakeAnnotations := rookalpha.Annotations{
|
||||
fakeAnnotations := rookv1.Annotations{
|
||||
"foo.io/bar": "foobar",
|
||||
}
|
||||
c.annotations = fakeAnnotations
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephver "github.com/rook/rook/pkg/operator/ceph/version"
|
||||
"github.com/rook/rook/pkg/operator/test"
|
||||
@@ -37,8 +37,8 @@ func TestNodeAffinity(t *testing.T) {
|
||||
c := New(&clusterd.Context{Clientset: clientset}, "ns", "", cephv1.NetworkSpec{}, metav1.OwnerReference{}, &sync.Mutex{})
|
||||
setCommonMonProperties(c, 0, cephv1.MonSpec{Count: 3, AllowMultiplePerNode: true}, "myversion")
|
||||
|
||||
c.spec.Placement = map[rookalpha.KeyType]rookalpha.Placement{}
|
||||
c.spec.Placement[cephv1.KeyMon] = rookalpha.Placement{NodeAffinity: &v1.NodeAffinity{
|
||||
c.spec.Placement = map[rookv1.KeyType]rookv1.Placement{}
|
||||
c.spec.Placement[cephv1.KeyMon] = rookv1.Placement{NodeAffinity: &v1.NodeAffinity{
|
||||
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
|
||||
NodeSelectorTerms: []v1.NodeSelectorTerm{
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/ceph/config"
|
||||
opspec "github.com/rook/rook/pkg/operator/ceph/spec"
|
||||
@@ -63,7 +63,7 @@ func testPodSpec(t *testing.T, monID string, pvc bool) {
|
||||
v1.ResourceMemory: *resource.NewQuantity(500.0, resource.BinarySI),
|
||||
},
|
||||
}
|
||||
c.spec.PriorityClassNames = map[rook.KeyType]string{
|
||||
c.spec.PriorityClassNames = map[rookv1.KeyType]string{
|
||||
cephv1.KeyMon: "my-priority-class",
|
||||
}
|
||||
monConfig := testGenMonConfig(monID)
|
||||
|
||||
@@ -18,14 +18,14 @@ package osd
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
opspec "github.com/rook/rook/pkg/operator/ceph/spec"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
func (c *Cluster) prepareStorageClassDeviceSets(config *provisionConfig) []rookalpha.VolumeSource {
|
||||
volumeSources := []rookalpha.VolumeSource{}
|
||||
func (c *Cluster) prepareStorageClassDeviceSets(config *provisionConfig) []rookv1.VolumeSource {
|
||||
volumeSources := []rookv1.VolumeSource{}
|
||||
|
||||
// Iterate over storageClassDeviceSet
|
||||
for _, storageClassDeviceSet := range c.DesiredStorage.StorageClassDeviceSets {
|
||||
@@ -45,7 +45,7 @@ func (c *Cluster) prepareStorageClassDeviceSets(config *provisionConfig) []rooka
|
||||
config.addError("failed to create osd for storageClassDeviceSet %q for count %d. %v", storageClassDeviceSet.Name, i, err)
|
||||
continue
|
||||
}
|
||||
volumeSources = append(volumeSources, rookalpha.VolumeSource{
|
||||
volumeSources = append(volumeSources, rookv1.VolumeSource{
|
||||
Name: storageClassDeviceSet.Name,
|
||||
Resources: storageClassDeviceSet.Resources,
|
||||
Placement: storageClassDeviceSet.Placement,
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/daemon/ceph/client"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
@@ -78,13 +78,13 @@ type Cluster struct {
|
||||
clusterInfo *cephconfig.ClusterInfo
|
||||
context *clusterd.Context
|
||||
Namespace string
|
||||
placement rookalpha.Placement
|
||||
annotations rookalpha.Annotations
|
||||
placement rookv1.Placement
|
||||
annotations rookv1.Annotations
|
||||
Keyring string
|
||||
rookVersion string
|
||||
cephVersion cephv1.CephVersionSpec
|
||||
DesiredStorage rookalpha.StorageScopeSpec // user-defined storage scope spec
|
||||
ValidStorage rookalpha.StorageScopeSpec // valid subset of `Storage`, computed at runtime
|
||||
DesiredStorage rookv1.StorageScopeSpec // user-defined storage scope spec
|
||||
ValidStorage rookv1.StorageScopeSpec // valid subset of `Storage`, computed at runtime
|
||||
dataDirHostPath string
|
||||
Network cephv1.NetworkSpec
|
||||
resources v1.ResourceRequirements
|
||||
@@ -103,10 +103,10 @@ func New(
|
||||
namespace string,
|
||||
rookVersion string,
|
||||
cephVersion cephv1.CephVersionSpec,
|
||||
storageSpec rookalpha.StorageScopeSpec,
|
||||
storageSpec rookv1.StorageScopeSpec,
|
||||
dataDirHostPath string,
|
||||
placement rookalpha.Placement,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookv1.Placement,
|
||||
annotations rookv1.Annotations,
|
||||
network cephv1.NetworkSpec,
|
||||
resources v1.ResourceRequirements,
|
||||
prepareResources v1.ResourceRequirements,
|
||||
@@ -163,13 +163,13 @@ type OrchestrationStatus struct {
|
||||
type osdProperties struct {
|
||||
//crushHostname refers to the hostname or PVC name when the OSD is provisioned on Nodes or PVC block device, respectively.
|
||||
crushHostname string
|
||||
devices []rookalpha.Device
|
||||
devices []rookv1.Device
|
||||
pvc v1.PersistentVolumeClaimVolumeSource
|
||||
metadataPVC v1.PersistentVolumeClaimVolumeSource
|
||||
selection rookalpha.Selection
|
||||
selection rookv1.Selection
|
||||
resources v1.ResourceRequirements
|
||||
storeConfig osdconfig.StoreConfig
|
||||
placement rookalpha.Placement
|
||||
placement rookv1.Placement
|
||||
metadataDevice string
|
||||
location string
|
||||
portable bool
|
||||
@@ -358,7 +358,7 @@ func (c *Cluster) startProvisioningOverNodes(config *provisionConfig) {
|
||||
}
|
||||
c.DesiredStorage.Nodes = nil
|
||||
for _, hostname := range hostnameMap {
|
||||
storageNode := rookalpha.Node{
|
||||
storageNode := rookv1.Node{
|
||||
Name: hostname,
|
||||
}
|
||||
c.DesiredStorage.Nodes = append(c.DesiredStorage.Nodes, storageNode)
|
||||
@@ -655,7 +655,7 @@ func (c *Cluster) discoverStorageNodes() (map[string][]*apps.Deployment, error)
|
||||
return discoveredNodes, nil
|
||||
}
|
||||
|
||||
func (c *Cluster) resolveNode(nodeName string) *rookalpha.Node {
|
||||
func (c *Cluster) resolveNode(nodeName string) *rookv1.Node {
|
||||
// fully resolve the storage config and resources for this node
|
||||
rookNode := c.ValidStorage.ResolveNode(nodeName)
|
||||
if rookNode == nil {
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
discoverDaemon "github.com/rook/rook/pkg/daemon/discover"
|
||||
@@ -46,7 +46,7 @@ func TestStart(t *testing.T) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "myversion", cephv1.CephVersionSpec{},
|
||||
rookalpha.StorageScopeSpec{}, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
rookv1.StorageScopeSpec{}, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
// Start the first time
|
||||
err := c.Start()
|
||||
@@ -95,12 +95,12 @@ func createNode(nodeName string, condition v1.NodeConditionType, clientset *fake
|
||||
func TestAddRemoveNode(t *testing.T) {
|
||||
// create a storage spec with the given nodes/devices/dirs
|
||||
nodeName := "node8230"
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: nodeName,
|
||||
Selection: rookalpha.Selection{
|
||||
Devices: []rookalpha.Device{{Name: "sdx"}},
|
||||
Selection: rookv1.Selection{
|
||||
Devices: []rookv1.Device{{Name: "sdx"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -130,7 +130,7 @@ func TestAddRemoveNode(t *testing.T) {
|
||||
}
|
||||
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: executor}, "ns-add-remove", "myversion", cephv1.CephVersionSpec{},
|
||||
storageSpec, "/foo", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, "/foo", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
// kick off the start of the orchestration in a goroutine
|
||||
var startErr error
|
||||
@@ -207,9 +207,9 @@ func TestAddRemoveNode(t *testing.T) {
|
||||
}
|
||||
|
||||
// modify the storage spec to remove the node from the cluster
|
||||
storageSpec.Nodes = []rookalpha.Node{}
|
||||
storageSpec.Nodes = []rookv1.Node{}
|
||||
c = New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: mockExec}, "ns-add-remove", "myversion", cephv1.CephVersionSpec{},
|
||||
storageSpec, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
// reset the orchestration status watcher
|
||||
statusMapWatcher = watch.NewFake()
|
||||
@@ -237,12 +237,12 @@ func TestAddRemoveNode(t *testing.T) {
|
||||
func TestAddNodeFailure(t *testing.T) {
|
||||
// create a storage spec with the given nodes/devices/dirs
|
||||
nodeName := "node1672"
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: nodeName,
|
||||
Selection: rookalpha.Selection{
|
||||
Devices: []rookalpha.Device{{Name: "sdx"}},
|
||||
Selection: rookv1.Selection{
|
||||
Devices: []rookv1.Device{{Name: "sdx"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -266,7 +266,7 @@ func TestAddNodeFailure(t *testing.T) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns-add-remove", "myversion", cephv1.CephVersionSpec{},
|
||||
storageSpec, "/foo", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, "/foo", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
// kick off the start of the orchestration in a goroutine
|
||||
var startErr error
|
||||
@@ -286,7 +286,7 @@ func TestAddNodeFailure(t *testing.T) {
|
||||
|
||||
func TestGetOSDInfo(t *testing.T) {
|
||||
c := New(&cephconfig.ClusterInfo{}, &clusterd.Context{}, "ns", "myversion", cephv1.CephVersionSpec{},
|
||||
rookalpha.StorageScopeSpec{}, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{},
|
||||
rookv1.StorageScopeSpec{}, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{},
|
||||
v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
node := "n1"
|
||||
@@ -296,7 +296,7 @@ func TestGetOSDInfo(t *testing.T) {
|
||||
osdProp := osdProperties{
|
||||
crushHostname: node,
|
||||
pvc: v1.PersistentVolumeClaimVolumeSource{ClaimName: "pvc"},
|
||||
selection: rookalpha.Selection{},
|
||||
selection: rookv1.Selection{},
|
||||
resources: v1.ResourceRequirements{},
|
||||
storeConfig: config.StoreConfig{},
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
"github.com/rook/rook/pkg/operator/ceph/cluster/osd/config"
|
||||
@@ -40,7 +40,7 @@ func TestPodContainer(t *testing.T) {
|
||||
cluster := &Cluster{Namespace: "myosd", rookVersion: "23", cephVersion: cephv1.CephVersionSpec{}, clusterInfo: &cephconfig.ClusterInfo{}}
|
||||
osdProps := osdProperties{
|
||||
crushHostname: "node",
|
||||
devices: []rookalpha.Device{},
|
||||
devices: []rookv1.Device{},
|
||||
resources: v1.ResourceRequirements{},
|
||||
storeConfig: config.StoreConfig{},
|
||||
}
|
||||
@@ -72,11 +72,11 @@ func TestDaemonset(t *testing.T) {
|
||||
}
|
||||
|
||||
func testPodDevices(t *testing.T, dataDir, deviceName string, allDevices bool) {
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
Selection: rookalpha.Selection{UseAllDevices: &allDevices, DeviceFilter: deviceName},
|
||||
Nodes: []rookalpha.Node{{Name: "node1"}},
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Selection: rookv1.Selection{UseAllDevices: &allDevices, DeviceFilter: deviceName},
|
||||
Nodes: []rookv1.Node{{Name: "node1"}},
|
||||
}
|
||||
devices := []rookalpha.Device{
|
||||
devices := []rookv1.Device{
|
||||
{Name: deviceName},
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func testPodDevices(t *testing.T, dataDir, deviceName string, allDevices bool) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "rook/rook:myversion", cephVersion,
|
||||
storageSpec, dataDir, rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, dataDir, rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
devMountNeeded := deviceName != "" || allDevices
|
||||
|
||||
@@ -234,8 +234,8 @@ func verifyEnvVar(t *testing.T, envVars []v1.EnvVar, expectedName, expectedValue
|
||||
}
|
||||
|
||||
func TestStorageSpecConfig(t *testing.T) {
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: "node1",
|
||||
Config: map[string]string{
|
||||
@@ -243,7 +243,7 @@ func TestStorageSpecConfig(t *testing.T) {
|
||||
"walSizeMB": "20",
|
||||
"metadataDevice": "nvme093",
|
||||
},
|
||||
Selection: rookalpha.Selection{},
|
||||
Selection: rookv1.Selection{},
|
||||
Resources: v1.ResourceRequirements{
|
||||
Limits: v1.ResourceList{
|
||||
v1.ResourceCPU: *resource.NewQuantity(1024.0, resource.BinarySI),
|
||||
@@ -263,7 +263,7 @@ func TestStorageSpecConfig(t *testing.T) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "rook/rook:myversion", cephv1.CephVersionSpec{},
|
||||
storageSpec, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
n := c.DesiredStorage.ResolveNode(storageSpec.Nodes[0].Name)
|
||||
storeConfig := config.ToStoreConfig(storageSpec.Nodes[0].Config)
|
||||
@@ -296,8 +296,8 @@ func TestStorageSpecConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHostNetwork(t *testing.T) {
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: "node1",
|
||||
Config: map[string]string{
|
||||
@@ -313,7 +313,7 @@ func TestHostNetwork(t *testing.T) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "myversion", cephv1.CephVersionSpec{},
|
||||
storageSpec, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{HostNetwork: true}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
storageSpec, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{HostNetwork: true}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
n := c.DesiredStorage.ResolveNode(storageSpec.Nodes[0].Name)
|
||||
osd := OSDInfo{
|
||||
@@ -355,7 +355,7 @@ func TestOsdOnSDNFlag(t *testing.T) {
|
||||
func TestOsdPrepareResources(t *testing.T) {
|
||||
clientset := fake.NewSimpleClientset()
|
||||
c := New(&cephconfig.ClusterInfo{}, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "myversion", cephv1.CephVersionSpec{},
|
||||
rookalpha.StorageScopeSpec{}, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
rookv1.StorageScopeSpec{}, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
|
||||
// TEST 2: NOT running on PVC and some prepareResources are specificied
|
||||
rr := v1.ResourceRequirements{
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"time"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
cephver "github.com/rook/rook/pkg/operator/ceph/version"
|
||||
@@ -42,7 +42,7 @@ func TestOrchestrationStatus(t *testing.T) {
|
||||
CephVersion: cephver.Nautilus,
|
||||
}
|
||||
c := New(clusterInfo, &clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "myversion", cephv1.CephVersionSpec{},
|
||||
rookalpha.StorageScopeSpec{}, "", rookalpha.Placement{}, rookalpha.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
rookv1.StorageScopeSpec{}, "", rookv1.Placement{}, rookv1.Annotations{}, cephv1.NetworkSpec{}, v1.ResourceRequirements{}, v1.ResourceRequirements{}, "my-priority-class", metav1.OwnerReference{}, false, false)
|
||||
kv := k8sutil.NewConfigMapKVStore(c.Namespace, clientset, metav1.OwnerReference{})
|
||||
nodeName := "mynode"
|
||||
cmName := fmt.Sprintf(orchestrationStatusMapName, nodeName)
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/pkg/errors"
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/daemon/ceph/client"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
@@ -51,8 +51,8 @@ const (
|
||||
type Mirroring struct {
|
||||
ClusterInfo *cephconfig.ClusterInfo
|
||||
Namespace string
|
||||
placement rookalpha.Placement
|
||||
annotations rookalpha.Annotations
|
||||
placement rookv1.Placement
|
||||
annotations rookv1.Annotations
|
||||
context *clusterd.Context
|
||||
resources v1.ResourceRequirements
|
||||
priorityClassName string
|
||||
@@ -71,8 +71,8 @@ func New(
|
||||
context *clusterd.Context,
|
||||
namespace, rookVersion string,
|
||||
cephVersion cephv1.CephVersionSpec,
|
||||
placement rookalpha.Placement,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookv1.Placement,
|
||||
annotations rookv1.Annotations,
|
||||
network cephv1.NetworkSpec,
|
||||
spec cephv1.RBDMirroringSpec,
|
||||
resources v1.ResourceRequirements,
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
testop "github.com/rook/rook/pkg/operator/test"
|
||||
@@ -50,8 +50,8 @@ func TestRBDMirror(t *testing.T) {
|
||||
"ns",
|
||||
"rook/rook:myversion",
|
||||
cephv1.CephVersionSpec{Image: "ceph/ceph:myceph"},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.RBDMirroringSpec{Workers: 2},
|
||||
v1.ResourceRequirements{},
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
cephconfig "github.com/rook/rook/pkg/daemon/ceph/config"
|
||||
"github.com/rook/rook/pkg/operator/ceph/config"
|
||||
@@ -40,8 +40,8 @@ func TestPodSpec(t *testing.T) {
|
||||
"ns",
|
||||
"rook/rook:myversion",
|
||||
cephv1.CephVersionSpec{Image: "ceph/ceph:myceph"},
|
||||
rookalpha.Placement{},
|
||||
rookalpha.Annotations{},
|
||||
rookv1.Placement{},
|
||||
rookv1.Annotations{},
|
||||
cephv1.NetworkSpec{},
|
||||
cephv1.RBDMirroringSpec{Workers: 2},
|
||||
v1.ResourceRequirements{
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"time"
|
||||
|
||||
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
@@ -85,7 +85,7 @@ type cluster struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
spec cockroachdbv1alpha1.ClusterSpec
|
||||
annotations rookv1alpha2.Annotations
|
||||
annotations rookv1.Annotations
|
||||
ownerRef metav1.OwnerReference
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"time"
|
||||
|
||||
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
testop "github.com/rook/rook/pkg/operator/test"
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
func TestValidateClusterSpec(t *testing.T) {
|
||||
// invalid node count
|
||||
spec := cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{NodeCount: 0},
|
||||
Storage: rookv1.StorageScopeSpec{NodeCount: 0},
|
||||
Network: cockroachdbv1alpha1.NetworkSpec{
|
||||
Ports: []cockroachdbv1alpha1.PortSpec{
|
||||
{Name: "http", Port: 123},
|
||||
@@ -52,7 +52,7 @@ func TestValidateClusterSpec(t *testing.T) {
|
||||
|
||||
// invalid cache percent
|
||||
spec = cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{NodeCount: 1},
|
||||
Storage: rookv1.StorageScopeSpec{NodeCount: 1},
|
||||
Network: cockroachdbv1alpha1.NetworkSpec{
|
||||
Ports: []cockroachdbv1alpha1.PortSpec{
|
||||
{Name: "http", Port: 123},
|
||||
@@ -67,7 +67,7 @@ func TestValidateClusterSpec(t *testing.T) {
|
||||
|
||||
// invalid max SQL memory percent
|
||||
spec = cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{NodeCount: 1},
|
||||
Storage: rookv1.StorageScopeSpec{NodeCount: 1},
|
||||
Network: cockroachdbv1alpha1.NetworkSpec{
|
||||
Ports: []cockroachdbv1alpha1.PortSpec{
|
||||
{Name: "http", Port: 123},
|
||||
@@ -82,7 +82,7 @@ func TestValidateClusterSpec(t *testing.T) {
|
||||
|
||||
// invalid port spec
|
||||
spec = cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{NodeCount: 1},
|
||||
Storage: rookv1.StorageScopeSpec{NodeCount: 1},
|
||||
Network: cockroachdbv1alpha1.NetworkSpec{
|
||||
Ports: []cockroachdbv1alpha1.PortSpec{
|
||||
{Name: "foo-port", Port: 123},
|
||||
@@ -95,7 +95,7 @@ func TestValidateClusterSpec(t *testing.T) {
|
||||
|
||||
// valid spec
|
||||
spec = cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{NodeCount: 1},
|
||||
Storage: rookv1.StorageScopeSpec{NodeCount: 1},
|
||||
Network: cockroachdbv1alpha1.NetworkSpec{
|
||||
Ports: []cockroachdbv1alpha1.PortSpec{
|
||||
{Name: "http", Port: 123},
|
||||
@@ -115,9 +115,9 @@ func TestOnAdd(t *testing.T) {
|
||||
Namespace: namespace,
|
||||
},
|
||||
Spec: cockroachdbv1alpha1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
NodeCount: 5,
|
||||
Selection: rookalpha.Selection{
|
||||
Selection: rookv1.Selection{
|
||||
VolumeClaimTemplates: []v1.PersistentVolumeClaim{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
discoverDaemon "github.com/rook/rook/pkg/daemon/discover"
|
||||
k8sutil "github.com/rook/rook/pkg/operator/k8sutil"
|
||||
@@ -349,8 +349,8 @@ func matchDeviceFullPath(devLinks, fullpath string) bool {
|
||||
}
|
||||
|
||||
// GetAvailableDevices conducts outer join using input filters with free devices that a node has. It marks the devices from join result as in-use.
|
||||
func GetAvailableDevices(context *clusterd.Context, nodeName, clusterName string, devices []rookalpha.Device, filter string, useAllDevices bool) ([]rookalpha.Device, error) {
|
||||
results := []rookalpha.Device{}
|
||||
func GetAvailableDevices(context *clusterd.Context, nodeName, clusterName string, devices []rookv1.Device, filter string, useAllDevices bool) ([]rookv1.Device, error) {
|
||||
results := []rookv1.Device{}
|
||||
if len(devices) == 0 && len(filter) == 0 && !useAllDevices {
|
||||
return results, nil
|
||||
}
|
||||
@@ -404,7 +404,7 @@ func GetAvailableDevices(context *clusterd.Context, nodeName, clusterName string
|
||||
//TODO support filter based on other keys
|
||||
matched, err := regexp.Match(filter, []byte(nodeDevices[i].Name))
|
||||
if err == nil && matched {
|
||||
d := rookalpha.Device{
|
||||
d := rookv1.Device{
|
||||
Name: nodeDevices[i].Name,
|
||||
}
|
||||
claimedDevices = append(claimedDevices, nodeDevices[i])
|
||||
@@ -413,7 +413,7 @@ func GetAvailableDevices(context *clusterd.Context, nodeName, clusterName string
|
||||
}
|
||||
} else if useAllDevices {
|
||||
for i := range nodeDevices {
|
||||
d := rookalpha.Device{
|
||||
d := rookv1.Device{
|
||||
Name: nodeDevices[i].Name,
|
||||
}
|
||||
results = append(results, d)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
discoverDaemon "github.com/rook/rook/pkg/daemon/discover"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
@@ -117,7 +117,7 @@ func TestGetAvailableDevices(t *testing.T) {
|
||||
context := &clusterd.Context{
|
||||
Clientset: clientset,
|
||||
}
|
||||
d := []rookalpha.Device{
|
||||
d := []rookv1.Device{
|
||||
{
|
||||
Name: "sdc",
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/mgr"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/prepare"
|
||||
@@ -312,8 +312,8 @@ func (c *cluster) validateClusterSpec() error {
|
||||
|
||||
func clusterChanged(oldCluster, newCluster edgefsv1.ClusterSpec) bool {
|
||||
// sort the nodes by name then compare to see if there are changes
|
||||
sort.Sort(rookv1alpha2.NodesByName(oldCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1alpha2.NodesByName(newCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1.NodesByName(oldCluster.Storage.Nodes))
|
||||
sort.Sort(rookv1.NodesByName(newCluster.Storage.Nodes))
|
||||
|
||||
var diff string
|
||||
// any change in the crd will trigger an orchestration
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"strings"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/operator/discover"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/target"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/target/config"
|
||||
@@ -35,7 +35,7 @@ type ClusterReconfigureSpec struct {
|
||||
ClusterNodesToAdd []string
|
||||
}
|
||||
|
||||
func (c *cluster) createClusterReconfigurationSpec(existingConfig edgefsv1.ClusterDeploymentConfig, validNodes []rookv1alpha2.Node, dro edgefsv1.DevicesResurrectOptions) (ClusterReconfigureSpec, error) {
|
||||
func (c *cluster) createClusterReconfigurationSpec(existingConfig edgefsv1.ClusterDeploymentConfig, validNodes []rookv1.Node, dro edgefsv1.DevicesResurrectOptions) (ClusterReconfigureSpec, error) {
|
||||
|
||||
deploymentType, err := c.getClusterDeploymentType()
|
||||
if err != nil {
|
||||
@@ -181,7 +181,7 @@ func getClusterTransportKey(deploymentType string) string {
|
||||
}
|
||||
|
||||
// createDevicesConfig creates DevicesConfig for specific node
|
||||
func (c *cluster) createDevicesConfig(deploymentType string, node rookv1alpha2.Node, dro edgefsv1.DevicesResurrectOptions) (edgefsv1.DevicesConfig, error) {
|
||||
func (c *cluster) createDevicesConfig(deploymentType string, node rookv1.Node, dro edgefsv1.DevicesResurrectOptions) (edgefsv1.DevicesConfig, error) {
|
||||
devicesConfig := edgefsv1.DevicesConfig{}
|
||||
devicesConfig.Rtrd.Devices = make([]edgefsv1.RTDevice, 0)
|
||||
devicesConfig.RtrdSlaves = make([]edgefsv1.RTDevices, 0)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"time"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
rookfake "github.com/rook/rook/pkg/client/clientset/versioned/fake"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
@@ -53,40 +53,40 @@ func TestClusterDelete(t *testing.T) {
|
||||
func TestClusterChanged(t *testing.T) {
|
||||
// a new node added, should be a change
|
||||
old := edgefsv1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
},
|
||||
},
|
||||
}
|
||||
new := edgefsv1.ClusterSpec{
|
||||
Storage: rookalpha.StorageScopeSpec{
|
||||
Nodes: []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
Storage: rookv1.StorageScopeSpec{
|
||||
Nodes: []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
},
|
||||
},
|
||||
}
|
||||
assert.True(t, clusterChanged(old, new))
|
||||
|
||||
// a node was removed, should be a change
|
||||
old.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
old.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
new.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
new.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
assert.True(t, clusterChanged(old, new))
|
||||
|
||||
// the nodes being in a different order should not be a change
|
||||
old.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
old.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
new.Storage.Nodes = []rookalpha.Node{
|
||||
{Name: "node2", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
{Name: "node1", Selection: rookalpha.Selection{Devices: []rookalpha.Device{{Name: "sda"}}}},
|
||||
new.Storage.Nodes = []rookv1.Node{
|
||||
{Name: "node2", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
{Name: "node1", Selection: rookv1.Selection{Devices: []rookv1.Device{{Name: "sda"}}}},
|
||||
}
|
||||
assert.False(t, clusterChanged(old, new))
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
apps "k8s.io/api/apps/v1"
|
||||
@@ -63,10 +63,10 @@ type Cluster struct {
|
||||
Replicas int
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
context *clusterd.Context
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dashboardSpec edgefsv1.DashboardSpec
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
@@ -80,9 +80,9 @@ func New(
|
||||
serviceAccount string,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookalpha.Placement,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
annotations rookv1.Annotations,
|
||||
placement rookv1.Placement,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dashboardSpec edgefsv1.DashboardSpec,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"testing"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
testop "github.com/rook/rook/pkg/operator/test"
|
||||
exectest "github.com/rook/rook/pkg/util/exec/test"
|
||||
@@ -47,7 +47,7 @@ func TestStartMGR(t *testing.T) {
|
||||
ConfigDir: configDir,
|
||||
Clientset: clientset}
|
||||
volSize := resource.NewQuantity(100000.0, resource.BinarySI)
|
||||
c := New(context, "ns", "myversion", "", "", *volSize, rookalpha.Annotations{}, rookalpha.Placement{}, rookalpha.NetworkSpec{},
|
||||
c := New(context, "ns", "myversion", "", "", *volSize, rookv1.Annotations{}, rookv1.Placement{}, rookv1.NetworkSpec{},
|
||||
edgefsv1.DashboardSpec{}, v1.ResourceRequirements{}, "", metav1.OwnerReference{}, false)
|
||||
|
||||
// start a basic service
|
||||
@@ -68,8 +68,8 @@ func validateStart(t *testing.T, c *Cluster) {
|
||||
func TestPodSpec(t *testing.T) {
|
||||
clientset := testop.New(t, 1)
|
||||
volSize := resource.NewQuantity(100000.0, resource.BinarySI)
|
||||
c := New(&clusterd.Context{Clientset: clientset}, "ns", "rook/rook:myversion", "", "", *volSize, rookalpha.Annotations{}, rookalpha.Placement{},
|
||||
rookalpha.NetworkSpec{}, edgefsv1.DashboardSpec{}, v1.ResourceRequirements{
|
||||
c := New(&clusterd.Context{Clientset: clientset}, "ns", "rook/rook:myversion", "", "", *volSize, rookv1.Annotations{}, rookv1.Placement{},
|
||||
rookv1.NetworkSpec{}, edgefsv1.DashboardSpec{}, v1.ResourceRequirements{
|
||||
Limits: v1.ResourceList{
|
||||
v1.ResourceCPU: *resource.NewQuantity(100.0, resource.BinarySI),
|
||||
},
|
||||
@@ -110,8 +110,8 @@ func TestPodSpec(t *testing.T) {
|
||||
|
||||
func TestServiceSpec(t *testing.T) {
|
||||
volSize := resource.NewQuantity(100000.0, resource.BinarySI)
|
||||
c := New(&clusterd.Context{}, "ns", "myversion", "", "", *volSize, rookalpha.Annotations{}, rookalpha.Placement{},
|
||||
rookalpha.NetworkSpec{}, edgefsv1.DashboardSpec{}, v1.ResourceRequirements{},
|
||||
c := New(&clusterd.Context{}, "ns", "myversion", "", "", *volSize, rookv1.Annotations{}, rookv1.Placement{},
|
||||
rookv1.NetworkSpec{}, edgefsv1.DashboardSpec{}, v1.ResourceRequirements{},
|
||||
"", metav1.OwnerReference{}, false)
|
||||
|
||||
s := c.makeMgrService("rook-edgefs-mgr")
|
||||
@@ -123,13 +123,13 @@ func TestServiceSpec(t *testing.T) {
|
||||
func TestHostNetwork(t *testing.T) {
|
||||
clientset := testop.New(t, 1)
|
||||
volSize := resource.NewQuantity(100000.0, resource.BinarySI)
|
||||
net := rookalpha.NetworkSpec{
|
||||
net := rookv1.NetworkSpec{
|
||||
Provider: "host",
|
||||
Selectors: map[string]string{
|
||||
"server": "eth0",
|
||||
},
|
||||
}
|
||||
c := New(&clusterd.Context{Clientset: clientset}, "ns", "myversion", "", "", *volSize, rookalpha.Annotations{}, rookalpha.Placement{},
|
||||
c := New(&clusterd.Context{Clientset: clientset}, "ns", "myversion", "", "", *volSize, rookv1.Annotations{}, rookv1.Placement{},
|
||||
net, edgefsv1.DashboardSpec{}, v1.ResourceRequirements{},
|
||||
"", metav1.OwnerReference{}, false)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
batch "k8s.io/api/batch/v1"
|
||||
@@ -45,8 +45,8 @@ type Cluster struct {
|
||||
Namespace string
|
||||
Version string
|
||||
serviceAccount string
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
context *clusterd.Context
|
||||
resources v1.ResourceRequirements
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -57,8 +57,8 @@ type Cluster struct {
|
||||
func New(
|
||||
context *clusterd.Context, namespace, version string,
|
||||
serviceAccount string,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookalpha.Placement,
|
||||
annotations rookv1.Annotations,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
ownerRef metav1.OwnerReference,
|
||||
) *Cluster {
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"strings"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/target/config"
|
||||
"github.com/rook/rook/pkg/util/sys"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
@@ -320,7 +320,7 @@ func getRTDevices(cntDevs ContainerDevices, storeConfig *config.StoreConfig) (rt
|
||||
return rtDevices, nil
|
||||
}
|
||||
|
||||
func GetRtlfsDevices(directories []rookalpha.Directory, storeConfig *config.StoreConfig) []edgefsv1.RtlfsDevice {
|
||||
func GetRtlfsDevices(directories []rookv1.Directory, storeConfig *config.StoreConfig) []edgefsv1.RtlfsDevice {
|
||||
rtlfsDevices := make([]edgefsv1.RtlfsDevice, 0)
|
||||
walDisabled := 0
|
||||
if storeConfig.WalMode > 0 {
|
||||
@@ -347,7 +347,7 @@ func GetRtlfsDevices(directories []rookalpha.Directory, storeConfig *config.Stor
|
||||
return rtlfsDevices
|
||||
}
|
||||
|
||||
func GetRtkvsDevices(disks []string, directories []rookalpha.Directory, storeConfig *config.StoreConfig) edgefsv1.RtkvsDevices {
|
||||
func GetRtkvsDevices(disks []string, directories []rookv1.Directory, storeConfig *config.StoreConfig) edgefsv1.RtkvsDevices {
|
||||
rc := edgefsv1.RtkvsDevices{}
|
||||
rc.Devices = make([]edgefsv1.RtkvsDevice, 0)
|
||||
rc.Backend = storeConfig.UseRtkvsBackend
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/edgefs/cluster/target/config"
|
||||
exectest "github.com/rook/rook/pkg/util/exec/test"
|
||||
@@ -32,13 +32,13 @@ import (
|
||||
)
|
||||
|
||||
func TestStorageSpecConfig(t *testing.T) {
|
||||
storageSpec := rookalpha.StorageScopeSpec{
|
||||
storageSpec := rookv1.StorageScopeSpec{
|
||||
Config: map[string]string{
|
||||
"useAllSSD": "false",
|
||||
"useBCacheWB": "true",
|
||||
"useBCache": "true",
|
||||
},
|
||||
Nodes: []rookalpha.Node{
|
||||
Nodes: []rookv1.Node{
|
||||
{
|
||||
Name: "node1",
|
||||
Config: map[string]string{
|
||||
@@ -46,8 +46,8 @@ func TestStorageSpecConfig(t *testing.T) {
|
||||
"useAllSSD": "true",
|
||||
"useMetadataOffload": "false",
|
||||
},
|
||||
Selection: rookalpha.Selection{
|
||||
Devices: []rookalpha.Device{{Name: "sda"}, {Name: "sdb"}},
|
||||
Selection: rookv1.Selection{
|
||||
Devices: []rookv1.Device{{Name: "sda"}, {Name: "sdb"}},
|
||||
},
|
||||
Resources: v1.ResourceRequirements{
|
||||
Limits: v1.ResourceList{
|
||||
@@ -65,7 +65,7 @@ func TestStorageSpecConfig(t *testing.T) {
|
||||
deploymentConfig := edgefsv1.ClusterDeploymentConfig{}
|
||||
c := New(&clusterd.Context{Clientset: clientset, ConfigDir: "/var/lib/rook", Executor: &exectest.MockExecutor{}}, "ns", "rook/rook:myversion", "",
|
||||
storageSpec, "", *resource.NewQuantity(100000.0, resource.BinarySI),
|
||||
rookalpha.Annotations{}, rookalpha.Placement{}, rookalpha.NetworkSpec{}, v1.ResourceRequirements{}, "", *resource.NewQuantity(0.0, resource.BinarySI),
|
||||
rookv1.Annotations{}, rookv1.Placement{}, rookv1.NetworkSpec{}, v1.ResourceRequirements{}, "", *resource.NewQuantity(0.0, resource.BinarySI),
|
||||
metav1.OwnerReference{}, deploymentConfig, false)
|
||||
|
||||
n := c.Storage.ResolveNode(storageSpec.Nodes[0].Name)
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -49,13 +49,13 @@ const (
|
||||
type Cluster struct {
|
||||
context *clusterd.Context
|
||||
Namespace string
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
Version string
|
||||
Storage rookalpha.StorageScopeSpec
|
||||
Storage rookv1.StorageScopeSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
Privileged bool
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
@@ -72,12 +72,12 @@ func New(
|
||||
namespace,
|
||||
version,
|
||||
serviceAccount string,
|
||||
storageSpec rookalpha.StorageScopeSpec,
|
||||
storageSpec rookv1.StorageScopeSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
annotations rookalpha.Annotations,
|
||||
placement rookalpha.Placement,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
annotations rookv1.Annotations,
|
||||
placement rookv1.Placement,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
chunkCacheSize resource.Quantity,
|
||||
@@ -113,7 +113,7 @@ func New(
|
||||
}
|
||||
|
||||
// Start the target management
|
||||
func (c *Cluster) Start(rookImage string, nodes []rookalpha.Node, dro edgefsv1.DevicesResurrectOptions) (err error) {
|
||||
func (c *Cluster) Start(rookImage string, nodes []rookv1.Node, dro edgefsv1.DevicesResurrectOptions) (err error) {
|
||||
logger.Infof("start running targets in namespace %s", c.Namespace)
|
||||
|
||||
logger.Infof("Target Image is %s", rookImage)
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"time"
|
||||
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/operator/discover"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -84,7 +84,7 @@ func ToJSON(obj interface{}) string {
|
||||
return string(bytes)
|
||||
}
|
||||
|
||||
func (c *cluster) getClusterNodes() ([]rookv1alpha2.Node, error) {
|
||||
func (c *cluster) getClusterNodes() ([]rookv1.Node, error) {
|
||||
if c.Spec.Storage.UseAllNodes {
|
||||
c.Spec.Storage.Nodes = nil
|
||||
// Resolve all storage nodes
|
||||
@@ -95,7 +95,7 @@ func (c *cluster) getClusterNodes() ([]rookv1alpha2.Node, error) {
|
||||
return nil, err
|
||||
}
|
||||
for nodeName := range allNodeDevices {
|
||||
storageNode := rookv1alpha2.Node{
|
||||
storageNode := rookv1.Node{
|
||||
Name: nodeName,
|
||||
}
|
||||
c.Spec.Storage.Nodes = append(c.Spec.Storage.Nodes, storageNode)
|
||||
@@ -254,7 +254,7 @@ func (c *cluster) PrintDeploymentConfig(deploymentConfig *edgefsv1.ClusterDeploy
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cluster) resolveNode(nodeName string) *rookv1alpha2.Node {
|
||||
func (c *cluster) resolveNode(nodeName string) *rookv1.Node {
|
||||
// Fully resolve the storage config and resources for this node
|
||||
rookNode := c.Spec.Storage.ResolveNode(nodeName)
|
||||
if rookNode == nil {
|
||||
@@ -267,7 +267,7 @@ func (c *cluster) resolveNode(nodeName string) *rookv1alpha2.Node {
|
||||
rookNode.Resources = k8sutil.MergeResourceRequirements(rookNode.Resources, c.Spec.Resources)
|
||||
|
||||
// Ensure no invalid dirs are specified
|
||||
var validDirs []rookv1alpha2.Directory
|
||||
var validDirs []rookv1.Directory
|
||||
for _, dir := range rookNode.Directories {
|
||||
if dir.Path == k8sutil.DataDir || dir.Path == c.Spec.DataDirHostPath {
|
||||
logger.Warningf("skipping directory %s that would conflict with the dataDirHostPath", dir.Path)
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -54,11 +54,11 @@ type ISCSIController struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
rookImage string
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
placement rookalpha.Placement
|
||||
annotations rookalpha.Annotations
|
||||
placement rookv1.Placement
|
||||
annotations rookv1.Annotations
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -70,10 +70,10 @@ func NewISCSIController(
|
||||
context *clusterd.Context,
|
||||
namespace string,
|
||||
rookImage string,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
placement rookalpha.Placement,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
ownerRef metav1.OwnerReference,
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -54,11 +54,11 @@ type ISGWController struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
rookImage string
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -70,10 +70,10 @@ func NewISGWController(
|
||||
context *clusterd.Context,
|
||||
namespace string,
|
||||
rookImage string,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
placement rookalpha.Placement,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
ownerRef metav1.OwnerReference,
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -54,11 +54,11 @@ type NFSController struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
rookImage string
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -70,10 +70,10 @@ func NewNFSController(
|
||||
context *clusterd.Context,
|
||||
namespace string,
|
||||
rookImage string,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
placement rookalpha.Placement,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
ownerRef metav1.OwnerReference,
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -54,11 +54,11 @@ type S3Controller struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
rookImage string
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -70,10 +70,10 @@ func NewS3Controller(
|
||||
context *clusterd.Context,
|
||||
namespace string,
|
||||
rookImage string,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
placement rookalpha.Placement,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
ownerRef metav1.OwnerReference,
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/coreos/pkg/capnslog"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
edgefsv1 "github.com/rook/rook/pkg/apis/edgefs.rook.io/v1"
|
||||
rookalpha "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
|
||||
rookv1 "github.com/rook/rook/pkg/apis/rook.io/v1"
|
||||
"github.com/rook/rook/pkg/clusterd"
|
||||
"github.com/rook/rook/pkg/operator/k8sutil"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -54,11 +54,11 @@ type S3XController struct {
|
||||
context *clusterd.Context
|
||||
namespace string
|
||||
rookImage string
|
||||
NetworkSpec rookalpha.NetworkSpec
|
||||
NetworkSpec rookv1.NetworkSpec
|
||||
dataDirHostPath string
|
||||
dataVolumeSize resource.Quantity
|
||||
annotations rookalpha.Annotations
|
||||
placement rookalpha.Placement
|
||||
annotations rookv1.Annotations
|
||||
placement rookv1.Placement
|
||||
resources v1.ResourceRequirements
|
||||
resourceProfile string
|
||||
ownerRef metav1.OwnerReference
|
||||
@@ -70,10 +70,10 @@ func NewS3XController(
|
||||
context *clusterd.Context,
|
||||
namespace string,
|
||||
rookImage string,
|
||||
NetworkSpec rookalpha.NetworkSpec,
|
||||
NetworkSpec rookv1.NetworkSpec,
|
||||
dataDirHostPath string,
|
||||
dataVolumeSize resource.Quantity,
|
||||
placement rookalpha.Placement,
|
||||
placement rookv1.Placement,
|
||||
resources v1.ResourceRequirements,
|
||||
resourceProfile string,
|
||||
ownerRef metav1.OwnerReference,
|
||||
|
||||
Loaded 100 of 108 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user