Skip to content

Rewrite script to generate pilot/pkg/config/kube/crd/types.go in golang#4011

Merged
diemtvu merged 8 commits intoistio:masterfrom
diemtvu:generate_crd
Mar 6, 2018
Merged

Rewrite script to generate pilot/pkg/config/kube/crd/types.go in golang#4011
diemtvu merged 8 commits intoistio:masterfrom
diemtvu:generate_crd

Conversation

@diemtvu
Copy link
Copy Markdown
Contributor

@diemtvu diemtvu commented Mar 6, 2018

This is to replace pilot/pkg/config/kube/crd/generate.sh. The new script can access the model schema list (ConfigDescriptor) directly so it would be easier and more flexible to construct types.go

@diemtvu diemtvu requested a review from a team March 6, 2018 16:30
@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: andraxylia

Assign the PR to them by writing /assign @andraxylia 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

@diemtvu diemtvu changed the title Rewrite to generate pilot/pkg/config/kube/crd/types.go in golang Rewrite script to generate pilot/pkg/config/kube/crd/types.go in golang Mar 6, 2018
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2018

Codecov Report

Merging #4011 into master will increase coverage by 1%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4011   +/-   ##
======================================
+ Coverage      76%     76%   +1%     
======================================
  Files         297     297           
  Lines       27125   27164   +39     
======================================
+ Hits        20498   20537   +39     
+ Misses       5310    5307    -3     
- Partials     1317    1320    +3
Impacted Files Coverage Δ
pilot/pkg/config/kube/crd/types.go 63% <ø> (ø) ⬆️
mixer/pkg/config/store/queue.go 78% <0%> (-6%) ⬇️
mixer/adapter/circonus/circonus.go 72% <0%> (-4%) ⬇️
mixer/adapter/noop/noop.go 81% <0%> (-3%) ⬇️
mixer/adapter/denier/denier.go 93% <0%> (-2%) ⬇️
pilot/pkg/model/egress_rules.go 95% <0%> (-2%) ⬇️
mixer/adapter/stdio/zap.go 97% <0%> (-1%) ⬇️
pilot/pkg/config/kube/crd/controller.go 77% <0%> (-1%) ⬇️
mixer/adapter/servicecontrol/utils.go 89% <0%> (ø) ⬇️
mixer/adapter/memquota/dedup.go 100% <0%> (ø) ⬆️
... and 9 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 eebf7d4...6a84b8f. Read the comment docs.

@@ -0,0 +1,142 @@
// Code generated by generate.sh. DO NOT EDIT!
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.

update this to point to the new tool please

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.

Really, this could/should be a //go:generate directive.

package main

import (
"bytes"
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.

goimports

Copy link
Copy Markdown
Contributor

@xiaolanz xiaolanz left a comment

Choose a reason for hiding this comment

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

Thank you so much for doing it!

}
// Tweak to match current naming. This can be changed to meet the new naming convention.
if schema.Group == "authenticaiton" {
out.IstioKind = crd.KabobCaseToCamelCase(schema.Group + "-" + schema.Type)
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.

FYI I plan to do a follow up PR to generate type.go in folder apis/group/version to allow duplicate kinds.

IstioKind: crd.KabobCaseToCamelCase(schema.Type),
CrdKind: crd.KabobCaseToCamelCase(schema.Type),
}
// Tweak to match current naming. This can be changed to meet the new naming convention.
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.

Please make it a TODO(xiaolanz)

@diemtvu diemtvu merged commit 59cdec6 into istio:master Mar 6, 2018
@istio-testing
Copy link
Copy Markdown
Collaborator

@diemtvu: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/istio-unit-tests.sh 6a84b8f link /test istio-unit-tests
prow/e2e-simpleTests.sh 6a84b8f link /test e2e-simple
prow/e2e-bookInfoTests.sh 6a84b8f link /test e2e-bookInfo
prow/istio-pilot-e2e.sh 6a84b8f link /test istio-pilot-e2e
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@diemtvu diemtvu deleted the generate_crd branch March 15, 2018 20:09
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