Skip to content

Commit

Permalink
Merge pull request #99 from fluxcd/api/v0.1.0
Browse files Browse the repository at this point in the history
Promote the helm.toolkit.fluxcd.io API to v2beta1
  • Loading branch information
hiddeco authored Sep 30, 2020
2 parents 9e3760a + accd476 commit 77399d5
Show file tree
Hide file tree
Showing 55 changed files with 1,087 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2-beta
with:
go-version: 1.14.x
go-version: 1.15.x
- name: Setup Kubernetes
uses: engineerd/[email protected]
- name: Setup Helm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.14.x"
go-version: "^1.15.x"
- run: go version
# Runs a set of commands to initialize and analyze with FOSSA
- name: run FOSSA analysis
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Docker buildkit multi-arch build requires golang alpine
FROM golang:1.14-alpine as builder
FROM golang:1.15-alpine as builder

WORKDIR /workspace

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ manifests: controller-gen

# Generate API reference documentation
api-docs: gen-crd-api-reference-docs
$(API_REF_GEN) -api-dir=./api/v2alpha1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/helmrelease.md
$(API_REF_GEN) -api-dir=./api/v2beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/helmrelease.md

# Run go fmt against code
fmt:
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ repo: github.com/fluxcd/helm-controller
resources:
- group: helm
kind: HelmRelease
version: v2alpha1
version: v2beta1
version: "2"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ operator.

## Specifications

* [API](docs/spec/v2alpha1/README.md)
* [API](docs/spec/v2beta1/README.md)
* [Controller](docs/spec/README.md)

[source-controller]: https://github.com/fluxcd/source-controller
Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fluxcd/helm-controller/api

go 1.14
go 1.15

