Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

smi: update to smi-sdk-go v0.5.0 and traffic-specs v1alpha4 #2331

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

shashankram
Copy link
Member

Description:
This change upgrades the code to use the latest v0.5.0 SMI
SDK to be able to support v1alpha4 of SMI traffic-specs APIs.
v1alpha4 is primarily required for TCP routes support.

Resolves #2318

Signed-off-by: Shashank Ram shashr2204@gmail.com

Affected area:

  • New Functionality [ ]
  • Documentation [ ]
  • Install [ ]
  • Control Plane [ ]
  • CLI Tool [ ]
  • Certificate Management [ ]
  • Networking [ ]
  • Metrics [ ]
  • SMI Policy [X]
  • Security [ ]
  • Tests [ ]
  • CI System [ ]
  • Performance [ ]
  • Other [ ]

Please answer the following questions with yes/no.

  • Does this change contain code from or inspired by another project? If so, did you notify the maintainers and provide attribution?
    No

This change upgrades the code to use the latest v0.5.0 SMI
SDK to be able to support v1alpha4 of SMI traffic-specs APIs.
v1alpha4 is primarily required for TCP routes support.

Resolves openservicemesh#2318

Signed-off-by: Shashank Ram <shashr2204@gmail.com>
@shashankram shashankram added the wip Work-in-Progress label Jan 20, 2021
@codecov-io
Copy link

Codecov Report

Merging #2331 (fb94db1) into main (50a62d3) will decrease coverage by 0.04%.
The diff coverage is 26.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2331      +/-   ##
==========================================
- Coverage   57.26%   57.21%   -0.05%     
==========================================
  Files         149      149              
  Lines        6673     6663      -10     
==========================================
- Hits         3821     3812       -9     
+ Misses       2847     2846       -1     
  Partials        5        5              
Impacted Files Coverage Δ
pkg/catalog/debugger.go 97.22% <ø> (ø)
pkg/catalog/mock_catalog.go 0.00% <0.00%> (ø)
pkg/debugger/policy.go 53.84% <ø> (ø)
pkg/smi/fake.go 0.00% <ø> (ø)
pkg/smi/mock_meshspec.go 0.00% <0.00%> (ø)
pkg/catalog/traffictarget.go 87.14% <100.00%> (-0.36%) ⬇️
pkg/debugger/mock_debugger.go 48.52% <100.00%> (ø)
pkg/smi/client.go 77.01% <100.00%> (ø)

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 50a62d3...fb94db1. Read the comment docs.

@shashankram shashankram removed the wip Work-in-Progress label Jan 20, 2021
@shashankram shashankram marked this pull request as ready for review January 20, 2021 21:08
@shashankram shashankram requested a review from a team as a code owner January 20, 2021 21:08
@@ -34,7 +34,7 @@ require (
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/common v0.4.1
github.com/rs/zerolog v1.18.0
github.com/servicemeshinterface/smi-sdk-go v0.4.1
github.com/servicemeshinterface/smi-sdk-go v0.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@@ -179,25 +176,8 @@ func (mc *MeshCatalog) getTCPRouteMatchesFromTrafficTarget(trafficTarget smiAcce
return nil, errNoTrafficSpecFoundForTrafficPolicy
}

// TODO(#1521): Create an actual TCP route match once v1alpha4 TCPRoute spec is available
// Hack: derive ports from 'ports' label on the TCPRoute resource
portsStr, ok := tcpRoute.Labels["ports"]
Copy link
Contributor

Choose a reason for hiding this comment

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

✌️

tcpRouteMatch := trafficpolicy.TCPRouteMatch{
Ports: ports,
Ports: tcpRoute.Spec.Matches.Ports,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@draychev draychev left a comment

Choose a reason for hiding this comment

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

@shashankram this is great! Thank you!
I left a tiny comment on checking whether Matches is empty - this we could do in fast-followup PR (if at all needed).

@shashankram
Copy link
Member Author

@shashankram this is great! Thank you!
I left a tiny comment on checking whether Matches is empty - this we could do in fast-followup PR (if at all needed).

Discussed and resolved concern in #2331 (comment)

@shashankram shashankram merged commit db184fc into openservicemesh:main Jan 20, 2021
@shashankram shashankram deleted the smi-update branch January 20, 2021 21:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use v1alpha4 of SMI TCPRoute spec
4 participants