Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluxcd/helm-controller
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.0
Choose a base ref
...
head repository: fluxcd/helm-controller
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12.1
Choose a head ref
  • 13 commits
  • 9 files changed
  • 4 contributors

Commits on Oct 10, 2021

  1. Update the chart if ReconcileStrategy changes

    If the ReconcileStrategy is changed (from ChartVersion to Revision for
    example), we should update the HelmChart.
    
    Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
    arbourd committed Oct 10, 2021
    Copy the full SHA
    b724dca View commit details

Commits on Oct 14, 2021

  1. Copy the full SHA
    404cf50 View commit details
  2. Nit: update tests to use non-deprecated ValuesFiles

    Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
    arbourd authored and hiddeco committed Oct 14, 2021
    Copy the full SHA
    42ec2fb View commit details
  3. Copy the full SHA
    457e703 View commit details
  4. Use tonistiigi/xx for cross-platform builds

    Update the Dockerfile to use tonistiigi/xx to cross-compile the
    manager binaries natively and speed up the multi-arch image build
    time.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 14, 2021
    Copy the full SHA
    ab6612b View commit details
  5. Update github actions to work with the new builds

    e2e:
    - Enable buildx.
    - Build only for linux/amd64.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 14, 2021
    Copy the full SHA
    a55443e View commit details
  6. workflows/e2e: Use buildkit local cache

    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 14, 2021
    Copy the full SHA
    911f186 View commit details
  7. Makefile: Remove test dependency on docker-build

    Prevent running the tests twice in e2e workflow by removing the
    dependency on docker-build on test.
    Update e2e workflow to remove setting KUBEBUILDER_ASSETS needed to run
    tests from "Build container image" step.
    
    Signed-off-by: Sunny <darkowlzz@protonmail.com>
    darkowlzz committed Oct 14, 2021
    Copy the full SHA
    fd79fac View commit details
  8. Copy the full SHA
    e89fded View commit details
  9. Update Helm to v3.7.1

    Replacements have been removed as they have been dropped from upstream,
    or updated to newer versions.
    
    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Oct 14, 2021
    Copy the full SHA
    d665b05 View commit details
  10. Copy the full SHA
    6f64b00 View commit details
  11. Release v0.12.1

    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Oct 14, 2021
    Copy the full SHA
    fe84f6e View commit details
  12. Copy the full SHA
    fecd079 View commit details
Showing with 113 additions and 43 deletions.
  1. +29 −3 .github/workflows/e2e.yaml
  2. +17 −1 CHANGELOG.md
  3. +12 −2 Dockerfile
  4. +11 −2 Makefile
  5. +1 −1 config/manager/kustomization.yaml
  6. +2 −0 controllers/helmrelease_controller_chart.go
  7. +15 −8 controllers/helmrelease_controller_chart_test.go
  8. +2 −9 go.mod
  9. +24 −17 go.sum
32 changes: 29 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -13,13 +13,30 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: "--debug"
- name: Restore Go cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-ghcache-
- name: Setup Go
uses: actions/setup-go@v2
with:
@@ -49,9 +66,18 @@ jobs:
exit 1
fi
- name: Build container image
run: make docker-build IMG=test/helm-controller:latest
env:
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
run: |
make docker-build IMG=test/helm-controller:latest \
BUILD_PLATFORMS=linux/amd64 \
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max"
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Load test image
run: kind load docker-image test/helm-controller:latest
- name: Install CRDs
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.12.1

**Release date:** 2021-10-14

This prerelease updates Helm to `v3.7.1`, and ensures `ReconcileStrategy`
changes are applied to the underlying `HelmChart` of a `HelmRelease`.

