Skip to content

Commit

Permalink
Merge pull request #182 from kishen-v/move-to-artifacts
Browse files Browse the repository at this point in the history
Move logs under artifacts
  • Loading branch information
Power Cloud Robot authored Nov 7, 2024
2 parents f3ae7d6 + 6465df5 commit 8f15e09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kubetest2-tf/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog/v2"
"sigs.k8s.io/kubetest2/pkg/artifacts"
"sigs.k8s.io/kubetest2/pkg/types"

"github.com/ppc64le-cloud/kubetest2-plugins/kubetest2-tf/deployer/options"
Expand Down Expand Up @@ -121,7 +122,7 @@ var _ types.Deployer = &deployer{}
func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
d := &deployer{
commonOptions: opts,
logsDir: filepath.Join(opts.RunDir(), "logs"),
logsDir: filepath.Join(artifacts.BaseDir(), "logs"),
BuildOptions: &options.BuildOptions{
CommonBuildOptions: &build.Options{
Builder: &build.NoopBuilder{},
Expand Down
3 changes: 3 additions & 0 deletions kubetest2-tf/deployer/dumplogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (d *deployer) DumpClusterLogs() error {
for _, machineIP := range d.machineIPs {
klog.Infof("Collecting node level information from PowerVS instance %s", machineIP)
for logFile, command := range commandFilename {
stdOut.Reset()
stdErr.Reset()
commandArgs := []string{
"ssh",
"-i",
Expand All @@ -85,6 +87,7 @@ func (d *deployer) DumpClusterLogs() error {
errors = append(errors, fmt.Errorf("Failed to create a log-file: %v", err))
continue
} else {
outfile.WriteString(string(stdOut.Bytes()))
outfile.Close()
}
}
Expand Down

0 comments on commit 8f15e09

Please sign in to comment.