-
Notifications
You must be signed in to change notification settings - Fork 80
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
Upgraded the dependent go modules #232
Conversation
Codecov Report
@@ 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
📣 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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Fatal
instead?
There was a problem hiding this 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
1c87baa
to
cb9b3c5
Compare
|
||
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{}) |
There was a problem hiding this comment.
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{}) |
There was a problem hiding this comment.
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{}) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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: TUlJQ1VUQ0NBZnVnQXdJQkFnSUJBREFOQmdrcWhraUc5dzBCQVFRRkFEQlhNUXN3Q1FZRFZRUUdFd0pEVGpFTApNQWtHQTFVRUNCTUNVRTR4Q3pBSkJnTlZCQWNUQWtOT01Rc3dDUVlEVlFRS0V3SlBUakVMTUFrR0ExVUVDeE1DClZVNHhGREFTQmdOVkJBTVRDMGhsY205dVp5QlpZVzVuTUI0WERUQTFNRGN4TlRJeE1UazBOMW9YRFRBMU1EZ3gKTkRJe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R4OW04RU1zeHpYTjNQUGpDVTYxdz09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tDQo= |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admiral/pkg/clusters/handler_test.go
Outdated
@@ -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{}) |
There was a problem hiding this comment.
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?
admiral/pkg/clusters/handler_test.go
Outdated
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{}) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
97eaec6
to
e26473f
Compare
There was a problem hiding this 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>
3ada347
to
d305f4c
Compare
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
There was a problem hiding this 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>
Signed-off-by: Anubhav Aeron <anubhav_aeron@intuit.com>
Fixes #216
Upgraded the dependent go modules
Signed-off-by: Shriram Sharma shriram_sharma@intuit.com