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

H&H: Allow using Test Console (standalone) from operator 🤘 #666

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

jotak
Copy link
Member

@jotak jotak commented May 31, 2024

Description

To be used with a standalone plugin build image such as: quay.io/jotak/network-observability-standalone-frontend:riviera2024

Set spec.consolePlugin.advanced.env.TEST_CONSOLE "true"

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@jotak jotak requested a review from jpinsonneau May 31, 2024 16:43
@jotak jotak added no-qe This PR doesn't necessitate QE approval no-doc This PR doesn't require documentation change on the NetObserv operator labels May 31, 2024
Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 82.92683% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 66.55%. Comparing base (1ac0142) to head (6536824).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #666      +/-   ##
==========================================
+ Coverage   66.53%   66.55%   +0.01%     
==========================================
  Files          70       70              
  Lines        8095     8108      +13     
==========================================
+ Hits         5386     5396      +10     
- Misses       2315     2316       +1     
- Partials      394      396       +2     
Flag Coverage Δ
unittests 66.55% <82.92%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
controllers/flowcollector_controller.go 72.09% <100.00%> (-0.95%) ⬇️
pkg/helper/flowcollector.go 82.71% <100.00%> (+0.49%) ⬆️
controllers/consoleplugin/consoleplugin_objects.go 86.74% <86.95%> (-0.48%) ⬇️
...trollers/consoleplugin/consoleplugin_reconciler.go 71.64% <42.85%> (+0.42%) ⬆️

@jotak jotak changed the title H&H: Allow using Test Console (standalone) from operator H&H: Allow using Test Console (standalone) from operator 🤘 May 31, 2024
Copy link
Contributor

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

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

Looks good, just a small suggestion

func UseTestConsolePlugin(spec *flowslatest.FlowCollectorSpec) bool {
if spec.ConsolePlugin.Advanced != nil {
env := spec.ConsolePlugin.Advanced.Env[constants.EnvTestConsole]
return env == "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use:

Suggested change
return env == "true"
return strconv.ParseBool(env)

and manage errors here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tend to prefer just checking the correct case here, because it's simpler and (this is subjective) I don't believe the error brings much value here - but I don't have stronger arguments to give :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

it's more for consistency with eBPF environment variables than anything.

These allow upper case "True" for example

@openshift-ci openshift-ci bot removed the lgtm label Jun 3, 2024
Copy link
Contributor

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

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

Perfect ! Thanks @jotak

@openshift-ci openshift-ci bot added the lgtm label Jun 3, 2024
@jotak
Copy link
Member Author

jotak commented Jun 3, 2024

/approve

Copy link

openshift-ci bot commented Jun 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak

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 label Jun 3, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit a90617d into netobserv:main Jun 3, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm no-doc This PR doesn't require documentation change on the NetObserv operator no-qe This PR doesn't necessitate QE approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants