diff --git a/Makefile b/Makefile index 0db7dee78..2be9baa14 100644 --- a/Makefile +++ b/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) diff --git a/pkg/apis/arangodb/v1alpha/authentication_spec.go b/pkg/apis/deployment/v1alpha/authentication_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/authentication_spec.go rename to pkg/apis/deployment/v1alpha/authentication_spec.go diff --git a/pkg/apis/arangodb/v1alpha/authentication_spec_test.go b/pkg/apis/deployment/v1alpha/authentication_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/authentication_spec_test.go rename to pkg/apis/deployment/v1alpha/authentication_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/conditions.go b/pkg/apis/deployment/v1alpha/conditions.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/conditions.go rename to pkg/apis/deployment/v1alpha/conditions.go diff --git a/pkg/apis/arangodb/v1alpha/conditions_test.go b/pkg/apis/deployment/v1alpha/conditions_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/conditions_test.go rename to pkg/apis/deployment/v1alpha/conditions_test.go diff --git a/pkg/apis/arangodb/v1alpha/deployment.go b/pkg/apis/deployment/v1alpha/deployment.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment.go rename to pkg/apis/deployment/v1alpha/deployment.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_mode.go b/pkg/apis/deployment/v1alpha/deployment_mode.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_mode.go rename to pkg/apis/deployment/v1alpha/deployment_mode.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_mode_test.go b/pkg/apis/deployment/v1alpha/deployment_mode_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_mode_test.go rename to pkg/apis/deployment/v1alpha/deployment_mode_test.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_spec.go b/pkg/apis/deployment/v1alpha/deployment_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_spec.go rename to pkg/apis/deployment/v1alpha/deployment_spec.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_spec_test.go b/pkg/apis/deployment/v1alpha/deployment_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_spec_test.go rename to pkg/apis/deployment/v1alpha/deployment_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_state.go b/pkg/apis/deployment/v1alpha/deployment_state.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_state.go rename to pkg/apis/deployment/v1alpha/deployment_state.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_state_test.go b/pkg/apis/deployment/v1alpha/deployment_state_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_state_test.go rename to pkg/apis/deployment/v1alpha/deployment_state_test.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_status.go b/pkg/apis/deployment/v1alpha/deployment_status.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_status.go rename to pkg/apis/deployment/v1alpha/deployment_status.go diff --git a/pkg/apis/arangodb/v1alpha/deployment_status_members.go b/pkg/apis/deployment/v1alpha/deployment_status_members.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/deployment_status_members.go rename to pkg/apis/deployment/v1alpha/deployment_status_members.go diff --git a/pkg/apis/arangodb/v1alpha/doc.go b/pkg/apis/deployment/v1alpha/doc.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/doc.go rename to pkg/apis/deployment/v1alpha/doc.go diff --git a/pkg/apis/arangodb/v1alpha/environment.go b/pkg/apis/deployment/v1alpha/environment.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/environment.go rename to pkg/apis/deployment/v1alpha/environment.go diff --git a/pkg/apis/arangodb/v1alpha/environment_test.go b/pkg/apis/deployment/v1alpha/environment_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/environment_test.go rename to pkg/apis/deployment/v1alpha/environment_test.go diff --git a/pkg/apis/arangodb/v1alpha/errors.go b/pkg/apis/deployment/v1alpha/errors.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/errors.go rename to pkg/apis/deployment/v1alpha/errors.go diff --git a/pkg/apis/arangodb/v1alpha/member_state.go b/pkg/apis/deployment/v1alpha/member_state.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/member_state.go rename to pkg/apis/deployment/v1alpha/member_state.go diff --git a/pkg/apis/arangodb/v1alpha/member_status.go b/pkg/apis/deployment/v1alpha/member_status.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/member_status.go rename to pkg/apis/deployment/v1alpha/member_status.go diff --git a/pkg/apis/arangodb/v1alpha/member_status_list.go b/pkg/apis/deployment/v1alpha/member_status_list.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/member_status_list.go rename to pkg/apis/deployment/v1alpha/member_status_list.go diff --git a/pkg/apis/arangodb/v1alpha/monitoring_spec.go b/pkg/apis/deployment/v1alpha/monitoring_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/monitoring_spec.go rename to pkg/apis/deployment/v1alpha/monitoring_spec.go diff --git a/pkg/apis/arangodb/v1alpha/monitoring_spec_test.go b/pkg/apis/deployment/v1alpha/monitoring_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/monitoring_spec_test.go rename to pkg/apis/deployment/v1alpha/monitoring_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/plan.go b/pkg/apis/deployment/v1alpha/plan.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/plan.go rename to pkg/apis/deployment/v1alpha/plan.go diff --git a/pkg/apis/arangodb/v1alpha/register.go b/pkg/apis/deployment/v1alpha/register.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/register.go rename to pkg/apis/deployment/v1alpha/register.go diff --git a/pkg/apis/arangodb/v1alpha/rocksdb_spec.go b/pkg/apis/deployment/v1alpha/rocksdb_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/rocksdb_spec.go rename to pkg/apis/deployment/v1alpha/rocksdb_spec.go diff --git a/pkg/apis/arangodb/v1alpha/rocksdb_spec_test.go b/pkg/apis/deployment/v1alpha/rocksdb_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/rocksdb_spec_test.go rename to pkg/apis/deployment/v1alpha/rocksdb_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/server_group.go b/pkg/apis/deployment/v1alpha/server_group.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/server_group.go rename to pkg/apis/deployment/v1alpha/server_group.go diff --git a/pkg/apis/arangodb/v1alpha/server_group_spec.go b/pkg/apis/deployment/v1alpha/server_group_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/server_group_spec.go rename to pkg/apis/deployment/v1alpha/server_group_spec.go diff --git a/pkg/apis/arangodb/v1alpha/server_group_spec_test.go b/pkg/apis/deployment/v1alpha/server_group_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/server_group_spec_test.go rename to pkg/apis/deployment/v1alpha/server_group_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/server_group_test.go b/pkg/apis/deployment/v1alpha/server_group_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/server_group_test.go rename to pkg/apis/deployment/v1alpha/server_group_test.go diff --git a/pkg/apis/arangodb/v1alpha/storage_engine.go b/pkg/apis/deployment/v1alpha/storage_engine.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/storage_engine.go rename to pkg/apis/deployment/v1alpha/storage_engine.go diff --git a/pkg/apis/arangodb/v1alpha/storage_engine_test.go b/pkg/apis/deployment/v1alpha/storage_engine_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/storage_engine_test.go rename to pkg/apis/deployment/v1alpha/storage_engine_test.go diff --git a/pkg/apis/arangodb/v1alpha/sync_spec.go b/pkg/apis/deployment/v1alpha/sync_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/sync_spec.go rename to pkg/apis/deployment/v1alpha/sync_spec.go diff --git a/pkg/apis/arangodb/v1alpha/sync_spec_test.go b/pkg/apis/deployment/v1alpha/sync_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/sync_spec_test.go rename to pkg/apis/deployment/v1alpha/sync_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/tls_spec.go b/pkg/apis/deployment/v1alpha/tls_spec.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/tls_spec.go rename to pkg/apis/deployment/v1alpha/tls_spec.go diff --git a/pkg/apis/arangodb/v1alpha/tls_spec_test.go b/pkg/apis/deployment/v1alpha/tls_spec_test.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/tls_spec_test.go rename to pkg/apis/deployment/v1alpha/tls_spec_test.go diff --git a/pkg/apis/arangodb/v1alpha/zz_generated.deepcopy.go b/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/arangodb/v1alpha/zz_generated.deepcopy.go rename to pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go diff --git a/pkg/deployment/client_cache.go b/pkg/deployment/client_cache.go index cb600882f..7836dd87f 100644 --- a/pkg/deployment/client_cache.go +++ b/pkg/deployment/client_cache.go @@ -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" ) diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index 123bb75f4..5d6c9f562 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -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" diff --git a/pkg/deployment/members.go b/pkg/deployment/members.go index a72bd715a..ec6e589f4 100644 --- a/pkg/deployment/members.go +++ b/pkg/deployment/members.go @@ -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" diff --git a/pkg/deployment/plan_builder.go b/pkg/deployment/plan_builder.go index bcada6660..dc3734287 100644 --- a/pkg/deployment/plan_builder.go +++ b/pkg/deployment/plan_builder.go @@ -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" ) diff --git a/pkg/deployment/plan_executor.go b/pkg/deployment/plan_executor.go index 3ed7caa4b..0bdfe7f7b 100644 --- a/pkg/deployment/plan_executor.go +++ b/pkg/deployment/plan_executor.go @@ -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" ) diff --git a/pkg/deployment/pod_creator.go b/pkg/deployment/pod_creator.go index 0af17af03..d5b0fb3f4 100644 --- a/pkg/deployment/pod_creator.go +++ b/pkg/deployment/pod_creator.go @@ -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" diff --git a/pkg/deployment/pod_inspector.go b/pkg/deployment/pod_inspector.go index 6637b77e5..ef731703e 100644 --- a/pkg/deployment/pod_inspector.go +++ b/pkg/deployment/pod_inspector.go @@ -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" ) diff --git a/pkg/deployment/pvcs.go b/pkg/deployment/pvcs.go index 4847e2a14..9e4a5d292 100644 --- a/pkg/deployment/pvcs.go +++ b/pkg/deployment/pvcs.go @@ -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" ) diff --git a/pkg/deployment/secrets.go b/pkg/deployment/secrets.go index 89b582d95..b84450a22 100644 --- a/pkg/deployment/secrets.go +++ b/pkg/deployment/secrets.go @@ -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" ) diff --git a/pkg/deployment/services.go b/pkg/deployment/services.go index 817685a45..6169b46da 100644 --- a/pkg/deployment/services.go +++ b/pkg/deployment/services.go @@ -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" ) diff --git a/pkg/deployment/tls.go b/pkg/deployment/tls.go index 2bca95432..cd0b1c589 100644 --- a/pkg/deployment/tls.go +++ b/pkg/deployment/tls.go @@ -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" ) diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 193246f40..bc1c04ca6 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -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" diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 3c0e1010b..e8d4c1c9a 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -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" diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index cdfcec583..abb071360 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -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" diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 0c6cb41d1..ff2498822 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -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" diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go new file mode 100644 index 000000000..ded68c938 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go @@ -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 +} diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go new file mode 100644 index 000000000..902312814 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go @@ -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 +} diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go new file mode 100644 index 000000000..f48feba5c --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go new file mode 100644 index 000000000..6055f5176 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go new file mode 100644 index 000000000..1dfe34a38 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go @@ -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 +} diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go new file mode 100644 index 000000000..0c7e30746 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go @@ -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 +} diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go new file mode 100644 index 000000000..2e36f2670 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go @@ -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{} diff --git a/pkg/generated/informers/externalversions/deployment/interface.go b/pkg/generated/informers/externalversions/deployment/interface.go new file mode 100644 index 000000000..80b1c2cd4 --- /dev/null +++ b/pkg/generated/informers/externalversions/deployment/interface.go @@ -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) +} diff --git a/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go b/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go new file mode 100644 index 000000000..c0299c08d --- /dev/null +++ b/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go @@ -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()) +} diff --git a/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go b/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go new file mode 100644 index 000000000..0938ba563 --- /dev/null +++ b/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go @@ -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} +} diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 7d7bdd013..4567c5a62 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -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 { diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index bea2274e2..4f86ef566 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -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" diff --git a/pkg/generated/listers/deployment/v1alpha/arangodeployment.go b/pkg/generated/listers/deployment/v1alpha/arangodeployment.go new file mode 100644 index 000000000..3ad663c7b --- /dev/null +++ b/pkg/generated/listers/deployment/v1alpha/arangodeployment.go @@ -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 +} diff --git a/pkg/generated/listers/deployment/v1alpha/expansion_generated.go b/pkg/generated/listers/deployment/v1alpha/expansion_generated.go new file mode 100644 index 000000000..1e8cad6f6 --- /dev/null +++ b/pkg/generated/listers/deployment/v1alpha/expansion_generated.go @@ -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{} diff --git a/pkg/operator/crd.go b/pkg/operator/crd.go index ff3a1a935..2c81153db 100644 --- a/pkg/operator/crd.go +++ b/pkg/operator/crd.go @@ -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" ) diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 32cb9e649..b3287b516 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -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" diff --git a/pkg/operator/operator_deployment.go b/pkg/operator/operator_deployment.go index 8edfc96e2..201b0c8e1 100644 --- a/pkg/operator/operator_deployment.go +++ b/pkg/operator/operator_deployment.go @@ -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" ) diff --git a/pkg/util/arangod/client.go b/pkg/util/arangod/client.go index 3997e34fb..faa5673ee 100644 --- a/pkg/util/arangod/client.go +++ b/pkg/util/arangod/client.go @@ -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" )