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

Fix audit log file permission and use date suffix in name #181

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

congqixia
Copy link
Collaborator

Resolves #180
/kind bug

@sre-ci-robot sre-ci-robot added the kind/bug Something isn't working label Aug 10, 2023
@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia

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

@@ -119,7 +120,8 @@ func (s *InstanceState) DryModeCommand(ctx context.Context, p *DryModeParam) {

func getInstanceState(parent *framework.CmdState, cli clientv3.KV, instanceName, metaPath string, etcdState framework.State, config *configs.Config) framework.State {
var kv clientv3.KV
file, err := os.OpenFile("audit.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, os.ModeAppend)
name := fmt.Sprintf("audit_%s.log", time.Now().Format("2006_0102_150405"))
file, err := os.OpenFile(name, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
Copy link
Member

Choose a reason for hiding this comment

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

with `O_TRUNC"?

@yah01
Copy link
Member

yah01 commented Aug 10, 2023

/lgtm

@sre-ci-robot sre-ci-robot added the lgtm look good to me label Aug 10, 2023
@sre-ci-robot sre-ci-robot merged commit 6dace1c into milvus-io:main Aug 10, 2023
@congqixia congqixia deleted the fix_auditlog_permission branch August 18, 2023 06:26
congqixia added a commit to congqixia/birdwatcher that referenced this pull request Aug 18, 2023
sre-ci-robot pushed a commit that referenced this pull request Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-passed kind/bug Something isn't working lgtm look good to me size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: audit.log cannot be opened after second run
3 participants