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

Add KubeletBase base class #9051

Merged
merged 2 commits into from
Mar 30, 2021
Merged

Add KubeletBase base class #9051

merged 2 commits into from
Mar 30, 2021

Conversation

celenechang
Copy link
Contributor

What does this PR do?

Add kubelet_base in datadog_checks_base to be used for checks that need to access Kubelet

Motivation

Put shared code in a single place

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

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

🥇

Comment on lines 7 to 8
from datadog_checks.base import AgentCheck
from datadog_checks.base.utils.date import UTC, parse_rfc3339
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use relative throughout:

Suggested change
from datadog_checks.base import AgentCheck
from datadog_checks.base.utils.date import UTC, parse_rfc3339
from ...utils.date import UTC, parse_rfc3339
from .. import AgentCheck

from datadog_checks.base.checks.kubelet_base.base import KubeletBase, urljoin
from datadog_checks.base.utils.date import UTC

HERE = os.path.abspath(os.path.dirname(__file__))
Copy link
Contributor

Choose a reason for hiding this comment

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

from datadog_checks.dev import get_here

return f.read()


class MockStreamResponse:
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use #8276 e.g.

mock_http_response(file_path=get_fixture_path('linkerd_v2.txt'))

@ofek ofek changed the title [datadog_checks_base] Add kubelet_base to datadog_checks_base Add KubeletBase base class Mar 29, 2021
@ofek ofek merged commit c89fbf8 into master Mar 30, 2021
@ofek ofek deleted the celene/add_base_kubelet branch March 30, 2021 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants