-
Notifications
You must be signed in to change notification settings - Fork 68
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 init code for the istio provider #99
Add init code for the istio provider #99
Conversation
8fa45df
to
4e5c708
Compare
/test pull-ingress2gateway-verify |
4e5c708
to
4ecaca9
Compare
4ecaca9
to
bbe18f5
Compare
bbe18f5
to
5afb0e2
Compare
/assign @LiorLieberman |
Thats great @dpasiukevich ! In the meantime, can you edit the release-notes section to reflect the changes (that will then be included in our release notes) This is a user facing change assuming now users will be able to invoke the tool with istio provider. |
The current PR is just a basic foundation to put the actual code later on. |
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.
Overall looks good to me and thanks for improving the interface! I left a few small comments.
This PR actually looks like it is half implementing conversion (I can see you read storage.Gateways
and fill in some metadata while the spec and virtual services are not being read). Ideally it should either set up the init code and have a followup PR for the conversion itslef OR doing everything in this PR.
google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect | ||
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect | ||
google.golang.org/protobuf v1.31.0 // indirect | ||
gopkg.in/evanphx/json-patch.v5 v5.7.0 // indirect |
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 wonder where this comes from as we already have above
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
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 may be from istio.io/api v1.20.0
. It's needed for the new provider.
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.
Its from sigs.k8s.io/kustomize/api which was updated.
Istio API has no new deps:
github.com/golang/protobuf v1.5.3
google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c
google.golang.org/grpc v1.58.3
google.golang.org/protobuf v1.31.0
k8s.io/api v0.28.0
k8s.io/apimachinery v0.28.0
just upgraded to 0.28
5afb0e2
to
df62149
Compare
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.
@LiorLieberman updated in regards for the PR comments.
As for this PR -- I just want to have a proper basis and agreement for the conversion logic (imports, proper interface for the Provider).
If everything was done in one PR (this would've been a gargantuan PR). As I cannot reuse any existing conversion logic in the repo (it's for Ingress, while the provider is for Istio).
I'd prefer quicker&smaller iterations.
If needed I can remove the provider from registration for now.
df62149
to
71727d1
Compare
pkg/i2gw/providers/istio/types.go
Outdated
VirtualServiceKind = "VirtualService" | ||
) | ||
|
||
type gateway struct { |
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.
@howardjohn would this be an ok representation of the object to parse into from the unstructured.Unstructured
? Or is there something similar in the istio API (adapted Istio resources for K8S)?
I didn't find any, asking just to double check.
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.
istio/client-go repo already has these that can be used
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.
Cool, exactly what's needed. Thanks!
71727d1
to
165f869
Compare
4bc0d87
to
78baf25
Compare
78baf25
to
29b4c50
Compare
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.
Thanks for it @dpasiukevich, lgtm!
Will defer to @levikobi for the final lgtm stamp.
/test pull-ingress2gateway-test |
/label tide/merge-method-squash |
package istio | ||
|
||
const ( | ||
APIVersion = "networking.istio.io/v1beta1" |
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.
maybe APIVersionV1Beta1 as istio also have alpha3 IIRC
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'd keep as is to indicate the only currently supported API version is networking.istio.io/v1beta1
for istio converter
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dpasiukevich, LiorLieberman, mlavacca 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 |
* Add init code for the istio provider * rename resource_readers * use istio api types * return readers back * refactor upd * rename filenames to readers
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds initial code for istio provider. This PR adds the interface implementation and helpers to read istio CRDs from the cluster. The actual conversion would be done in the following PRs.
In detailed, this PR:
customResources
arg from the Provider interface. Currently is passed to the provider as ainterface{}
(nil value & nil type). Provider code currently cannot modify this struct (because cannot cast to any other type and cannot overwrite the value).The PR simplifies interface and removes the need to pass
customResources
asinterface{}
which is also shared across different providers.Now the provider if wants to handle custom resources, must itself parse them and store in any desired format locally until
ToGatewayAPI
is called on it.go.mod
to import latest IstioAPI.cc @howardjohn
Does this PR introduce a user-facing change?: