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

chore(logs): update log messages for better clarity #9443

Merged
merged 1 commit into from
Jun 19, 2024
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
6 changes: 6 additions & 0 deletions pkg/skaffold/build/cluster/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ const (
)

func (b *Builder) buildWithKaniko(ctx context.Context, out io.Writer, workspace string, artifactName string, artifact *latest.KanikoArtifact, tag string, requiredImages map[string]*string, platforms platform.Matcher) (string, error) {
log.Entry(ctx).Info("Start building with kaniko for artifact")
start := time.Now()
defer func() {
log.Entry(ctx).Infof("Building with kaniko completed in %s", time.Since(start))
}()

// TODO: Implement building multi-platform images for cluster builder
if platforms.IsMultiPlatform() {
log.Entry(ctx).Warnf("multiple target platforms %q found for artifact %q. Skaffold doesn't yet support multi-platform builds for the docker builder. Consider specifying a single target platform explicitly. See https://skaffold.dev/docs/pipeline-stages/builders/#cross-platform-build-support", platforms.String(), artifactName)
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/deploy/cloudrun/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (d *Deployer) deployService(crclient *run.APIService, manifest []byte, out
func (d *Deployer) deployJob(crclient *run.APIService, manifest []byte, out io.Writer) (*RunResourceName, error) {
job := &run.Job{}
if err := k8syaml.Unmarshal(manifest, job); err != nil {
return nil, sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Service config"), &proto.ActionableErr{
return nil, sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Job config"), &proto.ActionableErr{
Message: err.Error(),
ErrCode: proto.StatusCode_DEPLOY_READ_MANIFEST_ERR,
})
Expand Down Expand Up @@ -440,7 +440,7 @@ func (d *Deployer) deleteRunService(crclient *run.APIService, out io.Writer, dry
func (d *Deployer) deleteRunJob(crclient *run.APIService, out io.Writer, dryRun bool, manifest []byte) error {
job := &run.Job{}
if err := k8syaml.Unmarshal(manifest, job); err != nil {
return sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Service config"), &proto.ActionableErr{
return sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Job config"), &proto.ActionableErr{
Message: err.Error(),
ErrCode: proto.StatusCode_DEPLOY_READ_MANIFEST_ERR,
})
Expand Down
7 changes: 6 additions & 1 deletion pkg/skaffold/util/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/constants"
"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/output/log"
timeutil "github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util/time"
)

type headerModifier func(*tar.Header)
Expand Down Expand Up @@ -72,6 +73,11 @@ func CreateTar(ctx context.Context, w io.Writer, root string, paths []string) er
}

log.Entry(ctx).Infof("Creating tar file from %d file(s)", len(paths))
start := time.Now()
defer func() {
log.Entry(ctx).Infof("Creating tar file completed in %s", timeutil.Humanize(time.Since(start)))
}()

for i, path := range paths {
if err := addFileToTar(ctx, root, path, "", tw, nil); err != nil {
return err
Expand All @@ -81,7 +87,6 @@ func CreateTar(ctx context.Context, w io.Writer, root string, paths []string) er
log.Entry(ctx).Infof("Added %d/%d files to tar file", i+1, len(paths))
}
}
log.Entry(ctx).Info("Successfully created tar file")

return nil
}
Expand Down
Loading