@@ -38,6 +38,16 @@ func doTest(bldPrefix, debugStr string, same bool, oc *exutil.CLI) {
38
38
// corrupt the builder image
39
39
exutil .CorruptImage (fullImageName , corruptor )
40
40
41
+ if bldPrefix == buildPrefixFC || bldPrefix == buildPrefixTC {
42
+ // grant access to the custom build strategy
43
+ err := oc .AsAdmin ().Run ("adm" ).Args ("policy" , "add-cluster-role-to-user" , "system:build-strategy-custom" , oc .Username ()).Execute ()
44
+ o .Expect (err ).NotTo (o .HaveOccurred ())
45
+ defer func () {
46
+ err = oc .AsAdmin ().Run ("adm" ).Args ("policy" , "remove-cluster-role-from-user" , "system:build-strategy-custom" , oc .Username ()).Execute ()
47
+ o .Expect (err ).NotTo (o .HaveOccurred ())
48
+ }()
49
+ }
50
+
41
51
// kick off the app/lang build and verify the builder image accordingly
42
52
_ , err := exutil .StartBuildAndWait (oc , bldPrefix )
43
53
o .ExpectWithOffset (1 , err ).NotTo (o .HaveOccurred ())
@@ -110,6 +120,17 @@ var _ = g.Describe("[LocalNode][builds] forcePull should affect pulling builder
110
120
pre := exutil .FixturePath ("testdata" , "forcepull-test.json" )
111
121
post := exutil .ArtifactPath ("forcepull-test.json" )
112
122
varSubDest = authCfg .ServerAddress + "/" + oc .Namespace ()
123
+
124
+ // grant access to the custom build strategy
125
+ g .By ("granting system:build-strategy-custom" )
126
+ err = oc .AsAdmin ().Run ("adm" ).Args ("policy" , "add-cluster-role-to-user" , "system:build-strategy-custom" , oc .Username ()).Execute ()
127
+ o .Expect (err ).NotTo (o .HaveOccurred ())
128
+
129
+ defer func () {
130
+ err = oc .AsAdmin ().Run ("adm" ).Args ("policy" , "remove-cluster-role-from-user" , "system:build-strategy-custom" , oc .Username ()).Execute ()
131
+ o .Expect (err ).NotTo (o .HaveOccurred ())
132
+ }()
133
+
113
134
err = exutil .VarSubOnFile (pre , post , varSubSrc , varSubDest )
114
135
o .Expect (err ).NotTo (o .HaveOccurred ())
115
136
err = exutil .CreateResource (post , oc )
0 commit comments