@@ -45,7 +45,7 @@ import (
45
45
fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
46
46
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
47
47
48
- imagev1_reflect "github.com/fluxcd/image-reflector-controller/api/v1beta2"
48
+ reflectorv1 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
49
49
aclapi "github.com/fluxcd/pkg/apis/acl"
50
50
"github.com/fluxcd/pkg/apis/meta"
51
51
"github.com/fluxcd/pkg/gittestserver"
@@ -58,7 +58,6 @@ import (
58
58
imagev1 "github.com/fluxcd/image-automation-controller/api/v1beta2"
59
59
"github.com/fluxcd/image-automation-controller/internal/source"
60
60
"github.com/fluxcd/image-automation-controller/internal/testutil"
61
- "github.com/fluxcd/image-automation-controller/pkg/test"
62
61
)
63
62
64
63
const (
@@ -141,12 +140,12 @@ func TestImageUpdateAutomationReconciler_deleteBeforeFinalizer(t *testing.T) {
141
140
func TestImageUpdateAutomationReconciler_watchSourceAndLatestImage (t * testing.T ) {
142
141
g := NewWithT (t )
143
142
144
- policySpec := imagev1_reflect .ImagePolicySpec {
143
+ policySpec := reflectorv1 .ImagePolicySpec {
145
144
ImageRepositoryRef : meta.NamespacedObjectReference {
146
145
Name : "not-expected-to-exist" ,
147
146
},
148
- Policy : imagev1_reflect .ImagePolicyChoice {
149
- SemVer : & imagev1_reflect .SemVerPolicy {
147
+ Policy : reflectorv1 .ImagePolicyChoice {
148
+ SemVer : & reflectorv1 .SemVerPolicy {
150
149
Range : "1.x" ,
151
150
},
152
151
},
@@ -267,12 +266,12 @@ func TestImageUpdateAutomationReconciler_suspended(t *testing.T) {
267
266
}
268
267
269
268
func TestImageUpdateAutomationReconciler_Reconcile (t * testing.T ) {
270
- policySpec := imagev1_reflect .ImagePolicySpec {
269
+ policySpec := reflectorv1 .ImagePolicySpec {
271
270
ImageRepositoryRef : meta.NamespacedObjectReference {
272
271
Name : "not-expected-to-exist" ,
273
272
},
274
- Policy : imagev1_reflect .ImagePolicyChoice {
275
- SemVer : & imagev1_reflect .SemVerPolicy {
273
+ Policy : reflectorv1 .ImagePolicyChoice {
274
+ SemVer : & reflectorv1 .SemVerPolicy {
276
275
Range : "1.x" ,
277
276
},
278
277
},
@@ -707,12 +706,12 @@ func TestImageUpdateAutomationReconciler_Reconcile(t *testing.T) {
707
706
}
708
707
709
708
func TestImageUpdateAutomationReconciler_commitMessage (t * testing.T ) {
710
- policySpec := imagev1_reflect .ImagePolicySpec {
709
+ policySpec := reflectorv1 .ImagePolicySpec {
711
710
ImageRepositoryRef : meta.NamespacedObjectReference {
712
711
Name : "not-expected-to-exist" ,
713
712
},
714
- Policy : imagev1_reflect .ImagePolicyChoice {
715
- SemVer : & imagev1_reflect .SemVerPolicy {
713
+ Policy : reflectorv1 .ImagePolicyChoice {
714
+ SemVer : & reflectorv1 .SemVerPolicy {
716
715
Range : "1.x" ,
717
716
},
718
717
},
@@ -845,12 +844,12 @@ Automation: %s/update-test
845
844
846
845
// TestImageUpdateAutomationReconciler_removedTemplateField tests removed template field usage (.Updated and .Changed.ImageResult).
847
846
func TestImageUpdateAutomationReconciler_removedTemplateField (t * testing.T ) {
848
- policySpec := imagev1_reflect .ImagePolicySpec {
847
+ policySpec := reflectorv1 .ImagePolicySpec {
849
848
ImageRepositoryRef : meta.NamespacedObjectReference {
850
849
Name : "not-expected-to-exist" ,
851
850
},
852
- Policy : imagev1_reflect .ImagePolicyChoice {
853
- SemVer : & imagev1_reflect .SemVerPolicy {
851
+ Policy : reflectorv1 .ImagePolicyChoice {
852
+ SemVer : & reflectorv1 .SemVerPolicy {
854
853
Range : "1.x" ,
855
854
},
856
855
},
@@ -973,12 +972,12 @@ Images:
973
972
974
973
func TestImageUpdateAutomationReconciler_crossNamespaceRef (t * testing.T ) {
975
974
g := NewWithT (t )
976
- policySpec := imagev1_reflect .ImagePolicySpec {
975
+ policySpec := reflectorv1 .ImagePolicySpec {
977
976
ImageRepositoryRef : meta.NamespacedObjectReference {
978
977
Name : "not-expected-to-exist" ,
979
978
},
980
- Policy : imagev1_reflect .ImagePolicyChoice {
981
- SemVer : & imagev1_reflect .SemVerPolicy {
979
+ Policy : reflectorv1 .ImagePolicyChoice {
980
+ SemVer : & reflectorv1 .SemVerPolicy {
982
981
Range : "1.x" ,
983
982
},
984
983
},
@@ -1056,7 +1055,7 @@ func TestImageUpdateAutomationReconciler_crossNamespaceRef(t *testing.T) {
1056
1055
r := & ImageUpdateAutomationReconciler {
1057
1056
Client : fakeclient .NewClientBuilder ().
1058
1057
WithScheme (testEnv .Scheme ()).
1059
- WithStatusSubresource (& imagev1.ImageUpdateAutomation {}, & imagev1_reflect .ImagePolicy {}).
1058
+ WithStatusSubresource (& imagev1.ImageUpdateAutomation {}, & reflectorv1 .ImagePolicy {}).
1060
1059
Build (),
1061
1060
EventRecorder : testEnv .GetEventRecorderFor ("image-automation-controller" ),
1062
1061
NoCrossNamespaceRef : true ,
@@ -1105,12 +1104,12 @@ func TestImageUpdateAutomationReconciler_crossNamespaceRef(t *testing.T) {
1105
1104
}
1106
1105
1107
1106
func TestImageUpdateAutomationReconciler_updatePath (t * testing.T ) {
1108
- policySpec := imagev1_reflect .ImagePolicySpec {
1107
+ policySpec := reflectorv1 .ImagePolicySpec {
1109
1108
ImageRepositoryRef : meta.NamespacedObjectReference {
1110
1109
Name : "not-expected-to-exist" ,
1111
1110
},
1112
- Policy : imagev1_reflect .ImagePolicyChoice {
1113
- SemVer : & imagev1_reflect .SemVerPolicy {
1111
+ Policy : reflectorv1 .ImagePolicyChoice {
1112
+ SemVer : & reflectorv1 .SemVerPolicy {
1114
1113
Range : "1.x" ,
1115
1114
},
1116
1115
},
@@ -1187,12 +1186,12 @@ func TestImageUpdateAutomationReconciler_updatePath(t *testing.T) {
1187
1186
}
1188
1187
1189
1188
func TestImageUpdateAutomationReconciler_signedCommit (t * testing.T ) {
1190
- policySpec := imagev1_reflect .ImagePolicySpec {
1189
+ policySpec := reflectorv1 .ImagePolicySpec {
1191
1190
ImageRepositoryRef : meta.NamespacedObjectReference {
1192
1191
Name : "not-expected-to-exist" ,
1193
1192
},
1194
- Policy : imagev1_reflect .ImagePolicyChoice {
1195
- SemVer : & imagev1_reflect .SemVerPolicy {
1193
+ Policy : reflectorv1 .ImagePolicyChoice {
1194
+ SemVer : & reflectorv1 .SemVerPolicy {
1196
1195
Range : "1.x" ,
1197
1196
},
1198
1197
},
@@ -1722,10 +1721,10 @@ func Test_getPolicies(t *testing.T) {
1722
1721
// Create all the test policies.
1723
1722
testObjects := []client.Object {}
1724
1723
for _ , p := range tt .policies {
1725
- aPolicy := & imagev1_reflect .ImagePolicy {}
1724
+ aPolicy := & reflectorv1 .ImagePolicy {}
1726
1725
aPolicy .Name = p .name
1727
1726
aPolicy .Namespace = p .namespace
1728
- aPolicy .Status = imagev1_reflect .ImagePolicyStatus {
1727
+ aPolicy .Status = reflectorv1 .ImagePolicyStatus {
1729
1728
LatestRef : testutil .ImageToRef (p .latestImage ),
1730
1729
}
1731
1730
aPolicy .Labels = p .labels
@@ -1846,7 +1845,7 @@ func compareRepoWithExpected(ctx context.Context, g *WithT, repoURL, branch, fix
1846
1845
defer wt .Filesystem .Remove ("." )
1847
1846
1848
1847
g .Expect (err ).ToNot (HaveOccurred ())
1849
- test .ExpectMatchingDirectories (g , wt .Filesystem .Root (), expected )
1848
+ testutil .ExpectMatchingDirectories (g , wt .Filesystem .Root (), expected )
1850
1849
}
1851
1850
1852
1851
func waitForNewHead (g * WithT , repo * extgogit.Repository , branch , preChangeHash string ) {
@@ -1938,7 +1937,7 @@ func testWithRepoAndImagePolicy(
1938
1937
kClient client.Client ,
1939
1938
namespace string ,
1940
1939
fixture string ,
1941
- policySpec imagev1_reflect .ImagePolicySpec ,
1940
+ policySpec reflectorv1 .ImagePolicySpec ,
1942
1941
latest string ,
1943
1942
testFunc testWithRepoAndImagePolicyTestFunc ) {
1944
1943
// Generate unique repo and policy arguments.
@@ -1955,7 +1954,7 @@ func testWithCustomRepoAndImagePolicy(
1955
1954
g * WithT ,
1956
1955
kClient client.Client ,
1957
1956
fixture string ,
1958
- policySpec imagev1_reflect .ImagePolicySpec ,
1957
+ policySpec reflectorv1 .ImagePolicySpec ,
1959
1958
latest string ,
1960
1959
args repoAndPolicyArgs ,
1961
1960
testFunc testWithRepoAndImagePolicyTestFunc ) {
@@ -2013,21 +2012,21 @@ func createGitRepository(ctx context.Context, kClient client.Client, name, names
2013
2012
}
2014
2013
2015
2014
func createImagePolicyWithLatestImage (ctx context.Context , kClient client.Client , name , namespace , repoRef , semverRange , latest string ) error {
2016
- policySpec := imagev1_reflect .ImagePolicySpec {
2015
+ policySpec := reflectorv1 .ImagePolicySpec {
2017
2016
ImageRepositoryRef : meta.NamespacedObjectReference {
2018
2017
Name : repoRef ,
2019
2018
},
2020
- Policy : imagev1_reflect .ImagePolicyChoice {
2021
- SemVer : & imagev1_reflect .SemVerPolicy {
2019
+ Policy : reflectorv1 .ImagePolicyChoice {
2020
+ SemVer : & reflectorv1 .SemVerPolicy {
2022
2021
Range : semverRange ,
2023
2022
},
2024
2023
},
2025
2024
}
2026
2025
return createImagePolicyWithLatestImageForSpec (ctx , kClient , name , namespace , policySpec , latest )
2027
2026
}
2028
2027
2029
- func createImagePolicyWithLatestImageForSpec (ctx context.Context , kClient client.Client , name , namespace string , policySpec imagev1_reflect .ImagePolicySpec , latest string ) error {
2030
- policy := & imagev1_reflect .ImagePolicy {
2028
+ func createImagePolicyWithLatestImageForSpec (ctx context.Context , kClient client.Client , name , namespace string , policySpec reflectorv1 .ImagePolicySpec , latest string ) error {
2029
+ policy := & reflectorv1 .ImagePolicy {
2031
2030
Spec : policySpec ,
2032
2031
}
2033
2032
policy .Name = name
@@ -2042,7 +2041,7 @@ func createImagePolicyWithLatestImageForSpec(ctx context.Context, kClient client
2042
2041
}
2043
2042
2044
2043
func updateImagePolicyWithLatestImage (ctx context.Context , kClient client.Client , name , namespace , latest string ) error {
2045
- policy := & imagev1_reflect .ImagePolicy {}
2044
+ policy := & reflectorv1 .ImagePolicy {}
2046
2045
key := types.NamespacedName {
2047
2046
Name : name ,
2048
2047
Namespace : namespace ,
@@ -2107,7 +2106,7 @@ func deleteImageUpdateAutomation(ctx context.Context, kClient client.Client, nam
2107
2106
}
2108
2107
2109
2108
func deleteImagePolicy (ctx context.Context , kClient client.Client , name , namespace string ) error {
2110
- imagePolicy := & imagev1_reflect .ImagePolicy {}
2109
+ imagePolicy := & reflectorv1 .ImagePolicy {}
2111
2110
imagePolicy .Name = name
2112
2111
imagePolicy .Namespace = namespace
2113
2112
return kClient .Delete (ctx , imagePolicy )
0 commit comments