Skip to content

OCPBUGS-11652: Extend adm node-logs to new API#1403

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
aravindhp:OCPBUGS-11652
Jun 5, 2023
Merged

OCPBUGS-11652: Extend adm node-logs to new API#1403
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
aravindhp:OCPBUGS-11652

Conversation

@aravindhp
Copy link
Copy Markdown
Contributor

@aravindhp aravindhp commented Apr 14, 2023

  • Map --tail internally to tailLines
  • Map --unit internally to query
  • Use service instead of journal in the help to normalize across Linux and Windows

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 14, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 14, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 14, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 14, 2023
@openshift-ci-robot
Copy link
Copy Markdown

@aravindhp: This pull request references Jira Issue OCPBUGS-11652, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

  • Add support for --query, --since-time, --until-time, --tail-lines
  • Map --tail to --tail-lines
  • Map --unit to --query
  • Use service instead of journal in the help to normalize across Linux and Windows

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.

@openshift-ci openshift-ci Bot requested a review from zhouying7780 April 14, 2023 23:19
@aravindhp
Copy link
Copy Markdown
Contributor Author

/test unit
/test verify
/test verify-deps
/test e2e-aws-ovn

@aravindhp
Copy link
Copy Markdown
Contributor Author

/cc @ardaguclu

@openshift-ci openshift-ci Bot requested a review from ardaguclu April 14, 2023 23:21
@aravindhp
Copy link
Copy Markdown
Contributor Author

/cc @soltysh

@openshift-ci openshift-ci Bot requested a review from soltysh April 14, 2023 23:23
Copy link
Copy Markdown
Member

@ardaguclu ardaguclu left a comment

Choose a reason for hiding this comment

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

