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

comments for K8 describe package #294

Merged
merged 8 commits into from
Apr 13, 2023

Conversation

Philip-21
Copy link
Member

@Philip-21 Philip-21 commented Apr 10, 2023

Signed-off-by: Philip-21 [email protected]
Description
Created comments for k8 describe package

This PR fixes #287

Signed commits

  • Yes, I signed my commits.

@Philip-21 Philip-21 changed the title K8 describe package comments for K8 describe package Apr 10, 2023
@Aisuko Aisuko self-requested a review April 11, 2023 01:01
Copy link
Member

@Aisuko Aisuko left a comment

Choose a reason for hiding this comment

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

Can we only include the code comments for describe.go? Before we confirm the scope of the mocking test, we could merge that test case

@Philip-21
Copy link
Member Author

Philip-21 commented Apr 11, 2023

@Aisuko from what you are saying, do you want me to only comment on the role for the describe.go so it could tally with describe_test.go and should i also take out some of the comments i wrote for the codes in the describe.go ?

@Aisuko
Copy link
Member

Aisuko commented Apr 11, 2023

@Aisuko from what you are saying, do you want me to only comment on the role for the describe.go so it could tally with describe_test.go and should I also take out some of the comments i wrote for the codes in the describe.go ?

Please keep the code comments in the descrble.go. The mock testing part already include in your previous PR right? This PR is only for code comments. So, we can merge it directly.

@Aisuko
Copy link
Member

Aisuko commented Apr 11, 2023

Please do not forget to update to the latest version code.

@Philip-21
Copy link
Member Author

Philip-21 commented Apr 11, 2023

@Aisuko from what you are saying, do you want me to only comment on the role for the describe.go so it could tally with describe_test.go and should I also take out some of the comments i wrote for the codes in the describe.go ?

Please keep the code comments in the descrble.go. The mock testing part already include in your previous PR right? This PR is only for code comments. So, we can merge it directly.

Yes this pr only includes code comments for the describe.go . The previous Pr is for the Mock testing

@Philip-21
Copy link
Member Author

Please do not forget to update to the latest version code.

Please how do you mean by this

@Aisuko
Copy link
Member

Aisuko commented Apr 12, 2023

Screenshot 2023-04-12 at 11 48 50 am

@Philip-21
Copy link
Member Author

Screenshot 2023-04-12 at 11 48 50 am

ok thanks, i have just updated branch to latest version.

@Aisuko
Copy link
Member

Aisuko commented Apr 12, 2023

We need to only include the describe.go file in this PR. This PR only aims to add code comment to describle.go

Signed-off-by: Philip Obiora <[email protected]>
@Philip-21
Copy link
Member Author

Philip-21 commented Apr 12, 2023

We need to only include the describe.go file in this PR. This PR only aims to add code comment to describle.go

ok i have removed the describe_test.go file . The describe.go file is what is in this pr

@Aisuko Aisuko self-requested a review April 12, 2023 07:57
@Aisuko Aisuko self-assigned this Apr 12, 2023
Copy link
Member

@Aisuko Aisuko left a comment

Choose a reason for hiding this comment

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

Thank you, please take a look and help me replace these code comments. We use code comment // in the file.

}

