remove obsolete rook v1alpha1 types

Signed-off-by: travisn <tnielsen@redhat.com>
This commit is contained in:
travisn committed 2018-12-05 14:33:10 -07:00
1 parent 501c3a6681
commit df78f6ad6e
44 files changed
+12 -4682

No files matched your search

+1 -1
View File
@@ -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:v1alpha1,v1alpha2 ceph.rook.io:v1beta1,v1 cockroachdb.rook.io:v1alpha1 minio.rook.io:v1alpha1 nfs.rook.io:v1alpha1 cassandra.rook.io:v1alpha1"
"rook.io:v1alpha2 ceph.rook.io:v1beta1,v1 cockroachdb.rook.io:v1alpha1 minio.rook.io:v1alpha1 nfs.rook.io:v1alpha1 cassandra.rook.io:v1alpha1"
# this seems busted in the release-1.8 branch
# --go-header-file ${SCRIPT_ROOT}/build/codegen/header.txt
-21
View File
@@ -1,21 +0,0 @@
/*
Copyright 2017 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 API.
// +groupName=rook.io
package v1alpha1
-72
View File
@@ -1,72 +0,0 @@
/*
Copyright 2017 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 cluster to manage a rook cluster.
package v1alpha1
import "k8s.io/api/core/v1"
// ApplyToPodSpec adds placement to a pod spec
func (p Placement) ApplyToPodSpec(t *v1.PodSpec) {
if t.Affinity == nil {
t.Affinity = &v1.Affinity{}
}
if p.NodeAffinity != nil {
t.Affinity.NodeAffinity = p.NodeAffinity
}
if p.PodAffinity != nil {
t.Affinity.PodAffinity = p.PodAffinity
}
if p.PodAntiAffinity != nil {
t.Affinity.PodAntiAffinity = p.PodAntiAffinity
}
if p.Tolerations != nil {
t.Tolerations = p.Tolerations
}
}
// Merge returns a Placement which results from merging the attributes of the
// original Placement with the attributes of the supplied one. The supplied
// Placement's attributes will override the original ones if defined.
func (p Placement) Merge(with Placement) Placement {
ret := p
if with.NodeAffinity != nil {
ret.NodeAffinity = with.NodeAffinity
}
if with.PodAffinity != nil {
ret.PodAffinity = with.PodAffinity
}
if with.PodAntiAffinity != nil {
ret.PodAntiAffinity = with.PodAntiAffinity
}
if with.Tolerations != nil {
ret.Tolerations = with.Tolerations
}
return ret
}
// GetAPI returns the placement for the API service
func (p PlacementSpec) GetAPI() Placement { return p.All.Merge(p.API) }
// GetMgr returns the placement for the MGR service
func (p PlacementSpec) GetMgr() Placement { return p.All.Merge(p.Mgr) }
// GetMon returns the placement for the MON service
func (p PlacementSpec) GetMon() Placement { return p.All.Merge(p.Mon) }
// GetOSD returns the placement for the OSD service
func (p PlacementSpec) GetOSD() Placement { return p.All.Merge(p.OSD) }
-178
View File
@@ -1,178 +0,0 @@
/*
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 v1alpha1
import (
"encoding/json"
"testing"
"github.com/ghodss/yaml"
"github.com/stretchr/testify/assert"
"k8s.io/api/core/v1"
)
func TestPlacement_spec(t *testing.T) {
specYaml := []byte(`
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: foo
operator: In
values:
- bar
tolerations:
- key: foo
operator: Exists`)
// convert the raw spec yaml into JSON
rawJSON, err := yaml.YAMLToJSON(specYaml)
assert.Nil(t, err)
// unmarshal the JSON into a strongly typed placement spec object
var placement Placement
err = json.Unmarshal(rawJSON, &placement)
assert.Nil(t, err)
// the unmarshalled placement spec should equal the expected spec below
expected := Placement{
NodeAffinity: &v1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
NodeSelectorTerms: []v1.NodeSelectorTerm{
{
MatchExpressions: []v1.NodeSelectorRequirement{
{
Key: "foo",
Operator: v1.NodeSelectorOpIn,
Values: []string{"bar"},
},
},
},
},
},
},
Tolerations: []v1.Toleration{
{
Key: "foo",
Operator: v1.TolerationOpExists,
},
},
}
assert.Equal(t, expected, placement)
}
func TestPlacement_ApplyToPodSpec(t *testing.T) {
to := placementTestGetTolerations("foo", "bar")
na := placementTestGetNodeAffinity()
expected := &v1.PodSpec{Affinity: &v1.Affinity{NodeAffinity: na}, Tolerations: to}
var p Placement
var ps *v1.PodSpec
p = Placement{NodeAffinity: na, Tolerations: to}
ps = &v1.PodSpec{}
p.ApplyToPodSpec(ps)
assert.Equal(t, expected, ps)
// partial update
p = Placement{NodeAffinity: na}
ps = &v1.PodSpec{Tolerations: to}
p.ApplyToPodSpec(ps)
assert.Equal(t, expected, ps)
// overridden attributes
p = Placement{NodeAffinity: na, Tolerations: to}
ps = &v1.PodSpec{Tolerations: placementTestGetTolerations("bar", "baz")}
p.ApplyToPodSpec(ps)
assert.Equal(t, expected, ps)
p = Placement{NodeAffinity: na}
nap := placementTestGetNodeAffinity()
nap.PreferredDuringSchedulingIgnoredDuringExecution[0].Weight = 5
ps = &v1.PodSpec{Affinity: &v1.Affinity{NodeAffinity: nap}, Tolerations: to}
p.ApplyToPodSpec(ps)
assert.Equal(t, expected, ps)
}
func TestPlacement_Merge(t *testing.T) {
to := placementTestGetTolerations("foo", "bar")
na := placementTestGetNodeAffinity()
var original, with, expected, merged Placement
original = Placement{}
with = Placement{Tolerations: to}
expected = Placement{Tolerations: to}
merged = original.Merge(with)
assert.Equal(t, expected, merged)
original = Placement{NodeAffinity: na}
with = Placement{Tolerations: to}
expected = Placement{NodeAffinity: na, Tolerations: to}
merged = original.Merge(with)
assert.Equal(t, expected, merged)
original = Placement{Tolerations: placementTestGetTolerations("bar", "baz")}
with = Placement{NodeAffinity: na, Tolerations: to}
expected = Placement{NodeAffinity: na, Tolerations: to}
merged = original.Merge(with)
assert.Equal(t, expected, merged)
}
func placementTestGetTolerations(key, value string) []v1.Toleration {
var ts int64 = 10
return []v1.Toleration{
{
Key: key,
Operator: v1.TolerationOpExists,
Value: value,
Effect: v1.TaintEffectNoSchedule,
TolerationSeconds: &ts,
},
}
}
func placementTestGetNodeAffinity() *v1.NodeAffinity {
return &v1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
NodeSelectorTerms: []v1.NodeSelectorTerm{
{
MatchExpressions: []v1.NodeSelectorRequirement{
{
Key: "foo",
Operator: v1.NodeSelectorOpExists,
Values: []string{"bar"},
},
},
},
},
},
PreferredDuringSchedulingIgnoredDuringExecution: []v1.PreferredSchedulingTerm{
{
Weight: 10,
Preference: v1.NodeSelectorTerm{
MatchExpressions: []v1.NodeSelectorRequirement{
{
Key: "foo",
Operator: v1.NodeSelectorOpExists,
Values: []string{"bar"},
},
},
},
},
},
}
}
-50
View File
@@ -1,50 +0,0 @@
/*
Copyright 2017 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 v1alpha1
import "github.com/rook/rook/pkg/daemon/ceph/model"
func (p *PoolSpec) ToModel(name string) *model.Pool {
pool := &model.Pool{Name: name, FailureDomain: p.FailureDomain, CrushRoot: p.CrushRoot}
r := p.Replication()
if r != nil {
pool.ReplicatedConfig.Size = r.Size
pool.Type = model.Replicated
} else {
ec := p.ErasureCode()
if ec != nil {
pool.ErasureCodedConfig.CodingChunkCount = ec.CodingChunks
pool.ErasureCodedConfig.DataChunkCount = ec.DataChunks
pool.Type = model.ErasureCoded
}
}
return pool
}
func (p *PoolSpec) Replication() *ReplicatedSpec {
if p.Replicated.Size > 0 {
return &p.Replicated
}
return nil
}
func (p *PoolSpec) ErasureCode() *ErasureCodedSpec {
ec := &p.ErasureCoded
if ec.CodingChunks > 0 || ec.DataChunks > 0 {
return ec
}
return nil
}
-69
View File
@@ -1,69 +0,0 @@
/*
Copyright 2017 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 v1alpha1
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 (
CustomResourceGroup = "rook.io"
Version = "v1alpha1"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.GroupName, 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,
&Cluster{},
&ClusterList{},
&Pool{},
&PoolList{},
&Filesystem{},
&FilesystemList{},
&ObjectStore{},
&ObjectStoreList{},
&VolumeAttachment{},
&VolumeAttachmentList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
-141
View File
@@ -1,141 +0,0 @@
/*
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 osd for the Ceph OSDs.
package v1alpha1
const bluestore = "bluestore"
// AnyUseAllDevices gets whether to use all devices
func (s *StorageSpec) AnyUseAllDevices() bool {
if s.Selection.GetUseAllDevices() {
return true
}
for _, n := range s.Nodes {
if n.Selection.GetUseAllDevices() {
return true
}
}
return false
}
// ClearUseAllDevices clears all devices
func (s *StorageSpec) ClearUseAllDevices() {
clear := false
s.Selection.UseAllDevices = &clear
for i := range s.Nodes {
s.Nodes[i].Selection.UseAllDevices = &clear
}
}
// Fully resolves the config of the given node name, taking into account cluster level and node level specified config.
// In general, the more fine grained the configuration is specified, the more precedence it takes. Fully resolved
// configuration for the node has the following order of precedence.
// 1) Node (config defined on the node itself)
// 2) Cluster (config defined on the cluster)
// 3) Default values (if no config exists for the node or cluster)
func (s *StorageSpec) ResolveNode(nodeName string) *Node {
// find the requested storage node first, if it exists
var node *Node
for i := range s.Nodes {
if s.Nodes[i].Name == nodeName {
node = &(s.Nodes[i])
break
}
}
if node == nil {
// a node with the given name was not found
return nil
}
// now resolve all properties that haven't already been set on the node
s.resolveNodeSelection(node)
s.resolveNodeConfig(node)
return node
}
func (s *StorageSpec) resolveNodeSelection(node *Node) {
resolveString(&(node.Selection.DeviceFilter), s.Selection.DeviceFilter, "")
resolveString(&(node.Selection.MetadataDevice), s.Selection.MetadataDevice, "")
if node.Selection.UseAllDevices == nil {
if s.Selection.UseAllDevices != nil {
// the node does not have a value specified for use all devices, but the cluster does. Use the cluster's.
node.Selection.UseAllDevices = s.Selection.UseAllDevices
} else {
// neither node nor cluster have a value set for use all devices, use the default value.
node.Selection.UseAllDevices = newBool(false)
}
}
if len(node.Selection.Directories) == 0 {
node.Selection.Directories = s.Directories
}
}
func (s *StorageSpec) resolveNodeConfig(node *Node) {
resolveString(&(node.Config.StoreConfig.StoreType), s.Config.StoreConfig.StoreType, bluestore)
resolveInt(&(node.Config.StoreConfig.DatabaseSizeMB), s.Config.StoreConfig.DatabaseSizeMB, 0)
resolveInt(&(node.Config.StoreConfig.WalSizeMB), s.Config.StoreConfig.WalSizeMB, 0)
resolveInt(&(node.Config.StoreConfig.JournalSizeMB), s.Config.StoreConfig.JournalSizeMB, 0)
resolveString(&(node.Config.Location), s.Config.Location, "")
}
func (s *Selection) GetUseAllDevices() bool {
return s.UseAllDevices != nil && *(s.UseAllDevices)
}
func resolveString(setting *string, parent, defaultVal string) {
if *setting == "" {
if parent != "" {
*setting = parent
} else {
*setting = defaultVal
}
}
}
func resolveInt(setting *int, parent, defaultVal int) {
if *setting == 0 {
if parent != 0 {
*setting = parent
} else {
*setting = defaultVal
}
}
}
func newBool(val bool) *bool {
return &val
}
// NodesByName implements an interface to sort nodes by name
type NodesByName []Node
func (s NodesByName) Len() int {
return len(s)
}
func (s NodesByName) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}
func (s NodesByName) Less(i, j int) bool {
return s[i].Name < s[j].Name
}
-241
View File
@@ -1,241 +0,0 @@
/*
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 v1alpha1
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestResolveNodeNotExist(t *testing.T) {
// a non existing node should return nil
storageSpec := StorageSpec{}
node := storageSpec.ResolveNode("fake node")
assert.Nil(t, node)
// a node with no properties defined should inherit them from the cluster storage spec
storageSpec = StorageSpec{
Selection: Selection{
DeviceFilter: "^sd.",
MetadataDevice: "nvme01",
},
Config: Config{
Location: "root=default,row=a,rack=a2,chassis=a2a,host=a2a1",
StoreConfig: StoreConfig{
StoreType: bluestore,
DatabaseSizeMB: 1024,
WalSizeMB: 128,
JournalSizeMB: 2048,
},
},
Nodes: []Node{
{Name: "node1"}, // node gets nothing but its name set
},
}
node = storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, "^sd.", node.Selection.DeviceFilter)
assert.Equal(t, "nvme01", node.Selection.MetadataDevice)
assert.False(t, node.Selection.GetUseAllDevices())
assert.Equal(t, "root=default,row=a,rack=a2,chassis=a2a,host=a2a1", node.Config.Location)
assert.Equal(t, bluestore, node.Config.StoreConfig.StoreType)
assert.Equal(t, 1024, node.Config.StoreConfig.DatabaseSizeMB)
assert.Equal(t, 128, node.Config.StoreConfig.WalSizeMB)
assert.Equal(t, 2048, node.Config.StoreConfig.JournalSizeMB)
assert.Equal(t, storageSpec.Directories, node.Directories)
}
func TestResolveNodeInherentFromCluster(t *testing.T) {
// a node with no properties defined should inherit them from the cluster storage spec
storageSpec := StorageSpec{
Selection: Selection{
DeviceFilter: "^sd.",
MetadataDevice: "nvme01",
Directories: []Directory{{Path: "/rook/datadir1"}},
},
Config: Config{
Location: "root=default,row=a,rack=a2,chassis=a2a,host=a2a1",
StoreConfig: StoreConfig{
StoreType: bluestore,
DatabaseSizeMB: 1024,
WalSizeMB: 128,
JournalSizeMB: 2048,
},
},
Nodes: []Node{
{Name: "node1"}, // node gets nothing but its name set
},
}
node := storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, "^sd.", node.Selection.DeviceFilter)
assert.Equal(t, "nvme01", node.Selection.MetadataDevice)
assert.False(t, node.Selection.GetUseAllDevices())
assert.Equal(t, "root=default,row=a,rack=a2,chassis=a2a,host=a2a1", node.Config.Location)
assert.Equal(t, bluestore, node.Config.StoreConfig.StoreType)
assert.Equal(t, 1024, node.Config.StoreConfig.DatabaseSizeMB)
assert.Equal(t, 128, node.Config.StoreConfig.WalSizeMB)
assert.Equal(t, 2048, node.Config.StoreConfig.JournalSizeMB)
assert.Equal(t, []Directory{{Path: "/rook/datadir1"}}, node.Directories)
}
func TestResolveNodeDefaultValues(t *testing.T) {
// a node with no properties and none defined in the cluster storage spec should get the default values
storageSpec := StorageSpec{
Nodes: []Node{
{Name: "node1"}, // node gets nothing but its name set
},
}
node := storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, "", node.Selection.DeviceFilter)
assert.Equal(t, "", node.Selection.MetadataDevice)
assert.False(t, node.Selection.GetUseAllDevices())
assert.Equal(t, "", node.Config.Location)
assert.Equal(t, bluestore, node.Config.StoreConfig.StoreType)
assert.Equal(t, 0, node.Config.StoreConfig.DatabaseSizeMB)
assert.Equal(t, 0, node.Config.StoreConfig.WalSizeMB)
assert.Equal(t, 0, node.Config.StoreConfig.JournalSizeMB)
assert.Equal(t, storageSpec.Directories, node.Directories)
}
func TestResolveNodeUseAllDevices(t *testing.T) {
storageSpec := StorageSpec{
Selection: Selection{UseAllDevices: newBool(true)}, // UseAllDevices is set to true on the storage spec
Nodes: []Node{
{Name: "node1"}, // node gets nothing but its name set
},
}
node := storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.True(t, node.Selection.GetUseAllDevices())
}
func TestUseAllDevices(t *testing.T) {
storageSpec := StorageSpec{}
assert.False(t, storageSpec.AnyUseAllDevices())
storageSpec = StorageSpec{
Selection: Selection{
UseAllDevices: newBool(true)}, // UseAllDevices is set to true on the storage spec
}
assert.True(t, storageSpec.AnyUseAllDevices())
storageSpec = StorageSpec{
Selection: Selection{UseAllDevices: newBool(false)},
Nodes: []Node{
{
Name: "node1",
Selection: Selection{UseAllDevices: newBool(true)},
},
},
}
assert.True(t, storageSpec.AnyUseAllDevices())
}
func TestClearUseAllDevices(t *testing.T) {
// create a storage spec with use all devices set to true for the cluster and for all nodes
storageSpec := StorageSpec{
Selection: Selection{UseAllDevices: newBool(true)},
Nodes: []Node{
{
Name: "node1",
Selection: Selection{UseAllDevices: newBool(true)},
},
},
}
assert.True(t, storageSpec.AnyUseAllDevices())
// now clear the use all devices field, it should be cleared from the entire cluster and its nodes
storageSpec.ClearUseAllDevices()
assert.False(t, storageSpec.AnyUseAllDevices())
}
func TestClusterDirectoriesInherit(t *testing.T) {
// test for no directories given
storageSpec := StorageSpec{
Nodes: []Node{
{
Name: "node1",
},
},
}
node := storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
// compare both `StorageSpec` and `Node` `Directories` because both are empty (`omitempty`)
//empty `Directories` is "interpreted" as `[]osd.Directory(nil)` and not `[]osd.Directory{}`
//by `assert.Equal`
assert.Equal(t, storageSpec.Directories, node.Directories)
// test if cluster wide directories is inherited to no-directories node
storageSpec = StorageSpec{
Selection: Selection{
Directories: []Directory{{Path: "/rook/datadir1"}},
},
Nodes: []Node{
{
Name: "node1",
},
},
}
node = storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, []Directory{{Path: "/rook/datadir1"}}, node.Directories)
// test if node directories is used
storageSpec = StorageSpec{
Nodes: []Node{
{
Name: "node1",
Selection: Selection{
Directories: []Directory{{Path: "/rook/datadir2"}},
},
},
},
}
node = storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, []Directory{{Path: "/rook/datadir2"}}, node.Directories)
// test if cluster wide directories is and isn't inherited to nodes with and without directories
storageSpec = StorageSpec{
Selection: Selection{
Directories: []Directory{{Path: "/rook/datadir4"}},
},
Nodes: []Node{
{
Name: "node1",
Selection: Selection{
Directories: []Directory{{Path: "/rook/datadir3"}},
},
},
{
Name: "node2",
},
},
}
node = storageSpec.ResolveNode("node1")
assert.NotNil(t, node)
assert.Equal(t, []Directory{{Path: "/rook/datadir3"}}, node.Directories)
node = storageSpec.ResolveNode("node2")
assert.NotNil(t, node)
assert.Equal(t, []Directory{{Path: "/rook/datadir4"}}, node.Directories)
}
-336
View File
@@ -1,336 +0,0 @@
/*
Copyright 2017 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 v1alpha1
import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ***************************************************************************
// IMPORTANT FOR CODE GENERATION
// If the types in this file are updated, you will need to run
// `make codegen` to generate the new types under the client/clientset folder.
// ***************************************************************************
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ClusterSpec `json:"spec"`
Status ClusterStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Cluster `json:"items"`
}
type ClusterSpec struct {
// The type of backend for the cluster (only "ceph" is implemented)
Backend string `json:"backend"`
// The path on the host where config and data can be persisted.
DataDirHostPath string `json:"dataDirHostPath"`
// The placement-related configuration to pass to kubernetes (affinity, node selector, tolerations).
Placement PlacementSpec `json:"placement,omitempty"`
// A spec for available storage in the cluster and how it should be used
Storage StorageSpec `json:"storage"`
// HostNetwork to enable host network
HostNetwork bool `json:"hostNetwork"`
// MonCount sets the mon size
MonCount int `json:"monCount"`
// Resources set resource requests and limits
Resources ResourceSpec `json:"resources,omitempty"`
}
type ClusterStatus struct {
State ClusterState `json:"state,omitempty"`
Message string `json:"message,omitempty"`
}
type ClusterState string
const (
ClusterStateCreating ClusterState = "Creating"
ClusterStateCreated ClusterState = "Created"
ClusterStateUpdating ClusterState = "Updating"
ClusterStateError ClusterState = "Error"
)
type ResourceSpec struct {
API v1.ResourceRequirements `json:"api,omitempty"`
Mgr v1.ResourceRequirements `json:"mgr,omitempty"`
Mon v1.ResourceRequirements `json:"mon,omitempty"`
OSD v1.ResourceRequirements `json:"osd,omitempty"`
}
type StorageSpec struct {
Nodes []Node `json:"nodes,omitempty"`
UseAllNodes bool `json:"useAllNodes,omitempty"`
Selection
Config
}
type Node struct {
Name string `json:"name,omitempty"`
Devices []Device `json:"devices,omitempty"`
Resources v1.ResourceRequirements `json:"resources,omitempty"`
Selection
Config
}
type Device struct {
Name string `json:"name,omitempty"`
}
type Directory struct {
Path string `json:"path,omitempty"`
}
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"`
MetadataDevice string `json:"metadataDevice,omitempty"`
Directories []Directory `json:"directories,omitempty"`
}
type Config struct {
StoreConfig StoreConfig `json:"storeConfig,omitempty"`
Location string `json:"location,omitempty"`
}
type StoreConfig struct {
StoreType string `json:"storeType,omitempty"`
WalSizeMB int `json:"walSizeMB,omitempty"`
DatabaseSizeMB int `json:"databaseSizeMB,omitempty"`
JournalSizeMB int `json:"journalSizeMB,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PlacementSpec struct {
metav1.TypeMeta `json:",inline"`
All Placement `json:"all,omitempty"`
API Placement `json:"api,omitempty"`
Mgr Placement `json:"mgr,omitempty"`
Mon Placement `json:"mon,omitempty"`
OSD Placement `json:"osd,omitempty"`
}
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Pool struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec PoolSpec `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PoolList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Pool `json:"items"`
}
// PoolSpec represent the spec of a pool
type PoolSpec struct {
// The failure domain: osd or host (technically also any type in the crush map)
FailureDomain string `json:"failureDomain"`
// The root of the crush hierarchy utilized by the pool
CrushRoot string `json:"crushRoot"`
// The replication settings
Replicated ReplicatedSpec `json:"replicated"`
// The erasure code settings
ErasureCoded ErasureCodedSpec `json:"erasureCoded"`
}
// ReplicationSpec represents the spec for replication in a pool
type ReplicatedSpec struct {
// Number of copies per object in a replicated storage pool, including the object itself (required for replicated pool type)
Size uint `json:"size"`
}
// ErasureCodeSpec represents the spec for erasure code in a pool
type ErasureCodedSpec struct {
// Number of coding chunks per object in an erasure coded storage pool (required for erasure-coded pool type)
CodingChunks uint `json:"codingChunks"`
// Number of data chunks per object in an erasure coded storage pool (required for erasure-coded pool type)
DataChunks uint `json:"dataChunks"`
// The algorithm for erasure coding
Algorithm string `json:"algorithm"`
}
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VolumeAttachment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Attachments []Attachment `json:"attachments"`
}
type Attachment struct {
Node string `json:"node"`
PodNamespace string `json:"podNamespace"`
PodName string `json:"podName"`
ClusterName string `json:"clusterName"`
MountDir string `json:"mountDir"`
ReadOnly bool `json:"readOnly"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VolumeAttachmentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VolumeAttachment `json:"items"`
}
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Filesystem struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec FilesystemSpec `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type FilesystemList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Filesystem `json:"items"`
}
// FilesystemSpec represents the spec of a file system
type FilesystemSpec struct {
// The metadata pool settings
MetadataPool PoolSpec `json:"metadataPool"`
// The data pool settings
DataPools []PoolSpec `json:"dataPools"`
// The mds pod info
MetadataServer MetadataServerSpec `json:"metadataServer"`
}
type MetadataServerSpec struct {
// The number of metadata servers that are active. The remaining servers in the cluster will be in standby mode.
ActiveCount int32 `json:"activeCount"`
// Whether each active MDS instance will have an active standby with a warm metadata cache for faster failover.
// If false, standbys will still be available, but will not have a warm metadata cache.
ActiveStandby bool `json:"activeStandby"`
// The affinity to place the mds pods (default is to place on all available node) with a daemonset
Placement Placement `json:"placement"`
// The resource requirements for the rgw pods
Resources v1.ResourceRequirements `json:"resources"`
}
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ObjectStore struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ObjectStoreSpec `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ObjectStoreList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ObjectStore `json:"items"`
}
// ObjectStoreSpec represent the spec of a pool
type ObjectStoreSpec struct {
// The metadata pool settings
MetadataPool PoolSpec `json:"metadataPool"`
// The data pool settings
DataPool PoolSpec `json:"dataPool"`
// The rgw pod info
Gateway GatewaySpec `json:"gateway"`
}
type GatewaySpec struct {
// The port the rgw service will be listening on (http)
Port int32 `json:"port"`
// The port the rgw service will be listening on (https)
SecurePort int32 `json:"securePort"`
// The number of pods in the rgw replicaset. If "allNodes" is specified, a daemonset is created.
Instances int32 `json:"instances"`
// Whether the rgw pods should be started as a daemonset on all nodes
AllNodes bool `json:"allNodes"`
// The name of the secret that stores the ssl certificate for secure rgw connections
SSLCertificateRef string `json:"sslCertificateRef"`
// The affinity to place the rgw pods (default is to place on any available node)
Placement Placement `json:"placement"`
// The resource requirements for the rgw pods
Resources v1.ResourceRequirements `json:"resources"`
}
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Placement encapsulates the various kubernetes options that control where pods are scheduled and executed.
type Placement struct {
metav1.TypeMeta `json:",inline"`
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
PodAffinity *v1.PodAffinity `json:"podAffinity,omitempty"`
PodAntiAffinity *v1.PodAntiAffinity `json:"podAntiAffinity,omitempty"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
}
@@ -1,40 +0,0 @@
/*
Copyright 2017 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 v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// NewVolumeAttachment creates a reference of a Volumeattach CRD object
func NewVolumeAttachment(name, namespace, node, podNamespace, podName, clusterName, mountDir string, readOnly bool) *VolumeAttachment {
volumeAttachmentObj := &VolumeAttachment{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Attachments: []Attachment{
{
Node: node,
PodNamespace: podNamespace,
PodName: podName,
ClusterName: clusterName,
MountDir: mountDir,
ReadOnly: readOnly,
},
},
}
return volumeAttachmentObj
}
@@ -1,769 +0,0 @@
// +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 v1alpha1
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 *Attachment) DeepCopyInto(out *Attachment) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Attachment.
func (in *Attachment) DeepCopy() *Attachment {
if in == nil {
return nil
}
out := new(Attachment)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Cluster) DeepCopyInto(out *Cluster) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster.
func (in *Cluster) DeepCopy() *Cluster {
if in == nil {
return nil
}
out := new(Cluster)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Cluster) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterList) DeepCopyInto(out *ClusterList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Cluster, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList.
func (in *ClusterList) DeepCopy() *ClusterList {
if in == nil {
return nil
}
out := new(ClusterList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in
in.Placement.DeepCopyInto(&out.Placement)
in.Storage.DeepCopyInto(&out.Storage)
in.Resources.DeepCopyInto(&out.Resources)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec.
func (in *ClusterSpec) DeepCopy() *ClusterSpec {
if in == nil {
return nil
}
out := new(ClusterSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus.
func (in *ClusterStatus) DeepCopy() *ClusterStatus {
if in == nil {
return nil
}
out := new(ClusterStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Config) DeepCopyInto(out *Config) {
*out = *in
out.StoreConfig = in.StoreConfig
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.
func (in *Config) DeepCopy() *Config {
if in == nil {
return nil
}
out := new(Config)
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
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
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 *ErasureCodedSpec) DeepCopyInto(out *ErasureCodedSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErasureCodedSpec.
func (in *ErasureCodedSpec) DeepCopy() *ErasureCodedSpec {
if in == nil {
return nil
}
out := new(ErasureCodedSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Filesystem) DeepCopyInto(out *Filesystem) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filesystem.
func (in *Filesystem) DeepCopy() *Filesystem {
if in == nil {
return nil
}
out := new(Filesystem)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Filesystem) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FilesystemList) DeepCopyInto(out *FilesystemList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Filesystem, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilesystemList.
func (in *FilesystemList) DeepCopy() *FilesystemList {
if in == nil {
return nil
}
out := new(FilesystemList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FilesystemList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FilesystemSpec) DeepCopyInto(out *FilesystemSpec) {
*out = *in
out.MetadataPool = in.MetadataPool
if in.DataPools != nil {
in, out := &in.DataPools, &out.DataPools
*out = make([]PoolSpec, len(*in))
copy(*out, *in)
}
in.MetadataServer.DeepCopyInto(&out.MetadataServer)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilesystemSpec.
func (in *FilesystemSpec) DeepCopy() *FilesystemSpec {
if in == nil {
return nil
}
out := new(FilesystemSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) {
*out = *in
in.Placement.DeepCopyInto(&out.Placement)
in.Resources.DeepCopyInto(&out.Resources)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec.
func (in *GatewaySpec) DeepCopy() *GatewaySpec {
if in == nil {
return nil
}
out := new(GatewaySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetadataServerSpec) DeepCopyInto(out *MetadataServerSpec) {
*out = *in
in.Placement.DeepCopyInto(&out.Placement)
in.Resources.DeepCopyInto(&out.Resources)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataServerSpec.
func (in *MetadataServerSpec) DeepCopy() *MetadataServerSpec {
if in == nil {
return nil
}
out := new(MetadataServerSpec)
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
if in.Devices != nil {
in, out := &in.Devices, &out.Devices
*out = make([]Device, len(*in))
copy(*out, *in)
}
in.Resources.DeepCopyInto(&out.Resources)
in.Selection.DeepCopyInto(&out.Selection)
out.Config = in.Config
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 *ObjectStore) DeepCopyInto(out *ObjectStore) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStore.
func (in *ObjectStore) DeepCopy() *ObjectStore {
if in == nil {
return nil
}
out := new(ObjectStore)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ObjectStore) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectStoreList) DeepCopyInto(out *ObjectStoreList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ObjectStore, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStoreList.
func (in *ObjectStoreList) DeepCopy() *ObjectStoreList {
if in == nil {
return nil
}
out := new(ObjectStoreList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ObjectStoreList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectStoreSpec) DeepCopyInto(out *ObjectStoreSpec) {
*out = *in
out.MetadataPool = in.MetadataPool
out.DataPool = in.DataPool
in.Gateway.DeepCopyInto(&out.Gateway)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStoreSpec.
func (in *ObjectStoreSpec) DeepCopy() *ObjectStoreSpec {
if in == nil {
return nil
}
out := new(ObjectStoreSpec)
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
out.TypeMeta = in.TypeMeta
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
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Placement) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec) {
*out = *in
out.TypeMeta = in.TypeMeta
in.All.DeepCopyInto(&out.All)
in.API.DeepCopyInto(&out.API)
in.Mgr.DeepCopyInto(&out.Mgr)
in.Mon.DeepCopyInto(&out.Mon)
in.OSD.DeepCopyInto(&out.OSD)
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
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PlacementSpec) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Pool) DeepCopyInto(out *Pool) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pool.
func (in *Pool) DeepCopy() *Pool {
if in == nil {
return nil
}
out := new(Pool)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Pool) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PoolList) DeepCopyInto(out *PoolList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Pool, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolList.
func (in *PoolList) DeepCopy() *PoolList {
if in == nil {
return nil
}
out := new(PoolList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PoolList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PoolSpec) DeepCopyInto(out *PoolSpec) {
*out = *in
out.Replicated = in.Replicated
out.ErasureCoded = in.ErasureCoded
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolSpec.
func (in *PoolSpec) DeepCopy() *PoolSpec {
if in == nil {
return nil
}
out := new(PoolSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ReplicatedSpec) DeepCopyInto(out *ReplicatedSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedSpec.
func (in *ReplicatedSpec) DeepCopy() *ReplicatedSpec {
if in == nil {
return nil
}
out := new(ReplicatedSpec)
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) {
*out = *in
in.API.DeepCopyInto(&out.API)
in.Mgr.DeepCopyInto(&out.Mgr)
in.Mon.DeepCopyInto(&out.Mon)
in.OSD.DeepCopyInto(&out.OSD)
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.Directories != nil {
in, out := &in.Directories, &out.Directories
*out = make([]Directory, len(*in))
copy(*out, *in)
}
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 *StorageSpec) DeepCopyInto(out *StorageSpec) {
*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])
}
}
in.Selection.DeepCopyInto(&out.Selection)
out.Config = in.Config
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.
func (in *StorageSpec) DeepCopy() *StorageSpec {
if in == nil {
return nil
}
out := new(StorageSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StoreConfig) DeepCopyInto(out *StoreConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreConfig.
func (in *StoreConfig) DeepCopy() *StoreConfig {
if in == nil {
return nil
}
out := new(StoreConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeAttachment) DeepCopyInto(out *VolumeAttachment) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Attachments != nil {
in, out := &in.Attachments, &out.Attachments
*out = make([]Attachment, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachment.
func (in *VolumeAttachment) DeepCopy() *VolumeAttachment {
if in == nil {
return nil
}
out := new(VolumeAttachment)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *VolumeAttachment) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeAttachmentList) DeepCopyInto(out *VolumeAttachmentList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]VolumeAttachment, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentList.
func (in *VolumeAttachmentList) DeepCopy() *VolumeAttachmentList {
if in == nil {
return nil
}
out := new(VolumeAttachmentList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *VolumeAttachmentList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
+6 -20
View File
@@ -25,7 +25,6 @@ import (
cockroachdbv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/cockroachdb.rook.io/v1alpha1"
miniov1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/minio.rook.io/v1alpha1"
nfsv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/nfs.rook.io/v1alpha1"
rookv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha1"
rookv1alpha2 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha2"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
@@ -50,10 +49,9 @@ type Interface interface {
NfsV1alpha1() nfsv1alpha1.NfsV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Nfs() nfsv1alpha1.NfsV1alpha1Interface
RookV1alpha1() rookv1alpha1.RookV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Rook() rookv1alpha1.RookV1alpha1Interface
RookV1alpha2() rookv1alpha2.RookV1alpha2Interface
// Deprecated: please explicitly pick a version if possible.
Rook() rookv1alpha2.RookV1alpha2Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@@ -66,7 +64,6 @@ type Clientset struct {
cockroachdbV1alpha1 *cockroachdbv1alpha1.CockroachdbV1alpha1Client
minioV1alpha1 *miniov1alpha1.MinioV1alpha1Client
nfsV1alpha1 *nfsv1alpha1.NfsV1alpha1Client
rookV1alpha1 *rookv1alpha1.RookV1alpha1Client
rookV1alpha2 *rookv1alpha2.RookV1alpha2Client
}
@@ -130,19 +127,14 @@ func (c *Clientset) Nfs() nfsv1alpha1.NfsV1alpha1Interface {
return c.nfsV1alpha1
}
// RookV1alpha1 retrieves the RookV1alpha1Client
func (c *Clientset) RookV1alpha1() rookv1alpha1.RookV1alpha1Interface {
return c.rookV1alpha1
// RookV1alpha2 retrieves the RookV1alpha2Client
func (c *Clientset) RookV1alpha2() rookv1alpha2.RookV1alpha2Interface {
return c.rookV1alpha2
}
// Deprecated: Rook retrieves the default version of RookClient.
// Please explicitly pick a version.
func (c *Clientset) Rook() rookv1alpha1.RookV1alpha1Interface {
return c.rookV1alpha1
}
// RookV1alpha2 retrieves the RookV1alpha2Client
func (c *Clientset) RookV1alpha2() rookv1alpha2.RookV1alpha2Interface {
func (c *Clientset) Rook() rookv1alpha2.RookV1alpha2Interface {
return c.rookV1alpha2
}
@@ -186,10 +178,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.rookV1alpha1, err = rookv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.rookV1alpha2, err = rookv1alpha2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@@ -212,7 +200,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.cockroachdbV1alpha1 = cockroachdbv1alpha1.NewForConfigOrDie(c)
cs.minioV1alpha1 = miniov1alpha1.NewForConfigOrDie(c)
cs.nfsV1alpha1 = nfsv1alpha1.NewForConfigOrDie(c)
cs.rookV1alpha1 = rookv1alpha1.NewForConfigOrDie(c)
cs.rookV1alpha2 = rookv1alpha2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
@@ -228,7 +215,6 @@ func New(c rest.Interface) *Clientset {
cs.cockroachdbV1alpha1 = cockroachdbv1alpha1.New(c)
cs.minioV1alpha1 = miniov1alpha1.New(c)
cs.nfsV1alpha1 = nfsv1alpha1.New(c)
cs.rookV1alpha1 = rookv1alpha1.New(c)
cs.rookV1alpha2 = rookv1alpha2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
@@ -32,8 +32,6 @@ import (
fakeminiov1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/minio.rook.io/v1alpha1/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"
rookv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha1"
fakerookv1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha1/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"
"k8s.io/apimachinery/pkg/runtime"
@@ -140,17 +138,12 @@ func (c *Clientset) Nfs() nfsv1alpha1.NfsV1alpha1Interface {
return &fakenfsv1alpha1.FakeNfsV1alpha1{Fake: &c.Fake}
}
// RookV1alpha1 retrieves the RookV1alpha1Client
func (c *Clientset) RookV1alpha1() rookv1alpha1.RookV1alpha1Interface {
return &fakerookv1alpha1.FakeRookV1alpha1{Fake: &c.Fake}
}
// Rook retrieves the RookV1alpha1Client
func (c *Clientset) Rook() rookv1alpha1.RookV1alpha1Interface {
return &fakerookv1alpha1.FakeRookV1alpha1{Fake: &c.Fake}
}
// RookV1alpha2 retrieves the RookV1alpha2Client
func (c *Clientset) RookV1alpha2() rookv1alpha2.RookV1alpha2Interface {
return &fakerookv1alpha2.FakeRookV1alpha2{Fake: &c.Fake}
}
// Rook retrieves the RookV1alpha2Client
func (c *Clientset) Rook() rookv1alpha2.RookV1alpha2Interface {
return &fakerookv1alpha2.FakeRookV1alpha2{Fake: &c.Fake}
}
@@ -25,7 +25,6 @@ import (
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
miniov1alpha1 "github.com/rook/rook/pkg/apis/minio.rook.io/v1alpha1"
nfsv1alpha1 "github.com/rook/rook/pkg/apis/nfs.rook.io/v1alpha1"
rookv1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
@@ -63,6 +62,5 @@ func AddToScheme(scheme *runtime.Scheme) {
cockroachdbv1alpha1.AddToScheme(scheme)
miniov1alpha1.AddToScheme(scheme)
nfsv1alpha1.AddToScheme(scheme)
rookv1alpha1.AddToScheme(scheme)
rookv1alpha2.AddToScheme(scheme)
}
@@ -25,7 +25,6 @@ import (
cockroachdbv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
miniov1alpha1 "github.com/rook/rook/pkg/apis/minio.rook.io/v1alpha1"
nfsv1alpha1 "github.com/rook/rook/pkg/apis/nfs.rook.io/v1alpha1"
rookv1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
rookv1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
@@ -63,6 +62,5 @@ func AddToScheme(scheme *runtime.Scheme) {
cockroachdbv1alpha1.AddToScheme(scheme)
miniov1alpha1.AddToScheme(scheme)
nfsv1alpha1.AddToScheme(scheme)
rookv1alpha1.AddToScheme(scheme)
rookv1alpha2.AddToScheme(scheme)
}
@@ -1,157 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ClustersGetter has a method to return a ClusterInterface.
// A group's client should implement this interface.
type ClustersGetter interface {
Clusters(namespace string) ClusterInterface
}
// ClusterInterface has methods to work with Cluster resources.
type ClusterInterface interface {
Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error)
List(opts v1.ListOptions) (*v1alpha1.ClusterList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error)
ClusterExpansion
}
// clusters implements ClusterInterface
type clusters struct {
client rest.Interface
ns string
}
// newClusters returns a Clusters
func newClusters(c *RookV1alpha1Client, namespace string) *clusters {
return &clusters{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
result = &v1alpha1.ClusterList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusters").
Body(cluster).
Do().
Into(result)
return
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusters").
Name(cluster.Name).
Body(cluster).
Do().
Into(result)
return
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *clusters) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched cluster.
func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusters").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -1,20 +0,0 @@
/*
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 v1alpha1
@@ -1,20 +0,0 @@
/*
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
@@ -1,128 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeClusters implements ClusterInterface
type FakeClusters struct {
Fake *FakeRookV1alpha1
ns string
}
var clustersResource = schema.GroupVersionResource{Group: "rook.io", Version: "v1alpha1", Resource: "clusters"}
var clustersKind = schema.GroupVersionKind{Group: "rook.io", Version: "v1alpha1", Kind: "Cluster"}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts))
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
return err
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, data, subresources...), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
@@ -1,128 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeFilesystems implements FilesystemInterface
type FakeFilesystems struct {
Fake *FakeRookV1alpha1
ns string
}
var filesystemsResource = schema.GroupVersionResource{Group: "rook.io", Version: "v1alpha1", Resource: "filesystems"}
var filesystemsKind = schema.GroupVersionKind{Group: "rook.io", Version: "v1alpha1", Kind: "Filesystem"}
// Get takes name of the filesystem, and returns the corresponding filesystem object, and an error if there is any.
func (c *FakeFilesystems) Get(name string, options v1.GetOptions) (result *v1alpha1.Filesystem, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(filesystemsResource, c.ns, name), &v1alpha1.Filesystem{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Filesystem), err
}
// List takes label and field selectors, and returns the list of Filesystems that match those selectors.
func (c *FakeFilesystems) List(opts v1.ListOptions) (result *v1alpha1.FilesystemList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(filesystemsResource, filesystemsKind, c.ns, opts), &v1alpha1.FilesystemList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.FilesystemList{ListMeta: obj.(*v1alpha1.FilesystemList).ListMeta}
for _, item := range obj.(*v1alpha1.FilesystemList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested filesystems.
func (c *FakeFilesystems) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(filesystemsResource, c.ns, opts))
}
// Create takes the representation of a filesystem and creates it. Returns the server's representation of the filesystem, and an error, if there is any.
func (c *FakeFilesystems) Create(filesystem *v1alpha1.Filesystem) (result *v1alpha1.Filesystem, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(filesystemsResource, c.ns, filesystem), &v1alpha1.Filesystem{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Filesystem), err
}
// Update takes the representation of a filesystem and updates it. Returns the server's representation of the filesystem, and an error, if there is any.
func (c *FakeFilesystems) Update(filesystem *v1alpha1.Filesystem) (result *v1alpha1.Filesystem, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(filesystemsResource, c.ns, filesystem), &v1alpha1.Filesystem{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Filesystem), err
}
// Delete takes name of the filesystem and deletes it. Returns an error if one occurs.
func (c *FakeFilesystems) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(filesystemsResource, c.ns, name), &v1alpha1.Filesystem{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeFilesystems) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(filesystemsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.FilesystemList{})
return err
}
// Patch applies the patch and returns the patched filesystem.
func (c *FakeFilesystems) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Filesystem, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(filesystemsResource, c.ns, name, data, subresources...), &v1alpha1.Filesystem{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Filesystem), err
}
@@ -1,128 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeObjectStores implements ObjectStoreInterface
type FakeObjectStores struct {
Fake *FakeRookV1alpha1
ns string
}
var objectstoresResource = schema.GroupVersionResource{Group: "rook.io", Version: "v1alpha1", Resource: "objectstores"}
var objectstoresKind = schema.GroupVersionKind{Group: "rook.io", Version: "v1alpha1", Kind: "ObjectStore"}
// Get takes name of the objectStore, and returns the corresponding objectStore object, and an error if there is any.
func (c *FakeObjectStores) Get(name string, options v1.GetOptions) (result *v1alpha1.ObjectStore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(objectstoresResource, c.ns, name), &v1alpha1.ObjectStore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ObjectStore), err
}
// List takes label and field selectors, and returns the list of ObjectStores that match those selectors.
func (c *FakeObjectStores) List(opts v1.ListOptions) (result *v1alpha1.ObjectStoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(objectstoresResource, objectstoresKind, c.ns, opts), &v1alpha1.ObjectStoreList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ObjectStoreList{ListMeta: obj.(*v1alpha1.ObjectStoreList).ListMeta}
for _, item := range obj.(*v1alpha1.ObjectStoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested objectStores.
func (c *FakeObjectStores) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(objectstoresResource, c.ns, opts))
}
// Create takes the representation of a objectStore and creates it. Returns the server's representation of the objectStore, and an error, if there is any.
func (c *FakeObjectStores) Create(objectStore *v1alpha1.ObjectStore) (result *v1alpha1.ObjectStore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(objectstoresResource, c.ns, objectStore), &v1alpha1.ObjectStore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ObjectStore), err
}
// Update takes the representation of a objectStore and updates it. Returns the server's representation of the objectStore, and an error, if there is any.
func (c *FakeObjectStores) Update(objectStore *v1alpha1.ObjectStore) (result *v1alpha1.ObjectStore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(objectstoresResource, c.ns, objectStore), &v1alpha1.ObjectStore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ObjectStore), err
}
// Delete takes name of the objectStore and deletes it. Returns an error if one occurs.
func (c *FakeObjectStores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(objectstoresResource, c.ns, name), &v1alpha1.ObjectStore{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeObjectStores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(objectstoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ObjectStoreList{})
return err
}
// Patch applies the patch and returns the patched objectStore.
func (c *FakeObjectStores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ObjectStore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(objectstoresResource, c.ns, name, data, subresources...), &v1alpha1.ObjectStore{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ObjectStore), err
}
@@ -1,128 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakePools implements PoolInterface
type FakePools struct {
Fake *FakeRookV1alpha1
ns string
}
var poolsResource = schema.GroupVersionResource{Group: "rook.io", Version: "v1alpha1", Resource: "pools"}
var poolsKind = schema.GroupVersionKind{Group: "rook.io", Version: "v1alpha1", Kind: "Pool"}
// Get takes name of the pool, and returns the corresponding pool object, and an error if there is any.
func (c *FakePools) Get(name string, options v1.GetOptions) (result *v1alpha1.Pool, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(poolsResource, c.ns, name), &v1alpha1.Pool{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Pool), err
}
// List takes label and field selectors, and returns the list of Pools that match those selectors.
func (c *FakePools) List(opts v1.ListOptions) (result *v1alpha1.PoolList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(poolsResource, poolsKind, c.ns, opts), &v1alpha1.PoolList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.PoolList{ListMeta: obj.(*v1alpha1.PoolList).ListMeta}
for _, item := range obj.(*v1alpha1.PoolList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested pools.
func (c *FakePools) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(poolsResource, c.ns, opts))
}
// Create takes the representation of a pool and creates it. Returns the server's representation of the pool, and an error, if there is any.
func (c *FakePools) Create(pool *v1alpha1.Pool) (result *v1alpha1.Pool, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(poolsResource, c.ns, pool), &v1alpha1.Pool{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Pool), err
}
// Update takes the representation of a pool and updates it. Returns the server's representation of the pool, and an error, if there is any.
func (c *FakePools) Update(pool *v1alpha1.Pool) (result *v1alpha1.Pool, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(poolsResource, c.ns, pool), &v1alpha1.Pool{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Pool), err
}
// Delete takes name of the pool and deletes it. Returns an error if one occurs.
func (c *FakePools) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(poolsResource, c.ns, name), &v1alpha1.Pool{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePools) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(poolsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.PoolList{})
return err
}
// Patch applies the patch and returns the patched pool.
func (c *FakePools) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pool, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(poolsResource, c.ns, name, data, subresources...), &v1alpha1.Pool{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Pool), err
}
@@ -1,56 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/client/clientset/versioned/typed/rook.io/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeRookV1alpha1 struct {
*testing.Fake
}
func (c *FakeRookV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface {
return &FakeClusters{c, namespace}
}
func (c *FakeRookV1alpha1) Filesystems(namespace string) v1alpha1.FilesystemInterface {
return &FakeFilesystems{c, namespace}
}
func (c *FakeRookV1alpha1) ObjectStores(namespace string) v1alpha1.ObjectStoreInterface {
return &FakeObjectStores{c, namespace}
}
func (c *FakeRookV1alpha1) Pools(namespace string) v1alpha1.PoolInterface {
return &FakePools{c, namespace}
}
func (c *FakeRookV1alpha1) VolumeAttachments(namespace string) v1alpha1.VolumeAttachmentInterface {
return &FakeVolumeAttachments{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeRookV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
@@ -1,128 +0,0 @@
/*
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 (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeVolumeAttachments implements VolumeAttachmentInterface
type FakeVolumeAttachments struct {
Fake *FakeRookV1alpha1
ns string
}
var volumeattachmentsResource = schema.GroupVersionResource{Group: "rook.io", Version: "v1alpha1", Resource: "volumeattachments"}
var volumeattachmentsKind = schema.GroupVersionKind{Group: "rook.io", Version: "v1alpha1", Kind: "VolumeAttachment"}
// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any.
func (c *FakeVolumeAttachments) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(volumeattachmentsResource, c.ns, name), &v1alpha1.VolumeAttachment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VolumeAttachment), err
}
// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors.
func (c *FakeVolumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(volumeattachmentsResource, volumeattachmentsKind, c.ns, opts), &v1alpha1.VolumeAttachmentList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.VolumeAttachmentList{ListMeta: obj.(*v1alpha1.VolumeAttachmentList).ListMeta}
for _, item := range obj.(*v1alpha1.VolumeAttachmentList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested volumeAttachments.
func (c *FakeVolumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(volumeattachmentsResource, c.ns, opts))
}
// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any.
func (c *FakeVolumeAttachments) Create(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(volumeattachmentsResource, c.ns, volumeAttachment), &v1alpha1.VolumeAttachment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VolumeAttachment), err
}
// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any.
func (c *FakeVolumeAttachments) Update(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(volumeattachmentsResource, c.ns, volumeAttachment), &v1alpha1.VolumeAttachment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VolumeAttachment), err
}
// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs.
func (c *FakeVolumeAttachments) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(volumeattachmentsResource, c.ns, name), &v1alpha1.VolumeAttachment{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeVolumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(volumeattachmentsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttachmentList{})
return err
}
// Patch applies the patch and returns the patched volumeAttachment.
func (c *FakeVolumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumeattachmentsResource, c.ns, name, data, subresources...), &v1alpha1.VolumeAttachment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.VolumeAttachment), err
}
@@ -1,157 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// FilesystemsGetter has a method to return a FilesystemInterface.
// A group's client should implement this interface.
type FilesystemsGetter interface {
Filesystems(namespace string) FilesystemInterface
}
// FilesystemInterface has methods to work with Filesystem resources.
type FilesystemInterface interface {
Create(*v1alpha1.Filesystem) (*v1alpha1.Filesystem, error)
Update(*v1alpha1.Filesystem) (*v1alpha1.Filesystem, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Filesystem, error)
List(opts v1.ListOptions) (*v1alpha1.FilesystemList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Filesystem, err error)
FilesystemExpansion
}
// filesystems implements FilesystemInterface
type filesystems struct {
client rest.Interface
ns string
}
// newFilesystems returns a Filesystems
func newFilesystems(c *RookV1alpha1Client, namespace string) *filesystems {
return &filesystems{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the filesystem, and returns the corresponding filesystem object, and an error if there is any.
func (c *filesystems) Get(name string, options v1.GetOptions) (result *v1alpha1.Filesystem, err error) {
result = &v1alpha1.Filesystem{}
err = c.client.Get().
Namespace(c.ns).
Resource("filesystems").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Filesystems that match those selectors.
func (c *filesystems) List(opts v1.ListOptions) (result *v1alpha1.FilesystemList, err error) {
result = &v1alpha1.FilesystemList{}
err = c.client.Get().
Namespace(c.ns).
Resource("filesystems").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested filesystems.
func (c *filesystems) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("filesystems").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a filesystem and creates it. Returns the server's representation of the filesystem, and an error, if there is any.
func (c *filesystems) Create(filesystem *v1alpha1.Filesystem) (result *v1alpha1.Filesystem, err error) {
result = &v1alpha1.Filesystem{}
err = c.client.Post().
Namespace(c.ns).
Resource("filesystems").
Body(filesystem).
Do().
Into(result)
return
}
// Update takes the representation of a filesystem and updates it. Returns the server's representation of the filesystem, and an error, if there is any.
func (c *filesystems) Update(filesystem *v1alpha1.Filesystem) (result *v1alpha1.Filesystem, err error) {
result = &v1alpha1.Filesystem{}
err = c.client.Put().
Namespace(c.ns).
Resource("filesystems").
Name(filesystem.Name).
Body(filesystem).
Do().
Into(result)
return
}
// Delete takes name of the filesystem and deletes it. Returns an error if one occurs.
func (c *filesystems) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("filesystems").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *filesystems) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("filesystems").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched filesystem.
func (c *filesystems) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Filesystem, err error) {
result = &v1alpha1.Filesystem{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("filesystems").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -1,29 +0,0 @@
/*
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 v1alpha1
type ClusterExpansion interface{}
type FilesystemExpansion interface{}
type ObjectStoreExpansion interface{}
type PoolExpansion interface{}
type VolumeAttachmentExpansion interface{}
@@ -1,157 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ObjectStoresGetter has a method to return a ObjectStoreInterface.
// A group's client should implement this interface.
type ObjectStoresGetter interface {
ObjectStores(namespace string) ObjectStoreInterface
}
// ObjectStoreInterface has methods to work with ObjectStore resources.
type ObjectStoreInterface interface {
Create(*v1alpha1.ObjectStore) (*v1alpha1.ObjectStore, error)
Update(*v1alpha1.ObjectStore) (*v1alpha1.ObjectStore, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.ObjectStore, error)
List(opts v1.ListOptions) (*v1alpha1.ObjectStoreList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ObjectStore, err error)
ObjectStoreExpansion
}
// objectStores implements ObjectStoreInterface
type objectStores struct {
client rest.Interface
ns string
}
// newObjectStores returns a ObjectStores
func newObjectStores(c *RookV1alpha1Client, namespace string) *objectStores {
return &objectStores{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the objectStore, and returns the corresponding objectStore object, and an error if there is any.
func (c *objectStores) Get(name string, options v1.GetOptions) (result *v1alpha1.ObjectStore, err error) {
result = &v1alpha1.ObjectStore{}
err = c.client.Get().
Namespace(c.ns).
Resource("objectstores").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of ObjectStores that match those selectors.
func (c *objectStores) List(opts v1.ListOptions) (result *v1alpha1.ObjectStoreList, err error) {
result = &v1alpha1.ObjectStoreList{}
err = c.client.Get().
Namespace(c.ns).
Resource("objectstores").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested objectStores.
func (c *objectStores) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("objectstores").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a objectStore and creates it. Returns the server's representation of the objectStore, and an error, if there is any.
func (c *objectStores) Create(objectStore *v1alpha1.ObjectStore) (result *v1alpha1.ObjectStore, err error) {
result = &v1alpha1.ObjectStore{}
err = c.client.Post().
Namespace(c.ns).
Resource("objectstores").
Body(objectStore).
Do().
Into(result)
return
}
// Update takes the representation of a objectStore and updates it. Returns the server's representation of the objectStore, and an error, if there is any.
func (c *objectStores) Update(objectStore *v1alpha1.ObjectStore) (result *v1alpha1.ObjectStore, err error) {
result = &v1alpha1.ObjectStore{}
err = c.client.Put().
Namespace(c.ns).
Resource("objectstores").
Name(objectStore.Name).
Body(objectStore).
Do().
Into(result)
return
}
// Delete takes name of the objectStore and deletes it. Returns an error if one occurs.
func (c *objectStores) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("objectstores").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *objectStores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("objectstores").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched objectStore.
func (c *objectStores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ObjectStore, err error) {
result = &v1alpha1.ObjectStore{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("objectstores").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -1,157 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PoolsGetter has a method to return a PoolInterface.
// A group's client should implement this interface.
type PoolsGetter interface {
Pools(namespace string) PoolInterface
}
// PoolInterface has methods to work with Pool resources.
type PoolInterface interface {
Create(*v1alpha1.Pool) (*v1alpha1.Pool, error)
Update(*v1alpha1.Pool) (*v1alpha1.Pool, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Pool, error)
List(opts v1.ListOptions) (*v1alpha1.PoolList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pool, err error)
PoolExpansion
}
// pools implements PoolInterface
type pools struct {
client rest.Interface
ns string
}
// newPools returns a Pools
func newPools(c *RookV1alpha1Client, namespace string) *pools {
return &pools{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the pool, and returns the corresponding pool object, and an error if there is any.
func (c *pools) Get(name string, options v1.GetOptions) (result *v1alpha1.Pool, err error) {
result = &v1alpha1.Pool{}
err = c.client.Get().
Namespace(c.ns).
Resource("pools").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Pools that match those selectors.
func (c *pools) List(opts v1.ListOptions) (result *v1alpha1.PoolList, err error) {
result = &v1alpha1.PoolList{}
err = c.client.Get().
Namespace(c.ns).
Resource("pools").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested pools.
func (c *pools) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("pools").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a pool and creates it. Returns the server's representation of the pool, and an error, if there is any.
func (c *pools) Create(pool *v1alpha1.Pool) (result *v1alpha1.Pool, err error) {
result = &v1alpha1.Pool{}
err = c.client.Post().
Namespace(c.ns).
Resource("pools").
Body(pool).
Do().
Into(result)
return
}
// Update takes the representation of a pool and updates it. Returns the server's representation of the pool, and an error, if there is any.
func (c *pools) Update(pool *v1alpha1.Pool) (result *v1alpha1.Pool, err error) {
result = &v1alpha1.Pool{}
err = c.client.Put().
Namespace(c.ns).
Resource("pools").
Name(pool.Name).
Body(pool).
Do().
Into(result)
return
}
// Delete takes name of the pool and deletes it. Returns an error if one occurs.
func (c *pools) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pools").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *pools) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pools").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched pool.
func (c *pools) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pool, err error) {
result = &v1alpha1.Pool{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("pools").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -1,110 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"github.com/rook/rook/pkg/client/clientset/versioned/scheme"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type RookV1alpha1Interface interface {
RESTClient() rest.Interface
ClustersGetter
FilesystemsGetter
ObjectStoresGetter
PoolsGetter
VolumeAttachmentsGetter
}
// RookV1alpha1Client is used to interact with features provided by the rook.io group.
type RookV1alpha1Client struct {
restClient rest.Interface
}
func (c *RookV1alpha1Client) Clusters(namespace string) ClusterInterface {
return newClusters(c, namespace)
}
func (c *RookV1alpha1Client) Filesystems(namespace string) FilesystemInterface {
return newFilesystems(c, namespace)
}
func (c *RookV1alpha1Client) ObjectStores(namespace string) ObjectStoreInterface {
return newObjectStores(c, namespace)
}
func (c *RookV1alpha1Client) Pools(namespace string) PoolInterface {
return newPools(c, namespace)
}
func (c *RookV1alpha1Client) VolumeAttachments(namespace string) VolumeAttachmentInterface {
return newVolumeAttachments(c, namespace)
}
// NewForConfig creates a new RookV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*RookV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &RookV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new RookV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *RookV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new RookV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *RookV1alpha1Client {
return &RookV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.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 *RookV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
@@ -1,157 +0,0 @@
/*
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 v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface.
// A group's client should implement this interface.
type VolumeAttachmentsGetter interface {
VolumeAttachments(namespace string) VolumeAttachmentInterface
}
// VolumeAttachmentInterface has methods to work with VolumeAttachment resources.
type VolumeAttachmentInterface interface {
Create(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error)
Update(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.VolumeAttachment, error)
List(opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error)
VolumeAttachmentExpansion
}
// volumeAttachments implements VolumeAttachmentInterface
type volumeAttachments struct {
client rest.Interface
ns string
}
// newVolumeAttachments returns a VolumeAttachments
func newVolumeAttachments(c *RookV1alpha1Client, namespace string) *volumeAttachments {
return &volumeAttachments{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any.
func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) {
result = &v1alpha1.VolumeAttachment{}
err = c.client.Get().
Namespace(c.ns).
Resource("volumeattachments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors.
func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) {
result = &v1alpha1.VolumeAttachmentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("volumeattachments").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested volumeAttachments.
func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("volumeattachments").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any.
func (c *volumeAttachments) Create(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
result = &v1alpha1.VolumeAttachment{}
err = c.client.Post().
Namespace(c.ns).
Resource("volumeattachments").
Body(volumeAttachment).
Do().
Into(result)
return
}
// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any.
func (c *volumeAttachments) Update(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) {
result = &v1alpha1.VolumeAttachment{}
err = c.client.Put().
Namespace(c.ns).
Resource("volumeattachments").
Name(volumeAttachment.Name).
Body(volumeAttachment).
Do().
Into(result)
return
}
// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs.
func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumeattachments").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumeattachments").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched volumeAttachment.
func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) {
result = &v1alpha1.VolumeAttachment{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("volumeattachments").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -27,7 +27,6 @@ import (
cockroachdbrookiov1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
miniorookiov1alpha1 "github.com/rook/rook/pkg/apis/minio.rook.io/v1alpha1"
nfsrookiov1alpha1 "github.com/rook/rook/pkg/apis/nfs.rook.io/v1alpha1"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
v1alpha2 "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
@@ -99,18 +98,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case nfsrookiov1alpha1.SchemeGroupVersion.WithResource("nfsservers"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Nfs().V1alpha1().NFSServers().Informer()}, nil
// Group=rook.io, Version=v1alpha1
case rookiov1alpha1.SchemeGroupVersion.WithResource("clusters"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha1().Clusters().Informer()}, nil
case rookiov1alpha1.SchemeGroupVersion.WithResource("filesystems"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha1().Filesystems().Informer()}, nil
case rookiov1alpha1.SchemeGroupVersion.WithResource("objectstores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha1().ObjectStores().Informer()}, nil
case rookiov1alpha1.SchemeGroupVersion.WithResource("pools"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha1().Pools().Informer()}, nil
case rookiov1alpha1.SchemeGroupVersion.WithResource("volumeattachments"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha1().VolumeAttachments().Informer()}, nil
// Group=rook.io, Version=v1alpha2
case v1alpha2.SchemeGroupVersion.WithResource("volumes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Rook().V1alpha2().Volumes().Informer()}, nil
@@ -20,14 +20,11 @@ package rook
import (
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/informers/externalversions/rook.io/v1alpha1"
v1alpha2 "github.com/rook/rook/pkg/client/informers/externalversions/rook.io/v1alpha2"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1alpha2 provides access to shared informers for resources in V1alpha2.
V1alpha2() v1alpha2.Interface
}
@@ -43,11 +40,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
}
// V1alpha2 returns a new v1alpha2.Interface.
func (g *group) V1alpha2() v1alpha2.Interface {
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
@@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/listers/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// ClusterInformer provides access to a shared informer and lister for
// Clusters.
type ClusterInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterLister
}
type clusterInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewClusterInformer constructs a new informer for Cluster type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredClusterInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredClusterInformer constructs a new informer for Cluster type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Clusters(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Clusters(namespace).Watch(options)
},
},
&rookiov1alpha1.Cluster{},
resyncPeriod,
indexers,
)
}
func (f *clusterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredClusterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *clusterInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rookiov1alpha1.Cluster{}, f.defaultInformer)
}
func (f *clusterInformer) Lister() v1alpha1.ClusterLister {
return v1alpha1.NewClusterLister(f.Informer().GetIndexer())
}
@@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/listers/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// FilesystemInformer provides access to a shared informer and lister for
// Filesystems.
type FilesystemInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.FilesystemLister
}
type filesystemInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewFilesystemInformer constructs a new informer for Filesystem type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilesystemInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredFilesystemInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredFilesystemInformer constructs a new informer for Filesystem type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredFilesystemInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Filesystems(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Filesystems(namespace).Watch(options)
},
},
&rookiov1alpha1.Filesystem{},
resyncPeriod,
indexers,
)
}
func (f *filesystemInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredFilesystemInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *filesystemInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rookiov1alpha1.Filesystem{}, f.defaultInformer)
}
func (f *filesystemInformer) Lister() v1alpha1.FilesystemLister {
return v1alpha1.NewFilesystemLister(f.Informer().GetIndexer())
}
@@ -1,73 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// Clusters returns a ClusterInformer.
Clusters() ClusterInformer
// Filesystems returns a FilesystemInformer.
Filesystems() FilesystemInformer
// ObjectStores returns a ObjectStoreInformer.
ObjectStores() ObjectStoreInformer
// Pools returns a PoolInformer.
Pools() PoolInformer
// VolumeAttachments returns a VolumeAttachmentInformer.
VolumeAttachments() VolumeAttachmentInformer
}
type version struct {
factory internalinterfaces.SharedInformerFactory
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// New returns a new Interface.
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// Clusters returns a ClusterInformer.
func (v *version) Clusters() ClusterInformer {
return &clusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Filesystems returns a FilesystemInformer.
func (v *version) Filesystems() FilesystemInformer {
return &filesystemInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// ObjectStores returns a ObjectStoreInformer.
func (v *version) ObjectStores() ObjectStoreInformer {
return &objectStoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Pools returns a PoolInformer.
func (v *version) Pools() PoolInformer {
return &poolInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// VolumeAttachments returns a VolumeAttachmentInformer.
func (v *version) VolumeAttachments() VolumeAttachmentInformer {
return &volumeAttachmentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
@@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/listers/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// ObjectStoreInformer provides access to a shared informer and lister for
// ObjectStores.
type ObjectStoreInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ObjectStoreLister
}
type objectStoreInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewObjectStoreInformer constructs a new informer for ObjectStore type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewObjectStoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredObjectStoreInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredObjectStoreInformer constructs a new informer for ObjectStore type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredObjectStoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().ObjectStores(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().ObjectStores(namespace).Watch(options)
},
},
&rookiov1alpha1.ObjectStore{},
resyncPeriod,
indexers,
)
}
func (f *objectStoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredObjectStoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *objectStoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rookiov1alpha1.ObjectStore{}, f.defaultInformer)
}
func (f *objectStoreInformer) Lister() v1alpha1.ObjectStoreLister {
return v1alpha1.NewObjectStoreLister(f.Informer().GetIndexer())
}
@@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/listers/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// PoolInformer provides access to a shared informer and lister for
// Pools.
type PoolInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.PoolLister
}
type poolInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewPoolInformer constructs a new informer for Pool type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewPoolInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPoolInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredPoolInformer constructs a new informer for Pool type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredPoolInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Pools(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().Pools(namespace).Watch(options)
},
},
&rookiov1alpha1.Pool{},
resyncPeriod,
indexers,
)
}
func (f *poolInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPoolInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *poolInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rookiov1alpha1.Pool{}, f.defaultInformer)
}
func (f *poolInformer) Lister() v1alpha1.PoolLister {
return v1alpha1.NewPoolLister(f.Informer().GetIndexer())
}
@@ -1,89 +0,0 @@
/*
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 informer-gen. DO NOT EDIT.
package v1alpha1
import (
time "time"
rookiov1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/rook/rook/pkg/client/listers/rook.io/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// VolumeAttachmentInformer provides access to a shared informer and lister for
// VolumeAttachments.
type VolumeAttachmentInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.VolumeAttachmentLister
}
type volumeAttachmentInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewVolumeAttachmentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredVolumeAttachmentInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredVolumeAttachmentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().VolumeAttachments(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RookV1alpha1().VolumeAttachments(namespace).Watch(options)
},
},
&rookiov1alpha1.VolumeAttachment{},
resyncPeriod,
indexers,
)
}
func (f *volumeAttachmentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredVolumeAttachmentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&rookiov1alpha1.VolumeAttachment{}, f.defaultInformer)
}
func (f *volumeAttachmentInformer) Lister() v1alpha1.VolumeAttachmentLister {
return v1alpha1.NewVolumeAttachmentLister(f.Informer().GetIndexer())
}
@@ -1,94 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// ClusterLister helps list Clusters.
type ClusterLister interface {
// List lists all Clusters in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error)
// Clusters returns an object that can list and get Clusters.
Clusters(namespace string) ClusterNamespaceLister
ClusterListerExpansion
}
// clusterLister implements the ClusterLister interface.
type clusterLister struct {
indexer cache.Indexer
}
// NewClusterLister returns a new ClusterLister.
func NewClusterLister(indexer cache.Indexer) ClusterLister {
return &clusterLister{indexer: indexer}
}
// List lists all Clusters in the indexer.
func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Cluster))
})
return ret, err
}
// Clusters returns an object that can list and get Clusters.
func (s *clusterLister) Clusters(namespace string) ClusterNamespaceLister {
return clusterNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// ClusterNamespaceLister helps list and get Clusters.
type ClusterNamespaceLister interface {
// List lists all Clusters in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error)
// Get retrieves the Cluster from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.Cluster, error)
ClusterNamespaceListerExpansion
}
// clusterNamespaceLister implements the ClusterNamespaceLister
// interface.
type clusterNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Clusters in the indexer for a given namespace.
func (s clusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Cluster))
})
return ret, err
}
// Get retrieves the Cluster from the indexer for a given namespace and name.
func (s clusterNamespaceLister) Get(name string) (*v1alpha1.Cluster, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("cluster"), name)
}
return obj.(*v1alpha1.Cluster), nil
}
@@ -1,59 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
// ClusterListerExpansion allows custom methods to be added to
// ClusterLister.
type ClusterListerExpansion interface{}
// ClusterNamespaceListerExpansion allows custom methods to be added to
// ClusterNamespaceLister.
type ClusterNamespaceListerExpansion interface{}
// FilesystemListerExpansion allows custom methods to be added to
// FilesystemLister.
type FilesystemListerExpansion interface{}
// FilesystemNamespaceListerExpansion allows custom methods to be added to
// FilesystemNamespaceLister.
type FilesystemNamespaceListerExpansion interface{}
// ObjectStoreListerExpansion allows custom methods to be added to
// ObjectStoreLister.
type ObjectStoreListerExpansion interface{}
// ObjectStoreNamespaceListerExpansion allows custom methods to be added to
// ObjectStoreNamespaceLister.
type ObjectStoreNamespaceListerExpansion interface{}
// PoolListerExpansion allows custom methods to be added to
// PoolLister.
type PoolListerExpansion interface{}
// PoolNamespaceListerExpansion allows custom methods to be added to
// PoolNamespaceLister.
type PoolNamespaceListerExpansion interface{}
// VolumeAttachmentListerExpansion allows custom methods to be added to
// VolumeAttachmentLister.
type VolumeAttachmentListerExpansion interface{}
// VolumeAttachmentNamespaceListerExpansion allows custom methods to be added to
// VolumeAttachmentNamespaceLister.
type VolumeAttachmentNamespaceListerExpansion interface{}
@@ -1,94 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// FilesystemLister helps list Filesystems.
type FilesystemLister interface {
// List lists all Filesystems in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.Filesystem, err error)
// Filesystems returns an object that can list and get Filesystems.
Filesystems(namespace string) FilesystemNamespaceLister
FilesystemListerExpansion
}
// filesystemLister implements the FilesystemLister interface.
type filesystemLister struct {
indexer cache.Indexer
}
// NewFilesystemLister returns a new FilesystemLister.
func NewFilesystemLister(indexer cache.Indexer) FilesystemLister {
return &filesystemLister{indexer: indexer}
}
// List lists all Filesystems in the indexer.
func (s *filesystemLister) List(selector labels.Selector) (ret []*v1alpha1.Filesystem, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Filesystem))
})
return ret, err
}
// Filesystems returns an object that can list and get Filesystems.
func (s *filesystemLister) Filesystems(namespace string) FilesystemNamespaceLister {
return filesystemNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// FilesystemNamespaceLister helps list and get Filesystems.
type FilesystemNamespaceLister interface {
// List lists all Filesystems in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.Filesystem, err error)
// Get retrieves the Filesystem from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.Filesystem, error)
FilesystemNamespaceListerExpansion
}
// filesystemNamespaceLister implements the FilesystemNamespaceLister
// interface.
type filesystemNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Filesystems in the indexer for a given namespace.
func (s filesystemNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Filesystem, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Filesystem))
})
return ret, err
}
// Get retrieves the Filesystem from the indexer for a given namespace and name.
func (s filesystemNamespaceLister) Get(name string) (*v1alpha1.Filesystem, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("filesystem"), name)
}
return obj.(*v1alpha1.Filesystem), nil
}
@@ -1,94 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// ObjectStoreLister helps list ObjectStores.
type ObjectStoreLister interface {
// List lists all ObjectStores in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.ObjectStore, err error)
// ObjectStores returns an object that can list and get ObjectStores.
ObjectStores(namespace string) ObjectStoreNamespaceLister
ObjectStoreListerExpansion
}
// objectStoreLister implements the ObjectStoreLister interface.
type objectStoreLister struct {
indexer cache.Indexer
}
// NewObjectStoreLister returns a new ObjectStoreLister.
func NewObjectStoreLister(indexer cache.Indexer) ObjectStoreLister {
return &objectStoreLister{indexer: indexer}
}
// List lists all ObjectStores in the indexer.
func (s *objectStoreLister) List(selector labels.Selector) (ret []*v1alpha1.ObjectStore, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ObjectStore))
})
return ret, err
}
// ObjectStores returns an object that can list and get ObjectStores.
func (s *objectStoreLister) ObjectStores(namespace string) ObjectStoreNamespaceLister {
return objectStoreNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// ObjectStoreNamespaceLister helps list and get ObjectStores.
type ObjectStoreNamespaceLister interface {
// List lists all ObjectStores in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.ObjectStore, err error)
// Get retrieves the ObjectStore from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.ObjectStore, error)
ObjectStoreNamespaceListerExpansion
}
// objectStoreNamespaceLister implements the ObjectStoreNamespaceLister
// interface.
type objectStoreNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all ObjectStores in the indexer for a given namespace.
func (s objectStoreNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ObjectStore, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ObjectStore))
})
return ret, err
}
// Get retrieves the ObjectStore from the indexer for a given namespace and name.
func (s objectStoreNamespaceLister) Get(name string) (*v1alpha1.ObjectStore, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("objectstore"), name)
}
return obj.(*v1alpha1.ObjectStore), nil
}
@@ -1,94 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// PoolLister helps list Pools.
type PoolLister interface {
// List lists all Pools in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.Pool, err error)
// Pools returns an object that can list and get Pools.
Pools(namespace string) PoolNamespaceLister
PoolListerExpansion
}
// poolLister implements the PoolLister interface.
type poolLister struct {
indexer cache.Indexer
}
// NewPoolLister returns a new PoolLister.
func NewPoolLister(indexer cache.Indexer) PoolLister {
return &poolLister{indexer: indexer}
}
// List lists all Pools in the indexer.
func (s *poolLister) List(selector labels.Selector) (ret []*v1alpha1.Pool, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Pool))
})
return ret, err
}
// Pools returns an object that can list and get Pools.
func (s *poolLister) Pools(namespace string) PoolNamespaceLister {
return poolNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// PoolNamespaceLister helps list and get Pools.
type PoolNamespaceLister interface {
// List lists all Pools in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.Pool, err error)
// Get retrieves the Pool from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.Pool, error)
PoolNamespaceListerExpansion
}
// poolNamespaceLister implements the PoolNamespaceLister
// interface.
type poolNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all Pools in the indexer for a given namespace.
func (s poolNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Pool, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.Pool))
})
return ret, err
}
// Get retrieves the Pool from the indexer for a given namespace and name.
func (s poolNamespaceLister) Get(name string) (*v1alpha1.Pool, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("pool"), name)
}
return obj.(*v1alpha1.Pool), nil
}
@@ -1,94 +0,0 @@
/*
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 lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/rook/rook/pkg/apis/rook.io/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// VolumeAttachmentLister helps list VolumeAttachments.
type VolumeAttachmentLister interface {
// List lists all VolumeAttachments in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error)
// VolumeAttachments returns an object that can list and get VolumeAttachments.
VolumeAttachments(namespace string) VolumeAttachmentNamespaceLister
VolumeAttachmentListerExpansion
}
// volumeAttachmentLister implements the VolumeAttachmentLister interface.
type volumeAttachmentLister struct {
indexer cache.Indexer
}
// NewVolumeAttachmentLister returns a new VolumeAttachmentLister.
func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister {
return &volumeAttachmentLister{indexer: indexer}
}
// List lists all VolumeAttachments in the indexer.
func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.VolumeAttachment))
})
return ret, err
}
// VolumeAttachments returns an object that can list and get VolumeAttachments.
func (s *volumeAttachmentLister) VolumeAttachments(namespace string) VolumeAttachmentNamespaceLister {
return volumeAttachmentNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// VolumeAttachmentNamespaceLister helps list and get VolumeAttachments.
type VolumeAttachmentNamespaceLister interface {
// List lists all VolumeAttachments in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error)
// Get retrieves the VolumeAttachment from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.VolumeAttachment, error)
VolumeAttachmentNamespaceListerExpansion
}
// volumeAttachmentNamespaceLister implements the VolumeAttachmentNamespaceLister
// interface.
type volumeAttachmentNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all VolumeAttachments in the indexer for a given namespace.
func (s volumeAttachmentNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.VolumeAttachment))
})
return ret, err
}
// Get retrieves the VolumeAttachment from the indexer for a given namespace and name.
func (s volumeAttachmentNamespaceLister) Get(name string) (*v1alpha1.VolumeAttachment, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("volumeattachment"), name)
}
return obj.(*v1alpha1.VolumeAttachment), nil
}