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

Upgraded the dependent go modules #232

Merged
merged 15 commits into from
Aug 17, 2022

Conversation

shriramsharma
Copy link
Collaborator

Fixes #216
Upgraded the dependent go modules

Signed-off-by: Shriram Sharma shriram_sharma@intuit.com

@shriramsharma shriramsharma added the WIP Work In Progress label Jun 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2022

Codecov Report

Merging #232 (7686693) into master (1d0fe30) will increase coverage by 0.00%.
The diff coverage is 74.68%.

@@           Coverage Diff           @@
##           master     #232   +/-   ##
=======================================
  Coverage   73.21%   73.21%           
=======================================
  Files          31       31           
  Lines        3084     3088    +4     
=======================================
+ Hits         2258     2261    +3     
- Misses        681      682    +1     
  Partials      145      145           
Impacted Files Coverage Δ
admiral/pkg/controller/admiral/service.go 84.54% <36.36%> (+0.14%) ⬆️
admiral/pkg/clusters/handler.go 64.80% <51.72%> (ø)
admiral/pkg/clusters/types.go 58.21% <58.73%> (ø)
admiral/pkg/controller/admiral/controller.go 38.15% <60.00%> (-0.51%) ⬇️
admiral/pkg/controller/admiral/configmap.go 67.44% <70.00%> (ø)
admiral/pkg/controller/admiral/deployment.go 83.15% <84.61%> (ø)
admiral/pkg/controller/admiral/rollouts.go 75.47% <84.61%> (ø)
admiral/pkg/clusters/serviceentry.go 80.59% <85.71%> (-0.13%) ⬇️
admiral/pkg/clusters/envoyfilter.go 93.60% <95.00%> (+0.15%) ⬆️
admiral/pkg/apis/admiral/routes/handlers.go 68.86% <100.00%> (+0.29%) ⬆️
... and 10 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
Copy link
Collaborator

Choose a reason for hiding this comment

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

💯