/*
Copy link
Member

Choose a reason for hiding this comment

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

Replace to // DescribeType is an integer value that represents the Kubernetes resource that needs to be described.

@@ -57,6 +64,12 @@ const (
EndpointSlice
)

/*
Copy link
Member

Choose a reason for hiding this comment

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

Replace to // The ResourceMap variable contains the GroupKind information of all the Kubernetes resources that can be described.

@@ -88,22 +101,30 @@ var ResourceMap = map[DescribeType]schema.GroupKind{
EndpointSlice: {Group: discoveryv1.GroupName, Kind: "EndpointSlice"},
}

/*
Copy link
Member

Choose a reason for hiding this comment

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

Replace to // The Describe() function takes a meshkitkube.Client object and a DescriberOptions object as input. // And it returns the description of the specified Kubernetes resource as a string.

output, err := describer.Describe(options.Namespace, options.Name, describerSetting)
if err != nil {
return "", err
}

/*
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this code comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, i have made the changes

@Aisuko Aisuko added kind/enhancement Improvement in current feature language/go Golang related labels Apr 12, 2023
making adjustments to comments

Signed-off-by: Philip Obiora <[email protected]>
Copy link
Member

@Aisuko Aisuko left a comment

Choose a reason for hiding this comment

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

After remove these blanks and pass CI. We can merge it. You can get more detail from https://stackoverflow.com/questions/69049182/file-is-not-gofmt-ed-with-s-why-is-this-happening-and-how-to-resolve-it

}

// DescribeType is an integer value that represents the Kubernetes resource that needs to be described.
Copy link
Member

Choose a reason for hiding this comment

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

Here is a blank at the beginning, CI cannot run succeed. So, please remove it.

@@ -57,6 +60,7 @@ const (
EndpointSlice
)

// The ResourceMap variable contains the GroupKind information of all the Kubernetes resources that can be described.
Copy link
Member

Choose a reason for hiding this comment

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

Here.

@@ -88,22 +92,23 @@ var ResourceMap = map[DescribeType]schema.GroupKind{
EndpointSlice: {Group: discoveryv1.GroupName, Kind: "EndpointSlice"},
}

// The Describe() function takes a meshkitkube.Client object and a DescriberOptions object as input.
// And it returns the description of the specified Kubernetes resource as a string.
Copy link
Member

Choose a reason for hiding this comment

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

Here.

Copy link
Member Author

Choose a reason for hiding this comment

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

You want me to remove the comments or the spaces in between the comments ?

Copy link
Member

Choose a reason for hiding this comment

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

The space at the second comment

Copy link
Member Author

Choose a reason for hiding this comment

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

i have removed the spaces

Signed-off-by: Philip Obiora <[email protected]>
Copy link
Member

@Aisuko Aisuko 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: Philip Obiora <[email protected]>
@Aisuko
Copy link
Member

Aisuko commented Apr 13, 2023

CI may have some issues, I check the PR manually by using golangci-lint, there is no error.

ErrGetDescriberFunc was defined under the same package.

Screenshot 2023-04-13 at 6 25 40 pm

@Aisuko Aisuko self-requested a review April 13, 2023 08:28
Copy link
Member

@Aisuko Aisuko left a comment

Choose a reason for hiding this comment

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

LGTM

@Aisuko Aisuko merged commit 49c5bc1 into meshery:master Apr 13, 2023
@welcome
Copy link

welcome bot commented Apr 13, 2023

Thanks for your contribution to the Layer5 community! 🎉

Congrats!

@Philip-21
Copy link
Member Author

CI may have some issues, I check the PR manually by using golangci-lint, there is no error. ErrGetDescriberFunc was defined under the same package.

Screenshot 2023-04-13 at 6 25 40 pm

does it mean that it shouldn't be there .

@Aisuko
Copy link
Member

Aisuko commented Apr 13, 2023

CI may have some issues, I check the PR manually by using golangci-lint, there is no error. ErrGetDescriberFunc was defined under the same package.
Screenshot 2023-04-13 at 6 25 40 pm

does it mean that it shouldn't be there .

No worries, this is not related to this PR.

@Philip-21
Copy link
Member Author

CI may have some issues, I check the PR manually by using golangci-lint, there is no error. ErrGetDescriberFunc was defined under the same package.
Screenshot 2023-04-13 at 6 25 40 pm

does it mean that it shouldn't be there .

No worries, this is not related to this PR.

Ok I would start working on the describe_test in the other pr and make changes where necessary.
And I will Write more unit test for the K8 packages .

@Philip-21 Philip-21 deleted the k8-describe-package branch April 14, 2023 18:50
@Philip-21 Philip-21 restored the k8-describe-package branch April 14, 2023 18:50
@Philip-21 Philip-21 deleted the k8-describe-package branch April 14, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvement in current feature language/go Golang related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing Unit tests For k8 in Utils package
2 participants