8000 add support for dcos-log v2 by initcore0 · Pull Request #1105 · dcos/dcos-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add support for dcos-log v2 #1105

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

Merged
merged 7 commits into from
Nov 21, 2017
Merged

add support for dcos-log v2 #1105

merged 7 commits into from
Nov 21, 2017

Conversation

initcore0
Copy link
Contributor
@initcore0 initcore0 commented Nov 19, 2017

affected subcommands:

  • dcos task <name> log
  • dcos node log ...
  • dcos service log <name>
  • unittests

If DC/OS cluster has the LOGGING_V2 capability, dcos-cli should use dcos-log v2, otherwise based on the logging strategy mesos files API or dcos-log v1 will be used.

@initcore0
Copy link
Contributor Author

run linux integration tests

@initcore0 initcore0 force-pushed the mnaboka/log-v2 branch 2 times, most recently from 09af8d6 to adc7225 Compare November 20, 2017 21:47
@initcore0 initcore0 changed the title WIP: add support for dcos-log v2 add support for dcos-log v2 Nov 20, 2017
@initcore0
Copy link
Contributor Author

run linux integration tests

Copy link
Contributor
@bamarni bamarni left a comment

Choose a reason for hiding this comment

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

I left some comments, mostly typos

@@ -221,7 +221,19 @@ def has_journald_capability():
get_cosmos_url()).has_capability('LOGGING')


def dcos_log_enabled():
def has_log_v2_capability():
""" function checks thec cosmos capability LOGGING_V2
Copy link
Contributor

Choose a reason for hiding this comment

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

thec -> the

:return: leader logs url
:rtype: str
"""

if version < 1 and version > 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

this can't be evaluated to true, did you mean or?


if len(tasks) != 1:
raise DCOSException(
"found more then one task with the same name: {}. Please provide "
Copy link
Contributor

Choose a reason for hiding this comment

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

then -> than

:param follow: same as unix tail's -f
:type follow: bool
:param task: task pattern to match
:type task: str
Copy link
Contributor

Choose a reason for hiding this comment

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

8000

the param name is tasks

@mock.patch('dcos.config.get_config_val')
@mock.patch('dcos.http.get')
@mock.patch('dcoscli.log.dcos_log_enabled')
def test_dcos_log_v2_leader_mesos(mocked_dcos_log_enabked, mocked_http_get,
Copy link
Contributor

Choose a reason for hiding this comment

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

there are multiple occurences of mocked_dcos_log_enabked instead of mocked_dcos_log_enabled in this file.

dcos task <name> log will check the LOGGING_V2 capability first. If V2 is
enabled, it will be used by default. Otherwise it will check for logging
strategy in the cluster and use either mesos files API directly or dcos-log v1.
@initcore0
Copy link
Contributor Author

run linux integration tests

@initcore0
Copy link
Contributor Author

@bamarni i addressed your comments, please review again

Copy link
Contributor
@bamarni bamarni left a comment

Choose a reason for hiding this comment

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

LGTM

@initcore0 initcore0 merged commit c014477 into dcos:master Nov 21, 2017
@initcore0 initcore0 deleted the mnaboka/log-v2 branch November 21, 2017 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0