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

fix: Argo CD should provide apiversion and kinds to 'helm template' command #7519

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

alexmt
Copy link
Collaborator

@alexmt alexmt commented Oct 21, 2021

Signed-off-by: Alexander Matyushentsev AMatyushentsev@gmail.com

Closes #6351

PR changes ensures that Argo CD passes both api versions and api version kinds to helm template command during manifest generation.

Depends on argoproj/gitops-engine#337

@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #7519 (6cc0bad) into master (d6d620e) will increase coverage by 0.01%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7519      +/-   ##
==========================================
+ Coverage   41.38%   41.40%   +0.01%     
==========================================
  Files         161      161              
  Lines       21618    21622       +4     
==========================================
+ Hits         8947     8952       +5     
  Misses      11408    11408              
+ Partials     1263     1262       -1     
Impacted Files Coverage Δ
controller/cache/cache.go 10.50% <0.00%> (ø)
server/application/application.go 32.18% <0.00%> (-0.12%) ⬇️
util/argo/normalizers/corev1_known_types.go 100.00% <ø> (ø)
controller/clusterinfoupdater.go 36.20% <100.00%> (ø)
controller/state.go 68.02% <100.00%> (ø)
util/argo/argo.go 64.51% <100.00%> (+0.77%) ⬆️
util/http/http.go 62.31% <0.00%> (ø)
util/settings/settings.go 46.83% <0.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6d620e...6cc0bad. Read the comment docs.

@@ -313,7 +314,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan
return err
}

apiGroups, err := s.kubectl.GetAPIGroups(config)
apiGroups, err := s.kubectl.GetAPIResources(config, false, kubecache.NewNoopSettings())
Copy link
Contributor

Choose a reason for hiding this comment

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

Variable apiGroups should be renamed to apiResources

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point. renamed.

func APIResourcesToStrings(resources []kube.APIResourceInfo, includeKinds bool) []string {
resMap := map[string]bool{}
for _, r := range resources {
val := r.GroupVersionResource.GroupVersion().String()
Copy link
Member

Choose a reason for hiding this comment

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

i think it will be better name it groupVersion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds good. renamed.

@alexmt alexmt force-pushed the 6351-helm-apiverision-kind branch 2 times, most recently from a590663 to a802edd Compare October 22, 2021 19:32
@alexmt alexmt marked this pull request as ready for review October 22, 2021 19:38
@alexmt alexmt force-pushed the 6351-helm-apiverision-kind branch 5 times, most recently from 1c5c49b to 31ac554 Compare October 22, 2021 22:39
go.mod Outdated
)

replace github.com/argoproj/gitops-engine => github.com/alexmt/gitops-engine v0.0.0-20211022180552-069d05c651a6
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be from github.com/argoproj/gitops-engine, instead of a fork.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ops, thanks for catching it. Removed replace and switched to latest github.com/argoproj/gitops-engine commit

@@ -47,7 +47,6 @@ core/v1/EnvVar
core/v1/EnvVarSource
core/v1/EphemeralContainer
core/v1/EphemeralContainerCommon
core/v1/EphemeralContainers
Copy link
Contributor

Choose a reason for hiding this comment

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

Why EphemeralContainers is removed from known_types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code is auto-generated. Looks like EphemeralContainers type was removed from the v1.22 k8s client library.

…ommand

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
@alexmt
Copy link
Collaborator Author

alexmt commented Oct 25, 2021

Thank you for review @mayzhang2000 . PTAL

Copy link
Contributor

@mayzhang2000 mayzhang2000 left a comment

Choose a reason for hiding this comment

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

LGTM

@alexmt alexmt merged commit a21b036 into argoproj:master Oct 25, 2021
@alexmt alexmt deleted the 6351-helm-apiverision-kind branch October 26, 2021 01:27
behoof4mind pushed a commit to iits-consulting/argo-cd that referenced this pull request Oct 29, 2021
…ommand (argoproj#7519)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Denis Lavrushko <denis.lavrushko@iits-consulting.de>
khuedoan added a commit to khuedoan/homelab that referenced this pull request Nov 17, 2021
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.

Inconsistent .Capabilities.APIVersions between helm install and argocd's helm template
3 participants