Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:You can indicate your approval by writing |
Codecov Report
@@ Coverage Diff @@
## master #1841 +/- ##
==========================================
+ Coverage 81.68% 81.89% +0.21%
==========================================
Files 135 189 +54
Lines 11537 18721 +7184
==========================================
+ Hits 9424 15332 +5908
- Misses 1920 2961 +1041
- Partials 193 428 +235
Continue to review full report at Codecov.
|
| return clientset.CoreV1().Services(namespace).Get(name, metav1.GetOptions{}) | ||
| } | ||
|
|
||
| // DeleteService takes identity information of a service and deletes the service. |
There was a problem hiding this comment.
Remove "takes identity information of a service"?
| return clientset.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{}) | ||
| } | ||
|
|
||
| // DeletePod takes ideneity information of a pod and deletes the pod. |
| } | ||
|
|
||
| // CreateRole creates a role object named "istio-ca-role". | ||
| func CreateRole(clientset kubernetes.Interface, namespace string) error { |
There was a problem hiding this comment.
Rename this function to "CreateIstioCARole" to be precise?
| } | ||
|
|
||
| // CreateRoleBinding binds role "istio-ca-role" to default service account. | ||
| func CreateRoleBinding(clientset kubernetes.Interface, namespace string) error { |
|
Ah, sorry not noticing you, but can you also update Once that's done, linters (and presubmit) will now fail when new lint warnings come in, so we can keep the code health. Thanks for the comments. These two "^security" lines are removed. |
27179d4 to
6818cd7
Compare
| flags.StringVar(&opts.org_root_cert, "root-cert", "", "Path to the original root ceritificate") | ||
| flags.StringVar(&opts.org_cert_chain, "cert-chain", "", "Path to the original certificate chain") | ||
| flags.StringVar(&opts.orgRootCert, "root-cert", "", "Path to the original root ceritificate") | ||
| flags.StringVar(&opts.orgCertChain, "cert-chain", "", "Path to the original certificate chain") |
There was a problem hiding this comment.
Since you are already here, can you change the description to something like 'Path to the original workload certificate chain'
|
|
||
| expectedID := fmt.Sprintf("spiffe://cluster.local/ns/%s/sa/default", s.GetNamespace()) | ||
| examineSecret(s, expectedID) | ||
| secret, error := utils.WaitForSecretExist(opts.clientset, opts.namespace, "istio.default", |
There was a problem hiding this comment.
I think 'err' is widely used since 'error' can be confused with some lib name. At least please be consistent within this file (there are some 'err' and some 'error').
There was a problem hiding this comment.
I replaced err with errors in this file.
|
I didn't clone the istio code from my forked repository correctly. I am going to close this pull request and create a new one. |
What this PR does / why we need it: Fix linter errors.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #1446Special notes for your reviewer:
The following linter errors are reported by linters.sh, and are fixed in this PR.
security/integration/main.go:151:13:warning: "Succesfully" is a misspelling of "Successfully" (misspell)
security/integration/main.go:368::error: unreachable code (vet)
security/cmd/istio_ca/main.go:171::warning: declaration of "ca" shadows declaration at security/cmd/istio_ca/main.go:32 (vetshadow)
security/cmd/istio_ca/main.go:191::warning: declaration of "ca" shadows declaration at security/cmd/istio_ca/main.go:32 (vetshadow)
security/integration/main.go:155::warning: declaration of "err" shadows declaration at security/integration/main.go:146 (vetshadow)
security/integration/main.go:167::warning: declaration of "err" shadows declaration at security/integration/main.go:146 (vetshadow)
security/integration/main.go:174::warning: declaration of "err" shadows declaration at security/integration/main.go:146 (vetshadow)
security/integration/utils/kubernetes.go:111::warning: declaration of "uuid" shadows declaration at security/integration/utils/kubernetes.go:26 (vetshadow)
security/integration/utils/kubernetes.go:146:2:warning: ineffectual assignment to pod (ineffassign)
security/pkg/platform/aws_test.go:168:20:warning: ineffectual assignment to err (ineffassign)
security/cmd/node_agent/na/nafactory.go:35:26:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/cmd/node_agent/na/nodeagent.go:44:26:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/cmd/node_agent/na/nodeagent.go:52:26:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:66:2:warning: don't use underscores in Go names; struct field org_root_cert should be orgRootCert (golint)
security/integration/main.go:67:2:warning: don't use underscores in Go names; struct field org_cert_chain should be orgCertChain (golint)
security/integration/main.go:146:2:warning: don't use underscores in Go names; var self_signed_ca_pod should be selfSignedCaPod (golint)
security/integration/main.go:158:9:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
security/integration/main.go:169:9:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
security/integration/main.go:177:9:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
security/integration/main.go:192:2:warning: don't use underscores in Go names; var ca_pod should be caPod (golint)
security/integration/main.go:200:2:warning: don't use underscores in Go names; var ca_service should be caService (golint)
security/integration/main.go:207:2:warning: don't use underscores in Go names; var na_pod should be naPod (golint)
security/integration/main.go:215:2:warning: don't use underscores in Go names; var na_service should be naService (golint)
security/integration/main.go:231:9:warning: if block ends with a return statement, so drop this else and outdent its block (golint)
security/integration/main.go:269:21:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:288:21:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:302:6:warning: func readUri should be readURI (golint)
security/integration/main.go:318:2:warning: don't use underscores in Go names; var max_retry should be maxRetry (golint)
security/integration/main.go:321:2:warning: don't use underscores in Go names; var org_root_cert should be orgRootCert (golint)
security/integration/main.go:323:21:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:326:2:warning: don't use underscores in Go names; var org_cert_chain should be orgCertChain (golint)
security/integration/main.go:328:21:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:351:22:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/main.go:387:20:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
security/integration/utils/kubernetes.go:32:1:warning: exported function CreateClientset should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:47:1:warning: exported function CreateTestNamespace should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:63:1:warning: exported function DeleteTestNamespace should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:71:1:warning: exported function CreateService should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:106:1:warning: exported function DeleteService should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:110:1:warning: exported function CreatePod should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:158:1:warning: exported function DeletePod should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:162:1:warning: exported function CreateRole should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:190:1:warning: exported function CreateRoleBinding should have comment or be unexported (golint)
security/integration/utils/kubernetes.go:275:1:warning: exported function WaitForSecretExist should have comment or be unexported (golint)
security/pkg/credential/token.go:45:1:warning: comment on exported method GcpTokenFetcher.FetchServiceAccount should be of the form "FetchServiceAccount ..." (golint)
security/pkg/server/grpc/authorizer.go:27:6:warning: type sameIdAuthorizer should be sameIDAuthorizer (golint)
security/pkg/server/grpc/authorizer.go:44:22:warning: error strings should not be capitalized or end with punctuation or a newline (golint)
Release note: