-
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: 1374 Make enums camelCase #483
Conversation
50f6abf
to
c2e131d
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #483 +/- ##
==========================================
- Coverage 62.26% 61.92% -0.35%
==========================================
Files 55 55
Lines 6769 6875 +106
==========================================
+ Hits 4215 4257 +42
- Misses 2238 2286 +48
- Partials 316 332 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c2e131d
to
813f324
Compare
@jpinsonneau @msherif1234 @jotak I am getting errors when I do make bundle, could you guys PTAL and let me know what needs to be done here? make bundle |
Hey @Amoghrd, thanks for contributing with us 😸 You should not update golang structs here, only enums values. Else the linter will complain. |
// +k8s:conversion-gen=false | ||
Exporters []*FlowCollectorExporter `json:"exporters"` |
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.
I have to skip conversion-gen here since ExporterType
doesn't overlap anymore
// Following K8S convention, mixed capitalization should be preserved | ||
// see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#constants | ||
var upperPascalExceptions = map[string]string{ | ||
"IPFIX": "IPFIX", | ||
"EBPF": "eBPF", | ||
"SCRAM-SHA512": "ScramSHA512", | ||
} |
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.
Managing exceptions manually here. eBPF and IPFIX are kept as their original acronyms case.
Following discussion with @jotak, he suggested to use ScramSHA512
for better readability.
In AMQ-Streams, this is fully lowercase as scram-sha-512
😞 We may consider SCRAM-SHA-512
as alternative.
pkg/conversion/conversion.go
Outdated
|
||
// Split on '-' or '_' rune, capitalize first letter of each part and join them | ||
var sb strings.Builder | ||
array := regexp.MustCompile(`[\-\_]+`).Split(strings.ToLower(str), -1) |
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.
Perhaps pre-compute the regex? That's generally a good practice and won't change your design. Like this on package scope:
var upperTokenizer = regexp.MustCompile(`[\-\_]+`)
(You may find me nitpicking but I think just a static map of that dozen of converted strings would have done the job without the need for any compute like this - it's called at every read/write of the CR, at least as long as v1beta1 is still the stored version. If they were many more strings to convert I'd agree that a map wouldn't be the best choice. Anyway that's not a huge compute and conversions don't happen so often so I'm fine with this option as well.)
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.
sure, done in 0d51d44
A small nit, other than that lgtm; note there's a lint failure => missing a nolint annotation on one of the webhook conversion func |
d03261d
to
0d51d44
Compare
I've rebased the PR to fix these. We should be good to go now 😸 |
New images:
They will expire after two weeks. To deploy this build: # Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:f543ef2 make deploy
# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-f543ef2 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-f543ef2
displayName: NetObserv development catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 1m |
@nathan-weinberg marking this PR as breaking tests since enums has been renamed. |
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. |
* NETOBSERV-1326: NETOBSERV-1231: Drops & RTT metrics - Added metrics: node_rtt, namespace_rtt, workload_rtt, node_drop_packets_total, node_drop_bytes_total, namespace_drop_packets_total, namespace_drop_bytes_total, workload_drop_packets_total, workload_drop_bytes_total - Add dashboards for drops (not yet for RTT, need to handle histomgrams in dashboards first) * Update CRD doc and tests with added metrics * Set new defaults * Update CRD doc * externalize metrics doc
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…etobserv#451) Co-authored-by: Joel Takvorian <jtakvori@redhat.com>
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.13.0 to 2.13.1. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](onsi/ginkgo@v2.13.0...v2.13.1) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…toring (netobserv#492) Bumps [github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring](https://github.com/prometheus-operator/prometheus-operator) from 0.68.0 to 0.69.1. - [Release notes](https://github.com/prometheus-operator/prometheus-operator/releases) - [Changelog](https://github.com/prometheus-operator/prometheus-operator/blob/main/CHANGELOG.md) - [Commits](prometheus-operator/prometheus-operator@v0.68.0...v0.69.1) --- updated-dependencies: - dependency-name: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Closing this PR in favor of #511 I don't know why I was not able to force push in this PR:
|
Description
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.