Skip to content

adding SE status generation#2979

Merged
istio-testing merged 4 commits intoistio:masterfrom
ilrudie:se-status-gen
Jul 9, 2024
Merged

adding SE status generation#2979
istio-testing merged 4 commits intoistio:masterfrom
ilrudie:se-status-gen

Conversation

@ilrudie
Copy link
Copy Markdown
Contributor

@ilrudie ilrudie commented Jul 3, 2024

adds logic to consume the new ServiceEntry status from istio/api#3244 when generating our types

Signed-off-by: ilrudie <ian.rudie@solo.io>
@ilrudie ilrudie requested a review from a team as a code owner July 3, 2024 15:17
@istio-policy-bot
Copy link
Copy Markdown

😊 Welcome @ilrudie! This is either your first contribution to the Istio tools repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 3, 2024
@ilrudie ilrudie force-pushed the se-status-gen branch 2 times, most recently from abfe363 to fbea7d7 Compare July 3, 2024 15:33
Signed-off-by: ilrudie <ian.rudie@solo.io>
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Overall looks good

localM := m
// ServiceEntry has a unique status type which includes addresses for auto allocated IPs, substitute IstioServiceEntryStatus
// for IstioStatus when type is ServiceEntry
if kubeType.Type().Name.Name == "ServiceEntry" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would be ideal if this was from checking some comment on the type indicating this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

potential impl in latest commit, thanks for the suggestion, I think this would allow decoupling this PR from API PR somewhat, yeah?

@istio-testing istio-testing added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 3, 2024
…nstead of matching type name

Signed-off-by: ilrudie <ian.rudie@solo.io>
@howardjohn howardjohn added the do-not-merge/hold Block automatic merging of a PR. label Jul 4, 2024
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

lgtm but with a hold - either need to not hardcode here, or address my comments on the API to rename the field and align here

// ServiceEntry has a unique status type which includes addresses for auto allocated IPs, substitute IstioServiceEntryStatus
// for IstioStatus when type is ServiceEntry
if slices.Contains(kubeType.RawType().CommentLines, useIstioServiceEntryStatus) {
localM["IstioStatus"] = c.Universe.Type(types.Name{Name: "IstioServiceEntryStatus", Package: "istio.io/api/meta/v1alpha1"})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: extract the custom type instead of hard coding .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added, also istio/api#3257 adds the required comment so we can remove the hardcode

Signed-off-by: ilrudie <ilrudie@gmail.com>
@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 6, 2024
Copy link
Copy Markdown
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

#2982 adds another way to set the same thing, maybe we can consolidate on that. Can be a followup

@ilrudie
Copy link
Copy Markdown
Contributor Author

ilrudie commented Jul 9, 2024

#2982 adds another way to set the same thing, maybe we can consolidate on that. Can be a followup

We'd change to this in api and the adjust the parsing in the kubetype-gen to consume this cue-gen tag?
// +cue-gen:ServiceEntry:subresource:status=istio.networking.v1alpha3.ServiceEntryStatus

@howardjohn
Copy link
Copy Markdown
Member

howardjohn commented Jul 9, 2024 via email

@ilrudie
Copy link
Copy Markdown
Contributor Author

ilrudie commented Jul 9, 2024

yeah that's what I was thinking. the whole "cue-gen" prefix a bit odd, but we don't even use "cue" anymore anyway

It's certainly cleaner than what I did despite the odd prefix. I considered using tags but was wary of potential knock-on effects so I went with a regular comment.

@ilrudie ilrudie removed the do-not-merge/hold Block automatic merging of a PR. label Jul 9, 2024
@istio-testing istio-testing merged commit 3a1982f into istio:master Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants