diff --git a/Makefile b/Makefile index 318c0d5..8c7bc56 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ VERSION ?= $(shell git describe --tags --always --dirty) IMAGE ?= mikkeloscar/$(BINARY) TAG ?= $(VERSION) SOURCES = $(shell find . -name '*.go') -GENERATED = pkg/client pkg/apis/amazonaws.com/v1/zz_generated.deepcopy.go +GENERATED = pkg/client pkg/apis/zalando.org/v1/zz_generated.deepcopy.go DOCKERFILE ?= Dockerfile GOPKGS = $(shell go list ./...) BUILD_FLAGS ?= -v diff --git a/README.md b/README.md index 5a45da6..4cd0dc2 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ applications in a namespace you need to define an `AWSIAMRole` resource which references the IAM role you want: ```yaml -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: my-app-iam-role diff --git a/awsiamrole_controller.go b/awsiamrole_controller.go index d90a54e..119899e 100644 --- a/awsiamrole_controller.go +++ b/awsiamrole_controller.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - av1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + av1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" "github.com/mikkeloscar/kube-aws-iam-controller/pkg/clientset" "github.com/mikkeloscar/kube-aws-iam-controller/pkg/recorder" log "github.com/sirupsen/logrus" @@ -120,7 +120,7 @@ func (c *AWSIAMRoleController) refresh() error { return err } - awsIAMRoles, err := c.client.AmazonawsV1().AWSIAMRoles(c.namespace).List(metav1.ListOptions{}) + awsIAMRoles, err := c.client.ZalandoV1().AWSIAMRoles(c.namespace).List(metav1.ListOptions{}) if err != nil { return err } @@ -210,7 +210,7 @@ func (c *AWSIAMRoleController) refresh() error { Expiration: &expiryTime, } - _, err = c.client.AmazonawsV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) + _, err = c.client.ZalandoV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) if err != nil { log.Errorf("Failed to update status for AWSIAMRole %s/%s: %v", awsIAMRole.Namespace, awsIAMRole.Name, err) continue @@ -323,7 +323,7 @@ func (c *AWSIAMRoleController) refresh() error { } // update AWSIAMRole status - _, err = c.client.AmazonawsV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) + _, err = c.client.ZalandoV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) if err != nil { log.Errorf("Failed to update status of AWSIAMRole %s/%s: %v", awsIAMRole.Namespace, awsIAMRole.Name, err) continue @@ -393,7 +393,7 @@ func (c *AWSIAMRoleController) refresh() error { Expiration: &expiryTime, } - _, err = c.client.AmazonawsV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) + _, err = c.client.ZalandoV1().AWSIAMRoles(awsIAMRole.Namespace).UpdateStatus(&awsIAMRole) if err != nil { log.Errorf("Failed to update status of AWSIAMRole %s/%s: %v", awsIAMRole.Namespace, awsIAMRole.Name, err) continue diff --git a/awsiamrole_controller_test.go b/awsiamrole_controller_test.go index 93a8551..c663528 100644 --- a/awsiamrole_controller_test.go +++ b/awsiamrole_controller_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - av1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + av1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" fakeAWS "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/fake" "github.com/mikkeloscar/kube-aws-iam-controller/pkg/clientset" "github.com/stretchr/testify/require" @@ -17,7 +17,7 @@ import ( func TestIsOwnedReference(t *testing.T) { owner := av1.AWSIAMRole{ TypeMeta: metav1.TypeMeta{ - APIVersion: "amazonaws.com/v1", + APIVersion: "zalando.org/v1", Kind: "AWSIAMRole", }, ObjectMeta: metav1.ObjectMeta{ @@ -152,7 +152,7 @@ func TestRefreshAWSIAMRole(tt *testing.T) { client := clientset.NewClientset(kubeClient, awsKubeClient) for _, role := range tc.awsIAMRoles { - _, err := client.AmazonawsV1().AWSIAMRoles("default").Create(&role) + _, err := client.ZalandoV1().AWSIAMRoles("default").Create(&role) require.NoError(t, err) } diff --git a/docs/aws_iam_role_crd.yaml b/docs/aws_iam_role_crd.yaml index 42b8fb8..c3fd4c2 100644 --- a/docs/aws_iam_role_crd.yaml +++ b/docs/aws_iam_role_crd.yaml @@ -1,9 +1,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: awsiamroles.amazonaws.com + name: awsiamroles.zalando.org spec: - group: amazonaws.com + group: zalando.org version: v1 scope: Namespaced names: diff --git a/docs/deployment_with_role.yaml b/docs/deployment_with_role.yaml index 89e412e..24f9d5b 100644 --- a/docs/deployment_with_role.yaml +++ b/docs/deployment_with_role.yaml @@ -41,7 +41,7 @@ spec: secret: secretName: kube-aws-iam-controller-iam-role # name of the AWSIAMRole resource --- -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: kube-aws-iam-controller-iam-role diff --git a/docs/example-app.yaml b/docs/example-app.yaml index 93b8b07..127707a 100644 --- a/docs/example-app.yaml +++ b/docs/example-app.yaml @@ -47,7 +47,7 @@ spec: secret: secretName: my-app-iam-role # name of the AWSIAMRole resource --- -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: my-app-iam-role diff --git a/docs/rbac.yaml b/docs/rbac.yaml index 99a46e0..cf3aeb5 100644 --- a/docs/rbac.yaml +++ b/docs/rbac.yaml @@ -10,7 +10,7 @@ metadata: name: kube-aws-iam-controller rules: - apiGroups: - - "amazonaws.com" + - "zalando.org" resources: - awsiamroles - awsiamroles/status diff --git a/docs/sdk-configuration.md b/docs/sdk-configuration.md index 3a7770d..41394c8 100644 --- a/docs/sdk-configuration.md +++ b/docs/sdk-configuration.md @@ -55,7 +55,7 @@ spec: secret: secretName: aws-iam-java-example # name of the AWSIAMRole resource --- -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: aws-iam-java-example @@ -112,7 +112,7 @@ spec: secret: secretName: aws-iam-python-example # name of the AWSIAMRole resource --- -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: aws-iam-python-example @@ -181,7 +181,7 @@ spec: secret: secretName: aws-iam-golang-example # name of the AWSIAMRole resource --- -apiVersion: amazonaws.com/v1 +apiVersion: zalando.org/v1 kind: AWSIAMRole metadata: name: aws-iam-golang-example diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index b7e9255..ef53cae 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -20,7 +20,7 @@ set -o pipefail SRC="github.com" GOPKG="$SRC/mikkeloscar/kube-aws-iam-controller" -CUSTOM_RESOURCE_NAME="amazonaws.com" +CUSTOM_RESOURCE_NAME="zalando.org" CUSTOM_RESOURCE_VERSION="v1" SCRIPT_ROOT="$(dirname "${BASH_SOURCE[0]}")/.." diff --git a/pkg/apis/amazonaws.com/register.go b/pkg/apis/zalando.org/register.go similarity index 58% rename from pkg/apis/amazonaws.com/register.go rename to pkg/apis/zalando.org/register.go index 43d7c32..ae01281 100644 --- a/pkg/apis/amazonaws.com/register.go +++ b/pkg/apis/zalando.org/register.go @@ -1,6 +1,6 @@ -package amazonaws +package zalando const ( // GroupName is the group name used in this package. - GroupName = "amazonaws.com" + GroupName = "zalando.org" ) diff --git a/pkg/apis/amazonaws.com/v1/register.go b/pkg/apis/zalando.org/v1/register.go similarity index 85% rename from pkg/apis/amazonaws.com/v1/register.go rename to pkg/apis/zalando.org/v1/register.go index 9b21eca..d83d3af 100644 --- a/pkg/apis/amazonaws.com/v1/register.go +++ b/pkg/apis/zalando.org/v1/register.go @@ -1,7 +1,7 @@ package v1 import ( - amazonaws "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com" + zalando "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -15,7 +15,7 @@ var ( ) // SchemeGroupVersion is the group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: amazonaws.GroupName, Version: "v1"} +var SchemeGroupVersion = schema.GroupVersion{Group: zalando.GroupName, Version: "v1"} // Resource takes an unqualified resource and returns a Group-qualified GroupResource. func Resource(resource string) schema.GroupResource { diff --git a/pkg/apis/amazonaws.com/v1/types.go b/pkg/apis/zalando.org/v1/types.go similarity index 100% rename from pkg/apis/amazonaws.com/v1/types.go rename to pkg/apis/zalando.org/v1/types.go diff --git a/pkg/apis/amazonaws.com/v1/zz_generated.deepcopy.go b/pkg/apis/zalando.org/v1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/amazonaws.com/v1/zz_generated.deepcopy.go rename to pkg/apis/zalando.org/v1/zz_generated.deepcopy.go diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 9aebdac..39a8648 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,7 +19,7 @@ limitations under the License. package versioned import ( - amazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/amazonaws.com/v1" + zalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/zalando.org/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -27,27 +27,27 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - AmazonawsV1() amazonawsv1.AmazonawsV1Interface + ZalandoV1() zalandov1.ZalandoV1Interface // Deprecated: please explicitly pick a version if possible. - Amazonaws() amazonawsv1.AmazonawsV1Interface + Zalando() zalandov1.ZalandoV1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - amazonawsV1 *amazonawsv1.AmazonawsV1Client + zalandoV1 *zalandov1.ZalandoV1Client } -// AmazonawsV1 retrieves the AmazonawsV1Client -func (c *Clientset) AmazonawsV1() amazonawsv1.AmazonawsV1Interface { - return c.amazonawsV1 +// ZalandoV1 retrieves the ZalandoV1Client +func (c *Clientset) ZalandoV1() zalandov1.ZalandoV1Interface { + return c.zalandoV1 } -// Deprecated: Amazonaws retrieves the default version of AmazonawsClient. +// Deprecated: Zalando retrieves the default version of ZalandoClient. // Please explicitly pick a version. -func (c *Clientset) Amazonaws() amazonawsv1.AmazonawsV1Interface { - return c.amazonawsV1 +func (c *Clientset) Zalando() zalandov1.ZalandoV1Interface { + return c.zalandoV1 } // Discovery retrieves the DiscoveryClient @@ -66,7 +66,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.amazonawsV1, err = amazonawsv1.NewForConfig(&configShallowCopy) + cs.zalandoV1, err = zalandov1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -82,7 +82,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.amazonawsV1 = amazonawsv1.NewForConfigOrDie(c) + cs.zalandoV1 = zalandov1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -91,7 +91,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.amazonawsV1 = amazonawsv1.New(c) + cs.zalandoV1 = zalandov1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 28ee905..2de717d 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -20,8 +20,8 @@ package fake import ( clientset "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned" - amazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/amazonaws.com/v1" - fakeamazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake" + zalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/zalando.org/v1" + fakezalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/zalando.org/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -71,12 +71,12 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// AmazonawsV1 retrieves the AmazonawsV1Client -func (c *Clientset) AmazonawsV1() amazonawsv1.AmazonawsV1Interface { - return &fakeamazonawsv1.FakeAmazonawsV1{Fake: &c.Fake} +// ZalandoV1 retrieves the ZalandoV1Client +func (c *Clientset) ZalandoV1() zalandov1.ZalandoV1Interface { + return &fakezalandov1.FakeZalandoV1{Fake: &c.Fake} } -// Amazonaws retrieves the AmazonawsV1Client -func (c *Clientset) Amazonaws() amazonawsv1.AmazonawsV1Interface { - return &fakeamazonawsv1.FakeAmazonawsV1{Fake: &c.Fake} +// Zalando retrieves the ZalandoV1Client +func (c *Clientset) Zalando() zalandov1.ZalandoV1Interface { + return &fakezalandov1.FakeZalandoV1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 28d8b78..615ac2e 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - amazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + zalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - amazonawsv1.AddToScheme, + zalandov1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 93ed2f6..6266d97 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - amazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + zalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - amazonawsv1.AddToScheme, + zalandov1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/awsiamrole.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/awsiamrole.go similarity index 97% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/awsiamrole.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/awsiamrole.go index 9487524..cf89688 100644 --- a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/awsiamrole.go +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/awsiamrole.go @@ -21,7 +21,7 @@ package v1 import ( "time" - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" scheme "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -56,7 +56,7 @@ type aWSIAMRoles struct { } // newAWSIAMRoles returns a AWSIAMRoles -func newAWSIAMRoles(c *AmazonawsV1Client, namespace string) *aWSIAMRoles { +func newAWSIAMRoles(c *ZalandoV1Client, namespace string) *aWSIAMRoles { return &aWSIAMRoles{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/doc.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/doc.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/doc.go diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/doc.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_awsiamrole.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_awsiamrole.go similarity index 67% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_awsiamrole.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_awsiamrole.go index 1ccf1d6..dd5c986 100644 --- a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_awsiamrole.go +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_awsiamrole.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - amazonawscomv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + zalandoorgv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeAWSIAMRoles implements AWSIAMRoleInterface type FakeAWSIAMRoles struct { - Fake *FakeAmazonawsV1 + Fake *FakeZalandoV1 ns string } -var awsiamrolesResource = schema.GroupVersionResource{Group: "amazonaws.com", Version: "v1", Resource: "awsiamroles"} +var awsiamrolesResource = schema.GroupVersionResource{Group: "zalando.org", Version: "v1", Resource: "awsiamroles"} -var awsiamrolesKind = schema.GroupVersionKind{Group: "amazonaws.com", Version: "v1", Kind: "AWSIAMRole"} +var awsiamrolesKind = schema.GroupVersionKind{Group: "zalando.org", Version: "v1", Kind: "AWSIAMRole"} // Get takes name of the aWSIAMRole, and returns the corresponding aWSIAMRole object, and an error if there is any. -func (c *FakeAWSIAMRoles) Get(name string, options v1.GetOptions) (result *amazonawscomv1.AWSIAMRole, err error) { +func (c *FakeAWSIAMRoles) Get(name string, options v1.GetOptions) (result *zalandoorgv1.AWSIAMRole, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(awsiamrolesResource, c.ns, name), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewGetAction(awsiamrolesResource, c.ns, name), &zalandoorgv1.AWSIAMRole{}) if obj == nil { return nil, err } - return obj.(*amazonawscomv1.AWSIAMRole), err + return obj.(*zalandoorgv1.AWSIAMRole), err } // List takes label and field selectors, and returns the list of AWSIAMRoles that match those selectors. -func (c *FakeAWSIAMRoles) List(opts v1.ListOptions) (result *amazonawscomv1.AWSIAMRoleList, err error) { +func (c *FakeAWSIAMRoles) List(opts v1.ListOptions) (result *zalandoorgv1.AWSIAMRoleList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(awsiamrolesResource, awsiamrolesKind, c.ns, opts), &amazonawscomv1.AWSIAMRoleList{}) + Invokes(testing.NewListAction(awsiamrolesResource, awsiamrolesKind, c.ns, opts), &zalandoorgv1.AWSIAMRoleList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeAWSIAMRoles) List(opts v1.ListOptions) (result *amazonawscomv1.AWSI if label == nil { label = labels.Everything() } - list := &amazonawscomv1.AWSIAMRoleList{ListMeta: obj.(*amazonawscomv1.AWSIAMRoleList).ListMeta} - for _, item := range obj.(*amazonawscomv1.AWSIAMRoleList).Items { + list := &zalandoorgv1.AWSIAMRoleList{ListMeta: obj.(*zalandoorgv1.AWSIAMRoleList).ListMeta} + for _, item := range obj.(*zalandoorgv1.AWSIAMRoleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeAWSIAMRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a aWSIAMRole and creates it. Returns the server's representation of the aWSIAMRole, and an error, if there is any. -func (c *FakeAWSIAMRoles) Create(aWSIAMRole *amazonawscomv1.AWSIAMRole) (result *amazonawscomv1.AWSIAMRole, err error) { +func (c *FakeAWSIAMRoles) Create(aWSIAMRole *zalandoorgv1.AWSIAMRole) (result *zalandoorgv1.AWSIAMRole, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(awsiamrolesResource, c.ns, aWSIAMRole), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewCreateAction(awsiamrolesResource, c.ns, aWSIAMRole), &zalandoorgv1.AWSIAMRole{}) if obj == nil { return nil, err } - return obj.(*amazonawscomv1.AWSIAMRole), err + return obj.(*zalandoorgv1.AWSIAMRole), err } // Update takes the representation of a aWSIAMRole and updates it. Returns the server's representation of the aWSIAMRole, and an error, if there is any. -func (c *FakeAWSIAMRoles) Update(aWSIAMRole *amazonawscomv1.AWSIAMRole) (result *amazonawscomv1.AWSIAMRole, err error) { +func (c *FakeAWSIAMRoles) Update(aWSIAMRole *zalandoorgv1.AWSIAMRole) (result *zalandoorgv1.AWSIAMRole, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(awsiamrolesResource, c.ns, aWSIAMRole), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewUpdateAction(awsiamrolesResource, c.ns, aWSIAMRole), &zalandoorgv1.AWSIAMRole{}) if obj == nil { return nil, err } - return obj.(*amazonawscomv1.AWSIAMRole), err + return obj.(*zalandoorgv1.AWSIAMRole), 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 *FakeAWSIAMRoles) UpdateStatus(aWSIAMRole *amazonawscomv1.AWSIAMRole) (*amazonawscomv1.AWSIAMRole, error) { +func (c *FakeAWSIAMRoles) UpdateStatus(aWSIAMRole *zalandoorgv1.AWSIAMRole) (*zalandoorgv1.AWSIAMRole, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(awsiamrolesResource, "status", c.ns, aWSIAMRole), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewUpdateSubresourceAction(awsiamrolesResource, "status", c.ns, aWSIAMRole), &zalandoorgv1.AWSIAMRole{}) if obj == nil { return nil, err } - return obj.(*amazonawscomv1.AWSIAMRole), err + return obj.(*zalandoorgv1.AWSIAMRole), err } // Delete takes name of the aWSIAMRole and deletes it. Returns an error if one occurs. func (c *FakeAWSIAMRoles) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(awsiamrolesResource, c.ns, name), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewDeleteAction(awsiamrolesResource, c.ns, name), &zalandoorgv1.AWSIAMRole{}) return err } @@ -124,17 +124,17 @@ func (c *FakeAWSIAMRoles) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeAWSIAMRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(awsiamrolesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &amazonawscomv1.AWSIAMRoleList{}) + _, err := c.Fake.Invokes(action, &zalandoorgv1.AWSIAMRoleList{}) return err } // Patch applies the patch and returns the patched aWSIAMRole. -func (c *FakeAWSIAMRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *amazonawscomv1.AWSIAMRole, err error) { +func (c *FakeAWSIAMRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *zalandoorgv1.AWSIAMRole, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(awsiamrolesResource, c.ns, name, pt, data, subresources...), &amazonawscomv1.AWSIAMRole{}) + Invokes(testing.NewPatchSubresourceAction(awsiamrolesResource, c.ns, name, pt, data, subresources...), &zalandoorgv1.AWSIAMRole{}) if obj == nil { return nil, err } - return obj.(*amazonawscomv1.AWSIAMRole), err + return obj.(*zalandoorgv1.AWSIAMRole), err } diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_amazonaws.com_client.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_zalando.org_client.go similarity index 82% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_amazonaws.com_client.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_zalando.org_client.go index e057db1..ef8734b 100644 --- a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/fake/fake_amazonaws.com_client.go +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_zalando.org_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/zalando.org/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeAmazonawsV1 struct { +type FakeZalandoV1 struct { *testing.Fake } -func (c *FakeAmazonawsV1) AWSIAMRoles(namespace string) v1.AWSIAMRoleInterface { +func (c *FakeZalandoV1) AWSIAMRoles(namespace string) v1.AWSIAMRoleInterface { return &FakeAWSIAMRoles{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeAmazonawsV1) RESTClient() rest.Interface { +func (c *FakeZalandoV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/amazonaws.com_client.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/zalando.org_client.go similarity index 67% rename from pkg/client/clientset/versioned/typed/amazonaws.com/v1/amazonaws.com_client.go rename to pkg/client/clientset/versioned/typed/zalando.org/v1/zalando.org_client.go index 8baa552..ab52ea2 100644 --- a/pkg/client/clientset/versioned/typed/amazonaws.com/v1/amazonaws.com_client.go +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/zalando.org_client.go @@ -19,28 +19,28 @@ limitations under the License. package v1 import ( - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AmazonawsV1Interface interface { +type ZalandoV1Interface interface { RESTClient() rest.Interface AWSIAMRolesGetter } -// AmazonawsV1Client is used to interact with features provided by the amazonaws.com group. -type AmazonawsV1Client struct { +// ZalandoV1Client is used to interact with features provided by the zalando.org group. +type ZalandoV1Client struct { restClient rest.Interface } -func (c *AmazonawsV1Client) AWSIAMRoles(namespace string) AWSIAMRoleInterface { +func (c *ZalandoV1Client) AWSIAMRoles(namespace string) AWSIAMRoleInterface { return newAWSIAMRoles(c, namespace) } -// NewForConfig creates a new AmazonawsV1Client for the given config. -func NewForConfig(c *rest.Config) (*AmazonawsV1Client, error) { +// NewForConfig creates a new ZalandoV1Client for the given config. +func NewForConfig(c *rest.Config) (*ZalandoV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -49,12 +49,12 @@ func NewForConfig(c *rest.Config) (*AmazonawsV1Client, error) { if err != nil { return nil, err } - return &AmazonawsV1Client{client}, nil + return &ZalandoV1Client{client}, nil } -// NewForConfigOrDie creates a new AmazonawsV1Client for the given config and +// NewForConfigOrDie creates a new ZalandoV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AmazonawsV1Client { +func NewForConfigOrDie(c *rest.Config) *ZalandoV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -62,9 +62,9 @@ func NewForConfigOrDie(c *rest.Config) *AmazonawsV1Client { return client } -// New creates a new AmazonawsV1Client for the given RESTClient. -func New(c rest.Interface) *AmazonawsV1Client { - return &AmazonawsV1Client{c} +// New creates a new ZalandoV1Client for the given RESTClient. +func New(c rest.Interface) *ZalandoV1Client { + return &ZalandoV1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -82,7 +82,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AmazonawsV1Client) RESTClient() rest.Interface { +func (c *ZalandoV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index bed6a8b..e833864 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -24,8 +24,8 @@ import ( time "time" versioned "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned" - amazonawscom "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/amazonaws.com" internalinterfaces "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/internalinterfaces" + zalandoorg "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/zalando.org" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -172,9 +172,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Amazonaws() amazonawscom.Interface + Zalando() zalandoorg.Interface } -func (f *sharedInformerFactory) Amazonaws() amazonawscom.Interface { - return amazonawscom.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Zalando() zalandoorg.Interface { + return zalandoorg.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 49dff94..5628419 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -52,9 +52,9 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=amazonaws.com, Version=v1 + // Group=zalando.org, Version=v1 case v1.SchemeGroupVersion.WithResource("awsiamroles"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Amazonaws().V1().AWSIAMRoles().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Zalando().V1().AWSIAMRoles().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/amazonaws.com/interface.go b/pkg/client/informers/externalversions/zalando.org/interface.go similarity index 96% rename from pkg/client/informers/externalversions/amazonaws.com/interface.go rename to pkg/client/informers/externalversions/zalando.org/interface.go index 35198d7..c72eee6 100644 --- a/pkg/client/informers/externalversions/amazonaws.com/interface.go +++ b/pkg/client/informers/externalversions/zalando.org/interface.go @@ -16,11 +16,11 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package amazonaws +package zalando import ( - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/amazonaws.com/v1" internalinterfaces "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/zalando.org/v1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/amazonaws.com/v1/awsiamrole.go b/pkg/client/informers/externalversions/zalando.org/v1/awsiamrole.go similarity index 90% rename from pkg/client/informers/externalversions/amazonaws.com/v1/awsiamrole.go rename to pkg/client/informers/externalversions/zalando.org/v1/awsiamrole.go index e6789bd..0e32912 100644 --- a/pkg/client/informers/externalversions/amazonaws.com/v1/awsiamrole.go +++ b/pkg/client/informers/externalversions/zalando.org/v1/awsiamrole.go @@ -21,10 +21,10 @@ package v1 import ( time "time" - amazonawscomv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + zalandoorgv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" versioned "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned" internalinterfaces "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/listers/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/listers/zalando.org/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,16 +61,16 @@ func NewFilteredAWSIAMRoleInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.AmazonawsV1().AWSIAMRoles(namespace).List(options) + return client.ZalandoV1().AWSIAMRoles(namespace).List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AmazonawsV1().AWSIAMRoles(namespace).Watch(options) + return client.ZalandoV1().AWSIAMRoles(namespace).Watch(options) }, }, - &amazonawscomv1.AWSIAMRole{}, + &zalandoorgv1.AWSIAMRole{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *aWSIAMRoleInformer) defaultInformer(client versioned.Interface, resyncP } func (f *aWSIAMRoleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&amazonawscomv1.AWSIAMRole{}, f.defaultInformer) + return f.factory.InformerFor(&zalandoorgv1.AWSIAMRole{}, f.defaultInformer) } func (f *aWSIAMRoleInformer) Lister() v1.AWSIAMRoleLister { diff --git a/pkg/client/informers/externalversions/amazonaws.com/v1/interface.go b/pkg/client/informers/externalversions/zalando.org/v1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/amazonaws.com/v1/interface.go rename to pkg/client/informers/externalversions/zalando.org/v1/interface.go diff --git a/pkg/client/listers/amazonaws.com/v1/awsiamrole.go b/pkg/client/listers/zalando.org/v1/awsiamrole.go similarity index 97% rename from pkg/client/listers/amazonaws.com/v1/awsiamrole.go rename to pkg/client/listers/zalando.org/v1/awsiamrole.go index b75c19b..c0bfec0 100644 --- a/pkg/client/listers/amazonaws.com/v1/awsiamrole.go +++ b/pkg/client/listers/zalando.org/v1/awsiamrole.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/amazonaws.com/v1" + v1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/apis/zalando.org/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/amazonaws.com/v1/expansion_generated.go b/pkg/client/listers/zalando.org/v1/expansion_generated.go similarity index 100% rename from pkg/client/listers/amazonaws.com/v1/expansion_generated.go rename to pkg/client/listers/zalando.org/v1/expansion_generated.go diff --git a/pkg/clientset/unified.go b/pkg/clientset/unified.go index 1a2ede6..812dd86 100644 --- a/pkg/clientset/unified.go +++ b/pkg/clientset/unified.go @@ -7,7 +7,7 @@ import ( "time" awsiamrole "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned" - amazonawsv1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/amazonaws.com/v1" + zalandov1 "github.com/mikkeloscar/kube-aws-iam-controller/pkg/client/clientset/versioned/typed/zalando.org/v1" discovery "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" admissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" @@ -116,7 +116,7 @@ type Interface interface { // Deprecated: please explicitly pick a version if possible. Storage() storagev1.StorageV1Interface StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface - AmazonawsV1() amazonawsv1.AmazonawsV1Interface + ZalandoV1() zalandov1.ZalandoV1Interface } type Clientset struct { @@ -145,8 +145,8 @@ func NewForConfig(kubeconfig *rest.Config) (*Clientset, error) { return &Clientset{kubeClient, awsIAMRoleClient}, nil } -func (c *Clientset) AmazonawsV1() amazonawsv1.AmazonawsV1Interface { - return c.awsiamrole.AmazonawsV1() +func (c *Clientset) ZalandoV1() zalandov1.ZalandoV1Interface { + return c.awsiamrole.ZalandoV1() } // ConfigureKubeConfig configures a kubeconfig.