diff --git a/Makefile b/Makefile index 2be9baa14..29ec15883 100644 --- a/Makefile +++ b/Makefile @@ -208,7 +208,7 @@ run-unit-tests: $(GOBUILDDIR) $(SOURCES) -w /usr/code/ \ golang:$(GOVERSION) \ go test $(TESTVERBOSEOPTIONS) \ - $(REPOPATH)/pkg/apis/arangodb/v1alpha \ + $(REPOPATH)/pkg/apis/deployment/v1alpha \ $(REPOPATH)/pkg/deployment \ $(REPOPATH)/pkg/util/k8sutil \ $(REPOPATH)/pkg/util/k8sutil/test diff --git a/pkg/deployment/plan_builder_test.go b/pkg/deployment/plan_builder_test.go index dd9a29b73..b03e06125 100644 --- a/pkg/deployment/plan_builder_test.go +++ b/pkg/deployment/plan_builder_test.go @@ -29,7 +29,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha" + api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha" ) // TestCreatePlanSingleScale creates a `single` deployment to test the creating of scaling plan. diff --git a/pkg/deployment/pod_creator_agent_args_test.go b/pkg/deployment/pod_creator_agent_args_test.go index a7260ab4b..35b2f0d22 100644 --- a/pkg/deployment/pod_creator_agent_args_test.go +++ b/pkg/deployment/pod_creator_agent_args_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" 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" ) // TestCreateArangodArgsAgent tests createArangodArgs for agent. diff --git a/pkg/deployment/pod_creator_coordinator_args_test.go b/pkg/deployment/pod_creator_coordinator_args_test.go index b4050dd8b..3a6e150fe 100644 --- a/pkg/deployment/pod_creator_coordinator_args_test.go +++ b/pkg/deployment/pod_creator_coordinator_args_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" 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" ) // TestCreateArangodArgsCoordinator tests createArangodArgs for coordinator. diff --git a/pkg/deployment/pod_creator_dbserver_args_test.go b/pkg/deployment/pod_creator_dbserver_args_test.go index e323d066e..3e345e62a 100644 --- a/pkg/deployment/pod_creator_dbserver_args_test.go +++ b/pkg/deployment/pod_creator_dbserver_args_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" 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" ) // TestCreateArangodArgsDBServer tests createArangodArgs for dbserver. diff --git a/pkg/deployment/pod_creator_single_args_test.go b/pkg/deployment/pod_creator_single_args_test.go index da26ac0cc..fc93a1913 100644 --- a/pkg/deployment/pod_creator_single_args_test.go +++ b/pkg/deployment/pod_creator_single_args_test.go @@ -27,7 +27,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/stretchr/testify/assert" ) diff --git a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/arangodb_client.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/arangodb_client.go deleted file mode 100644 index 4664fce35..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/arangodb_client.go +++ /dev/null @@ -1,91 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/arangodeployment.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/arangodeployment.go deleted file mode 100644 index 0171f0fd9..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/arangodeployment.go +++ /dev/null @@ -1,175 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/doc.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/doc.go deleted file mode 100644 index f48feba5c..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// -// 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/arangodb/v1alpha/fake/doc.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/doc.go deleted file mode 100644 index 6055f5176..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// -// 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/arangodb/v1alpha/fake/fake_arangodb_client.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/fake_arangodb_client.go deleted file mode 100644 index 33b8595ff..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/fake_arangodb_client.go +++ /dev/null @@ -1,41 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/fake/fake_arangodeployment.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/fake_arangodeployment.go deleted file mode 100644 index b1bf592b8..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/fake/fake_arangodeployment.go +++ /dev/null @@ -1,141 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/generated_expansion.go b/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/generated_expansion.go deleted file mode 100644 index 2e36f2670..000000000 --- a/pkg/generated/clientset/versioned/typed/arangodb/v1alpha/generated_expansion.go +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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/arangodb/interface.go b/pkg/generated/informers/externalversions/arangodb/interface.go deleted file mode 100644 index 85e3563bb..000000000 --- a/pkg/generated/informers/externalversions/arangodb/interface.go +++ /dev/null @@ -1,50 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/arangodeployment.go b/pkg/generated/informers/externalversions/arangodb/v1alpha/arangodeployment.go deleted file mode 100644 index 05a8c420e..000000000 --- a/pkg/generated/informers/externalversions/arangodb/v1alpha/arangodeployment.go +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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" - - arangodb_v1alpha "github.com/arangodb/k8s-operator/pkg/apis/arangodb/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/arangodb/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) - }, - }, - &arangodb_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(&arangodb_v1alpha.ArangoDeployment{}, f.defaultInformer) -} - -func (f *arangoDeploymentInformer) Lister() v1alpha.ArangoDeploymentLister { - return v1alpha.NewArangoDeploymentLister(f.Informer().GetIndexer()) -} diff --git a/pkg/generated/informers/externalversions/arangodb/v1alpha/interface.go b/pkg/generated/informers/externalversions/arangodb/v1alpha/interface.go deleted file mode 100644 index 0938ba563..000000000 --- a/pkg/generated/informers/externalversions/arangodb/v1alpha/interface.go +++ /dev/null @@ -1,49 +0,0 @@ -// -// 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/listers/arangodb/v1alpha/arangodeployment.go b/pkg/generated/listers/arangodb/v1alpha/arangodeployment.go deleted file mode 100644 index dabc986f9..000000000 --- a/pkg/generated/listers/arangodb/v1alpha/arangodeployment.go +++ /dev/null @@ -1,98 +0,0 @@ -// -// 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/arangodb/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/arangodb/v1alpha/expansion_generated.go b/pkg/generated/listers/arangodb/v1alpha/expansion_generated.go deleted file mode 100644 index 1e8cad6f6..000000000 --- a/pkg/generated/listers/arangodb/v1alpha/expansion_generated.go +++ /dev/null @@ -1,31 +0,0 @@ -// -// 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/util/k8sutil/test/events_test.go b/pkg/util/k8sutil/test/events_test.go index 8aba4097d..42b619eef 100644 --- a/pkg/util/k8sutil/test/events_test.go +++ b/pkg/util/k8sutil/test/events_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/api/core/v1" 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/tests/auth_test.go b/tests/auth_test.go index 8cf95d8ba..5779db81b 100644 --- a/tests/auth_test.go +++ b/tests/auth_test.go @@ -8,7 +8,7 @@ import ( "github.com/dchest/uniuri" - 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/client" "github.com/arangodb/k8s-operator/pkg/util/arangod" "github.com/arangodb/k8s-operator/pkg/util/k8sutil" diff --git a/tests/predicates.go b/tests/predicates.go index 6971f48ed..934ec57a1 100644 --- a/tests/predicates.go +++ b/tests/predicates.go @@ -25,7 +25,7 @@ package tests import ( "fmt" - api "github.com/arangodb/k8s-operator/pkg/apis/arangodb/v1alpha" + api "github.com/arangodb/k8s-operator/pkg/apis/deployment/v1alpha" ) // deploymentHasState creates a predicate that returns nil when the deployment has the given state. diff --git a/tests/rocksdb_encryption_test.go b/tests/rocksdb_encryption_test.go index d8d141f44..b180fe5d9 100644 --- a/tests/rocksdb_encryption_test.go +++ b/tests/rocksdb_encryption_test.go @@ -8,7 +8,7 @@ import ( "github.com/dchest/uniuri" - 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/client" "github.com/arangodb/k8s-operator/pkg/util/k8sutil" ) diff --git a/tests/scale_test.go b/tests/scale_test.go index 81ea39aea..f1967b465 100644 --- a/tests/scale_test.go +++ b/tests/scale_test.go @@ -7,7 +7,7 @@ import ( "github.com/dchest/uniuri" 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/client" ) diff --git a/tests/simple_test.go b/tests/simple_test.go index 0731e1a5c..729ca6f9d 100644 --- a/tests/simple_test.go +++ b/tests/simple_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" 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/client" ) diff --git a/tests/test_util.go b/tests/test_util.go index 254d5a6e3..76d1fd34c 100644 --- a/tests/test_util.go +++ b/tests/test_util.go @@ -37,7 +37,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 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/generated/clientset/versioned" "github.com/arangodb/k8s-operator/pkg/util/arangod" "github.com/arangodb/k8s-operator/pkg/util/k8sutil"