require (
github.com/fluxcd/pkg/apis/meta v0.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha1
package v2beta1

const (
// ReleasedCondition represents the status of the last release attempt
Expand Down
4 changes: 2 additions & 2 deletions api/v2alpha1/doc.go → api/v2beta1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v2alpha1 contains API Schema definitions for the helm v2alpha1 API group
// Package v2beta1 contains API Schema definitions for the helm v2beta1 API group
// +kubebuilder:object:generate=true
// +groupName=helm.toolkit.fluxcd.io
package v2alpha1
package v2beta1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha1
package v2beta1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -23,7 +23,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2alpha1"}
GroupVersion = schema.GroupVersion{Group: "helm.toolkit.fluxcd.io", Version: "v2beta1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha1
package v2beta1

import (
"encoding/json"
Expand All @@ -35,7 +35,7 @@ const HelmReleaseFinalizer = "finalizers.fluxcd.io"

// HelmReleaseSpec defines the desired state of a Helm release.
type HelmReleaseSpec struct {
// Chart defines the template of the v1alpha1.HelmChart that should be created
// Chart defines the template of the v1beta1.HelmChart that should be created
// for this HelmRelease.
// +required
Chart HelmChartTemplate `json:"chart"`
Expand Down Expand Up @@ -155,31 +155,31 @@ func (in HelmReleaseSpec) GetUninstall() Uninstall {
}

// HelmChartTemplate defines the template from which the controller will
// generate a v1alpha1.HelmChart object in the same namespace as the referenced
// v1alpha1.Source.
// generate a v1beta1.HelmChart object in the same namespace as the referenced
// v1beta1.Source.
type HelmChartTemplate struct {
// Spec holds the template for the v1alpha1.HelmChartSpec for this HelmRelease.
// Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.
// +required
Spec HelmChartTemplateSpec `json:"spec"`
}

// HelmChartTemplateSpec defines the template from which the controller will
// generate a v1alpha1.HelmChartSpec object.
// generate a v1beta1.HelmChartSpec object.
type HelmChartTemplateSpec struct {
// The name or path the Helm chart is available at in the SourceRef.
// +required
Chart string `json:"chart"`

// Version semver expression, ignored for charts from v1alpha1.GitRepository and
// v1alpha1.Bucket sources. Defaults to latest when omitted.
// Version semver expression, ignored for charts from v1beta1.GitRepository and
// v1beta1.Bucket sources. Defaults to latest when omitted.
// +optional
Version string `json:"version,omitempty"`

// The name and namespace of the v1alpha1.Source the chart is available at.
// The name and namespace of the v1beta1.Source the chart is available at.
// +required
SourceRef CrossNamespaceObjectReference `json:"sourceRef"`

// Interval at which to check the v1alpha1.Source for updates. Defaults to
// Interval at which to check the v1beta1.Source for updates. Defaults to
// 'HelmReleaseSpec.Interval'.
// +optional
Interval *metav1.Duration `json:"interval,omitempty"`
Expand All @@ -190,7 +190,7 @@ type HelmChartTemplateSpec struct {
ValuesFile string `json:"valuesFile,omitempty"`
}

// GetInterval returns the configured interval for the v1alpha1.HelmChart,
// GetInterval returns the configured interval for the v1beta1.HelmChart,
// or the given default.
func (in HelmChartTemplate) GetInterval(defaultInterval metav1.Duration) metav1.Duration {
if in.Spec.Interval == nil {
Expand All @@ -200,7 +200,7 @@ func (in HelmChartTemplate) GetInterval(defaultInterval metav1.Duration) metav1.
}

// GetNamespace returns the namespace targeted namespace for the
// v1alpha1.HelmChart, or the given default.
// v1beta1.HelmChart, or the given default.
func (in HelmChartTemplate) GetNamespace(defaultNamespace string) string {
if in.Spec.SourceRef.Namespace == "" {
return defaultNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha1
package v2beta1

// CrossNamespaceObjectReference contains enough information to let you locate
// the typed referenced object at cluster level.
Expand Down

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

16 changes: 8 additions & 8 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2alpha1
name: v2beta1
schema:
openAPIV3Schema:
description: HelmRelease is the Schema for the helmreleases API
Expand All @@ -49,23 +49,23 @@ spec:
description: HelmReleaseSpec defines the desired state of a Helm release.
properties:
chart:
description: Chart defines the template of the v1alpha1.HelmChart
that should be created for this HelmRelease.
description: Chart defines the template of the v1beta1.HelmChart that
should be created for this HelmRelease.
properties:
spec:
description: Spec holds the template for the v1alpha1.HelmChartSpec
description: Spec holds the template for the v1beta1.HelmChartSpec
for this HelmRelease.
properties:
chart:
description: The name or path the Helm chart is available
at in the SourceRef.
type: string
interval:
description: Interval at which to check the v1alpha1.Source
description: Interval at which to check the v1beta1.Source
for updates. Defaults to 'HelmReleaseSpec.Interval'.
type: string
sourceRef:
description: The name and namespace of the v1alpha1.Source
description: The name and namespace of the v1beta1.Source
the chart is available at.
properties:
apiVersion:
Expand Down Expand Up @@ -98,8 +98,8 @@ spec:
type: string
version:
description: Version semver expression, ignored for charts
from v1alpha1.GitRepository and v1alpha1.Bucket sources.
Defaults to latest when omitted.
from v1beta1.GitRepository and v1beta1.Bucket sources. Defaults
to latest when omitted.
type: string
required:
- chart
Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ resources:
- ../crd
- ../rbac
- ../manager
- github.com/fluxcd/source-controller/config//crd?ref=v0.0.15
- github.com/fluxcd/source-controller/config//manager?ref=v0.0.15
- github.com/fluxcd/source-controller/config//crd?ref=v0.1.0
- github.com/fluxcd/source-controller/config//manager?ref=v0.1.0
- namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: podinfo-gitrepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: podinfo-helmrepository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: podinfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: podinfo
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/dependencies/helmrelease-backend.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: backend
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/dependencies/helmrelease-frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: frontend
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/dependencies/helmrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: webapp
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/install-fail-remediate/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: install-fail-remediate
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/install-fail-retry/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: install-fail-retry
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/install-fail/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: install-fail
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/install-test-fail-ignore/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: install-test-fail-ignore
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/install-test-fail/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: install-test-fail
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/podinfo/gitrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: podinfo
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/podinfo/helmrelease-git.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: podinfo-git
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/podinfo/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: podinfo
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/podinfo/helmrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1alpha1
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: podinfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail-remediate/install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-remediate
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail-remediate/upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-remediate
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail-retry/install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-retry
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail-retry/upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail-retry
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail/install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-fail/upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-fail
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/upgrade-test-fail/install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: helm.toolkit.fluxcd.io/v2alpha1
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: upgrade-test-fail
Expand Down
Loading

0 comments on commit 77399d5

Please sign in to comment.