-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
c70ba5a
to
17ae3e9
Compare
Codecov ReportAttention:
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
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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: It would be great to avoid keeping this PR open too long |
// 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) | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
network-observability-operator/pkg/volumes/builder.go
Lines 133 to 144 in 5fa0717
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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
New images:
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 |
[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 |
Description
columns
andfilters
definitions.server
andloki
to configmap for consistencyIt 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:
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.