From a2657dd697f9eab0451cfff1deaf653a6827b9a7 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 12 Aug 2019 23:59:33 +0200 Subject: [PATCH 1/5] Change copyright name to "Flux CD contributors" --- hack/custom-boilerplate.go.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/custom-boilerplate.go.txt b/hack/custom-boilerplate.go.txt index 515584866..ed8755e2d 100644 --- a/hack/custom-boilerplate.go.txt +++ b/hack/custom-boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From ac335a56ddc0f0c2229e90bbe7c21aa3c55150c1 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 13 Aug 2019 00:01:42 +0200 Subject: [PATCH 2/5] Remove helm.integrations.flux.weave.works This includes the FluxHelmRelease custom resource. --- hack/update-codegen.sh | 2 +- .../register.go | 5 - .../v1alpha2/doc.go | 5 - .../v1alpha2/register.go | 42 ----- .../v1alpha2/types.go | 68 ------- .../v1alpha2/types_test.go | 52 ------ .../v1alpha2/zz_generated.deepcopy.go | 125 ------------- pkg/client/clientset/versioned/clientset.go | 16 +- .../versioned/fake/clientset_generated.go | 7 - .../clientset/versioned/fake/register.go | 2 - .../clientset/versioned/scheme/register.go | 2 - .../v1alpha2/doc.go | 20 -- .../v1alpha2/fake/doc.go | 20 -- .../v1alpha2/fake/fake_fluxhelmrelease.go | 128 ------------- ...lm.integrations.flux.weave.works_client.go | 40 ---- .../v1alpha2/fluxhelmrelease.go | 174 ------------------ .../v1alpha2/generated_expansion.go | 21 --- ...lm.integrations.flux.weave.works_client.go | 90 --------- .../informers/externalversions/factory.go | 8 +- .../flux.weave.works/interface.go | 2 +- .../flux.weave.works/v1beta1/helmrelease.go | 2 +- .../flux.weave.works/v1beta1/interface.go | 2 +- .../informers/externalversions/generic.go | 7 +- .../interface.go | 46 ----- .../v1alpha2/fluxhelmrelease.go | 89 --------- .../v1alpha2/interface.go | 45 ----- .../internalinterfaces/factory_interfaces.go | 2 +- .../v1alpha2/expansion_generated.go | 27 --- .../v1alpha2/fluxhelmrelease.go | 94 ---------- 29 files changed, 8 insertions(+), 1135 deletions(-) delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/register.go delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/v1alpha2/doc.go delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/v1alpha2/register.go delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types.go delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types_test.go delete mode 100644 pkg/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/doc.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/doc.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_fluxhelmrelease.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_helm.integrations.flux.weave.works_client.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/generated_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/helm.integrations.flux.weave.works_client.go delete mode 100644 pkg/client/informers/externalversions/helm.integrations.flux.weave.works/interface.go delete mode 100644 pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go delete mode 100644 pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go delete mode 100644 pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/expansion_generated.go delete mode 100644 pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 80bc01758..a12ad93d5 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -31,7 +31,7 @@ chmod +x ${CODEGEN_PKG}/generate-groups.sh # :magic: ${CODEGEN_PKG}/generate-groups.sh all \ github.com/fluxcd/helm-operator/pkg/client github.com/fluxcd/helm-operator/pkg/apis \ - "flux.weave.works:v1beta1 helm.integrations.flux.weave.works:v1alpha2" \ + "flux.weave.works:v1beta1" \ --output-base "${TEMP_DIR}" \ --go-header-file "${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt" diff --git a/pkg/apis/helm.integrations.flux.weave.works/register.go b/pkg/apis/helm.integrations.flux.weave.works/register.go deleted file mode 100644 index 3904814b4..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/register.go +++ /dev/null @@ -1,5 +0,0 @@ -package fluxintegrations - -const ( - GroupName = "helm.integrations.flux.weave.works" -) diff --git a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/doc.go b/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/doc.go deleted file mode 100644 index 7a0d95014..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +k8s:deepcopy-gen=package,register - -// Package v1 is the v1 version of the API. -// +groupName=helm.integrations.flux.weave.works -package v1alpha2 diff --git a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/register.go b/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/register.go deleted file mode 100644 index 4a2763465..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/register.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - - fluxintegrations "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: fluxintegrations.GroupName, Version: "v1alpha2"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // AddToScheme will stay in k8s.io/kubernetes. - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &FluxHelmRelease{}, - &FluxHelmReleaseList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types.go b/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types.go deleted file mode 100644 index e898cdfbc..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types.go +++ /dev/null @@ -1,68 +0,0 @@ -package v1alpha2 - -import ( - "github.com/ghodss/yaml" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/helm/pkg/chartutil" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// FluxHelmRelease represents custom resource associated with a Helm Chart -type FluxHelmRelease struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec FluxHelmReleaseSpec `json:"spec"` - Status FluxHelmReleaseStatus `json:"status"` -} - -// FluxHelmReleaseSpec is the spec for a FluxHelmRelease resource -// FluxHelmReleaseSpec -type FluxHelmReleaseSpec struct { - ChartGitPath string `json:"chartGitPath"` - ReleaseName string `json:"releaseName,omitempty"` - ValueFileSecrets []v1.LocalObjectReference `json:"valueFileSecrets,omitempty"` - FluxHelmValues `json:",inline"` -} - -type FluxHelmReleaseStatus struct { - ReleaseStatus string `json:"releaseStatus"` -} - -// FluxHelmValues embeds chartutil.Values so we can implement deepcopy on map[string]interface{} -// +k8s:deepcopy-gen=false -type FluxHelmValues struct { - chartutil.Values `json:"values,omitempty"` -} - -// DeepCopyInto implements deepcopy-gen method for use in generated code -func (in *FluxHelmValues) DeepCopyInto(out *FluxHelmValues) { - if in == nil { - return - } - - b, err := yaml.Marshal(in.Values) - if err != nil { - return - } - var values chartutil.Values - err = yaml.Unmarshal(b, &values) - if err != nil { - return - } - out.Values = values -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// FluxHelmReleaseList is a list of FluxHelmRelease resources -type FluxHelmReleaseList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []FluxHelmRelease `json:"items"` -} diff --git a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types_test.go b/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types_test.go deleted file mode 100644 index 2c9b668e3..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/types_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package v1alpha2 - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestFluxHelmValues(t *testing.T) { - testCases := []struct { - original *FluxHelmValues - transformer func(v *FluxHelmValues) *FluxHelmValues - expectedCopy *FluxHelmValues - expectedOriginal *FluxHelmValues - }{ - // reassignment - { - original: nil, - transformer: func(v *FluxHelmValues) *FluxHelmValues { - return &FluxHelmValues{} - }, - expectedCopy: &FluxHelmValues{}, - expectedOriginal: nil, - }, - // mutation - { - original: &FluxHelmValues{Values: map[string]interface{}{}}, - transformer: func(v *FluxHelmValues) *FluxHelmValues { - v.Values["foo"] = "bar" - return v - }, - expectedCopy: &FluxHelmValues{Values: map[string]interface{}{"foo": "bar"}}, - expectedOriginal: &FluxHelmValues{Values: map[string]interface{}{}}, - }, - { - original: &FluxHelmValues{Values: map[string]interface{}{"foo": map[string]interface{}{"bar": "baz"}}}, - transformer: func(v *FluxHelmValues) *FluxHelmValues { - v.Values["foo"] = map[string]interface{}{"bar": "oof"} - return v - }, - expectedCopy: &FluxHelmValues{Values: map[string]interface{}{"foo": map[string]interface{}{"bar": "oof"}}}, - expectedOriginal: &FluxHelmValues{Values: map[string]interface{}{"foo": map[string]interface{}{"bar": "baz"}}}, - }, - } - - for i, tc := range testCases { - output := &FluxHelmValues{} - tc.original.DeepCopyInto(output) - assert.Exactly(t, tc.expectedCopy, tc.transformer(output), "copy was not mutated. test case: %d", i) - assert.Exactly(t, tc.expectedOriginal, tc.original, "original was mutated. test case: %d", i) - } -} diff --git a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go deleted file mode 100644 index a1ac33d99..000000000 --- a/pkg/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go +++ /dev/null @@ -1,125 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluxHelmRelease) DeepCopyInto(out *FluxHelmRelease) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmRelease. -func (in *FluxHelmRelease) DeepCopy() *FluxHelmRelease { - if in == nil { - return nil - } - out := new(FluxHelmRelease) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FluxHelmRelease) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluxHelmReleaseList) DeepCopyInto(out *FluxHelmReleaseList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]FluxHelmRelease, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseList. -func (in *FluxHelmReleaseList) DeepCopy() *FluxHelmReleaseList { - if in == nil { - return nil - } - out := new(FluxHelmReleaseList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FluxHelmReleaseList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluxHelmReleaseSpec) DeepCopyInto(out *FluxHelmReleaseSpec) { - *out = *in - if in.ValueFileSecrets != nil { - in, out := &in.ValueFileSecrets, &out.ValueFileSecrets - *out = make([]v1.LocalObjectReference, len(*in)) - copy(*out, *in) - } - in.FluxHelmValues.DeepCopyInto(&out.FluxHelmValues) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseSpec. -func (in *FluxHelmReleaseSpec) DeepCopy() *FluxHelmReleaseSpec { - if in == nil { - return nil - } - out := new(FluxHelmReleaseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FluxHelmReleaseStatus) DeepCopyInto(out *FluxHelmReleaseStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseStatus. -func (in *FluxHelmReleaseStatus) DeepCopy() *FluxHelmReleaseStatus { - if in == nil { - return nil - } - out := new(FluxHelmReleaseStatus) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index faba7450f..0b1943da2 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,7 +20,6 @@ package versioned import ( fluxv1beta1 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/flux.weave.works/v1beta1" - helmv1alpha2 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -29,15 +28,13 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface FluxV1beta1() fluxv1beta1.FluxV1beta1Interface - HelmV1alpha2() helmv1alpha2.HelmV1alpha2Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - fluxV1beta1 *fluxv1beta1.FluxV1beta1Client - helmV1alpha2 *helmv1alpha2.HelmV1alpha2Client + fluxV1beta1 *fluxv1beta1.FluxV1beta1Client } // FluxV1beta1 retrieves the FluxV1beta1Client @@ -45,11 +42,6 @@ func (c *Clientset) FluxV1beta1() fluxv1beta1.FluxV1beta1Interface { return c.fluxV1beta1 } -// HelmV1alpha2 retrieves the HelmV1alpha2Client -func (c *Clientset) HelmV1alpha2() helmv1alpha2.HelmV1alpha2Interface { - return c.helmV1alpha2 -} - // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -70,10 +62,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.helmV1alpha2, err = helmv1alpha2.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { @@ -87,7 +75,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset cs.fluxV1beta1 = fluxv1beta1.NewForConfigOrDie(c) - cs.helmV1alpha2 = helmv1alpha2.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -97,7 +84,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.fluxV1beta1 = fluxv1beta1.New(c) - cs.helmV1alpha2 = helmv1alpha2.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 ae4d7f294..c09917b2e 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -22,8 +22,6 @@ import ( clientset "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned" fluxv1beta1 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/flux.weave.works/v1beta1" fakefluxv1beta1 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake" - helmv1alpha2 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2" - fakehelmv1alpha2 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -77,8 +75,3 @@ var _ clientset.Interface = &Clientset{} func (c *Clientset) FluxV1beta1() fluxv1beta1.FluxV1beta1Interface { return &fakefluxv1beta1.FakeFluxV1beta1{Fake: &c.Fake} } - -// HelmV1alpha2 retrieves the HelmV1alpha2Client -func (c *Clientset) HelmV1alpha2() helmv1alpha2.HelmV1alpha2Interface { - return &fakehelmv1alpha2.FakeHelmV1alpha2{Fake: &c.Fake} -} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 0e5484725..e950d4c7c 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -20,7 +20,6 @@ package fake import ( fluxv1beta1 "github.com/fluxcd/helm-operator/pkg/apis/flux.weave.works/v1beta1" - helmv1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +32,6 @@ var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ fluxv1beta1.AddToScheme, - helmv1alpha2.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 bdf00898a..ab9c4a740 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -20,7 +20,6 @@ package scheme import ( fluxv1beta1 "github.com/fluxcd/helm-operator/pkg/apis/flux.weave.works/v1beta1" - helmv1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +32,6 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ fluxv1beta1.AddToScheme, - helmv1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/doc.go deleted file mode 100644 index 36dbcad74..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha2 diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/doc.go deleted file mode 100644 index c13844a4d..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_fluxhelmrelease.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_fluxhelmrelease.go deleted file mode 100644 index 31bda8898..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_fluxhelmrelease.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" - 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" -) - -// FakeFluxHelmReleases implements FluxHelmReleaseInterface -type FakeFluxHelmReleases struct { - Fake *FakeHelmV1alpha2 - ns string -} - -var fluxhelmreleasesResource = schema.GroupVersionResource{Group: "helm.integrations.flux.weave.works", Version: "v1alpha2", Resource: "fluxhelmreleases"} - -var fluxhelmreleasesKind = schema.GroupVersionKind{Group: "helm.integrations.flux.weave.works", Version: "v1alpha2", Kind: "FluxHelmRelease"} - -// Get takes name of the fluxHelmRelease, and returns the corresponding fluxHelmRelease object, and an error if there is any. -func (c *FakeFluxHelmReleases) Get(name string, options v1.GetOptions) (result *v1alpha2.FluxHelmRelease, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(fluxhelmreleasesResource, c.ns, name), &v1alpha2.FluxHelmRelease{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.FluxHelmRelease), err -} - -// List takes label and field selectors, and returns the list of FluxHelmReleases that match those selectors. -func (c *FakeFluxHelmReleases) List(opts v1.ListOptions) (result *v1alpha2.FluxHelmReleaseList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(fluxhelmreleasesResource, fluxhelmreleasesKind, c.ns, opts), &v1alpha2.FluxHelmReleaseList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.FluxHelmReleaseList{ListMeta: obj.(*v1alpha2.FluxHelmReleaseList).ListMeta} - for _, item := range obj.(*v1alpha2.FluxHelmReleaseList).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 fluxHelmReleases. -func (c *FakeFluxHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(fluxhelmreleasesResource, c.ns, opts)) - -} - -// Create takes the representation of a fluxHelmRelease and creates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any. -func (c *FakeFluxHelmReleases) Create(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(fluxhelmreleasesResource, c.ns, fluxHelmRelease), &v1alpha2.FluxHelmRelease{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.FluxHelmRelease), err -} - -// Update takes the representation of a fluxHelmRelease and updates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any. -func (c *FakeFluxHelmReleases) Update(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(fluxhelmreleasesResource, c.ns, fluxHelmRelease), &v1alpha2.FluxHelmRelease{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.FluxHelmRelease), err -} - -// Delete takes name of the fluxHelmRelease and deletes it. Returns an error if one occurs. -func (c *FakeFluxHelmReleases) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(fluxhelmreleasesResource, c.ns, name), &v1alpha2.FluxHelmRelease{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFluxHelmReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(fluxhelmreleasesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha2.FluxHelmReleaseList{}) - return err -} - -// Patch applies the patch and returns the patched fluxHelmRelease. -func (c *FakeFluxHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.FluxHelmRelease, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(fluxhelmreleasesResource, c.ns, name, pt, data, subresources...), &v1alpha2.FluxHelmRelease{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.FluxHelmRelease), err -} diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_helm.integrations.flux.weave.works_client.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_helm.integrations.flux.weave.works_client.go deleted file mode 100644 index 405a28878..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fake/fake_helm.integrations.flux.weave.works_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha2 "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeHelmV1alpha2 struct { - *testing.Fake -} - -func (c *FakeHelmV1alpha2) FluxHelmReleases(namespace string) v1alpha2.FluxHelmReleaseInterface { - return &FakeFluxHelmReleases{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeHelmV1alpha2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go deleted file mode 100644 index 948803dc5..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "time" - - v1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" - scheme "github.com/fluxcd/helm-operator/pkg/client/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" -) - -// FluxHelmReleasesGetter has a method to return a FluxHelmReleaseInterface. -// A group's client should implement this interface. -type FluxHelmReleasesGetter interface { - FluxHelmReleases(namespace string) FluxHelmReleaseInterface -} - -// FluxHelmReleaseInterface has methods to work with FluxHelmRelease resources. -type FluxHelmReleaseInterface interface { - Create(*v1alpha2.FluxHelmRelease) (*v1alpha2.FluxHelmRelease, error) - Update(*v1alpha2.FluxHelmRelease) (*v1alpha2.FluxHelmRelease, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.FluxHelmRelease, error) - List(opts v1.ListOptions) (*v1alpha2.FluxHelmReleaseList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.FluxHelmRelease, err error) - FluxHelmReleaseExpansion -} - -// fluxHelmReleases implements FluxHelmReleaseInterface -type fluxHelmReleases struct { - client rest.Interface - ns string -} - -// newFluxHelmReleases returns a FluxHelmReleases -func newFluxHelmReleases(c *HelmV1alpha2Client, namespace string) *fluxHelmReleases { - return &fluxHelmReleases{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the fluxHelmRelease, and returns the corresponding fluxHelmRelease object, and an error if there is any. -func (c *fluxHelmReleases) Get(name string, options v1.GetOptions) (result *v1alpha2.FluxHelmRelease, err error) { - result = &v1alpha2.FluxHelmRelease{} - err = c.client.Get(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FluxHelmReleases that match those selectors. -func (c *fluxHelmReleases) List(opts v1.ListOptions) (result *v1alpha2.FluxHelmReleaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.FluxHelmReleaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested fluxHelmReleases. -func (c *fluxHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch() -} - -// Create takes the representation of a fluxHelmRelease and creates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any. -func (c *fluxHelmReleases) Create(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) { - result = &v1alpha2.FluxHelmRelease{} - err = c.client.Post(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - Body(fluxHelmRelease). - Do(). - Into(result) - return -} - -// Update takes the representation of a fluxHelmRelease and updates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any. -func (c *fluxHelmReleases) Update(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) { - result = &v1alpha2.FluxHelmRelease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - Name(fluxHelmRelease.Name). - Body(fluxHelmRelease). - Do(). - Into(result) - return -} - -// Delete takes name of the fluxHelmRelease and deletes it. Returns an error if one occurs. -func (c *fluxHelmReleases) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *fluxHelmReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("fluxhelmreleases"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Timeout(timeout). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched fluxHelmRelease. -func (c *fluxHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.FluxHelmRelease, err error) { - result = &v1alpha2.FluxHelmRelease{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("fluxhelmreleases"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/generated_expansion.go deleted file mode 100644 index d1237ad0f..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -type FluxHelmReleaseExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/helm.integrations.flux.weave.works_client.go b/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/helm.integrations.flux.weave.works_client.go deleted file mode 100644 index e94169a37..000000000 --- a/pkg/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/helm.integrations.flux.weave.works_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" - "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type HelmV1alpha2Interface interface { - RESTClient() rest.Interface - FluxHelmReleasesGetter -} - -// HelmV1alpha2Client is used to interact with features provided by the helm.integrations.flux.weave.works group. -type HelmV1alpha2Client struct { - restClient rest.Interface -} - -func (c *HelmV1alpha2Client) FluxHelmReleases(namespace string) FluxHelmReleaseInterface { - return newFluxHelmReleases(c, namespace) -} - -// NewForConfig creates a new HelmV1alpha2Client for the given config. -func NewForConfig(c *rest.Config) (*HelmV1alpha2Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &HelmV1alpha2Client{client}, nil -} - -// NewForConfigOrDie creates a new HelmV1alpha2Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *HelmV1alpha2Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new HelmV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *HelmV1alpha2Client { - return &HelmV1alpha2Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.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 *HelmV1alpha2Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index b4bd63d2b..5ad8ec81d 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import ( versioned "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned" fluxweaveworks "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/flux.weave.works" - helmintegrationsfluxweaveworks "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/helm.integrations.flux.weave.works" internalinterfaces "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -174,13 +173,8 @@ type SharedInformerFactory interface { WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool Flux() fluxweaveworks.Interface - Helm() helmintegrationsfluxweaveworks.Interface } func (f *sharedInformerFactory) Flux() fluxweaveworks.Interface { return fluxweaveworks.New(f, f.namespace, f.tweakListOptions) } - -func (f *sharedInformerFactory) Helm() helmintegrationsfluxweaveworks.Interface { - return helmintegrationsfluxweaveworks.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/client/informers/externalversions/flux.weave.works/interface.go b/pkg/client/informers/externalversions/flux.weave.works/interface.go index aa55a89f3..705692949 100644 --- a/pkg/client/informers/externalversions/flux.weave.works/interface.go +++ b/pkg/client/informers/externalversions/flux.weave.works/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/flux.weave.works/v1beta1/helmrelease.go b/pkg/client/informers/externalversions/flux.weave.works/v1beta1/helmrelease.go index 68fe8ec66..0ad320f9d 100644 --- a/pkg/client/informers/externalversions/flux.weave.works/v1beta1/helmrelease.go +++ b/pkg/client/informers/externalversions/flux.weave.works/v1beta1/helmrelease.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/flux.weave.works/v1beta1/interface.go b/pkg/client/informers/externalversions/flux.weave.works/v1beta1/interface.go index 8b9a566fa..4bf1f5ff2 100644 --- a/pkg/client/informers/externalversions/flux.weave.works/v1beta1/interface.go +++ b/pkg/client/informers/externalversions/flux.weave.works/v1beta1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index ac838ec45..1bcf4fe99 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( "fmt" v1beta1 "github.com/fluxcd/helm-operator/pkg/apis/flux.weave.works/v1beta1" - v1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -57,10 +56,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1beta1.SchemeGroupVersion.WithResource("helmreleases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flux().V1beta1().HelmReleases().Informer()}, nil - // Group=helm.integrations.flux.weave.works, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("fluxhelmreleases"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Helm().V1alpha2().FluxHelmReleases().Informer()}, nil - } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/interface.go b/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/interface.go deleted file mode 100644 index 9a7ba2e94..000000000 --- a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package helm - -import ( - v1alpha2 "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2" - internalinterfaces "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.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} -} - -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go b/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go deleted file mode 100644 index 078140158..000000000 --- a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - time "time" - - helmintegrationsfluxweaveworksv1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" - versioned "github.com/fluxcd/helm-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/fluxcd/helm-operator/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2" - 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" -) - -// FluxHelmReleaseInformer provides access to a shared informer and lister for -// FluxHelmReleases. -type FluxHelmReleaseInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.FluxHelmReleaseLister -} - -type fluxHelmReleaseInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewFluxHelmReleaseInformer constructs a new informer for FluxHelmRelease 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 NewFluxHelmReleaseInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredFluxHelmReleaseInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredFluxHelmReleaseInformer constructs a new informer for FluxHelmRelease 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 NewFilteredFluxHelmReleaseInformer(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.HelmV1alpha2().FluxHelmReleases(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.HelmV1alpha2().FluxHelmReleases(namespace).Watch(options) - }, - }, - &helmintegrationsfluxweaveworksv1alpha2.FluxHelmRelease{}, - resyncPeriod, - indexers, - ) -} - -func (f *fluxHelmReleaseInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredFluxHelmReleaseInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *fluxHelmReleaseInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&helmintegrationsfluxweaveworksv1alpha2.FluxHelmRelease{}, f.defaultInformer) -} - -func (f *fluxHelmReleaseInformer) Lister() v1alpha2.FluxHelmReleaseLister { - return v1alpha2.NewFluxHelmReleaseLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go b/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go deleted file mode 100644 index e88b849f4..000000000 --- a/pkg/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - internalinterfaces "github.com/fluxcd/helm-operator/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // FluxHelmReleases returns a FluxHelmReleaseInformer. - FluxHelmReleases() FluxHelmReleaseInformer -} - -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} -} - -// FluxHelmReleases returns a FluxHelmReleaseInformer. -func (v *version) FluxHelmReleases() FluxHelmReleaseInformer { - return &fluxHelmReleaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 5115a13b6..b38e83298 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2018 Weaveworks Ltd. +Copyright 2018-2019 The Flux CD contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/expansion_generated.go b/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/expansion_generated.go deleted file mode 100644 index fb01867ba..000000000 --- a/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -// FluxHelmReleaseListerExpansion allows custom methods to be added to -// FluxHelmReleaseLister. -type FluxHelmReleaseListerExpansion interface{} - -// FluxHelmReleaseNamespaceListerExpansion allows custom methods to be added to -// FluxHelmReleaseNamespaceLister. -type FluxHelmReleaseNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go b/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go deleted file mode 100644 index eb3009e4b..000000000 --- a/pkg/client/listers/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2018 Weaveworks Ltd. - -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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1alpha2 "github.com/fluxcd/helm-operator/pkg/apis/helm.integrations.flux.weave.works/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// FluxHelmReleaseLister helps list FluxHelmReleases. -type FluxHelmReleaseLister interface { - // List lists all FluxHelmReleases in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.FluxHelmRelease, err error) - // FluxHelmReleases returns an object that can list and get FluxHelmReleases. - FluxHelmReleases(namespace string) FluxHelmReleaseNamespaceLister - FluxHelmReleaseListerExpansion -} - -// fluxHelmReleaseLister implements the FluxHelmReleaseLister interface. -type fluxHelmReleaseLister struct { - indexer cache.Indexer -} - -// NewFluxHelmReleaseLister returns a new FluxHelmReleaseLister. -func NewFluxHelmReleaseLister(indexer cache.Indexer) FluxHelmReleaseLister { - return &fluxHelmReleaseLister{indexer: indexer} -} - -// List lists all FluxHelmReleases in the indexer. -func (s *fluxHelmReleaseLister) List(selector labels.Selector) (ret []*v1alpha2.FluxHelmRelease, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.FluxHelmRelease)) - }) - return ret, err -} - -// FluxHelmReleases returns an object that can list and get FluxHelmReleases. -func (s *fluxHelmReleaseLister) FluxHelmReleases(namespace string) FluxHelmReleaseNamespaceLister { - return fluxHelmReleaseNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// FluxHelmReleaseNamespaceLister helps list and get FluxHelmReleases. -type FluxHelmReleaseNamespaceLister interface { - // List lists all FluxHelmReleases in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha2.FluxHelmRelease, err error) - // Get retrieves the FluxHelmRelease from the indexer for a given namespace and name. - Get(name string) (*v1alpha2.FluxHelmRelease, error) - FluxHelmReleaseNamespaceListerExpansion -} - -// fluxHelmReleaseNamespaceLister implements the FluxHelmReleaseNamespaceLister -// interface. -type fluxHelmReleaseNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all FluxHelmReleases in the indexer for a given namespace. -func (s fluxHelmReleaseNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.FluxHelmRelease, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.FluxHelmRelease)) - }) - return ret, err -} - -// Get retrieves the FluxHelmRelease from the indexer for a given namespace and name. -func (s fluxHelmReleaseNamespaceLister) Get(name string) (*v1alpha2.FluxHelmRelease, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("fluxhelmrelease"), name) - } - return obj.(*v1alpha2.FluxHelmRelease), nil -} From fcffc4404dd7a533087a1e1cbcb58a0278f24ec3 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 13 Aug 2019 10:30:56 +0200 Subject: [PATCH 3/5] Bump 'v1beta1' API to 'v1' And simultaneously change the group domain to 'helm.fluxcd.io'. --- chart/helm-operator/README.md | 4 +- chart/helm-operator/templates/crd.yaml | 8 +- cmd/helm-operator/main.go | 10 +- deploy/flux-helm-release-crd.yaml | 8 +- .../references/helmrelease-custom-resource.md | 6 +- hack/update-codegen.sh | 2 +- pkg/apis/flux.weave.works/register.go | 5 - pkg/apis/flux.weave.works/v1beta1/doc.go | 10 - pkg/apis/helm.fluxcd.io/register.go | 5 + pkg/apis/helm.fluxcd.io/v1/doc.go | 5 + .../v1beta1 => helm.fluxcd.io/v1}/register.go | 8 +- .../v1beta1 => helm.fluxcd.io/v1}/types.go | 50 ++-- .../v1}/types_test.go | 2 +- .../v1}/zz_generated.deepcopy.go | 14 +- pkg/chartsync/chartsync.go | 231 +++++++++--------- pkg/chartsync/download.go | 8 +- pkg/client/clientset/versioned/clientset.go | 20 +- pkg/client/clientset/versioned/doc.go | 2 +- .../versioned/fake/clientset_generated.go | 12 +- pkg/client/clientset/versioned/fake/doc.go | 2 +- .../clientset/versioned/fake/register.go | 6 +- pkg/client/clientset/versioned/scheme/doc.go | 2 +- .../clientset/versioned/scheme/register.go | 6 +- .../v1beta1 => helm.fluxcd.io/v1}/doc.go | 4 +- .../v1beta1 => helm.fluxcd.io/v1}/fake/doc.go | 2 +- .../v1/fake/fake_helm.fluxcd.io_client.go} | 10 +- .../v1}/fake/fake_helmrelease.go | 52 ++-- .../v1}/generated_expansion.go | 4 +- .../v1/helm.fluxcd.io_client.go} | 34 +-- .../v1}/helmrelease.go | 58 ++--- .../informers/externalversions/factory.go | 8 +- .../informers/externalversions/generic.go | 8 +- .../interface.go | 14 +- .../v1}/helmrelease.go | 26 +- .../v1}/interface.go | 2 +- .../v1}/expansion_generated.go | 4 +- .../v1}/helmrelease.go | 26 +- pkg/install/generated_templates.gogen.go | 14 +- .../templates/flux-helm-release-crd.yaml.tmpl | 8 +- pkg/operator/operator.go | 74 +++--- pkg/release/release.go | 75 +++--- pkg/release/release_test.go | 9 +- pkg/status/conditions.go | 25 +- pkg/status/status.go | 28 ++- 44 files changed, 462 insertions(+), 449 deletions(-) delete mode 100644 pkg/apis/flux.weave.works/register.go delete mode 100644 pkg/apis/flux.weave.works/v1beta1/doc.go create mode 100644 pkg/apis/helm.fluxcd.io/register.go create mode 100644 pkg/apis/helm.fluxcd.io/v1/doc.go rename pkg/apis/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/register.go (85%) rename pkg/apis/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/types.go (88%) rename pkg/apis/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/types_test.go (98%) rename pkg/apis/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/zz_generated.deepcopy.go (97%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/doc.go (91%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/fake/doc.go (93%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1/fake/fake_flux.weave.works_client.go => helm.fluxcd.io/v1/fake/fake_helm.fluxcd.io_client.go} (74%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/fake/fake_helmrelease.go (66%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/generated_expansion.go (91%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1/flux.weave.works_client.go => helm.fluxcd.io/v1/helm.fluxcd.io_client.go} (64%) rename pkg/client/clientset/versioned/typed/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/helmrelease.go (69%) rename pkg/client/informers/externalversions/{flux.weave.works => helm.fluxcd.io}/interface.go (77%) rename pkg/client/informers/externalversions/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/helmrelease.go (78%) rename pkg/client/informers/externalversions/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/interface.go (98%) rename pkg/client/listers/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/expansion_generated.go (93%) rename pkg/client/listers/{flux.weave.works/v1beta1 => helm.fluxcd.io/v1}/helmrelease.go (79%) diff --git a/chart/helm-operator/README.md b/chart/helm-operator/README.md index 892f31c70..adc9ca5eb 100755 --- a/chart/helm-operator/README.md +++ b/chart/helm-operator/README.md @@ -48,7 +48,7 @@ Install podinfo by referring to its Helm repository: ```sh cat <= hr.Generation } // HasRolledBack returns if the current generation of the HelmRelease // has been rolled back. -func HasRolledBack(hr v1beta1.HelmRelease) bool { +func HasRolledBack(hr helmfluxv1.HelmRelease) bool { if !HasSynced(hr) { return false } - rolledBack := GetCondition(hr.Status, v1beta1.HelmReleaseRolledBack) + rolledBack := GetCondition(hr.Status, helmfluxv1.HelmReleaseRolledBack) if rolledBack == nil { return false } - chartFetched := GetCondition(hr.Status, v1beta1.HelmReleaseChartFetched) + chartFetched := GetCondition(hr.Status, helmfluxv1.HelmReleaseChartFetched) if chartFetched != nil { // NB: as two successful state updates can happen right after // each other, on which we both want to act, we _must_ compare From c870c5b2caf0ef9284804fdb7aaeee839a25d7e3 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 13 Aug 2019 12:03:47 +0200 Subject: [PATCH 4/5] Use in-repo HelmRelease for e2e --- test/e2e/run.sh | 2 +- test/mongodb-hr.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/mongodb-hr.yaml diff --git a/test/e2e/run.sh b/test/e2e/run.sh index d03bdfbed..59480d980 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -83,7 +83,7 @@ echo '>>> Applying HelmRelease' kubectl create namespace "${DEMO_NAMESPACE}" defer kubectl delete namespace "${DEMO_NAMESPACE}" -kubectl -n "${DEMO_NAMESPACE}" apply -f https://raw.githubusercontent.com/fluxcd/flux-get-started/master/releases/mongodb.yaml +kubectl -n "${DEMO_NAMESPACE}" apply -f ${REPO_ROOT}/test/mongodb-hr.yaml echo '>>> Waiting for Helm release mongodb' retries=24 diff --git a/test/mongodb-hr.yaml b/test/mongodb-hr.yaml new file mode 100644 index 000000000..3d9041cbd --- /dev/null +++ b/test/mongodb-hr.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: helm.fluxcd.io/v1 +kind: HelmRelease +metadata: + name: mongodb + namespace: demo + annotations: + flux.weave.works/automated: "false" + flux.weave.works/tag.chart-image: semver:~4.0 +spec: + releaseName: mongodb + chart: + repository: https://kubernetes-charts.storage.googleapis.com/ + name: mongodb + version: 4.9.0 + values: + image: + repository: bitnami/mongodb + tag: 4.0.3 + usePassword: false + persistence: + enabled: false + securityContext: + enabled: true + fsGroup: 0 + runAsUser: 0 From 36df15d66c19186b17e12a6cbdd280030f0ca3e0 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 13 Aug 2019 12:27:20 +0200 Subject: [PATCH 5/5] Only push images to `fluxcd` Docker Hub org --- .circleci/config.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca2be9a24..4695f9dc6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - working_directory: /home/circleci/go/src/github.com/weaveworks/flux + working_directory: /home/circleci/go/src/github.com/fluxcd/helm-operator machine: image: ubuntu-1604:201903-01 environment: @@ -20,6 +20,7 @@ jobs: sudo rm -rf /usr/local/go sudo mv go /usr/local mkdir -p "$HOME/go/bin" + rm -rf go${GO_VERSION}.linux-amd64.tar.gz go version - run: name: Update packages @@ -68,13 +69,6 @@ jobs: name: Maybe push prerelease images command: | if [ -z "${CIRCLE_TAG}" -a "${CIRCLE_BRANCH}" == "master" ]; then - # Push to weaveworks org - echo "$DOCKER_REGISTRY_PASSWORD" | docker login --username "$DOCKER_REGISTRY_USER" --password-stdin - - docker tag "docker.io/fluxcd/helm-operator:$(docker/image-tag)" "docker.io/weaveworks/helm-operator-prerelease:$(docker/image-tag)" - docker push "docker.io/weaveworks/helm-operator-prerelease:$(docker/image-tag)" - - # Push to fluxcd org echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin docker tag "docker.io/fluxcd/helm-operator:$(docker/image-tag)" "docker.io/fluxcd/helm-operator-prerelease:$(docker/image-tag)" @@ -84,12 +78,6 @@ jobs: name: Maybe push release image command: | if echo "${CIRCLE_TAG}" | grep -Eq "^[0-9]+(\.[0-9]+)*(-[a-z]+)?$"; then - # Push to weaveworks org - echo "$DOCKER_REGISTRY_PASSWORD" | docker login --username "$DOCKER_REGISTRY_USER" --password-stdin - docker tag "docker.io/fluxcd/helm-operator:${CIRCLE_TAG}" "docker.io/weaveworks/helm-operator:${CIRCLE_TAG}" - docker push "docker.io/weaveworks/helm-operator:${CIRCLE_TAG}" - - # Push to fluxcd org echo "$DOCKER_FLUXCD_PASSWORD" | docker login --username "$DOCKER_FLUXCD_USER" --password-stdin docker push "docker.io/fluxcd/helm-operator:${CIRCLE_TAG}" fi