mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
Merge pull request #46 from arangodb/rename-api-deployment-dir
Renamed pkg/apis/arangodb to pkg/apis/deployment
This commit is contained in:
commit
eb60b3bc8c
71 changed files with 859 additions and 26 deletions
2
Makefile
2
Makefile
|
@ -156,7 +156,7 @@ update-generated: $(GOBUILDDIR)
|
|||
"all" \
|
||||
"github.com/arangodb/k8s-operator/pkg/generated" \
|
||||
"github.com/arangodb/k8s-operator/pkg/apis" \
|
||||
"arangodb:v1alpha storage:v1alpha" \
|
||||
"deployment:v1alpha storage:v1alpha" \
|
||||
--go-header-file "./tools/codegen/boilerplate.go.txt" \
|
||||
$(VERIFYARGS)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
driver "github.com/arangodb/go-driver"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/arangod"
|
||||
)
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import (
|
|||
"k8s.io/client-go/kubernetes"
|
||||
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/retry"
|
||||
|
|
|
@ -26,7 +26,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/dchest/uniuri"
|
||||
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
package deployment
|
||||
|
||||
import (
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import (
|
|||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/arangod"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/constants"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
|
|
|
@ -26,7 +26,7 @@ import (
|
|||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
"k8s.io/api/core/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/metrics"
|
||||
)
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
package deployment
|
||||
|
||||
import (
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
package deployment
|
||||
|
||||
import (
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package versioned
|
||||
|
||||
import (
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/arangodb/v1alpha"
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/deployment/v1alpha"
|
||||
storagev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/storage/v1alpha"
|
||||
glog "github.com/golang/glog"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
|
|
|
@ -21,8 +21,8 @@ package fake
|
|||
|
||||
import (
|
||||
clientset "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned"
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/arangodb/v1alpha"
|
||||
fakedatabasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake"
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/deployment/v1alpha"
|
||||
fakedatabasev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake"
|
||||
storagev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/storage/v1alpha"
|
||||
fakestoragev1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package fake
|
||||
|
||||
import (
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
storagev1alpha "github.com/arangodb/k8s-operator/pkg/apis/storage/v1alpha"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package scheme
|
||||
|
||||
import (
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
databasev1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
storagev1alpha "github.com/arangodb/k8s-operator/pkg/apis/storage/v1alpha"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
|
|
|
@ -0,0 +1,175 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
scheme "github.com/arangodb/k8s-operator/pkg/generated/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"
|
||||
)
|
||||
|
||||
// ArangoDeploymentsGetter has a method to return a ArangoDeploymentInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ArangoDeploymentsGetter interface {
|
||||
ArangoDeployments(namespace string) ArangoDeploymentInterface
|
||||
}
|
||||
|
||||
// ArangoDeploymentInterface has methods to work with ArangoDeployment resources.
|
||||
type ArangoDeploymentInterface interface {
|
||||
Create(*v1alpha.ArangoDeployment) (*v1alpha.ArangoDeployment, error)
|
||||
Update(*v1alpha.ArangoDeployment) (*v1alpha.ArangoDeployment, error)
|
||||
UpdateStatus(*v1alpha.ArangoDeployment) (*v1alpha.ArangoDeployment, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*v1alpha.ArangoDeployment, error)
|
||||
List(opts v1.ListOptions) (*v1alpha.ArangoDeploymentList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoDeployment, err error)
|
||||
ArangoDeploymentExpansion
|
||||
}
|
||||
|
||||
// arangoDeployments implements ArangoDeploymentInterface
|
||||
type arangoDeployments struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newArangoDeployments returns a ArangoDeployments
|
||||
func newArangoDeployments(c *DatabaseV1alphaClient, namespace string) *arangoDeployments {
|
||||
return &arangoDeployments{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any.
|
||||
func (c *arangoDeployments) Get(name string, options v1.GetOptions) (result *v1alpha.ArangoDeployment, err error) {
|
||||
result = &v1alpha.ArangoDeployment{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors.
|
||||
func (c *arangoDeployments) List(opts v1.ListOptions) (result *v1alpha.ArangoDeploymentList, err error) {
|
||||
result = &v1alpha.ArangoDeploymentList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested arangoDeployments.
|
||||
func (c *arangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any.
|
||||
func (c *arangoDeployments) Create(arangoDeployment *v1alpha.ArangoDeployment) (result *v1alpha.ArangoDeployment, err error) {
|
||||
result = &v1alpha.ArangoDeployment{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
Body(arangoDeployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any.
|
||||
func (c *arangoDeployments) Update(arangoDeployment *v1alpha.ArangoDeployment) (result *v1alpha.ArangoDeployment, err error) {
|
||||
result = &v1alpha.ArangoDeployment{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
Name(arangoDeployment.Name).
|
||||
Body(arangoDeployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *arangoDeployments) UpdateStatus(arangoDeployment *v1alpha.ArangoDeployment) (result *v1alpha.ArangoDeployment, err error) {
|
||||
result = &v1alpha.ArangoDeployment{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
Name(arangoDeployment.Name).
|
||||
SubResource("status").
|
||||
Body(arangoDeployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs.
|
||||
func (c *arangoDeployments) Delete(name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *arangoDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched arangoDeployment.
|
||||
func (c *arangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoDeployment, err error) {
|
||||
result = &v1alpha.ArangoDeployment{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("arangodeployments").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/scheme"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type DatabaseV1alphaInterface interface {
|
||||
RESTClient() rest.Interface
|
||||
ArangoDeploymentsGetter
|
||||
}
|
||||
|
||||
// DatabaseV1alphaClient is used to interact with features provided by the database.arangodb.com group.
|
||||
type DatabaseV1alphaClient struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *DatabaseV1alphaClient) ArangoDeployments(namespace string) ArangoDeploymentInterface {
|
||||
return newArangoDeployments(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new DatabaseV1alphaClient for the given config.
|
||||
func NewForConfig(c *rest.Config) (*DatabaseV1alphaClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DatabaseV1alphaClient{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new DatabaseV1alphaClient for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *DatabaseV1alphaClient {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new DatabaseV1alphaClient for the given RESTClient.
|
||||
func New(c rest.Interface) *DatabaseV1alphaClient {
|
||||
return &DatabaseV1alphaClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha.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 *DatabaseV1alphaClient) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
|
@ -0,0 +1,141 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeArangoDeployments implements ArangoDeploymentInterface
|
||||
type FakeArangoDeployments struct {
|
||||
Fake *FakeDatabaseV1alpha
|
||||
ns string
|
||||
}
|
||||
|
||||
var arangodeploymentsResource = schema.GroupVersionResource{Group: "database.arangodb.com", Version: "v1alpha", Resource: "arangodeployments"}
|
||||
|
||||
var arangodeploymentsKind = schema.GroupVersionKind{Group: "database.arangodb.com", Version: "v1alpha", Kind: "ArangoDeployment"}
|
||||
|
||||
// Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any.
|
||||
func (c *FakeArangoDeployments) Get(name string, options v1.GetOptions) (result *v1alpha.ArangoDeployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(arangodeploymentsResource, c.ns, name), &v1alpha.ArangoDeployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors.
|
||||
func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *v1alpha.ArangoDeploymentList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(arangodeploymentsResource, arangodeploymentsKind, c.ns, opts), &v1alpha.ArangoDeploymentList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha.ArangoDeploymentList{}
|
||||
for _, item := range obj.(*v1alpha.ArangoDeploymentList).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 arangoDeployments.
|
||||
func (c *FakeArangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(arangodeploymentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any.
|
||||
func (c *FakeArangoDeployments) Create(arangoDeployment *v1alpha.ArangoDeployment) (result *v1alpha.ArangoDeployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(arangodeploymentsResource, c.ns, arangoDeployment), &v1alpha.ArangoDeployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any.
|
||||
func (c *FakeArangoDeployments) Update(arangoDeployment *v1alpha.ArangoDeployment) (result *v1alpha.ArangoDeployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(arangodeploymentsResource, c.ns, arangoDeployment), &v1alpha.ArangoDeployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeArangoDeployments) UpdateStatus(arangoDeployment *v1alpha.ArangoDeployment) (*v1alpha.ArangoDeployment, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(arangodeploymentsResource, "status", c.ns, arangoDeployment), &v1alpha.ArangoDeployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), err
|
||||
}
|
||||
|
||||
// Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeArangoDeployments) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(arangodeploymentsResource, c.ns, name), &v1alpha.ArangoDeployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeArangoDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(arangodeploymentsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha.ArangoDeploymentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched arangoDeployment.
|
||||
func (c *FakeArangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoDeployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(arangodeploymentsResource, c.ns, name, data, subresources...), &v1alpha.ArangoDeployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), err
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned/typed/deployment/v1alpha"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeDatabaseV1alpha struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeDatabaseV1alpha) ArangoDeployments(namespace string) v1alpha.ArangoDeploymentInterface {
|
||||
return &FakeArangoDeployments{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeDatabaseV1alpha) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
package v1alpha
|
||||
|
||||
type ArangoDeploymentExpansion interface{}
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/deployment/v1alpha"
|
||||
internalinterfaces "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V1alpha provides access to shared informers for resources in V1alpha.
|
||||
V1alpha() v1alpha.Interface
|
||||
}
|
||||
|
||||
type group 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 &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// V1alpha returns a new v1alpha.Interface.
|
||||
func (g *group) V1alpha() v1alpha.Interface {
|
||||
return v1alpha.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
deployment_v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
versioned "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/generated/listers/deployment/v1alpha"
|
||||
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"
|
||||
)
|
||||
|
||||
// ArangoDeploymentInformer provides access to a shared informer and lister for
|
||||
// ArangoDeployments.
|
||||
type ArangoDeploymentInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha.ArangoDeploymentLister
|
||||
}
|
||||
|
||||
type arangoDeploymentInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewArangoDeploymentInformer constructs a new informer for ArangoDeployment 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 NewArangoDeploymentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredArangoDeploymentInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredArangoDeploymentInformer constructs a new informer for ArangoDeployment 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 NewFilteredArangoDeploymentInformer(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.DatabaseV1alpha().ArangoDeployments(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.DatabaseV1alpha().ArangoDeployments(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&deployment_v1alpha.ArangoDeployment{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *arangoDeploymentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredArangoDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *arangoDeploymentInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&deployment_v1alpha.ArangoDeployment{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *arangoDeploymentInformer) Lister() v1alpha.ArangoDeploymentLister {
|
||||
return v1alpha.NewArangoDeploymentLister(f.Informer().GetIndexer())
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
|
||||
// This file was automatically generated by informer-gen
|
||||
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// ArangoDeployments returns a ArangoDeploymentInformer.
|
||||
ArangoDeployments() ArangoDeploymentInformer
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
// ArangoDeployments returns a ArangoDeploymentInformer.
|
||||
func (v *version) ArangoDeployments() ArangoDeploymentInformer {
|
||||
return &arangoDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
|
@ -28,7 +28,7 @@ import (
|
|||
time "time"
|
||||
|
||||
versioned "github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned"
|
||||
arangodb "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/arangodb"
|
||||
deployment "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/deployment"
|
||||
internalinterfaces "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
storage "github.com/arangodb/k8s-operator/pkg/generated/informers/externalversions/storage"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -128,12 +128,12 @@ type SharedInformerFactory interface {
|
|||
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
Database() arangodb.Interface
|
||||
Database() deployment.Interface
|
||||
Storage() storage.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Database() arangodb.Interface {
|
||||
return arangodb.New(f, f.namespace, f.tweakListOptions)
|
||||
func (f *sharedInformerFactory) Database() deployment.Interface {
|
||||
return deployment.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Storage() storage.Interface {
|
||||
|
|
|
@ -25,7 +25,7 @@ package externalversions
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
storage_v1alpha "github.com/arangodb/k8s-operator/pkg/apis/storage/v1alpha"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
|
|
98
pkg/generated/listers/deployment/v1alpha/arangodeployment.go
Normal file
98
pkg/generated/listers/deployment/v1alpha/arangodeployment.go
Normal file
|
@ -0,0 +1,98 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
v1alpha "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ArangoDeploymentLister helps list ArangoDeployments.
|
||||
type ArangoDeploymentLister interface {
|
||||
// List lists all ArangoDeployments in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1alpha.ArangoDeployment, err error)
|
||||
// ArangoDeployments returns an object that can list and get ArangoDeployments.
|
||||
ArangoDeployments(namespace string) ArangoDeploymentNamespaceLister
|
||||
ArangoDeploymentListerExpansion
|
||||
}
|
||||
|
||||
// arangoDeploymentLister implements the ArangoDeploymentLister interface.
|
||||
type arangoDeploymentLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewArangoDeploymentLister returns a new ArangoDeploymentLister.
|
||||
func NewArangoDeploymentLister(indexer cache.Indexer) ArangoDeploymentLister {
|
||||
return &arangoDeploymentLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all ArangoDeployments in the indexer.
|
||||
func (s *arangoDeploymentLister) List(selector labels.Selector) (ret []*v1alpha.ArangoDeployment, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha.ArangoDeployment))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// ArangoDeployments returns an object that can list and get ArangoDeployments.
|
||||
func (s *arangoDeploymentLister) ArangoDeployments(namespace string) ArangoDeploymentNamespaceLister {
|
||||
return arangoDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ArangoDeploymentNamespaceLister helps list and get ArangoDeployments.
|
||||
type ArangoDeploymentNamespaceLister interface {
|
||||
// List lists all ArangoDeployments in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1alpha.ArangoDeployment, err error)
|
||||
// Get retrieves the ArangoDeployment from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1alpha.ArangoDeployment, error)
|
||||
ArangoDeploymentNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// arangoDeploymentNamespaceLister implements the ArangoDeploymentNamespaceLister
|
||||
// interface.
|
||||
type arangoDeploymentNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all ArangoDeployments in the indexer for a given namespace.
|
||||
func (s arangoDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1alpha.ArangoDeployment, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha.ArangoDeployment))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the ArangoDeployment from the indexer for a given namespace and name.
|
||||
func (s arangoDeploymentNamespaceLister) Get(name string) (*v1alpha.ArangoDeployment, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha.Resource("arangodeployment"), name)
|
||||
}
|
||||
return obj.(*v1alpha.ArangoDeployment), nil
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// DISCLAIMER
|
||||
//
|
||||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// Copyright holder is ArangoDB GmbH, Cologne, Germany
|
||||
//
|
||||
|
||||
// This file was automatically generated by lister-gen
|
||||
|
||||
package v1alpha
|
||||
|
||||
// ArangoDeploymentListerExpansion allows custom methods to be added to
|
||||
// ArangoDeploymentLister.
|
||||
type ArangoDeploymentListerExpansion interface{}
|
||||
|
||||
// ArangoDeploymentNamespaceListerExpansion allows custom methods to be added to
|
||||
// ArangoDeploymentNamespaceLister.
|
||||
type ArangoDeploymentNamespaceListerExpansion interface{}
|
|
@ -27,7 +27,7 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
deplapi "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
deplapi "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
lsapi "github.com/arangodb/k8s-operator/pkg/apis/storage/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/crd"
|
||||
)
|
||||
|
|
|
@ -31,7 +31,7 @@ import (
|
|||
kwatch "k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
deplapi "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
deplapi "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
lsapi "github.com/arangodb/k8s-operator/pkg/apis/storage/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/deployment"
|
||||
"github.com/arangodb/k8s-operator/pkg/generated/clientset/versioned"
|
||||
|
|
|
@ -31,7 +31,7 @@ import (
|
|||
kwatch "k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/deployment"
|
||||
"github.com/arangodb/k8s-operator/pkg/metrics"
|
||||
)
|
||||
|
|
|
@ -34,7 +34,7 @@ import (
|
|||
"github.com/arangodb/go-driver/http"
|
||||
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha"
|
||||
api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha"
|
||||
"github.com/arangodb/k8s-operator/pkg/util/k8sutil"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue