@@ -56,7 +56,7 @@ func newSampleContext(binaryPath string, samplePath string, env ...string) utils
56
56
57
57
// Prepare the Context for the sample project
58
58
func (sp * Sample ) Prepare () {
59
- log .Infof ("destroying directory for sample project" )
59
+ log .Infof ("destroying directory for cronjob sample project" )
60
60
sp .ctx .Destroy ()
61
61
62
62
log .Infof ("refreshing tools and creating directory..." )
@@ -66,7 +66,7 @@ func (sp *Sample) Prepare() {
66
66
}
67
67
68
68
func (sp * Sample ) GenerateSampleProject () {
69
- log .Infof ("Initializing the project" )
69
+ log .Infof ("Initializing the cronjob project" )
70
70
71
71
err := sp .ctx .Init (
72
72
"--plugins" , "go/v4" ,
@@ -75,7 +75,7 @@ func (sp *Sample) GenerateSampleProject() {
75
75
"--license" , "apache2" ,
76
76
"--owner" , "The Kubernetes authors" ,
77
77
)
78
- CheckError ("Initializing the project" , err )
78
+ CheckError ("Initializing the cronjob project" , err )
79
79
80
80
log .Infof ("Adding a new config type" )
81
81
err = sp .ctx .CreateAPI (
@@ -466,13 +466,13 @@ func updateSuiteTest(sp *Sample) {
466
466
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
467
467
`limitations under the License.
468
468
*/` , SuiteTestIntro )
469
- CheckError ("fixing suite_test.go" , err )
469
+ CheckError ("updating suite_test.go to add license intro " , err )
470
470
471
471
err = pluginutil .InsertCode (
472
472
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
473
473
`import (` , `
474
474
"context"` )
475
- CheckError ("fixing suite_test.go" , err )
475
+ CheckError ("updating suite_test.go to add context " , err )
476
476
477
477
err = pluginutil .InsertCode (
478
478
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -481,7 +481,7 @@ func updateSuiteTest(sp *Sample) {
481
481
` , `
482
482
ctrl "sigs.k8s.io/controller-runtime"
483
483
` )
484
- CheckError ("fixing suite_test.go" , err )
484
+ CheckError ("updating suite_test.go to add ctrl import " , err )
485
485
486
486
err = pluginutil .ReplaceInFile (
487
487
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -490,14 +490,14 @@ var cfg *rest.Config
490
490
var k8sClient client.Client
491
491
var testEnv *envtest.Environment
492
492
` , SuiteTestEnv )
493
- CheckError ("fixing suite_test.go" , err )
493
+ CheckError ("updating suite_test.go to add more variables " , err )
494
494
495
495
err = pluginutil .InsertCode (
496
496
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
497
497
`
498
498
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
499
499
` , SuiteTestReadCRD )
500
- CheckError ("fixing suite_test.go" , err )
500
+ CheckError ("updating suite_test.go to add text about CRD " , err )
501
501
502
502
err = pluginutil .InsertCode (
503
503
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -507,7 +507,7 @@ var testEnv *envtest.Environment
507
507
/*
508
508
Then, we start the envtest cluster.
509
509
*/` )
510
- CheckError ("fixing suite_test.go" , err )
510
+ CheckError ("updating suite_test.go to add text to show where envtest cluster start " , err )
511
511
512
512
err = pluginutil .ReplaceInFile (
513
513
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -517,7 +517,7 @@ var testEnv *envtest.Environment
517
517
518
518
//+kubebuilder:scaffold:scheme
519
519
` , SuiteTestAddSchema )
520
- CheckError ("fixing suite_test.go" , err )
520
+ CheckError ("updating suite_test.go to add schema " , err )
521
521
522
522
err = pluginutil .InsertCode (
523
523
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -526,7 +526,7 @@ var testEnv *envtest.Environment
526
526
Expect(err).NotTo(HaveOccurred())
527
527
Expect(k8sClient).NotTo(BeNil())
528
528
` , SuiteTestDescription )
529
- CheckError ("fixing suite_test.go" , err )
529
+ CheckError ("updating suite_test.go for test description " , err )
530
530
531
531
err = pluginutil .ReplaceInFile (
532
532
filepath .Join (sp .ctx .Dir , "internal/controller/suite_test.go" ),
@@ -537,7 +537,7 @@ var _ = AfterSuite(func() {
537
537
Expect(err).NotTo(HaveOccurred())
538
538
})
539
539
` , SuiteTestCleanup )
540
- CheckError ("fixing suite_test.go" , err )
540
+ CheckError ("updating suite_test.go to cleanup tests " , err )
541
541
}
542
542
543
543
func updateKustomization (sp * Sample ) {
0 commit comments