return &cs
cs, err := NewForConfig(c)
if err != nil {
panic(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

log.Fatal instead?

Copy link
Contributor

@aattuluri aattuluri left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for doing this long pending work


sidecarObj, _ := sidecarController.IstioClient.NetworkingV1alpha3().Sidecars("test-sidecar-namespace").Get(common.GetWorkloadSidecarName(), v12.GetOptions{})
sidecarObj, _ := sidecarController.IstioClient.NetworkingV1alpha3().Sidecars("test-sidecar-namespace").Get(ctx, common.GetWorkloadSidecarName(), v12.GetOptions{})
Copy link
Collaborator

@nirvanagit nirvanagit Jun 29, 2022

Choose a reason for hiding this comment

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

does this API return an error? If so we could add an assertion.

@@ -534,15 +539,16 @@ func TestModifyExistingSidecarForLocalClusterCommunication(t *testing.T) {
Egress: []*istionetworkingv1alpha3.IstioEgressListener{&istioEgress},
}

createdSidecar, _ := sidecarController.IstioClient.NetworkingV1alpha3().Sidecars("test-sidecar-namespace").Create(existingSidecarObj)
ctx := context.Background()
createdSidecar, _ := sidecarController.IstioClient.NetworkingV1alpha3().Sidecars("test-sidecar-namespace").Create(ctx, existingSidecarObj, v12.CreateOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this API return an error? If so we could add an assertion.

_, err = client.AppsV1().Deployments("test-ns").Create(&deploymentWithBadLabels)
_, err = client.AppsV1().Deployments("test-ns").Create(&deploymentWithIgnoreLabels)
_, err = client.AppsV1().Deployments("test-ns").Create(ctx, &deployment, metav1.CreateOptions{})
_, err = client.AppsV1().Deployments("test-ns").Create(ctx, &deploymentWithBadLabels, metav1.CreateOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will be good to add assertions for each error.


if err != nil {
t.Errorf("%v", err)
}

depController.K8sClient = client
resultingDeps, _ := depController.GetDeployments()
resultingDeps, _ := depController.GetDeployments(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this API return an error? If so we could add an assertion.

@@ -1,7 +1,7 @@
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: TUlJQ1VUQ0NBZnVnQXdJQkFnSUJBREFOQmdrcWhraUc5dzBCQVFRRkFEQlhNUXN3Q1FZRFZRUUdFd0pEVGpFTApNQWtHQTFVRUNCTUNVRTR4Q3pBSkJnTlZCQWNUQWtOT01Rc3dDUVlEVlFRS0V3SlBUakVMTUFrR0ExVUVDeE1DClZVNHhGREFTQmdOVkJBTVRDMGhsY205dVp5QlpZVzVuTUI0WERUQTFNRGN4TlRJeE1UazBOMW9YRFRBMU1EZ3gKTkRJeE1UazBOMW93VnpFTE1Ba0dBMVVFQmhNQ1EwNHhDekFKQmdOVkJBZ1RBbEJPTVFzd0NRWURWUVFIRXdKRApUakVMTUFrR0ExVUVDaE1DVDA0eEN6QUpCZ05WQkFzVEFsVk9NUlF3RWdZRFZRUURFd3RJWlhKdmJtY2dXV0Z1Clp6QmNNQTBHQ1NxR1NJYjNEUUVCQVFVQUEwc0FNRWdDUVFDcDVobkc3b2dCaHRseW5wT1MyMWNCZXdLRS9CN2oKVjE0cWV5c2xucjI2eFpVc1NWa28zNlpuaGlhTy96Yk1Pb1JjS0s5dkVjZ010Y0xGdVFUV0RsM1JBZ01CQUFHagpnYkV3Z2E0d0hRWURWUjBPQkJZRUZGWEk3MGtyWGVRRHhaZ2JhQ1FvUjRqVURuY0VNSDhHQTFVZEl3UjRNSGFBCkZGWEk3MGtyWGVRRHhaZ2JhQ1FvUjRqVURuY0VvVnVrV1RCWE1Rc3dDUVlEVlFRR0V3SkRUakVMTUFrR0ExVUUKQ0JNQ1VFNHhD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R1crYkFXc0lSRHc2V2pvbThQWTN1RDA1QWEzV2RYd2ROYUE1R2hTQ3ZVVEU0bVVYDQpESjdYVjVLZjlPdEhObllXOFZ3b3B0NlBhM2tpUHdQZE9BU0E1OVUvVVFhWTRwVE5TRnBTY1A1R1VEbnVKUTUwDQpXOEdmem1FNkV4Y0ROOXRMRnVYT0oyelFpTWpKMGVKQUxIckM2UUtrRXk0anpCTFY0RFN0SURBQ2dqbzdtU28zDQphWER0NnozbTVlSUp4TmIrMG51VTRnc1BRbnQwb2sxVW9VNVpES3ZRZ3FKcGZSMU9NYUlEWkVPREJ6dXpZYTE2DQp1V0pOQ3BEaU4rZGtBMXhQQ08wVUk4STRqcDBxek9rMjNzejlEVEwvNldNbldndkZRdWxJcVRWMDNHVE1MRnEyDQpFOXpLb0JqQzdURUJrczVwSlZmMkhwVkdrUitMVzVnZnBVT0ZFanFLYnBhMEorV1hHVVRSU3R1UVBiNjQzRVBTDQpZeEl6TGR4OW04RU1zeHpYTjNQUGpDVTYxdz09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tDQo=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, why was an update required to ca data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

somehow I was getting the following error so I updated it.

destinationrule_test.go:28: Unexpected err failed to create destination rule controller k8s client: unable to load root certificates: unable to parse bytes as PEM block
    destinationrule_test.go:32: DestinationRule controller should never be nil without an error thrown
--- FAIL: TestNewDestinationRuleController

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool, Just ran openssl command after decoding using base64, and the old one was not a certificate.
Screen Shot 2022-08-17 at 11 09 45 AM

@@ -1479,7 +1486,7 @@ func TestAddUpdateServiceEntry(t *testing.T) {
Spec: twoEndpointSe,
}

seCtrl.IstioClient.NetworkingV1alpha3().ServiceEntries("namespace").Create(oldSeTwoEndpoints)
seCtrl.IstioClient.NetworkingV1alpha3().ServiceEntries("namespace").Create(ctx, oldSeTwoEndpoints, v12.CreateOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we check for error in this?

if c.skipDestructive {
//verify the update did not go through
se, _ := c.rc.ServiceEntryController.IstioClient.NetworkingV1alpha3().ServiceEntries("namespace").Get(c.oldSe.Name, v12.GetOptions{})
se, _ := c.rc.ServiceEntryController.IstioClient.NetworkingV1alpha3().ServiceEntries("namespace").Get(ctx, c.oldSe.Name, v12.GetOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this API return an error? If so we could add an assertion.

return &cs
cs, err := NewForConfig(c)
if err != nil {
log.Fatal(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for the second comment on the same line. I think we should return an error to the caller.

op = "Add"
} else {
exist.Labels = obj.Labels
exist.Annotations = obj.Annotations
exist.Spec = obj.Spec
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hey @aattuluri , we were getting copylock linting errors on this line and @nirvanagit and I quickly scanned through the code and it seemed we could pass obj directly to the Update func without having to assign it to exist. Since we don't have much historic context to it, can you please review this and let us know if this is ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case obj is not something returned by the client but rather a new generated one. I think it might work. I am fine as long as the tests pass. Dont really remember why it was written this way :)

@@ -599,8 +599,7 @@ func addUpdateServiceEntry(obj *v1alpha3.ServiceEntry, exist *v1alpha3.ServiceEn
log.Infof(LogFormat, op, "ServiceEntry", obj.Name, rc.ClusterID, "Update skipped as it was destructive during Admiral's bootup phase")
return
} else {
exist.Spec = obj.Spec
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aattuluri , here is the same as before for resolving copylock

op = "Add"
} else {
exist.Labels = obj.Labels
exist.Annotations = obj.Annotations
exist.Spec = obj.Spec
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aattuluri , here is the same as before for resolving copylock

@@ -368,10 +368,7 @@ func modifySidecarForLocalClusterCommunication(ctx context.Context, sidecarNames

func addUpdateSidecar(ctx context.Context, obj *v1alpha3.Sidecar, exist *v1alpha3.Sidecar, namespace string, rc *RemoteController) {
var err error
exist.Labels = obj.Labels
exist.Annotations = obj.Annotations
exist.Spec = obj.Spec
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aattuluri , here is the same as before for resolving copylock

Copy link
Contributor

@aattuluri aattuluri left a comment

Choose a reason for hiding this comment

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

This looks good. Do we need to generate a client/api for dependency record also?
Also, how was this generated. Would be good to add a command to Makefile to generate this in future.

Upgraded the dependent go modules

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Copy link
Contributor

@aattuluri aattuluri left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
@shriramsharma shriramsharma merged commit bdfcbae into istio-ecosystem:master Aug 17, 2022
@shriramsharma shriramsharma deleted the upgrade_deps_216 branch August 17, 2022 22:53
nirvanagit pushed a commit that referenced this pull request Sep 19, 2022
Signed-off-by: Anubhav Aeron <anubhav_aeron@intuit.com>
itsLucario pushed a commit that referenced this pull request Nov 7, 2022
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.

[Enhancement] Make admiral build/dev env work with latest Go version and dependencies
4 participants