-
Notifications
You must be signed in to change notification settings - Fork 24
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-971 Fix couple of CRD issues on zero-values #319
NETOBSERV-971 Fix couple of CRD issues on zero-values #319
Conversation
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.
Nice catch, but I would suggest a different fix.
We have many others bool in the API and removing all of them the omitempty flag would create a lot of unnecessary mandatory fields.
After some test it would also work if we let the omitempty flag but swithc to a bool pointer.
The downside is we would have to check for nil each time which can be done in a sugar function but the good side is that we would keep the field optional in the API.
@OlivierCazade I reviewed the whole CRD ... which leads to a bigger pull request |
Codecov Report
@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 50.90% 51.34% +0.44%
==========================================
Files 43 43
Lines 5080 5155 +75
==========================================
+ Hits 2586 2647 +61
- Misses 2293 2310 +17
+ Partials 201 198 -3
Flags with carried forward coverage won't be shown. Click here to find out 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, and sorry for my previous comment. After discussion, your previous solution would have worked.
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.
nit: pls consider using "k8s.io/utils/pointer
to convert from type
to *type
for Example
pointer.IntPtr(0)
/lgtm |
/approve |
/approve cancel |
New images:
They will expire after two weeks. 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-908f029
displayName: NetObserv development catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 1m |
6992083
to
b30f2bf
Compare
/ok-to-test |
New images:
They will expire after two weeks. 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-32a550d
displayName: NetObserv development catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 1m |
/label qe-approved |
CRD cleanup / sanitizing Find & fix a bunch of CRD issues where go zero-value was conflicting with CRD default. The typical workaround is to use pointers or, for lists and maps, remove "omitempty". Add a test to help catch these issues Found issues: - portNamings.enable (this was the original issue) - portNamings.portNames (could not set empty list) - ebpf.interfaces and excludeInterfaces (e.g. could not set empty exclusion list) - processor.metrics.ignoreTags and disableAlerts (could not set empty ignoreTags) - processor.enableKubeProbles, dropUnusedFields (could not set false) - processor.kafkaConsumerReplicas (could not set 0) - loki.maxRetries (could not set 0) - loki.staticLabels (could not set empty list) - plugin.register (could not set false) - plugin.replicas (could not set 0) - plugin.quickFilters (could not set empry list)
b30f2bf
to
6948a3a
Compare
New changes are detected. LGTM label has been removed. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpinsonneau 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 |
CRD cleanup / sanitizing
Find & fix a bunch of CRD issues where go zero-value was conflicting
with CRD default. The typical workaround is to use pointers or, for
lists and maps, remove "omitempty".
Add a test to help catch these issues
Found issues:
list)
ignoreTags)