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/kustomize-controller
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.24.0
Choose a base ref
...
head repository: fluxcd/kustomize-controller
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.24.1
Choose a head ref
  • 4 commits
  • 8 files changed
  • 2 contributors

Commits on Apr 20, 2022

  1. generator: ensure remote build dirs can be reached

    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Apr 20, 2022

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    880587f View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6985449 View commit details
  3. Release v0.24.1

    Signed-off-by: Hidde Beydals <hello@hidde.co>
    hiddeco committed Apr 20, 2022

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1cd31e6 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    65d0fe9 View commit details
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,18 @@

All notable changes to this project are documented in this file.

## 0.24.1

**Release date:** 2022-04-20

This prerelease fixes a regression bug introduced in
[#620](https://github.com/fluxcd/kustomize-controller/pull/620), which
prevented remote build directories from being reachable within the FS.

Fixes:
- generator: ensure remote build dirs can be reached
[#626](https://github.com/fluxcd/kustomize-controller/pull/626)

## 0.24.0

**Release date:** 2022-04-19
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/kustomize-controller
newName: fluxcd/kustomize-controller
newTag: v0.24.0
newTag: v0.24.1
2 changes: 1 addition & 1 deletion controllers/kustomization_controller.go
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ func (r *KustomizationReconciler) reconcile(
revision := source.GetArtifact().Revision

// create tmp dir
tmpDir, err := os.MkdirTemp("", kustomization.Name)
tmpDir, err := os.MkdirTemp("", "kustomization-")
if err != nil {
err = fmt.Errorf("tmp dir error: %w", err)
return kustomizev1.KustomizationNotReady(
6 changes: 4 additions & 2 deletions controllers/kustomization_generator.go
Original file line number Diff line number Diff line change
@@ -200,7 +200,9 @@ func (kg *KustomizeGenerator) generateKustomization(dirPath string) error {
if err != nil {
return err
}
f.Close()
if err = f.Close(); err != nil {
return err
}

kus := kustypes.Kustomization{
TypeMeta: kustypes.TypeMeta{
@@ -247,7 +249,7 @@ var kustomizeBuildMutex sync.Mutex
// - disable plugins except for the builtin ones
func secureBuildKustomization(root, dirPath string) (resmap.ResMap, error) {
// Create secure FS for root
fs, err := securefs.MakeFsOnDiskSecure(root)
fs, err := securefs.MakeFsOnDiskSecureBuild(root)
if err != nil {
return nil, err
}
32 changes: 32 additions & 0 deletions controllers/kustomization_generator_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package controllers

import (
"testing"

. "github.com/onsi/gomega"
)

func Test_secureBuildKustomization(t *testing.T) {
t.Run("remote build", func(t *testing.T) {
g := NewWithT(t)

_, err := secureBuildKustomization("testdata/remote", "testdata/remote")
g.Expect(err).ToNot(HaveOccurred())
})
}
7 changes: 7 additions & 0 deletions controllers/testdata/remote/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/fluxcd/kustomize-controller//config/crd?ref=main
- git::https://github.com/fluxcd/kustomize-controller//config/rbac?ref=main
- https://github.com/fluxcd/kustomize-controller//config/manager?ref=main
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@ require (
github.com/cyphar/filepath-securejoin v0.2.3
github.com/dimchansky/utfbom v1.1.1
github.com/drone/envsubst v1.0.3
github.com/fluxcd/kustomize-controller/api v0.24.0
github.com/fluxcd/kustomize-controller/api v0.24.1
github.com/fluxcd/pkg/apis/acl v0.0.3
github.com/fluxcd/pkg/apis/kustomize v0.3.3
github.com/fluxcd/pkg/apis/meta v0.12.2
github.com/fluxcd/pkg/kustomize v0.2.0
github.com/fluxcd/pkg/kustomize v0.3.0
github.com/fluxcd/pkg/runtime v0.14.1
github.com/fluxcd/pkg/ssa v0.15.2
github.com/fluxcd/pkg/testserver v0.2.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -276,8 +276,8 @@ github.com/fluxcd/pkg/apis/kustomize v0.3.3 h1:bPN29SdVzWl0yhgivuf/83IAe2R6vUuDV
github.com/fluxcd/pkg/apis/kustomize v0.3.3/go.mod h1:5HTOFZfQFVMMqR2rvuxpbZhpb+sQpcTT6RCQZOhjFzA=
github.com/fluxcd/pkg/apis/meta v0.12.2 h1:AiKAZxLyPtV150y63WC+mL1Qm4x5qWQmW6r4mLy1i8c=
github.com/fluxcd/pkg/apis/meta v0.12.2/go.mod h1:Z26X5uTU5LxAyWETGueRQY7TvdPaGfKU7Wye9bdUlho=
github.com/fluxcd/pkg/kustomize v0.2.0 h1:twiGAFJctt2tyH8vHxL1uqb6BlU3B9ZqG8uSlluuioM=
github.com/fluxcd/pkg/kustomize v0.2.0/go.mod h1:Qczvl7vNY9NJBpyaFrldsxfGjj6uaMcMmKGsSJ6hcxc=
github.com/fluxcd/pkg/kustomize v0.3.0 h1:mrUsbONJxw1YapmIhim4C7yDGNILmQnAEFolrUdRx+s=
github.com/fluxcd/pkg/kustomize v0.3.0/go.mod h1:Qczvl7vNY9NJBpyaFrldsxfGjj6uaMcMmKGsSJ6hcxc=
github.com/fluxcd/pkg/runtime v0.14.1 h1:ZbS3RzR+f+wu1e6Y7GoCxY9PFZkOgX6/gL7Enr75CY0=
github.com/fluxcd/pkg/runtime v0.14.1/go.mod h1:eS4378ydLlWPt2fFjcrAAnJegGJNj3Q/iqYZqjBeWlM=
github.com/fluxcd/pkg/ssa v0.15.2 h1:hLEIh7Ymlt6ihfQHIEx7DjAa+FCndBpHW6wyELToVsI=