Skip to content

Commit 336c5c6

Browse files
authored
Merge pull request #661 from fluxcd/update-deps
2 parents 4009fb6 + 2de972c commit 336c5c6

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

config/default/kustomization.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
namespace: helm-system
44
resources:
5-
- https://github.com/fluxcd/source-controller/releases/download/v0.36.1/source-controller.crds.yaml
6-
- https://github.com/fluxcd/source-controller/releases/download/v0.36.1/source-controller.deployment.yaml
5+
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.1/source-controller.crds.yaml
6+
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0-rc.1/source-controller.deployment.yaml
77
- ../crd
88
- ../rbac
99
- ../manager

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ require (
1111
github.com/fluxcd/pkg/apis/kustomize v1.0.0
1212
github.com/fluxcd/pkg/apis/meta v1.0.0
1313
github.com/fluxcd/pkg/runtime v0.35.0
14-
github.com/fluxcd/pkg/ssa v0.26.0
15-
github.com/fluxcd/source-controller/api v0.36.1
16-
github.com/go-logr/logr v1.2.3
14+
github.com/fluxcd/pkg/ssa v0.27.0
15+
github.com/fluxcd/source-controller/api v1.0.0-rc.1
16+
github.com/go-logr/logr v1.2.4
1717
github.com/google/go-cmp v0.5.9
1818
github.com/hashicorp/go-retryablehttp v0.7.2
19-
github.com/onsi/gomega v1.27.5
19+
github.com/onsi/gomega v1.27.6
2020
github.com/opencontainers/go-digest v1.0.0
2121
github.com/opencontainers/go-digest/blake3 v0.0.0-20220411205349-bde1400a84be
2222
github.com/spf13/pflag v1.0.5

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ github.com/fluxcd/pkg/apis/meta v1.0.0 h1:i9IGHd/VNEZELX7mepkiYFbJxs2J5znaB4cN9z
179179
github.com/fluxcd/pkg/apis/meta v1.0.0/go.mod h1:04ZdpZYm1x+aL93K4daNHW1UX6E8K7Gyf5za9OhrE+U=
180180
github.com/fluxcd/pkg/runtime v0.35.0 h1:9PYLcul8qdfLYQArcYpHe/QuMqyhAGGFN9F7uY/QVX4=
181181
github.com/fluxcd/pkg/runtime v0.35.0/go.mod h1:sAaSTH8RHj3Y99xj0AtAndDTe5cv0DP4enyLV62EO78=
182-
github.com/fluxcd/pkg/ssa v0.26.0 h1:xqAPF9wA4a3HVeUL1bMsrk1pJDjo5IEqL3+Vjts6vTM=
183-
github.com/fluxcd/pkg/ssa v0.26.0/go.mod h1:GEzdW/IkhD/EGvhRerwipp5IrLVkWjhVFsB4Y7MnnMI=
184-
github.com/fluxcd/source-controller/api v0.36.1 h1:/ul69kJNEwrFG1Cwk2P/GwgraIxOETCL+tP+zMtxTu8=
185-
github.com/fluxcd/source-controller/api v0.36.1/go.mod h1:GktZmd5Dfxo84vPFBdLDl0bBtiJRODfd47uugK0romU=
182+
github.com/fluxcd/pkg/ssa v0.27.0 h1:BJnWDy3xDtYD2U+sVZPkoh6PfnQKoXsklO0pzojU8XU=
183+
github.com/fluxcd/pkg/ssa v0.27.0/go.mod h1:fxvmVf4FxodJi5lTglMcL8JsF6hfJLG99C56/CgchH0=
184+
github.com/fluxcd/source-controller/api v1.0.0-rc.1 h1:MZaP5utClMG95Aw/AVu1l05WEfmpEw/RIlCLnkCQl14=
185+
github.com/fluxcd/source-controller/api v1.0.0-rc.1/go.mod h1:CvGNdS8g/MqwpERUK6aJp4lndsrm+JBzGpoyyZ4u0c8=
186186
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
187187
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
188188
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
@@ -207,8 +207,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG
207207
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
208208
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
209209
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
210-
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
211-
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
210+
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
211+
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
212212
github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
213213
github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
214214
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -506,8 +506,8 @@ github.com/nelsam/hel/v2 v2.3.3/go.mod h1:1ZTGfU2PFTOd5mx22i5O0Lc2GY933lQ2wb/ggy
506506
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
507507
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
508508
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
509-
github.com/onsi/gomega v1.27.5 h1:T/X6I0RNFw/kTqgfkZPcQ5KU6vCnWNBGdtrIx2dpGeQ=
510-
github.com/onsi/gomega v1.27.5/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
509+
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
510+
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
511511
github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be h1:f2PlhC9pm5sqpBZFvnAoKj+KzXRzbjFMA+TqXfJdgho=
512512
github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
513513
github.com/opencontainers/go-digest/blake3 v0.0.0-20220411205349-bde1400a84be h1:yJISmqboKE7zWqC2Nlg3pBkelqCblzZBoMHv2nbrUjQ=

internal/controllers/helmrelease_controller_chart.go

+16-15
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ import (
4040
"k8s.io/apimachinery/pkg/types"
4141
ctrl "sigs.k8s.io/controller-runtime"
4242

43-
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
43+
sourcev1 "github.com/fluxcd/source-controller/api/v1"
44+
sourcev1b2 "github.com/fluxcd/source-controller/api/v1beta2"
4445

4546
v2 "github.com/fluxcd/helm-controller/api/v2beta1"
4647
)
4748

48-
func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1.HelmChart, error) {
49+
func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1b2.HelmChart, error) {
4950
chartName := types.NamespacedName{
5051
Namespace: hr.Spec.Chart.GetNamespace(hr.Namespace),
5152
Name: hr.GetHelmChartName(),
@@ -67,7 +68,7 @@ func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmR
6768
}
6869

6970
// Continue with the reconciliation of the current template.
70-
var helmChart sourcev1.HelmChart
71+
var helmChart sourcev1b2.HelmChart
7172
err := r.Client.Get(ctx, chartName, &helmChart)
7273
if err != nil && !apierrors.IsNotFound(err) {
7374
return nil, err
@@ -81,7 +82,7 @@ func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmR
8182
hr.Status.HelmChart = chartName.String()
8283
return hc, nil
8384
case helmChartRequiresUpdate(hr, &helmChart):
84-
ctrl.LoggerFrom(ctx).Info("chart diverged from template", strings.ToLower(sourcev1.HelmChartKind), chartName.String())
85+
ctrl.LoggerFrom(ctx).Info("chart diverged from template", strings.ToLower(sourcev1b2.HelmChartKind), chartName.String())
8586
helmChart.Spec = hc.Spec
8687
helmChart.Labels = hc.Labels
8788
helmChart.Annotations = hc.Annotations
@@ -97,9 +98,9 @@ func (r *HelmReleaseReconciler) reconcileChart(ctx context.Context, hr *v2.HelmR
9798
// getHelmChart retrieves the v1beta2.HelmChart for the given
9899
// v2beta1.HelmRelease using the name that is advertised in the status
99100
// object. It returns the v1beta2.HelmChart, or an error.
100-
func (r *HelmReleaseReconciler) getHelmChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1.HelmChart, error) {
101+
func (r *HelmReleaseReconciler) getHelmChart(ctx context.Context, hr *v2.HelmRelease) (*sourcev1b2.HelmChart, error) {
101102
namespace, name := hr.Status.GetHelmChart()
102-
hc := &sourcev1.HelmChart{}
103+
hc := &sourcev1b2.HelmChart{}
103104
if err := r.Client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: name}, hc); err != nil {
104105
return nil, err
105106
}
@@ -109,7 +110,7 @@ func (r *HelmReleaseReconciler) getHelmChart(ctx context.Context, hr *v2.HelmRel
109110
// loadHelmChart attempts to download the artifact from the provided source,
110111
// loads it into a chart.Chart, and removes the downloaded artifact.
111112
// It returns the loaded chart.Chart on success, or an error.
112-
func (r *HelmReleaseReconciler) loadHelmChart(source *sourcev1.HelmChart) (*chart.Chart, error) {
113+
func (r *HelmReleaseReconciler) loadHelmChart(source *sourcev1b2.HelmChart) (*chart.Chart, error) {
113114
f, err := os.CreateTemp("", fmt.Sprintf("%s-%s-*.tgz", source.GetNamespace(), source.GetName()))
114115
if err != nil {
115116
return nil, err
@@ -174,7 +175,7 @@ func (r *HelmReleaseReconciler) deleteHelmChart(ctx context.Context, hr *v2.Helm
174175
if hr.Status.HelmChart == "" {
175176
return nil
176177
}
177-
var hc sourcev1.HelmChart
178+
var hc sourcev1b2.HelmChart
178179
chartNS, chartName := hr.Status.GetHelmChart()
179180
err := r.Client.Get(ctx, types.NamespacedName{Namespace: chartNS, Name: chartName}, &hc)
180181
if err != nil {
@@ -196,19 +197,19 @@ func (r *HelmReleaseReconciler) deleteHelmChart(ctx context.Context, hr *v2.Helm
196197

197198
// buildHelmChartFromTemplate builds a v1beta2.HelmChart from the
198199
// v2beta1.HelmChartTemplate of the given v2beta1.HelmRelease.
199-
func buildHelmChartFromTemplate(hr *v2.HelmRelease) *sourcev1.HelmChart {
200+
func buildHelmChartFromTemplate(hr *v2.HelmRelease) *sourcev1b2.HelmChart {
200201
template := hr.Spec.Chart
201-
return &sourcev1.HelmChart{
202+
return &sourcev1b2.HelmChart{
202203
ObjectMeta: metav1.ObjectMeta{
203204
Name: hr.GetHelmChartName(),
204205
Namespace: hr.Spec.Chart.GetNamespace(hr.Namespace),
205206
Labels: hr.Spec.Chart.ObjectMeta.Labels,
206207
Annotations: hr.Spec.Chart.ObjectMeta.Annotations,
207208
},
208-
Spec: sourcev1.HelmChartSpec{
209+
Spec: sourcev1b2.HelmChartSpec{
209210
Chart: template.Spec.Chart,
210211
Version: template.Spec.Version,
211-
SourceRef: sourcev1.LocalHelmChartSourceReference{
212+
SourceRef: sourcev1b2.LocalHelmChartSourceReference{
212213
Name: template.Spec.SourceRef.Name,
213214
Kind: template.Spec.SourceRef.Kind,
214215
},
@@ -224,7 +225,7 @@ func buildHelmChartFromTemplate(hr *v2.HelmRelease) *sourcev1.HelmChart {
224225
// helmChartRequiresUpdate compares the v2beta1.HelmChartTemplate of the
225226
// v2beta1.HelmRelease to the given v1beta2.HelmChart to determine if an
226227
// update is required.
227-
func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool {
228+
func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1b2.HelmChart) bool {
228229
template := hr.Spec.Chart
229230
switch {
230231
case template.Spec.Chart != chart.Spec.Chart:
@@ -257,12 +258,12 @@ func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool
257258
}
258259

259260
// templateVerificationToSourceVerification converts the HelmChartTemplateVerification to the OCIRepositoryVerification.
260-
func templateVerificationToSourceVerification(template *v2.HelmChartTemplateVerification) *sourcev1.OCIRepositoryVerification {
261+
func templateVerificationToSourceVerification(template *v2.HelmChartTemplateVerification) *sourcev1b2.OCIRepositoryVerification {
261262
if template == nil {
262263
return nil
263264
}
264265

265-
return &sourcev1.OCIRepositoryVerification{
266+
return &sourcev1b2.OCIRepositoryVerification{
266267
Provider: template.Provider,
267268
SecretRef: template.SecretRef,
268269
}

internal/controllers/source_predicate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"sigs.k8s.io/controller-runtime/pkg/event"
2121
"sigs.k8s.io/controller-runtime/pkg/predicate"
2222

23-
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
23+
sourcev1 "github.com/fluxcd/source-controller/api/v1"
2424
)
2525

2626
type SourceRevisionChangePredicate struct {

0 commit comments

Comments
 (0)