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

remove all the log files when running crc delete --clear-cache #3753

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

anjannath
Copy link
Member

currently after #3720 was merged it is only deleting the
'crc.log' and 'crcd.log' files and not deleting the backups

@cfergeau
Copy link
Contributor

/lgtm

@praveenkumar
Copy link
Member

/hold

Till it is tested on windows.

cmd/crc/cmd/delete.go Outdated Show resolved Hide resolved
@anjannath anjannath force-pushed the logfile-cleaning branch 2 times, most recently from 04e33f0 to e576d38 Compare July 24, 2023 05:45
@anjannath
Copy link
Member Author

/retest

1 similar comment
@anjannath
Copy link
Member Author

/retest

@anjannath
Copy link
Member Author

/test integration-crc

@anjannath
Copy link
Member Author

@praveenkumar tested on windows as well now, and the behavior is modified to delete all log files on crc cleanup and only delete the backed up log files on crc delete --clear-cache

Copy link
Contributor

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack from me, just one minor remark regarding one of the comments.

pkg/os/util.go Outdated
@@ -113,3 +113,17 @@ func RemoveFileIfExists(path string) error {
func RunningUsingSSH() bool {
return os.Getenv("SSH_TTY") != ""
}

// RemoveFileGlob takes a glob pattern as string and removes the files that matches
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the files and directories that matches (because of the use of RemoveAll)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfergeau @praveenkumar after this change we can merge, right?

@anjannath ^^^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@openshift-ci openshift-ci bot added the lgtm label Jul 28, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jul 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

currently after crc-org#3720 was merged it is deleting the
'crc.log' and 'crcd.log' files and not deleting the backups

this adds deletion of the backed up log files named crc-*.log
and removes deletion of the crc.log file which is handled  by
'crc cleanup'

it removes the deletion of crcd.log file as when delete is
performed the daemon still keeps running in the background
this renames the removeOldLogs func to removeAllLogs
and uses the 'RemoveFileGlob' func with '*.log' glob
which deletes all the log files
this was mistakenly recreated inside the InitLogrus function again
@openshift-ci
Copy link

openshift-ci bot commented Jul 31, 2023

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link

openshift-ci bot commented Jul 31, 2023

@anjannath: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-crc d61deb2 link true /test integration-crc
ci/prow/e2e-crc d61deb2 link true /test e2e-crc

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@praveenkumar praveenkumar merged commit 4a4e889 into crc-org:main Aug 8, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants