Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Finishes implementation of syncing due to repo chart changes; helm ve…
Browse files Browse the repository at this point in the history
…rsion to 2.8.

Changes CRD API naming; cleans up flags

Renames CRD from FluxHelmResource to FluxHelmRelease

Renames fields of CRD definition

Adds CircleCi additions for helm operator

Updates CRD file to reflect renaming

Bug fix for charts sync

Updates helm-operator manifest

Fixes continuous redundant releases during chart sync

Adds helm integration documentation
  • Loading branch information
Tamara Kaufler committed Feb 20, 2018
1 parent f22bdca commit 5d70ad1
Show file tree
Hide file tree
Showing 60 changed files with 1,185 additions and 1,630 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
if [ -z "${CIRCLE_TAG}" -a "${CIRCLE_BRANCH}" == "master" ]; then
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" quay.io
docker push "quay.io/weaveworks/flux:$(docker/image-tag)"
docker push "quay.io/weaveworks/helm-operator:$(docker/image-tag)"
fi
- deploy:
Expand All @@ -31,6 +32,7 @@ jobs:
bin/upload-binaries
docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD" quay.io
docker push "quay.io/weaveworks/flux:$(docker/image-tag)"
docker push "quay.io/weaveworks/helm-operator:$(docker/image-tag)"
fi
workflows:
Expand Down
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ required = ["k8s.io/code-generator/cmd/client-gen"]

[[constraint]]
name = "k8s.io/helm"
version = "v2.8.0"
version = "v2.8.1"

[[constraint]]
name = "google.golang.org/grpc"
Expand Down
5 changes: 5 additions & 0 deletions apis/helm.integrations.flux.weave.works/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package fluxintegrations

const (
GroupName = "helm.integrations.flux.weave.works"
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +k8s:deepcopy-gen=package,register

// Package v1 is the v1 version of the API.
// +groupName=integrations.flux
package v1
// +groupName=helm.integrations.flux.weave.works
package v1alpha
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package v1
package v1alpha

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

fluxintegrations "github.com/weaveworks/flux/apis/integrations.flux"
fluxintegrations "github.com/weaveworks/flux/apis/helm.integrations.flux.weave.works"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: fluxintegrations.GroupName, Version: "v1"}
var SchemeGroupVersion = schema.GroupVersion{Group: fluxintegrations.GroupName, Version: "v1alpha"}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
Expand All @@ -34,8 +34,8 @@ func init() {
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&FluxHelmResource{},
&FluxHelmResourceList{},
&FluxHelmRelease{},
&FluxHelmReleaseList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
Expand Down
47 changes: 47 additions & 0 deletions apis/helm.integrations.flux.weave.works/v1alpha/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package v1alpha

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
//"k8s.io/apimachinery/pkg/runtime"
)

// +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"`
}

// FluxHelmReleaseSpec is the spec for a FluxHelmRelease resource
// FluxHelmReleaseSpec
type FluxHelmReleaseSpec struct {
ChartGitPath string `json:"chartGitPath"`
ReleaseName string `json:"releaseName,omitempty"`
Values []HelmChartParam `json:"values,omitempty"`
}

// HelmChartParam represents Helm Chart customization
// it will be applied to override the values.yaml and/or the Chart itself
// Name ... parameter name; if missing this parameter will be discarded
// Value ...

// HelmChartParam ... user customization of Chart parameterized values
type HelmChartParam struct {
Name string `json:"name"`
Value string `json:"value"`
}

// +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"`
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// +build !ignore_autogenerated

/*
Copyright 2018 The Kubernetes Authors.
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.
Expand All @@ -18,33 +18,33 @@ limitations under the License.

// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package v1
package v1alpha

import (
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 *FluxHelmResource) DeepCopyInto(out *FluxHelmResource) {
func (in *FluxHelmRelease) DeepCopyInto(out *FluxHelmRelease) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmResource.
func (in *FluxHelmResource) DeepCopy() *FluxHelmResource {
// 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(FluxHelmResource)
out := new(FluxHelmRelease)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FluxHelmResource) DeepCopyObject() runtime.Object {
func (in *FluxHelmRelease) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
Expand All @@ -53,32 +53,32 @@ func (in *FluxHelmResource) DeepCopyObject() runtime.Object {
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FluxHelmResourceList) DeepCopyInto(out *FluxHelmResourceList) {
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([]FluxHelmResource, len(*in))
*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 FluxHelmResourceList.
func (in *FluxHelmResourceList) DeepCopy() *FluxHelmResourceList {
// 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(FluxHelmResourceList)
out := new(FluxHelmReleaseList)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *FluxHelmResourceList) DeepCopyObject() runtime.Object {
func (in *FluxHelmReleaseList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
Expand All @@ -87,22 +87,22 @@ func (in *FluxHelmResourceList) DeepCopyObject() runtime.Object {
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *FluxHelmResourceSpec) DeepCopyInto(out *FluxHelmResourceSpec) {
func (in *FluxHelmReleaseSpec) DeepCopyInto(out *FluxHelmReleaseSpec) {
*out = *in
if in.Customizations != nil {
in, out := &in.Customizations, &out.Customizations
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]HelmChartParam, len(*in))
copy(*out, *in)
}
return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmResourceSpec.
func (in *FluxHelmResourceSpec) DeepCopy() *FluxHelmResourceSpec {
// 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(FluxHelmResourceSpec)
out := new(FluxHelmReleaseSpec)
in.DeepCopyInto(out)
return out
}
Expand Down
5 changes: 0 additions & 5 deletions apis/integrations.flux/register.go

This file was deleted.

56 changes: 0 additions & 56 deletions apis/integrations.flux/v1/types.go

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions hack/update_codegen.sh → bin/helm/update_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ${GOPATH}/src/k8s.io/code-generator)}

${CODEGEN_PKG}/generate-groups.sh all github.com/weaveworks/flux/integrations/client \
github.com/weaveworks/flux/apis integrations.flux:v1 \
--go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt
github.com/weaveworks/flux/apis helm.integrations.flux.weave.works:v1alpha \
--go-header-file ${SCRIPT_ROOT}/bin/helm/custom-boilerplate.go.txt

Loading

0 comments on commit 5d70ad1

Please sign in to comment.