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

OSD-22892 (Part 2): Legacy Probe #241

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

abyrne55
Copy link
Contributor

What does this PR do? / Related Issues / Jira

This PR is composed of commits cherry-picked from my larger OSD-22892 branch for the sake of readability.

These commits introduce LegacyProbe, which implements the Probe interface similarly to CurlJSONProbe. The goal of this Probe is to mimic the functionality of the verifier pre-experimental-probe (i.e., v0.4.10) as closely as possible ("bug-for-bug" 😉) while still adhering to the letter and spirit of the new Probe interface. The x86 AMI IDs included in this PR are the last "golden AMI" images published to the verifier's golden AMI account: hopefully, we don't need to update these much at all.

This PR intentionally does not cover integration of this new code into the verifier's critical path. That integration will be covered in a separate cherry-picked PR. As such, there isn't much to execute for this PR beyond the included unit tests, and even those will likely fail to run until #240 is merged. When reviewing this PR, please focus on code style/structure.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have tested the functionality against gcp / aws, it doesn't cause any regression
  • [ ] I have added execution results to the PR's readme

"github.com/openshift/osd-network-verifier/pkg/output"
)

type LegacyProbe struct{}
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - I personally prefer to not name types starting with the package name, since it's redundant to external callers. e.g. another package calling this would look like legacy.LegacyProbe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hear you; I did feel a twinge of ick while writing that exact reference in the (soon-to-be-PR'd) integration code. Do you have any suggestions of how to avoid?

Copy link
Contributor

Choose a reason for hiding this comment

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

My vote would be to just go with type Probe struct{}, and then external callers would do legacy.Probe which is still clear to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might that conflict with the Probe interface though? Probably not literally due to being in different packages (although legacy is a child of probes), but mentally? Not trying to be obstinate, just want to best understand the suggestion

@AlexVulaj
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
@rafael-azevedo
Copy link
Contributor

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 2, 2024
Copy link
Contributor

@rafael-azevedo rafael-azevedo left a comment

Choose a reason for hiding this comment

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

/lgtm pending merge conflicts will unhold after those are resolved

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2024
Copy link
Contributor

openshift-ci bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rafael-azevedo

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2024
@abyrne55 abyrne55 force-pushed the OSD-22892-legacy branch from ad49eff to 8271c48 Compare July 2, 2024 17:27
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2024
Comment on lines +262 to +263
// TODO: REPLACE JUNK VALUE "helpers.UserdataTemplate" BELOW
data := os.Expand("helpers.UserdataTemplate", variableMapper)
Copy link
Contributor Author

@abyrne55 abyrne55 Jul 2, 2024

Choose a reason for hiding this comment

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

Note: this change will make the compiler happy once we delete helpers.UserdataTemplate (in a future PR; probably "Part 4"). GCP support is already broken, so this logical "non-fix" doesn't actually take anything away.

@abyrne55 abyrne55 force-pushed the OSD-22892-legacy branch from 8271c48 to 7956aad Compare July 2, 2024 17:48
Copy link
Contributor

openshift-ci bot commented Jul 2, 2024

@abyrne55: all tests passed!

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-sigs/prow repository. I understand the commands that are listed here.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 76.78571% with 13 lines in your changes missing coverage. Please review.

Project coverage is 28.81%. Comparing base (efd4245) to head (7956aad).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   27.42%   28.81%   +1.38%     
==========================================
  Files          11       12       +1     
  Lines        1072     1128      +56     
==========================================
+ Hits          294      325      +31     
- Misses        764      786      +22     
- Partials       14       17       +3     
Files Coverage Δ
pkg/probes/legacy/legacy.go 76.78% <76.78%> (ø)

... and 1 file with indirect coverage changes

@rafael-azevedo
Copy link
Contributor

/hold cancel

@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 Jul 2, 2024
@rafael-azevedo
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 652d95d into openshift:main Jul 2, 2024
6 checks passed
@abyrne55 abyrne55 deleted the OSD-22892-legacy branch July 2, 2024 18:29
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants