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

return resource list instead of string for helm manifest generation #88

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

mikeshng
Copy link
Collaborator

@mikeshng mikeshng commented Jun 2, 2020

Signed-off-by: Mike Ng ming@redhat.com

chartDir, err := downloadChart(client, s)
//generateResourceList generates the resource list for given HelmRelease
func generateResourceList(mgr manager.Manager, s *appv1.HelmRelease) (kube.ResourceList, error) {
chartDir, err := downloadChart(mgr.GetClient(), s)

Choose a reason for hiding this comment

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

I think the cache issue is related to this issue,

kubernetes-sigs/controller-runtime#180

Choose a reason for hiding this comment

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

mgr.Manager.GetCache().Get(ctx·context.Context,·key·client.ObjectKey,·obj·runtime.Object)

might resolve the cache complain.

The issue to me is, the manager build a cache for configmap, but we still query the k8s directly for the configmap.

Query directly will cause the unstructured object to be created, which somehow confused the cache.

In other words, since we waited for the cache to build up, then we can just use the cache to get object instead of query k8s directly via manager.GetClient()

@sonarcloud
Copy link

sonarcloud bot commented Jun 2, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

60.7% 60.7% Coverage
0.0% 0.0% Duplication

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ianzhang366, mikeshng

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mikeshng mikeshng merged commit 0d0667f into master Jun 3, 2020
@mikeshng mikeshng deleted the helm-manifest branch June 3, 2020 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants