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-1150 Console plugin columns & filters as config #477

Merged
merged 5 commits into from
Nov 7, 2023

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Oct 25, 2023

Description

  • import static config for frontend config containing columns and filters definitions.
  • move console plugin args related to server and loki to configmap for consistency

It also allow devs/users to remove the ownerReferences metadata of any resource created by FlowCollector to skip update on these.

The controller will log the following every reconcile loop:

2023-10-25T16:12:22.874Z INFO SKIP *v1.ConfigMap update since not owned {"controller": "flowcollector", "controllerGroup": "flows.netobserv.io", "controllerKind": "FlowCollector", "FlowCollector": {"name":"cluster"}, "namespace": "", "name": "cluster", "reconcileID": "41a05182-d7ba-4aeb-8a84-c03e3cdd80c2", "Namespace": "netobserv", "Name": "console-plugin-config"}

To quick reload the configmap, you need to restart the associated pod.

TODO: check console arguments that can be moved to configmap

Dependencies

netobserv/network-observability-console-plugin#417

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).

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (fc1c80c) 54.93% compared to head (9e37a34) 54.91%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #477      +/-   ##
==========================================
- Coverage   54.93%   54.91%   -0.03%     
==========================================
  Files          49       49              
  Lines        6449     6485      +36     
==========================================
+ Hits         3543     3561      +18     
- Misses       2662     2675      +13     
- Partials      244      249       +5     
Flag Coverage Δ
unittests 54.91% <72.53%> (-0.03%) ⬇️

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

Files Coverage Δ
controllers/ebpf/agent_controller.go 73.15% <100.00%> (ø)
pkg/helper/client_helper.go 59.70% <100.00%> (+6.25%) ⬆️
...ntrollers/ebpf/internal/permissions/permissions.go 46.06% <50.00%> (ø)
...ollers/flowlogspipeline/flp_monolith_reconciler.go 62.50% <50.00%> (ø)
...trollers/flowlogspipeline/flp_ingest_reconciler.go 62.60% <0.00%> (ø)
...rollers/flowlogspipeline/flp_transfo_reconciler.go 57.63% <0.00%> (ø)
controllers/reconcilers/common.go 56.30% <57.14%> (ø)
...trollers/consoleplugin/consoleplugin_reconciler.go 61.74% <12.50%> (-1.03%) ⬇️
controllers/consoleplugin/consoleplugin_objects.go 91.86% <79.62%> (-2.69%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jpinsonneau
Copy link
Contributor Author

jpinsonneau commented Oct 27, 2023

It's a bit hard to maintain this PR and continue working in parallel on columns. I've included the following PRs in the config:
netobserv/network-observability-console-plugin#423
netobserv/network-observability-console-plugin#422
netobserv/network-observability-console-plugin#425

It would be great to avoid keeping this PR open too long

Comment on lines +199 to +208
// ensure volumes are up to date
if b.loki.TLS.Enable && !b.loki.TLS.InsecureSkipVerify {
b.volumes.AddCACertificate(&b.loki.TLS, "loki-certs")
}
if b.loki.StatusTLS.Enable && !b.loki.StatusTLS.InsecureSkipVerify {
b.volumes.AddMutualTLSCertificates(&b.loki.StatusTLS, "loki-status-certs")
}
if b.loki.UseHostToken() {
b.volumes.AddToken(constants.PluginName)
}
Copy link
Member

@jotak jotak Nov 7, 2023

Choose a reason for hiding this comment

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

it seems like the volumes are added twice: here and from setLokiConfig. Is there a reason? Ideally if we could keep them from setLokiConfig it would be better, so we only have in a single place code related to checking TLS config and doing from the same place both volume mount and passing down TLS config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of these call the insertOrReplace function behind the scene

func (b *Builder) insertOrReplace(vi *VolumeInfo) {
// find any existing volume info and replace it
for i := range b.info {
if b.info[i].Volume.Name == vi.Volume.Name || b.info[i].Mount.Name == vi.Mount.Name {
b.info[i] = *vi
return
}
}
// else just append new volume info
b.info = append(b.info, *vi)
}

From what I seen, without that piece, the volumes are not up to date

Copy link
Member

@jotak jotak Nov 7, 2023

Choose a reason for hiding this comment

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

hmm, this is weird ... I'd prefer to keep the builder process as straightforward as possible, we shouldn't need this logic IMO .. I can take a look at that outside of your PR

configStr := "{}"
if bs, err := yaml.Marshal(config); err == nil {
var configStr string
bs, err := yaml.Marshal(config)
Copy link
Member

Choose a reason for hiding this comment

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

good thing to add error handling here ... since you did that you could also do the same line 407 below :-)
(error currently ignored on hasher.Write )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

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

/lgtm
I'll take a closer look at the volume creation in parallel

@openshift-ci openshift-ci bot added the lgtm label Nov 7, 2023
@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 7, 2023
Copy link

github-actions bot commented Nov 7, 2023

New images:

  • quay.io/netobserv/network-observability-operator:2f78264
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-2f78264
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-2f78264

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:2f78264 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-2f78264

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-2f78264
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

Copy link

openshift-ci bot commented Nov 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@jpinsonneau jpinsonneau added the no-qe This PR doesn't necessitate QE approval label Nov 7, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit 6c1b0b7 into netobserv:main Nov 7, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm no-qe This PR doesn't necessitate QE approval ok-to-test To set manually when a PR is safe to test. Triggers image build on PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants