@@ -17,11 +17,10 @@ limitations under the License.
1717package multiversion
1818
1919import (
20+ log "log/slog"
2021 "os/exec"
2122 "path/filepath"
2223
23- log "github.com/sirupsen/logrus"
24-
2524 hackutils "sigs.k8s.io/kubebuilder/v4/hack/docs/utils"
2625 pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
2726 "sigs.k8s.io/kubebuilder/v4/test/e2e/utils"
@@ -34,23 +33,23 @@ type Sample struct {
3433
3534// NewSample create a new instance of the sample and configure the KB CLI that will be used
3635func NewSample (binaryPath , samplePath string ) Sample {
37- log .Infof ("Generating the sample context of MultiVersion Cronjob..." )
36+ log .Info ("Generating the sample context of MultiVersion Cronjob..." )
3837 ctx := hackutils .NewSampleContext (binaryPath , samplePath , "GO111MODULE=on" )
3938 return Sample {& ctx }
4039}
4140
4241// Prepare the Context for the sample project
4342func (sp * Sample ) Prepare () {
44- log .Infof ("refreshing tools and creating directory for multiversion ..." )
43+ log .Info ("refreshing tools and creating directory for multiversion ..." )
4544 err := sp .ctx .Prepare ()
4645 hackutils .CheckError ("creating directory for multiversion project" , err )
4746}
4847
4948// GenerateSampleProject will generate the sample
5049func (sp * Sample ) GenerateSampleProject () {
51- log .Infof ("Initializing the multiversion cronjob project" )
50+ log .Info ("Initializing the multiversion cronjob project" )
5251
53- log .Infof ("Creating v2 API" )
52+ log .Info ("Creating v2 API" )
5453 err := sp .ctx .CreateAPI (
5554 "--group" , "batch" ,
5655 "--version" , "v2" ,
@@ -60,7 +59,7 @@ func (sp *Sample) GenerateSampleProject() {
6059 )
6160 hackutils .CheckError ("Creating the v2 API without controller" , err )
6261
63- log .Infof ("Creating conversion webhook for v1" )
62+ log .Info ("Creating conversion webhook for v1" )
6463 err = sp .ctx .CreateWebhook (
6564 "--group" , "batch" ,
6665 "--version" , "v1" ,
@@ -71,7 +70,7 @@ func (sp *Sample) GenerateSampleProject() {
7170 )
7271 hackutils .CheckError ("Creating conversion webhook for v1" , err )
7372
74- log .Infof ("Workaround to fix the issue with the conversion webhook" )
73+ log .Info ("Workaround to fix the issue with the conversion webhook" )
7574 // FIXME: This is a workaround to fix the issue with the conversion webhook
7675 // We should be able to inject the code when we create webhooks with different
7776 // types of webhooks. However, currently, we are not able to do that and we need to
@@ -81,7 +80,7 @@ func (sp *Sample) GenerateSampleProject() {
8180 _ , err = sp .ctx .Run (cmd )
8281 hackutils .CheckError ("Copying the code from cronjob tutorial" , err )
8382
84- log .Infof ("Creating defaulting and validation webhook for v2" )
83+ log .Info ("Creating defaulting and validation webhook for v2" )
8584 err = sp .ctx .CreateWebhook (
8685 "--group" , "batch" ,
8786 "--version" , "v2" ,
@@ -94,7 +93,7 @@ func (sp *Sample) GenerateSampleProject() {
9493
9594// UpdateTutorial the muilt-version sample tutorial with the scaffold changes
9695func (sp * Sample ) UpdateTutorial () {
97- log .Println ("Update tutorial with multiversion code" )
96+ log .Info ("Update tutorial with multiversion code" )
9897
9998 // Update files according to the multiversion
10099 sp .updateCronjobV1DueForce ()
0 commit comments