1
+ /*
2
+ Copyright 2021 The Flux authors
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
1
17
package runner
2
18
3
19
import (
4
20
"bytes"
5
21
"encoding/json"
6
22
7
- v2 "github.com/fluxcd/helm-controller/api/v2beta1"
8
23
"sigs.k8s.io/kustomize/api/filesys"
9
24
"sigs.k8s.io/kustomize/api/konfig"
10
25
"sigs.k8s.io/kustomize/api/krusty"
11
26
kustypes "sigs.k8s.io/kustomize/api/types"
27
+
28
+ "github.com/fluxcd/pkg/apis/kustomize"
29
+
30
+ v2 "github.com/fluxcd/helm-controller/api/v2beta1"
12
31
)
13
32
14
33
type postRendererKustomize struct {
@@ -45,7 +64,7 @@ func writeFile(fs filesys.FileSystem, path string, content *bytes.Buffer) error
45
64
return nil
46
65
}
47
66
48
- func adaptImages (images []v2 .Image ) (output []kustypes.Image ) {
67
+ func adaptImages (images []kustomize .Image ) (output []kustypes.Image ) {
49
68
for _ , image := range images {
50
69
output = append (output , kustypes.Image {
51
70
Name : image .Name ,
@@ -57,12 +76,12 @@ func adaptImages(images []v2.Image) (output []kustypes.Image) {
57
76
return
58
77
}
59
78
60
- func adaptSelector (selector * v2 .Selector ) (output * kustypes.Selector ) {
79
+ func adaptSelector (selector * kustomize .Selector ) (output * kustypes.Selector ) {
61
80
if selector != nil {
62
81
output = & kustypes.Selector {}
63
- output .Gvk .Group = selector .Gvk . Group
64
- output .Gvk .Kind = selector .Gvk . Kind
65
- output .Gvk .Version = selector .Gvk . Version
82
+ output .Gvk .Group = selector .Group
83
+ output .Gvk .Kind = selector .Kind
84
+ output .Gvk .Version = selector .Version
66
85
output .Name = selector .Name
67
86
output .Namespace = selector .Namespace
68
87
output .LabelSelector = selector .LabelSelector
0 commit comments