Skip to content

Commit

Permalink
Update configs with SC v1beta2 APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Sunny <[email protected]>
  • Loading branch information
darkowlzz committed Feb 21, 2022
1 parent 21e5970 commit 0f96971
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
22 changes: 11 additions & 11 deletions api/v2beta1/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type PostRenderer struct {

// HelmReleaseSpec defines the desired state of a Helm release.
type HelmReleaseSpec struct {
// Chart defines the template of the v1beta1.HelmChart that should be created
// Chart defines the template of the v1beta2.HelmChart that should be created
// for this HelmRelease.
// +required
Chart HelmChartTemplate `json:"chart"`
Expand Down Expand Up @@ -216,32 +216,32 @@ type KubeConfig struct {
}

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

// HelmChartTemplateSpec defines the template from which the controller will
// generate a v1beta1.HelmChartSpec object.
// generate a v1beta2.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 v1beta1.GitRepository and
// v1beta1.Bucket sources. Defaults to latest when omitted.
// Version semver expression, ignored for charts from v1beta2.GitRepository and
// v1beta2.Bucket sources. Defaults to latest when omitted.
// +kubebuilder:default:=*
// +optional
Version string `json:"version,omitempty"`

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

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

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

// GetNamespace returns the namespace targeted namespace for the
// v1beta1.HelmChart, or the given default.
// v1beta2.HelmChart, or the given default.
func (in HelmChartTemplate) GetNamespace(defaultNamespace string) string {
if in.Spec.SourceRef.Namespace == "" {
return defaultNamespace
Expand Down
10 changes: 5 additions & 5 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ spec:
description: HelmReleaseSpec defines the desired state of a Helm release.
properties:
chart:
description: Chart defines the template of the v1beta1.HelmChart that
description: Chart defines the template of the v1beta2.HelmChart that
should be created for this HelmRelease.
properties:
spec:
description: Spec holds the template for the v1beta1.HelmChartSpec
description: Spec holds the template for the v1beta2.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 v1beta1.Source
description: Interval at which to check the v1beta2.Source
for updates. Defaults to 'HelmReleaseSpec.Interval'.
type: string
reconcileStrategy:
Expand All @@ -75,7 +75,7 @@ spec:
- Revision
type: string
sourceRef:
description: The name and namespace of the v1beta1.Source
description: The name and namespace of the v1beta2.Source
the chart is available at.
properties:
apiVersion:
Expand Down Expand Up @@ -120,7 +120,7 @@ spec:
version:
default: '*'
description: Version semver expression, ignored for charts
from v1beta1.GitRepository and v1beta1.Bucket sources. Defaults
from v1beta2.GitRepository and v1beta2.Bucket sources. Defaults
to latest when omitted.
type: string
required:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/source_v1beta1_gitrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: podinfo
Expand Down
2 changes: 1 addition & 1 deletion config/samples/source_v1beta1_helmrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: podinfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: this
Expand All @@ -13,4 +13,4 @@ spec:
{{- end}}
{{- if .Values.branch }}
tag: "{{ .Values.tag }}"
{{- end}}
{{- end}}
2 changes: 1 addition & 1 deletion config/testdata/sources/gitrepository.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: podinfo
Expand Down
28 changes: 14 additions & 14 deletions docs/api/helmrelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ HelmChartTemplate
</em>
</td>
<td>
<p>Chart defines the template of the v1beta1.HelmChart that should be created
<p>Chart defines the template of the v1beta2.HelmChart that should be created
for this HelmRelease.</p>
</td>
</tr>
Expand Down Expand Up @@ -438,8 +438,8 @@ string
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmReleaseSpec">HelmReleaseSpec</a>)
</p>
<p>HelmChartTemplate defines the template from which the controller will
generate a v1beta1.HelmChart object in the same namespace as the referenced
v1beta1.Source.</p>
generate a v1beta2.HelmChart object in the same namespace as the referenced
v1beta2.Source.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
Expand All @@ -460,7 +460,7 @@ HelmChartTemplateSpec
</em>
</td>
<td>
<p>Spec holds the template for the v1beta1.HelmChartSpec for this HelmRelease.</p>
<p>Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.</p>
<br/>
<br/>
<table>
Expand All @@ -484,8 +484,8 @@ string
</td>
<td>
<em>(Optional)</em>
<p>Version semver expression, ignored for charts from v1beta1.GitRepository and
v1beta1.Bucket sources. Defaults to latest when omitted.</p>
<p>Version semver expression, ignored for charts from v1beta2.GitRepository and
v1beta2.Bucket sources. Defaults to latest when omitted.</p>
</td>
</tr>
<tr>
Expand All @@ -498,7 +498,7 @@ CrossNamespaceObjectReference
</em>
</td>
<td>
<p>The name and namespace of the v1beta1.Source the chart is available at.</p>
<p>The name and namespace of the v1beta2.Source the chart is available at.</p>
</td>
</tr>
<tr>
Expand All @@ -512,7 +512,7 @@ Kubernetes meta/v1.Duration
</td>
<td>
<em>(Optional)</em>
<p>Interval at which to check the v1beta1.Source for updates. Defaults to
<p>Interval at which to check the v1beta2.Source for updates. Defaults to
&lsquo;HelmReleaseSpec.Interval&rsquo;.</p>
</td>
</tr>
Expand Down Expand Up @@ -575,7 +575,7 @@ ValuesFiles items. Ignored when omitted.</p>
<a href="#helm.toolkit.fluxcd.io/v2beta1.HelmChartTemplate">HelmChartTemplate</a>)
</p>
<p>HelmChartTemplateSpec defines the template from which the controller will
generate a v1beta1.HelmChartSpec object.</p>
generate a v1beta2.HelmChartSpec object.</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
Expand Down Expand Up @@ -606,8 +606,8 @@ string
</td>
<td>
<em>(Optional)</em>
<p>Version semver expression, ignored for charts from v1beta1.GitRepository and
v1beta1.Bucket sources. Defaults to latest when omitted.</p>
<p>Version semver expression, ignored for charts from v1beta2.GitRepository and
v1beta2.Bucket sources. Defaults to latest when omitted.</p>
</td>
</tr>
<tr>
Expand All @@ -620,7 +620,7 @@ CrossNamespaceObjectReference
</em>
</td>
<td>
<p>The name and namespace of the v1beta1.Source the chart is available at.</p>
<p>The name and namespace of the v1beta2.Source the chart is available at.</p>
</td>
</tr>
<tr>
Expand All @@ -634,7 +634,7 @@ Kubernetes meta/v1.Duration
</td>
<td>
<em>(Optional)</em>
<p>Interval at which to check the v1beta1.Source for updates. Defaults to
<p>Interval at which to check the v1beta2.Source for updates. Defaults to
&lsquo;HelmReleaseSpec.Interval&rsquo;.</p>
</td>
</tr>
Expand Down Expand Up @@ -714,7 +714,7 @@ HelmChartTemplate
</em>
</td>
<td>
<p>Chart defines the template of the v1beta1.HelmChart that should be created
<p>Chart defines the template of the v1beta2.HelmChart that should be created
for this HelmRelease.</p>
</td>
</tr>
Expand Down

0 comments on commit 0f96971

Please sign in to comment.