Skip to content

Commit 622a87a

Browse files
committed
Depend on the Kustomize API from fluxcd/pkg
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent d753d56 commit 622a87a

16 files changed

+154
-460
lines changed

api/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/fluxcd/helm-controller/api
33
go 1.15
44

55
require (
6+
github.com/fluxcd/pkg/apis/kustomize v0.0.1
67
github.com/fluxcd/pkg/apis/meta v0.7.0
78
github.com/fluxcd/pkg/runtime v0.6.2
89
k8s.io/apiextensions-apiserver v0.20.2

api/go.sum

+2-7
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0
5050
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
5151
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
5252
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
53-
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
5453
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
5554
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
56-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
5755
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
5856
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
5957
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -113,6 +111,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
113111
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
114112
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
115113
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
114+
github.com/fluxcd/pkg/apis/kustomize v0.0.1 h1:TkA80R0GopRY27VJqzKyS6ifiKIAfwBd7OHXtV3t2CI=
115+
github.com/fluxcd/pkg/apis/kustomize v0.0.1/go.mod h1:JAFPfnRmcrAoG1gNiA8kmEXsnOBuDyZ/F5X4DAQcVV0=
116116
github.com/fluxcd/pkg/apis/meta v0.5.0/go.mod h1:aEUuZIawboAAFLlYz/juVJ7KNmlWbBtJFYkOWWmGUR4=
117117
github.com/fluxcd/pkg/apis/meta v0.7.0 h1:5e8gm4OLqjuKWdrOIY5DEEsjcwzyJFK8rCDesJ+V8IY=
118118
github.com/fluxcd/pkg/apis/meta v0.7.0/go.mod h1:yHuY8kyGHYz22I0jQzqMMGCcHViuzC/WPdo9Gisk8Po=
@@ -150,13 +150,11 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+
150150
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
151151
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
152152
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
153-
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
154153
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
155154
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
156155
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
157156
github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
158157
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
159-
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
160158
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
161159
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
162160
github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
@@ -179,7 +177,6 @@ github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dp
179177
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
180178
github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
181179
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
182-
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
183180
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
184181
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
185182
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
@@ -307,7 +304,6 @@ github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN
307304
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
308305
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
309306
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
310-
github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
311307
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
312308
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
313309
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
@@ -357,7 +353,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
357353
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
358354
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
359355
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
360-
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
361356
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
362357
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
363358
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

api/v2beta1/helmrelease_types.go

+3-11
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@ import (
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/types"
2727

28+
"github.com/fluxcd/pkg/apis/kustomize"
2829
"github.com/fluxcd/pkg/apis/meta"
2930
"github.com/fluxcd/pkg/runtime/dependency"
3031
)
3132

3233
const HelmReleaseKind = "HelmRelease"
3334
const HelmReleaseFinalizer = "finalizers.fluxcd.io"
3435

35-
// PatchJSON6902 contains a JSON patch and the target it applies to.
36-
type PatchJSON6902 struct {
37-
// Patch is the YAML content of a patch.
38-
Patch []apiextensionsv1.JSON `json:"patch,omitempty" yaml:"patch,omitempty"`
39-
40-
// Target points to the resources that the patch is applied to.
41-
Target Selector `json:"target,omitempty" yaml:"target,omitempty"`
42-
}
43-
4436
// Kustomize Helm PostRenderer specification.
4537
type Kustomize struct {
4638
// Strategic merge patches, defined as inline YAML objects.
@@ -49,13 +41,13 @@ type Kustomize struct {
4941

5042
// JSON 6902 patches, defined as inline YAML objects.
5143
// +optional
52-
PatchesJSON6902 []PatchJSON6902 `json:"patchesJson6902,omitempty"`
44+
PatchesJSON6902 []kustomize.JSON6902Patch `json:"patchesJson6902,omitempty"`
5345

5446
// Images is a list of (image name, new name, new tag or digest)
5547
// for changing image names, tags or digests. This can also be achieved with a
5648
// patch, but this operator is simpler to specify.
5749
// +optional
58-
Images []Image `json:"images,omitempty" yaml:"images,omitempty"`
50+
Images []kustomize.Image `json:"images,omitempty" yaml:"images,omitempty"`
5951
}
6052

6153
// PostRenderer contains a Helm PostRenderer specification.

api/v2beta1/kustomization_types.go

-65
This file was deleted.

api/v2beta1/zz_generated.deepcopy.go

+4-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml

+46-5
Original file line numberDiff line numberDiff line change
@@ -250,44 +250,85 @@ spec:
250250
description: NewTag is the value used to replace the
251251
original tag.
252252
type: string
253+
required:
254+
- name
253255
type: object
254256
type: array
255257
patchesJson6902:
256258
description: JSON 6902 patches, defined as inline YAML objects.
257259
items:
258-
description: PatchJSON6902 contains a JSON patch and the
259-
target it applies to.
260+
description: JSON6902Patch contains a JSON6902 patch and
261+
the target the patch should be applied to.
260262
properties:
261263
patch:
262-
description: Patch is the YAML content of a patch.
264+
description: Patch contains the JSON6902 patch document
265+
with an array of operation objects.
263266
items:
264-
x-kubernetes-preserve-unknown-fields: true
267+
description: JSON6902 is a JSON6902 operation object.
268+
https://tools.ietf.org/html/rfc6902#section-4
269+
properties:
270+
from:
271+
type: string
272+
op:
273+
enum:
274+
- test
275+
- remove
276+
- add
277+
- replace
278+
- move
279+
- copy
280+
type: string
281+
path:
282+
type: string
283+
value:
284+
x-kubernetes-preserve-unknown-fields: true
285+
required:
286+
- op
287+
- path
288+
type: object
265289
type: array
266290
target:
267291
description: Target points to the resources that the
268-
patch is applied to.
292+
patch document should be applied to.
269293
properties:
270294
annotationSelector:
271295
description: AnnotationSelector is a string that
272296
follows the label selection expression https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
273297
It matches with the resource annotations.
274298
type: string
275299
group:
300+
description: Group is the API group to select
301+
resources from. Together with Version and Kind
302+
it is capable of unambiguously identifying and/or
303+
selecting resources. https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
276304
type: string
277305
kind:
306+
description: Kind of the API Group to select resources
307+
from. Together with Group and Version it is
308+
capable of unambiguously identifying and/or
309+
selecting resources. https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
278310
type: string
279311
labelSelector:
280312
description: LabelSelector is a string that follows
281313
the label selection expression https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
282314
It matches with the resource labels.
283315
type: string
284316
name:
317+
description: Name to match resources with.
285318
type: string
286319
namespace:
320+
description: Namespace to select resources from.
287321
type: string
288322
version:
323+
description: Version of the API Group to select
324+
resources from. Together with Group and Kind
325+
it is capable of unambiguously identifying and/or
326+
selecting resources. https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md
289327
type: string
290328
type: object
329+
required:
330+
- patch
331+
- target
291332
type: object
292333
type: array
293334
patchesStrategicMerge:

0 commit comments

Comments
 (0)