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

Add normalizations and lower case MAC address #2389

Merged
merged 1 commit into from
Jun 13, 2022
Merged

Add normalizations and lower case MAC address #2389

merged 1 commit into from
Jun 13, 2022

Conversation

chrisdoherty4
Copy link
Contributor

@chrisdoherty4 chrisdoherty4 commented Jun 10, 2022

When reading hardware data for Tinkerbell we need to apply normalizations so we can perform comparison operations. MAC Addresses are a culprit for incorrect comparisons because comparators don't take into consideration case insensitivty of a MAC.

We're lower-casing MAC as it seems to be lower-case more often than not.

This won't protect us against all failures. A real fix would be to edit all locations within Tinkerbell that perform a MAC comparison to be case-insensitive.

@eks-distro-bot eks-distro-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 10, 2022
@chrisdoherty4 chrisdoherty4 changed the title Add hardware normalization decorator Add normalizations and lower case MAC address Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #2389 (4d7c26c) into main (d450708) will decrease coverage by 2.18%.
The diff coverage is 81.57%.

❗ Current head 4d7c26c differs from pull request most recent head 94c6998. Consider uploading reports for the commit 94c6998 to get more accurate results

@@            Coverage Diff             @@
##             main    #2389      +/-   ##
==========================================
- Coverage   56.03%   53.84%   -2.19%     
==========================================
  Files         302      304       +2     
  Lines       24615    25963    +1348     
==========================================
+ Hits        13792    13981     +189     
- Misses       9531    10674    +1143     
- Partials     1292     1308      +16     
Impacted Files Coverage Δ
pkg/providers/tinkerbell/upgrade.go 0.00% <0.00%> (ø)
pkg/providers/tinkerbell/hardware/csv.go 62.50% <40.00%> (-7.50%) ⬇️
pkg/providers/tinkerbell/create.go 48.18% <100.00%> (ø)
pkg/providers/tinkerbell/hardware/normalize.go 100.00% <100.00%> (ø)
pkg/providers/tinkerbell/hardware/yaml.go 36.95% <0.00%> (-19.57%) ⬇️
pkg/cluster/fetch.go 11.11% <0.00%> (-10.63%) ⬇️
pkg/curatedpackages/curatedpackages.go 26.73% <0.00%> (-4.11%) ⬇️
pkg/cluster/spec.go 53.50% <0.00%> (-1.86%) ⬇️
pkg/api/v1alpha1/cluster_types.go 73.95% <0.00%> (-0.48%) ⬇️
...roviders/tinkerbell/hardware/catalogue_hardware.go 97.26% <0.00%> (-0.04%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d450708...94c6998. Read the comment docs.

Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

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

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavmpandey08

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

@chrisdoherty4
Copy link
Contributor Author

/retest

@eks-distro-bot
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

When reading hardware data for Tinkerbell we need to apply
normalizations so we can perform comparison operations. MAC Addresses
are a culprit for incorrect comparisons because comparators don't take
into consideration case insensitivty of a MAC.

We're lower-casing MAC as it seems to be lower-case more often than not.
@eks-distro-bot eks-distro-bot merged commit dc30f16 into aws:main Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants