Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 logs info updated #3512

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -477,13 +477,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 @@ -493,7 +493,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 @@ -502,14 +502,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 @@ -523,7 +523,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 @@ -533,7 +533,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 @@ -542,7 +542,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 @@ -553,7 +553,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
Loading