Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

collecting GCP clusters data #693

Merged
merged 18 commits into from
Apr 14, 2023
Merged

Conversation

AnnuCode
Copy link
Contributor

@AnnuCode AnnuCode commented Apr 3, 2023

Problem

Collect GCP Container clusters data

Solution

Created container package to collect GCP container clusters data.

Changes Made

  • created container package.
  • transferred the ExtractZoneFromURL function to utils package in region.go file as it is also used in the compute package.

Notes

  • Link of the GKE needs to be added in the models.Resource slice.
  • Nodeconfig is used which is deprecated according to the docs. It can be replaced using Nodepool.

Checklist

  • Code follows the contributing guidelines
  • Any dependencies have been added to the project, if necessary

Reviewers

@eneskaya

Signed-off-by: Annu Singh <annu4444.as@gmail.com>
@mlabouardy mlabouardy added the gcp label Apr 4, 2023
@mlabouardy mlabouardy added this to the v3.0.11 milestone Apr 4, 2023
@mlabouardy mlabouardy changed the base branch from master to develop April 5, 2023 07:29
Copy link
Collaborator

@mlabouardy mlabouardy left a comment

Choose a reason for hiding this comment

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

@AnnuCode do you need some help for the PR to be ready for review? :)

@AnnuCode
Copy link
Contributor Author

AnnuCode commented Apr 5, 2023

@mlabouardy Hi, Link of the GKE needs to be added in the models.Resource slice but I do not know the correct format of the link.

AnnuCode added 2 commits April 5, 2023 16:23
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
@AnnuCode AnnuCode marked this pull request as ready for review April 5, 2023 12:59

for _, cluster := range clusters.Clusters {
tags := make([]models.Tag, 0)
//according to docs, NodeConfig is deprecated and is advised to use node_pool.config
Copy link
Contributor

Choose a reason for hiding this comment

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

one more remark, if it's deprecated to use NodeConfig, can you change this to the non-deprecated way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eneskaya yes sure, working on it.

Signed-off-by: Annu Singh <annu4444.as@gmail.com>
@eneskaya
Copy link
Contributor

eneskaya commented Apr 6, 2023

Hey @AnnuCode I wanted to test your code, but it seems there is a critical bug which leads to komiser crashing. Please see screenshot. You can ping me once the issue is resolved and I can have a look again.

Screenshot 2023-04-06 at 08 56 33

EDIT: Also, make sure to add your container.Clusters in gcp.go, like so:

func listOfSupportedServices() []providers.FetchDataFunction {
	return []providers.FetchDataFunction{
		compute.Instances,
		storage.Buckets,
                container.Clusters // <--- Add this
	}
}

@mlabouardy mlabouardy modified the milestones: v3.0.11, v3.0.12 Apr 7, 2023
@mlabouardy
Copy link
Collaborator

Hey @AnnuCode, do you need some help with this PR? :)

@AnnuCode
Copy link
Contributor Author

HI @mlabouardy , I think the program was crashing(invalid memory address) because I forgot to write the return statement in the error check associated with NodePool which is being shown in the attached photo above('failed to collect labels'). The issue is after I have written the return statement in the error check, I am not able to check if its the right fix as I am getting 'Network Request Error' after running go build and ./komiser start on my feature/666 branch. Is it because of the lack of cloud credentials in my case? The program is not crashing anymore with the above shown error but maybe I am not able to reproduce it properly?

@mlabouardy
Copy link
Collaborator

HI @mlabouardy , I think the program was crashing(invalid memory address) because I forgot to write the return statement in the error check associated with NodePool which is being shown in the attached photo above('failed to collect labels'). The issue is after I have written the return statement in the error check, I am not able to check if its the right fix as I am getting 'Network Request Error' after running go build and ./komiser start on my feature/666 branch. Is it because of the lack of cloud credentials in my case? The program is not crashing anymore with the above shown error but maybe I am not able to reproduce it properly?

the 'Network Request Error' error was fixed last week, if you rebase your branch with develop (make sure you pull latest changes from develop first) you won't have the issue anymore :)

AnnuCode added 12 commits April 11, 2023 21:13
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
Signed-off-by: Annu Singh <annu4444.as@gmail.com>
…o feature/666

Signed-off-by: Annu Singh <annu4444.as@gmail.com>
@AnnuCode
Copy link
Contributor Author

@mlabouardy Tried but could not do it. I started with git fetch upstream --> git merge upstream/develop from the feature branch --> git rebase upstream/develop from the feature branch. After resolving conflicts and doing git rebase --continue VSCode says failed to execute git. Also created a mess in this branch in the process.

@AnnuCode
Copy link
Contributor Author

@mlabouardy @eneskaya After resolving conflicts in the rebase process, this message is there. Can you please have a look?

git_rebase

@mlabouardy mlabouardy self-requested a review April 14, 2023 12:40
Copy link
Collaborator

@mlabouardy mlabouardy left a comment

Choose a reason for hiding this comment

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

@AnnuCode I've fixed the missing dependencies, thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants