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

NETOBSERV-939: Detect which dashboards to show based on ocp version #399

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jotak
Copy link
Member

@jotak jotak commented Jul 25, 2023

This PR is based on #386 - merge it first
Related console-plugin PR: - to come -

Based on OCP version, the console plugin reconciler will configure a
list of dashboard names that are available, so the the plugin will
create links for them

  • Read & compare versions
  • Some refactoring:
    • Permission vendor detection and Available API detection were two
      mechanisms very similar: merge Permission vendor detection in
      Available APIs
    • Reading cluster info (id, version) can also considered as part of the discovery
      mechanism: merge them all in a new ClusterInfo structure, that
      provides the ClusterVersion stuff and the available APIs

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 25, 2023

@jotak: This pull request references NETOBSERV-939 which is a valid jira issue.

In response to this:

This PR is based on #386 - merge it first
Required console-plugin PR: - to come -

Based on OCP version, the console plugin reconciler will configure a
list of dashboard names that are available, so the the plugin will
create links for them

  • Read & compare versions
  • Some refactoring:
  • Permission vendor detection and Available API detection were two
    mechanisms very similar: merge Permission vendor detection in
    Available APIs
  • Reading cluster info (id, version) can also considered as part of the discovery
    mechanism: merge them all in a new ClusterInfo structure, that
    provides the ClusterVersion stuff and the available APIs

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
Copy link

openshift-ci bot commented Jul 25, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jotak. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Based on OCP version, the console plugin reconciler will configure a
list of dashboard names that are available, so the the plugin will
create links for them

- Read & compare versions
- Some refactoring:
  - Permission vendor detection and Available API detection were two
    mechanisms very similar: merge Permission vendor detection in
Available APIs
  - Reading cluster info (id, version) can also considered as part of the discovery
    mechanism: merge them all in a new ClusterInfo structure, that
provides the ClusterVersion stuff and the available APIs
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Aug 24, 2023

@jotak: This pull request references NETOBSERV-939 which is a valid jira issue.

In response to this:

This PR is based on #386 - merge it first
Related console-plugin PR: - to come -

Based on OCP version, the console plugin reconciler will configure a
list of dashboard names that are available, so the the plugin will
create links for them

  • Read & compare versions
  • Some refactoring:
  • Permission vendor detection and Available API detection were two
    mechanisms very similar: merge Permission vendor detection in
    Available APIs
  • Reading cluster info (id, version) can also considered as part of the discovery
    mechanism: merge them all in a new ClusterInfo structure, that
    provides the ClusterVersion stuff and the available APIs

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.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 70.25% and project coverage change: +0.07% 🎉

Comparison is base (3e5454d) 55.49% compared to head (90498ef) 55.57%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   55.49%   55.57%   +0.07%     
==========================================
  Files          45       45              
  Lines        5874     5920      +46     
==========================================
+ Hits         3260     3290      +30     
- Misses       2393     2407      +14     
- Partials      221      223       +2     
Flag Coverage Δ
unittests 55.57% <70.25%> (+0.07%) ⬆️

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

Files Changed Coverage Δ
...ntrollers/ebpf/internal/permissions/permissions.go 44.18% <0.00%> (ø)
controllers/reconcilers/common.go 56.30% <ø> (ø)
controllers/flowcollector_controller.go 53.44% <57.69%> (+1.06%) ⬆️
pkg/cluster/cluster.go 58.10% <58.10%> (ø)
pkg/cluster/dashboards_list.go 83.33% <83.33%> (ø)
controllers/consoleplugin/consoleplugin_objects.go 95.45% <100.00%> (+0.02%) ⬆️
...trollers/consoleplugin/consoleplugin_reconciler.go 63.54% <100.00%> (+0.38%) ⬆️
controllers/flowlogspipeline/flp_common_objects.go 81.67% <100.00%> (ø)
controllers/flowlogspipeline/flp_ingest_objects.go 73.84% <100.00%> (ø)
...trollers/flowlogspipeline/flp_ingest_reconciler.go 66.05% <100.00%> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

@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 Aug 24, 2023
jpinsonneau
jpinsonneau previously approved these changes Aug 31, 2023
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.

Code looks good, maybe just change the log level to info when not on Openshift ?

func (d *Dashboards) CheckClusterDashboards(ctx context.Context, clusterInfo *Info) {
if ok, err := clusterInfo.OpenShiftVersionIsAtLeast("4.15.0"); err != nil {
// Log error but do not fail: it's likely a bug in code, if the openshift version cannot be found
log.FromContext(ctx).Error(err, "Could not get available dashboards for this cluster version. Is it OpenShift?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: log info including err.Message instead ?

Copy link
Member Author

Choose a reason for hiding this comment

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

if fact this function is only called for openshift (on the caller's side, it's inside a if c.HasOCPSecurity() block, which is our way to detect openshift). But I agree it could be made more explicit, let me see that...

@openshift-ci
Copy link

openshift-ci bot commented Aug 31, 2023

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot removed the lgtm label Aug 31, 2023
@jotak
Copy link
Member Author

jotak commented Aug 31, 2023

@jpinsonneau 90498ef => better like that?

@jpinsonneau
Copy link
Contributor

@jpinsonneau 90498ef => better like that?

Even better ! Thanks @jotak

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference lgtm needs-rebase 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

4 participants