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

Updated go.mod file with necessary dependencies to improve functionality #38

Merged
merged 16 commits into from
Jun 10, 2024

Conversation

UdayMadhav88
Copy link
Collaborator

Goal

To update go.mod file with the latest versions of all dependencies to improve functionality.

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@@ -117,7 +111,4 @@ func TestUpdateToken(t *testing.T) {
if token1 == token2 || token1Expire == token2Expire {
t.Error("Token failed to updated")
}
if *tp.config.Client.CredsToken != token2 {
t.Error("Failed to update client token to token2")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove those test cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @zetaj ,
From the given nested structure *tp.config.Client.CredsToken, it looks like the CredsToken field has been removed from the recent upgraded packages of github.com/AthenZ/athenz/clients/go/zms. As a result, it is no longer supported, hence our test cases are failing. Therefore, we removed the CredsToken field.

@@ -81,9 +81,6 @@ func TestToken(t *testing.T) {
if token1 != token2 || token1Expire != token2Expire {
t.Error("Token updated when not expired")
}
if *tp.config.Client.CredsToken != token2 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know the reason we are removing this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @bhaskaramVaranasi ,
From the given nested structure *tp.config.Client.CredsToken, it looks like the CredsToken field has been removed from the recent upgraded packages of github.com/AthenZ/athenz/clients/go/zms. As a result, it is no longer supported, hence our test cases are failing. Therefore, we removed the CredsToken field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @bhaskaramVaranasi @zetaj ,
Client.CredsToken has been removed from github.com/AthenZ/[email protected] version. The last it was used in
github.com/AthenZ/[email protected] version.

Below is the screenshot of the Client.CredsToken being used for the final time under client.go file
Screenshot 2024-06-05 at 12 10 09 PM

pkg/cron/cron.go Outdated
@@ -96,7 +96,7 @@ func notifyOnErr(err error, backoffDelay time.Duration) {
// RequestCall - ZMS call for update crons
func (c *Cron) requestCall() error {
master := false
domains, etag, err := c.zmsClient.GetSignedDomains("", "true", "", &master, c.etag)
domains, etag, err := c.zmsClient.GetSignedDomains("", "true", "", &master,&master, c.etag)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to pass in the &master twice ? what is it being used for ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @bhaskaramVaranasi,
Please find the attached screenshot of the function GetSignedDomains().
The conditions field has been added as a parameter to the updated package. So to accomodate this, we are sending it as a boolean set to false.

Screenshot 2024-06-03 at 10 17 01 AM

@@ -296,7 +296,7 @@ func (c *Controller) sync(domain string) error {
func (c *Controller) zmsGetSignedDomains(domain string) (*zms.SignedDomains, bool, error) {
d := zms.DomainName(domain)
master := false
signedDomain, _, err := c.zmsClient.GetSignedDomains(d, "", "", &master, "")
signedDomain, _, err := c.zmsClient.GetSignedDomains(d, "", "", &master,&master, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @bhaskaramVaranasi ,
Please find the attached screenshot of the function GetSignedDomains().
The conditions field has been added as a parameter to the updated package. So to accomodate this, we are sending it as a boolean set to false.

Screenshot 2024-06-03 at 10 17 01 AM

pkg/cron/cron.go Outdated
@@ -96,7 +96,7 @@ func notifyOnErr(err error, backoffDelay time.Duration) {
// RequestCall - ZMS call for update crons
func (c *Cron) requestCall() error {
master := false
domains, etag, err := c.zmsClient.GetSignedDomains("", "true", "", &master, c.etag)
domains, etag, err := c.zmsClient.GetSignedDomains("", "true", "", &master,&master, c.etag)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you give more information regarding this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @zetaj ,
Please find the attached screenshot of the function GetSignedDomains().
The conditions field has been added as a parameter to the updated package. So to accomodate this, we are sending it as a boolean set to false.

Screenshot 2024-06-03 at 10 17 01 AM

@@ -296,7 +296,7 @@ func (c *Controller) sync(domain string) error {
func (c *Controller) zmsGetSignedDomains(domain string) (*zms.SignedDomains, bool, error) {
d := zms.DomainName(domain)
master := false
signedDomain, _, err := c.zmsClient.GetSignedDomains(d, "", "", &master, "")
signedDomain, _, err := c.zmsClient.GetSignedDomains(d, "", "", &master,&master, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give more context/information regarding this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @zetaj ,
Please find the attached screenshot of the function GetSignedDomains().
The conditions field has been added as a parameter to the updated package. So to accomodate this, we are sending it as a boolean set to false.

Screenshot 2024-06-03 at 10 17 01 AM


Items []AthenzDomain `json:"items"`
}
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this whole file shows changes, can you please check why and fix it so that only the changes are made to the specific lines you changed ?

@@ -96,7 +96,8 @@ func notifyOnErr(err error, backoffDelay time.Duration) {
// RequestCall - ZMS call for update crons
func (c *Cron) requestCall() error {
master := false
domains, etag, err := c.zmsClient.GetSignedDomains("", "true", "", &master, c.etag)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the conditions variable being used here for ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @bhaskaramVaranasi , Please find the screenshot below.
This conditions field is one of the input parameter required to form the url. The value for this is kept as false since the other variable master was set to false in the same way we are setting this conditions field to false.

Below screenshot is from cron.go
Screenshot 2024-06-05 at 1 11 02 PM

Below screenshot is from client.go, this file is from the package [email protected]/clients/go/zms/client.go
Screenshot 2024-06-03 at 10 17 01 AM

pkg/controller/controller.go Outdated Show resolved Hide resolved
pkg/cron/cron.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zetaj zetaj left a comment

Choose a reason for hiding this comment

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

Please have Bhaskaram doing 2nd review.

@UdayMadhav88 UdayMadhav88 merged commit b8f1144 into AthenZ:master Jun 10, 2024
2 checks passed
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.

3 participants