Skip to content

Commit

Permalink
🌱 logs info updated (#3512)
Browse files Browse the repository at this point in the history
logs info updated
  • Loading branch information
Sajiyah-Salat committed Aug 15, 2023
1 parent 136aac6 commit 266a038
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newSampleContext(binaryPath string, samplePath string, env ...string) utils

// Prepare the Context for the sample project
func (sp *Sample) Prepare() {
log.Infof("destroying directory for sample project")
log.Infof("destroying directory for component_config sample project")
sp.ctx.Destroy()

log.Infof("refreshing tools and creating directory...")
Expand All @@ -66,7 +66,7 @@ func (sp *Sample) Prepare() {
}

func (sp *Sample) GenerateSampleProject() {
log.Infof("Initializing the project")
log.Infof("Initializing the component config project")
err := sp.ctx.Init(
"--domain", "tutorial.kubebuilder.io",
"--repo", "tutorial.kubebuilder.io/project",
Expand All @@ -75,7 +75,7 @@ func (sp *Sample) GenerateSampleProject() {
"--plugins=go/v4",
"--component-config",
)
CheckError("Initializing the project", err)
CheckError("Initializing the component config project", err)

log.Infof("Adding a new config type")
err = sp.ctx.CreateAPI(
Expand Down
24 changes: 12 additions & 12 deletions hack/docs/internal/cronjob-tutorial/generate_cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newSampleContext(binaryPath string, samplePath string, env ...string) utils

// Prepare the Context for the sample project
func (sp *Sample) Prepare() {
log.Infof("destroying directory for sample project")
log.Infof("destroying directory for cronjob sample project")
sp.ctx.Destroy()

log.Infof("refreshing tools and creating directory...")
Expand All @@ -66,7 +66,7 @@ func (sp *Sample) Prepare() {
}

func (sp *Sample) GenerateSampleProject() {
log.Infof("Initializing the project")
log.Infof("Initializing the cronjob project")

err := sp.ctx.Init(
"--plugins", "go/v4",
Expand All @@ -75,7 +75,7 @@ func (sp *Sample) GenerateSampleProject() {
"--license", "apache2",
"--owner", "The Kubernetes authors",
)
CheckError("Initializing the project", err)
CheckError("Initializing the cronjob project", err)

log.Infof("Adding a new config type")
err = sp.ctx.CreateAPI(
Expand Down Expand Up @@ -466,13 +466,13 @@ func updateSuiteTest(sp *Sample) {
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`limitations under the License.
*/`, SuiteTestIntro)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add license intro", err)

err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`import (`, `
"context"`)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add context", err)

err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -481,7 +481,7 @@ func updateSuiteTest(sp *Sample) {
`, `
ctrl "sigs.k8s.io/controller-runtime"
`)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add ctrl import", err)

err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -490,14 +490,14 @@ var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
`, SuiteTestEnv)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add more variables", err)

err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
`, SuiteTestReadCRD)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add text about CRD", err)

err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -507,7 +507,7 @@ var testEnv *envtest.Environment
/*
Then, we start the envtest cluster.
*/`)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add text to show where envtest cluster start", err)

err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -517,7 +517,7 @@ var testEnv *envtest.Environment
//+kubebuilder:scaffold:scheme
`, SuiteTestAddSchema)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to add schema", err)

err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -526,7 +526,7 @@ var testEnv *envtest.Environment
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
`, SuiteTestDescription)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go for test description", err)

err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
Expand All @@ -537,7 +537,7 @@ var _ = AfterSuite(func() {
Expect(err).NotTo(HaveOccurred())
})
`, SuiteTestCleanup)
CheckError("fixing suite_test.go", err)
CheckError("updating suite_test.go to cleanup tests", err)
}

func updateKustomization(sp *Sample) {
Expand Down

0 comments on commit 266a038

Please sign in to comment.