Skip to content

Add Group/Version per schema#3214

Merged
xiaolanz merged 8 commits intoistio:masterfrom
xiaolanz:pilot
Feb 20, 2018
Merged

Add Group/Version per schema#3214
xiaolanz merged 8 commits intoistio:masterfrom
xiaolanz:pilot

Conversation

@xiaolanz
Copy link
Copy Markdown
Contributor

@xiaolanz xiaolanz commented Feb 6, 2018

Introducing Istio group prefix and version into each Istio config schema.
Removing Istio group. Preparing for each schema to have different apiVersion.

Addressing the first step in #3586

@xiaolanz xiaolanz requested a review from a team February 6, 2018 07:52
@xiaolanz xiaolanz requested review from ayj and diemtvu February 6, 2018 07:52
@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
We suggest the following additional approver: ayj

Assign the PR to them by writing /assign @ayj in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@xiaolanz
Copy link
Copy Markdown
Contributor Author

xiaolanz commented Feb 6, 2018

Hasn't fixed tests yet. Send out to seek for early feedbacks.

@xiaolanz xiaolanz requested a review from ozevren February 6, 2018 17:14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each rule in the array of rules must refer to a valid group/version/resource tuple, e.g.

var rules []admissionregistrationv1beta1.Rule
for _, schema := range ac.options.Descriptor {
    rules = append(rules, admissionregistrationv1beta.Rule{
        APIGroups: []string{crd.ResourceGroup(&schema)},
        APIVersion: []string{schema.Version},
        Resources: []string{crd.ResourceName(schema.Plural)}, 
    }
}

// assign `rule` in webhook.Webhooks[0].Rules

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.

But the field is a single Rule: instead of an array of Rules.

Copy link
Copy Markdown
Contributor

@ayj ayj Feb 6, 2018

Choose a reason for hiding this comment

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

Woops, I referenced the wrong type. See line 270 and admissionregistrationv1beta1.RuleWithOperations

Copy link
Copy Markdown
Contributor

@ijsnellf ijsnellf left a comment

Choose a reason for hiding this comment

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

looks good, just remove or .gitignore the file from cloudfoundry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add this to .gitignore so it does not accidentally get added to master?

@rshriram rshriram changed the title Allow individual api group and version for each config resource kind in Pilot config store [WIP] Allow individual api group and version for each config resource kind in Pilot config store Feb 9, 2018
@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 14, 2018
@istio-merge-robot
Copy link
Copy Markdown

@xiaolanz PR needs rebase

@xiaolanz xiaolanz requested review from a team February 16, 2018 22:53
@istio-merge-robot istio-merge-robot removed the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 16, 2018
@xiaolanz xiaolanz requested a review from cmluciano February 16, 2018 23:51
@xiaolanz xiaolanz changed the title [WIP] Allow individual api group and version for each config resource kind in Pilot config store Add Group/Version per schema Feb 18, 2018
@xiaolanz xiaolanz requested a review from a team February 18, 2018 04:19
@xiaolanz xiaolanz force-pushed the pilot branch 2 times, most recently from 226da0e to e9da6ee Compare February 18, 2018 06:37
@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 18, 2018
@istio-merge-robot
Copy link
Copy Markdown

@xiaolanz PR needs rebase

@istio-merge-robot istio-merge-robot removed the needs-rebase Indicates a PR needs to be rebased before being merged label Feb 18, 2018
@xiaolanz
Copy link
Copy Markdown
Contributor Author

/test istio-pilot-e2e

var IstioAPIGroupVersion = schema.GroupVersion{
Group: model.IstioAPIGroup,
Version: model.IstioAPIVersion,
Group: "config.istio.io",
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.

can you make this a model.IstioDefaultAPIGroup and ditto for version rather than hardcode this here
despite the TODO that doesn't seem like an improvement

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.

I intentionally not to introduce something like model.IstioDefaultAPIGroup. Same for the version. Everything out of model package should resolve group/version from schema dynamically.

IstioAPIGroupVersion together with the strings will be gone because I plan to do client change in a separate PR.

return model.Config{
ConfigMeta: model.ConfigMeta{
Type: model.MockConfig.Type,
Group: "config.istio.io",
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.

same, let's have at least the same 2 constants used instead of hardcoded strings

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.

For test, it doesn't really matter. It can be anything. It doesn't have to be config.

After next PR, I will change it and make it more interesting...

@ldemailly
Copy link
Copy Markdown
Member

I'm still bothered by having constants like "v1alpha2" more than one place in the source tree (not talking about golden files)

Maybe the follow up PR can be combined/stacked with this one?

@xiaolanz
Copy link
Copy Markdown
Contributor Author

/test istio-pilot-e2e

@xiaolanz xiaolanz requested a review from geeknoid February 19, 2018 17:01
@xiaolanz
Copy link
Copy Markdown
Contributor Author

xiaolanz commented Feb 19, 2018

Yes. follow up PR will resolve the redundant constants. Also, the constant int test will be different after the last PR.

PTAL

@xiaolanz xiaolanz merged commit ffa8184 into istio:master Feb 20, 2018
@xiaolanz xiaolanz deleted the pilot branch February 20, 2018 17:09
@ldemailly
Copy link
Copy Markdown
Member

I didn't notice until now but this PR changed vendor
we may need to revert it or fix forward (noticed similar in #3599 )

do you know how that happened ? can you retrace ? we probably need a hook to check against accidental vendor changes

@ldemailly ldemailly mentioned this pull request Feb 21, 2018
ldemailly added a commit that referenced this pull request Feb 21, 2018
@ldemailly
Copy link
Copy Markdown
Member

fixed it in 57a9d1a

in the future please always review the file changes before making a PR
also use make pull to rebase

@xiaolanz
Copy link
Copy Markdown
Contributor Author

@ldemailly Thanks for fixing it. Actually I saw it but I wasn't so sure what it is. I will be more proactive next time.

@ldemailly
Copy link
Copy Markdown
Member

that vendor/ stuff is new and not obvious, so no worries, and feel free to help update
https://github.com/istio/istio/wiki/Vendor-FAQ

@xiaolanz
Copy link
Copy Markdown
Contributor Author

Updated: https://github.com/istio/istio/wiki/Vendor-FAQ#should-i-merge-changes-in-vendor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants