Skip to content
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

[Testing Framework] Support per app annotations. #13486

Closed
wants to merge 14 commits into from

Conversation

incfly
Copy link

@incfly incfly commented Apr 20, 2019

  • This allows generic annotations for each app, such that for the Istio features that requiring annotations, we can test it via custmoize the app specifically. For example
    • service annotation is used for secure naming in mesh expansion.
    • we now also support turn on and off prober rewrite using annotations.
  • Currently only implemented for Kubernetes environment yet.
  • Test case for the test framework itself is also added as kube_test.go

Hopefully we can reduce the number of the Istio installation.

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: incfly
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: nmittler

If they are not already assigned, you can assign the PR to them by writing /assign @nmittler in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

"io/ioutil"
"testing"

"istio.io/istio/pilot/test/util"
Copy link
Contributor

Choose a reason for hiding this comment

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

File is not goimports-ed (from goimports)

if len(a.appName) == 0 {
return nil, fmt.Errorf("service does not contain the 'app' label")
return nil, fmt.Errorf("Service does not contain the 'App' label")
Copy link
Contributor

Choose a reason for hiding this comment

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

error strings should not be capitalized or end with punctuation or a newline (from golint)

var (
runtimeScheme = runtime.NewScheme()
codecs = serializer.NewCodecFactory(runtimeScheme)
deserializer = codecs.UniversalDeserializer()
Copy link
Contributor

Choose a reason for hiding this comment

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

deserializer is unused (from varcheck)

wantFilePath := fmt.Sprintf("testdata/%v.yaml", name)
golden, err := ioutil.ReadFile(wantFilePath)
gotBytes := []byte(got)
wantBytes := []byte(golden)
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary conversion (from unconvert)

)

var (
runtimeScheme = runtime.NewScheme()
Copy link
Contributor

Choose a reason for hiding this comment

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

U1000: var runtimeScheme is unused (from unused)


var (
runtimeScheme = runtime.NewScheme()
codecs = serializer.NewCodecFactory(runtimeScheme)
Copy link
Contributor

Choose a reason for hiding this comment

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

U1000: var codecs is unused (from unused)

@incfly incfly changed the title [Testing Framework] Support annotations in Apps component [Testing Framework] Support per app annotations. Apr 20, 2019
Copy link
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.

I like the change but it may be better off going into Echo which will deprecate Apps component soon

#13175

@@ -65,6 +65,13 @@ type App interface {
type AppParam struct {
Name string
Locality string
// ServiceAnnotations specifies the annotations for the deployment.
Copy link
Member

Choose a reason for hiding this comment

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

for the deployment or for the Service?

Copy link
Author

Choose a reason for hiding this comment

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

done.

Copy link
Contributor

@nmittler nmittler left a comment

Choose a reason for hiding this comment

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

Are native apps completely unaffected?

"serviceAccount": strconv.FormatBool(d.serviceAccount),
"locality": d.locality,
})
// TODO(incfly): retire InjectProxy field and use annotation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just do it in this PR

Copy link
Author

Choose a reason for hiding this comment

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

done.

@incfly
Copy link
Author

incfly commented Apr 22, 2019

Thanks for the heads up on echo component updates. I haven't stayed tuned with the native & echo implementation. IIRC, they don't have sidecar injector right? Annotations are consumed by either pilot or sidecar injector. Not sure how will these be reflected in native environment?

Thoughts? @howardjohn @nmittler @ozevren

@howardjohn
Copy link
Member

Annotations can impact pilot so still useful even without sidecar injector I think

@incfly
Copy link
Author

incfly commented Apr 22, 2019

In native environment, Pilot is configured thru MCP/galley, right? Does that mean we need to plumb this info to Galley in case of native env?

@ozevren
Copy link
Contributor

ozevren commented Apr 22, 2019 via email

@nmittler
Copy link
Contributor

@incfly I'm very close to landing the echo changes #13175 ... would you mind holding off on this until then?

@incfly
Copy link
Author

incfly commented Apr 22, 2019

@nmittler Sure.

@ozevren AFAIK, endpoints and service annotations.

KubeServiceAccountsOnVMAnnotation = "alpha.istio.io/kubernetes-serviceaccounts"

@incfly
Copy link
Author

incfly commented Apr 22, 2019

/hold until #13175 is merged.

@istio-testing
Copy link
Collaborator

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

Test name Commit Details Rerun command
prow/istio-integ-local-tests.sh 95b4fe0 link /test istio-integ-local-tests
prow/istio-integ-k8s-tests.sh 95b4fe0 link /test istio-integ-k8s-tests

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.

@incfly
Copy link
Author

incfly commented Apr 24, 2019

@nmittler your PR now is merged. Is it ready for us to revive this PR? Or we still need to wait for ollow-up changes on echo/apps component?

@nmittler
Copy link
Contributor

@incfly I'm currently working out a couple of issues with Echo which should probably be fixed first. I'm hoping to have it resolved over the next couple of days.

@incfly
Copy link
Author

incfly commented Apr 24, 2019

@nmittler okay, is there a issue number of pr for me to track?

@nmittler
Copy link
Contributor

#13553 and #13599

@stale
Copy link

stale bot commented May 8, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 2 weeks. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@nmittler
Copy link
Contributor

nmittler commented May 9, 2019

@incfly apps has been replaced by Echo. Can we close this in favor of #13945?

@stale stale bot removed the stale label May 9, 2019
@incfly incfly closed this May 9, 2019
nmittler added a commit to nmittler/istio that referenced this pull request May 13, 2019
Adds support for specifying service and workload annotations for Echo deployments.

Replaces istio#13486
istio-testing pushed a commit that referenced this pull request May 13, 2019
Adds support for specifying service and workload annotations for Echo deployments.

Replaces #13486
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.

None yet

7 participants