@@ -17,11 +17,10 @@ limitations under the License.
17
17
package multiversion
18
18
19
19
import (
20
+ log "log/slog"
20
21
"os/exec"
21
22
"path/filepath"
22
23
23
- log "github.com/sirupsen/logrus"
24
-
25
24
hackutils "sigs.k8s.io/kubebuilder/v4/hack/docs/utils"
26
25
pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
27
26
"sigs.k8s.io/kubebuilder/v4/test/e2e/utils"
@@ -34,23 +33,23 @@ type Sample struct {
34
33
35
34
// NewSample create a new instance of the sample and configure the KB CLI that will be used
36
35
func 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..." )
38
37
ctx := hackutils .NewSampleContext (binaryPath , samplePath , "GO111MODULE=on" )
39
38
return Sample {& ctx }
40
39
}
41
40
42
41
// Prepare the Context for the sample project
43
42
func (sp * Sample ) Prepare () {
44
- log .Infof ("refreshing tools and creating directory for multiversion ..." )
43
+ log .Info ("refreshing tools and creating directory for multiversion ..." )
45
44
err := sp .ctx .Prepare ()
46
45
hackutils .CheckError ("creating directory for multiversion project" , err )
47
46
}
48
47
49
48
// GenerateSampleProject will generate the sample
50
49
func (sp * Sample ) GenerateSampleProject () {
51
- log .Infof ("Initializing the multiversion cronjob project" )
50
+ log .Info ("Initializing the multiversion cronjob project" )
52
51
53
- log .Infof ("Creating v2 API" )
52
+ log .Info ("Creating v2 API" )
54
53
err := sp .ctx .CreateAPI (
55
54
"--group" , "batch" ,
56
55
"--version" , "v2" ,
@@ -60,7 +59,7 @@ func (sp *Sample) GenerateSampleProject() {
60
59
)
61
60
hackutils .CheckError ("Creating the v2 API without controller" , err )
62
61
63
- log .Infof ("Creating conversion webhook for v1" )
62
+ log .Info ("Creating conversion webhook for v1" )
64
63
err = sp .ctx .CreateWebhook (
65
64
"--group" , "batch" ,
66
65
"--version" , "v1" ,
@@ -71,7 +70,7 @@ func (sp *Sample) GenerateSampleProject() {
71
70
)
72
71
hackutils .CheckError ("Creating conversion webhook for v1" , err )
73
72
74
- log .Infof ("Workaround to fix the issue with the conversion webhook" )
73
+ log .Info ("Workaround to fix the issue with the conversion webhook" )
75
74
// FIXME: This is a workaround to fix the issue with the conversion webhook
76
75
// We should be able to inject the code when we create webhooks with different
77
76
// types of webhooks. However, currently, we are not able to do that and we need to
@@ -81,7 +80,7 @@ func (sp *Sample) GenerateSampleProject() {
81
80
_ , err = sp .ctx .Run (cmd )
82
81
hackutils .CheckError ("Copying the code from cronjob tutorial" , err )
83
82
84
- log .Infof ("Creating defaulting and validation webhook for v2" )
83
+ log .Info ("Creating defaulting and validation webhook for v2" )
85
84
err = sp .ctx .CreateWebhook (
86
85
"--group" , "batch" ,
87
86
"--version" , "v2" ,
@@ -94,7 +93,7 @@ func (sp *Sample) GenerateSampleProject() {
94
93
95
94
// UpdateTutorial the muilt-version sample tutorial with the scaffold changes
96
95
func (sp * Sample ) UpdateTutorial () {
97
- log .Println ("Update tutorial with multiversion code" )
96
+ log .Info ("Update tutorial with multiversion code" )
98
97
99
98
// Update files according to the multiversion
100
99
sp .updateCronjobV1DueForce ()
0 commit comments