Skip to content

Commit

Permalink
Merge pull request #46 from arangodb/rename-api-deployment-dir
Browse files Browse the repository at this point in the history
Renamed pkg/apis/arangodb to pkg/apis/deployment
  • Loading branch information
ewoutp authored Mar 13, 2018
2 parents 03a0950 + 7e9b5ad commit eb60b3b
Show file tree
Hide file tree
Showing 71 changed files with 859 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/deployment/client_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/plan_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/pod_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/pod_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/pvcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/generated/clientset/versioned/fake/clientset_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/fake/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/clientset/versioned/scheme/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Loading

0 comments on commit eb60b3b

Please sign in to comment.