Improvements:
* Update Helm to v3.7.1
[#336](https://github.com/fluxcd/helm-controller/pull/336)
* Nit: update tests to use non-deprecated ValuesFiles
[#334](https://github.com/fluxcd/helm-controller/pull/334)

Fixes:
* Update the release if ReconcileStrategy changes
[#333](https://github.com/fluxcd/helm-controller/pull/333)

## 0.12.0

**Release date:** 2021-10-08
@@ -16,7 +33,6 @@ The default value of the field is `ChartVersion`, which looks for version
changes in the `Chart.yaml` file.

Improvements:

* Update fluxcd/source-controller to v0.16.0
[#329](https://github.com/fluxcd/helm-controller/pull/329)
* Introduce ReconcileStrategy in HelmChartTemplateSpec
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
ARG XX_VERSION=1.0.0-rc.2

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

# Docker buildkit multi-arch build requires golang alpine
FROM golang:1.16-alpine as builder
FROM --platform=$BUILDPLATFORM golang:1.16-alpine as builder

# Copy the build utilities.
COPY --from=xx / /

ARG TARGETPLATFORM

WORKDIR /workspace

@@ -19,7 +28,8 @@ COPY controllers/ controllers/
COPY internal/ internal/

# build without specifing the arch
RUN CGO_ENABLED=0 go build -a -o helm-controller main.go
ENV CGO_ENABLED=0
RUN xx-go build -a -o helm-controller main.go

FROM alpine:3.13

13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -10,6 +10,11 @@ else
GOBIN=$(shell go env GOBIN)
endif

# Allows for defining additional Docker buildx arguments, e.g. '--push'.
BUILD_ARGS ?=
# Architectures to build images for.
BUILD_PLATFORMS ?= linux/amd64

all: manager

# Run tests
@@ -81,8 +86,12 @@ generate: controller-gen
cd api; $(CONTROLLER_GEN) object:headerFile="../hack/boilerplate.go.txt" paths="./..."

# Build the docker image
docker-build: test
docker build . -t ${IMG}
docker-build:
docker buildx build \
--platform=$(BUILD_PLATFORMS) \
-t ${IMG} \
--load \
${BUILD_ARGS} .

# Push the docker image
docker-push:
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@ resources:
images:
- name: fluxcd/helm-controller
newName: fluxcd/helm-controller
newTag: v0.12.0
newTag: v0.12.1
2 changes: 2 additions & 0 deletions controllers/helmrelease_controller_chart.go
Original file line number Diff line number Diff line change
@@ -200,6 +200,8 @@ func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool
return true
case template.GetInterval(hr.Spec.Interval) != chart.Spec.Interval:
return true
case template.Spec.ReconcileStrategy != chart.Spec.ReconcileStrategy:
return true
case !reflect.DeepEqual(template.Spec.ValuesFiles, chart.Spec.ValuesFiles):
return true
case template.Spec.ValuesFile != chart.Spec.ValuesFile:
23 changes: 15 additions & 8 deletions controllers/helmrelease_controller_chart_test.go
Original file line number Diff line number Diff line change
@@ -267,8 +267,8 @@ func Test_buildHelmChartFromTemplate(t *testing.T) {
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: &metav1.Duration{Duration: 2 * time.Minute},
ValuesFile: "values.yaml",
Interval: &metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
@@ -294,8 +294,8 @@ func Test_buildHelmChartFromTemplate(t *testing.T) {
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFile: "values.yaml",
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
@@ -316,8 +316,8 @@ func Test_buildHelmChartFromTemplate(t *testing.T) {
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFile: "values.yaml",
Interval: metav1.Duration{Duration: 2 * time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
@@ -338,8 +338,8 @@ func Test_buildHelmChartFromTemplate(t *testing.T) {
Name: "test-repository",
Kind: "HelmRepository",
},
Interval: metav1.Duration{Duration: time.Minute},
ValuesFile: "values.yaml",
Interval: metav1.Duration{Duration: time.Minute},
ValuesFiles: []string{"values.yaml"},
},
},
},
@@ -420,6 +420,13 @@ func Test_helmChartRequiresUpdate(t *testing.T) {
},
want: true,
},
{
name: "detects reconcile strategy change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.ReconcileStrategy = "Revision"
},
want: true,
},
{
name: "detects values files change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
11 changes: 2 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -5,18 +5,17 @@ go 1.16
replace github.com/fluxcd/helm-controller/api => ./api

require (
github.com/fluxcd/helm-controller/api v0.12.0
github.com/fluxcd/helm-controller/api v0.12.1
github.com/fluxcd/pkg/apis/kustomize v0.1.0
github.com/fluxcd/pkg/apis/meta v0.10.0
github.com/fluxcd/pkg/runtime v0.12.0
github.com/fluxcd/source-controller/api v0.16.0
github.com/go-logr/logr v0.4.0
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/spf13/pflag v1.0.5
helm.sh/helm/v3 v3.7.0
helm.sh/helm/v3 v3.7.1
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1
k8s.io/apimachinery v0.22.1
@@ -26,9 +25,3 @@ require (
sigs.k8s.io/kustomize/api v0.10.0
sigs.k8s.io/yaml v1.2.0
)

// required by https://github.com/helm/helm/blob/v3.6.3/go.mod
replace github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d

// fix CVE-2021-30465
replace github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc95
Loading