Skip to content

Conversation

chetan-rns
Copy link
Member

Signed-off-by: Chetan Banavikalmutt chetanrns1997@gmail.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

Use the context provided by the user while running the argocd admin dashboard command

Fixes: #7563

Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #7826 (9fa0a1a) into master (0c352f8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7826   +/-   ##
=======================================
  Coverage   41.48%   41.48%           
=======================================
  Files         169      169           
  Lines       22256    22256           
=======================================
  Hits         9234     9234           
  Misses      11703    11703           
  Partials     1319     1319           

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 0c352f8...9fa0a1a. Read the comment docs.

Copy link
Collaborator

@alexmt alexmt 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!

@alexmt alexmt merged commit 0f845a0 into argoproj:master Dec 2, 2021
alexmt pushed a commit that referenced this pull request Dec 3, 2021
Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
@pearj
Copy link

pearj commented Dec 16, 2021

This PR has broken the cli for me:

The cli crashes for me now:

goroutine 1 [running]:
github.com/argoproj/argo-cd/v2/cmd/argocd/commands/headless.InitCommand.func2(0xc000319680, 0xc00091ed00, 0x1, 0x10, 0x0, 0x0)
	/go/src/github.com/argoproj/argo-cd/cmd/argocd/commands/headless/headless.go:112 +0x377
github.com/spf13/cobra.(*Command).execute(0xc000319680, 0xc00091ec00, 0x10, 0x10, 0xc000319680, 0xc00091ec00)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:831 +0x582
github.com/spf13/cobra.(*Command).ExecuteC(0xc000159b80, 0x12, 0x0, 0x0)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
main.main()
	/go/src/github.com/argoproj/argo-cd/cmd/main.go:46 +0xe5

2.1.8 works fine for me.

The command I ran was:

argocd app create $appName `
    --upsert `
    --repo $repo `
    --path $path `
    --dest-namespace $destNamespace `
    --dest-server https://kubernetes.default.svc `

@ocraviotto
Copy link
Contributor

I can confirm I have the same issue with this change, and the reason is in the error output.
/go/src/github.com/argoproj/argo-cd/cmd/argocd/commands/headless/headless.go:112 has

if cmd.Flag("context").Changed {

which will cause the nil pointer exception when no "context" flag is set, as cmd.Flag(string) returns a pointer to flag.Flag and it will be nil in that case.

The fix seems simple enough in this case, ensure cmd.Flag("context")is not nil before using it, for example:

if cmd.Flag("context") != nil && cmd.Flag("context").Changed {

I got to this error when testing while working on a PR for #7767 and will for now include the fix there, unless someone else wants to fix it separately.

@chetan-rns
Copy link
Member Author

@ocraviotto @pearj The nil pointer issue is fixed by PR #7958

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.

argocd admin dashboard errors: Unable to load data: cannot find pod with selector [app.kubernetes.io/name=argocd-redis]
4 participants