@aravindhp thanks for the PR. I left a few comments.

Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("--boot accepts values [-100, 0]")
}
if len(o.Query) > 0 && (len(o.Path) > 0 || len(o.Units) > 0) {
return fmt.Errorf("cannot combine --query with --unit or --path")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("cannot combine --query with --unit or --path")
return fmt.Errorf("--path and --unit flags are mutually exclusive with --query")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread pkg/cli/admin/node/logs.go Outdated
Comment thread pkg/cli/admin/node/logs.go
Comment thread pkg/cli/admin/node/logs.go
Copy link
Copy Markdown
Contributor Author

@aravindhp aravindhp left a comment

Choose a reason for hiding this comment

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

Thanks for the review, @ardaguclu. I have responded to your comments.

Comment thread pkg/cli/admin/node/logs.go Outdated
Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("--boot accepts values [-100, 0]")
}
if len(o.Query) > 0 && (len(o.Path) > 0 || len(o.Units) > 0) {
return fmt.Errorf("cannot combine --query with --unit or --path")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread pkg/cli/admin/node/logs.go
Comment thread pkg/cli/admin/node/logs.go
Copy link
Copy Markdown
Member

@ardaguclu ardaguclu left a comment

Choose a reason for hiding this comment

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

If the user sets query, we are setting path to empty string. But we are generating Path by using path flag in here

Resource(mapping.Resource.Resource).SubResource("proxy", "logs").Suffix(o.Path).URL().Path
, will it work for the new API?

Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("cannot combine --since-time with --since or --until")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("--path and --unit flags are mutually exclusive with --query")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread pkg/cli/admin/node/logs.go Outdated
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should be len(o.UntilTime)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry. Fixed.

Copy link
Copy Markdown
Contributor Author

@aravindhp aravindhp left a comment

Choose a reason for hiding this comment

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

If the user sets query, we are setting path to empty string. But we are generating Path by using path flag in here

Resource(mapping.Resource.Resource).SubResource("proxy", "logs").Suffix(o.Path).URL().Path

, will it work for the new API?

Yes that will still work. Setting path to journal means the API call will be proxy/logs/journal?options=. With query it will be proxy/logs/?query=... and that works.

Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("--path and --unit flags are mutually exclusive with --query")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread pkg/cli/admin/node/logs.go Outdated
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry. Fixed.

Comment thread pkg/cli/admin/node/logs.go Outdated
return fmt.Errorf("cannot combine --since-time with --since or --until")
}
if len(o.SinceTime) > 0 && (len(o.Since) > 0 || len(o.Until) > 0) {
return fmt.Errorf("cannot combine --since-time with --since or --until")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ardaguclu
Copy link
Copy Markdown
Member

Sounds good to me, thanks @aravindhp

@aravindhp aravindhp marked this pull request as ready for review April 24, 2023 18:33
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2023
@openshift-ci openshift-ci Bot requested a review from ardaguclu April 24, 2023 18:34
@aravindhp
Copy link
Copy Markdown
Contributor Author

/test e2e-agnostic-ovn-cmd

The failure is in [sig-instrumentation] Prometheus [apigroup:image.openshift.io] when installed on the cluster shouldn't report any alerts in firing state apart from Watchdog and AlertmanagerReceiversNotConfigured and has nothing to do with the changes in this PR.

@aravindhp
Copy link
Copy Markdown
Contributor Author

/retest-required

e2e-aws-ovn-serial failed in [sig-arch] events should not repeat pathologically which has nothing to do with this PR

@ardaguclu
Copy link
Copy Markdown
Member

/test e2e-metal-ipi-ovn-ipv6
/test e2e-aws-ovn-serial

@ardaguclu
Copy link
Copy Markdown
Member

According to the pre-merging tests, this PR is compatible with older server versions. I think, we can merge it especially considering that current oc adm node-logs is not working already.

/lgtm
/hold
feel free to cancel hold tag

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 9, 2023
Copy link
Copy Markdown
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm cancel

Comment thread pkg/cli/admin/node/logs.go
Comment thread pkg/cli/admin/node/logs.go Outdated
Comment thread pkg/cli/admin/node/logs.go Outdated
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 9, 2023
Copy link
Copy Markdown
Contributor Author

@aravindhp aravindhp left a comment

Choose a reason for hiding this comment

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

Thanks for the review, @soltysh. I will address your requests shortly.

Comment thread pkg/cli/admin/node/logs.go
Comment thread pkg/cli/admin/node/logs.go Outdated
Comment thread pkg/cli/admin/node/logs.go Outdated
@aravindhp
Copy link
Copy Markdown
Contributor Author

@soltysh I have addressed your comments. Please review.

@aravindhp
Copy link
Copy Markdown
Contributor Author

/retest-required

Cluster failed to come up e2e-aws-ovn-upgrade

Comment thread pkg/cli/admin/node/logs.go
Comment thread pkg/cli/admin/node/logs.go
@openshift-ci-robot
Copy link
Copy Markdown

@aravindhp: This pull request references Jira Issue OCPBUGS-11652, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

Details

In response to this:

  • Map --tail internally to tailLines
  • Map --unit internally to query
  • Use service instead of journal in the help to normalize across Linux and Windows

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.

Comment thread pkg/cli/admin/node/logs.go Outdated
oc adm node-logs --role master --path=cron

# Display kubelet log from worker nodes using the new query sub-command
oc adm node-logs --role worker --query=kubelet
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now , we can't support query, please remove this example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that. I have now removed it.

- Map --tail internally to tailLines
- Map --unit internally to query
- Use service instead of journal in the help to normalize across Linux
  and Windows
@ardaguclu
Copy link
Copy Markdown
Member

@aravindhp What are we waiting for this PR?, is it requiring a new round of review?

@aravindhp
Copy link
Copy Markdown
Contributor Author

@ardaguclu it is not waiting on anything other than the official QE ack.

/hold cancel
/retest-required

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 31, 2023
@ardaguclu
Copy link
Copy Markdown
Member

I think, we are waiting for the last review from @soltysh;
/test e2e-metal-ipi-ovn-ipv6

@ardaguclu
Copy link
Copy Markdown
Member

@aravindhp I have one last question just for clarification;
will this https://github.com/openshift/origin/blob/6aeee601dea8ecb548c251f6a457ad66f0e44e77/pkg/monitor/nodedetails/node_log.go#L37 continue working after this PR?

@aravindhp
Copy link
Copy Markdown
Contributor Author

Yes the relative time options for --since and --until will continue to work. QE and I have manually have verified this.

@ardaguclu
Copy link
Copy Markdown
Member

/test e2e-metal-ipi-ovn-ipv6

Copy link
Copy Markdown
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aravindhp, ardaguclu, soltysh

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

The pull request process is described here

Details 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

@aravindhp
Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 60caade and 2 for PR HEAD a99b3f0 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2023

@aravindhp: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@openshift-merge-robot openshift-merge-robot merged commit 7339186 into openshift:master Jun 5, 2023
@openshift-ci-robot
Copy link
Copy Markdown

@aravindhp: Jira Issue OCPBUGS-11652: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-11652 has not been moved to the MODIFIED state.

Details

In response to this:

  • Map --tail internally to tailLines
  • Map --unit internally to query
  • Use service instead of journal in the help to normalize across Linux and Windows

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.

@aravindhp aravindhp deleted the OCPBUGS-11652 branch July 21, 2023 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants