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

Add ability to specify system namespace during cluster add operation #1661

Merged
merged 5 commits into from
Jun 3, 2019

Conversation

jannfis
Copy link
Member

@jannfis jannfis commented May 29, 2019

This change addresses #1595 by adding the --system-namespace option to the "cluster add" command of argocd CLI as well as a corresponding field in the API function:

[eris@docker-build argo-cd]$ ./dist/argocd cluster add --help | grep namespace
--system-namespace string Use different system namespace (default "kube-system")

When given, ArgoCD will create the System Account "argocd-manager" in the specified namespace. The change is non-breaking, defaults to previous behaviour by using "kube-system" as namespace when the option was not specified.

@codecov-io
Copy link

codecov-io commented May 29, 2019

Codecov Report

Merging #1661 into master will decrease coverage by 0.24%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1661      +/-   ##
==========================================
- Coverage   32.77%   32.53%   -0.25%     
==========================================
  Files          71       71              
  Lines       11378    11029     -349     
==========================================
- Hits         3729     3588     -141     
+ Misses       7098     6919     -179     
+ Partials      551      522      -29
Impacted Files Coverage Δ
cmd/argocd/commands/cluster.go 0% <0%> (ø) ⬆️
server/rbacpolicy/rbacpolicy.go 66.66% <0%> (-13.03%) ⬇️
server/project/project.go 62.04% <0%> (-1.09%) ⬇️
server/application/application.go 23.12% <0%> (-0.34%) ⬇️
server/server.go 46.97% <0%> (ø) ⬆️
server/application/forwarder_overwrite.go 100% <0%> (ø) ⬆️
util/kube/ctl.go 8.42% <0%> (+0.13%) ⬆️
server/account/account.go 68.18% <0%> (+8.18%) ⬆️

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 2777910...c917bdb. Read the comment docs.

@jannfis
Copy link
Member Author

jannfis commented May 29, 2019

Again, this passes both "test" and "test-e2e" on my workstation and Argo CI throws the following error at the E2E stage:

time="2019-05-29T17:00:52Z" level=info msg="ran command" duration=80.687149ms err="exit status 1"
time="2019-05-29T17:00:52Z" level=info msg="running command" args="[app get argocd-e2e-zvauz -o yaml --server 10.43.142.3:443 --auth-token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NTkxNDkyNTEsImlzcyI6ImFyZ29jZCIsIm5iZiI6MTU1OTE0OTI1MSwic3
ViIjoiYWRtaW4ifQ.Kh33s0H_3DJXsuVqDHelscECH2kNwXVCnqqvKBfkd-c --insecure]" name=../../dist/argocd workDir=
time="2019-05-29T17:00:52Z" level=info msg="0: time="2019-05-29T17:00:52Z" level=fatal msg="rpc error: code = Unauthenticated desc = invalid session: signature is invalid""

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

Hi,

Can you sync with master and run pre-commit?

git merge master
make pre-commit

Otherwise looks great!

Is your org listed in the README?

Alex

server/cluster/cluster.proto Outdated Show resolved Hide resolved
@jannfis
Copy link
Member Author

jannfis commented May 29, 2019

Hi @alexec

I have done both - merging from master and make pre-commit - already before submitting the PR. Actually, I branched off from latest upstream master, then pulled in the relevant changes from a previous local branch selectively. I'm still rather new to collaborating on GitHub (and also to working with git as a tool for that matter). What is the expected outcome of doing it again?

Running make protogen also re-generated some of the other files, which got me quite confused - I didn't include them in the PR, because I neither touched their sources nor do I understand the changes yet:

    modified:   pkg/apis/application/v1alpha1/generated.pb.go
    modified:   reposerver/repository/repository.pb.go
    modified:   server/account/account.pb.go
    modified:   server/application/application.pb.go
    modified:   server/project/project.pb.go
    modified:   server/repository/repository.pb.go
    modified:   server/session/session.pb.go
    modified:   server/settings/settings.pb.go
    modified:   server/version/version.pb.go

Shall I push them to the PR as well?

Regarding listing my organization in the README - it's not that simple, unfortunately... I work with a fairly huge and very public corporation which has certain processes and regulations in place before having their name displayed in a public place. I already initiated a request for reviewing whether that's possible - because I'd love to see us in there, too :) Anyway, all my code contributions are created in my free time - I've got no coder job in the corp (read: no time for coding during work hours), but I'm working towards the broad adoption of ArgoCD for our K8S-based projects.

@alexec
Copy link
Contributor

alexec commented May 29, 2019

Hmmmmmmm... do you want to write tests for this?

@jannfis
Copy link
Member Author

jannfis commented May 29, 2019

Sure, let me have a look at how the tests work - I guess the right place for this would be in the end-to-end test suite? As far as I understood up until now, the end-to-end tests work without the ArgoCD components running in a k8s cluster but running local.

I'll dig my way in, any pointers are appreciated!

@alexec
Copy link
Contributor

alexec commented May 29, 2019

I think you should be able to write unit tests for this. I don't think E2E tests support different namespaces, but please prove me wrong!

https://argoproj.github.io/argo-cd/developer-guide/test-e2e/

@jannfis
Copy link
Member Author

jannfis commented May 30, 2019

I seem to not get my head around this. Both, unit and e2e tests do not work with an installation of ArgoCD running in a K8S cluster.

This change however affects integration of a k8s cluster with ArgoCD, and only at the time when we incorporate a remote k8s cluster into ArgoCD configuration for the first time.

Not saying a test would not be important, but I cannot seem to find a valid test-case for this change in the current construct :-(

@alexec
Copy link
Contributor

alexec commented May 30, 2019

If there’s no straight forward valid test, we can probably skip it.

@alexec
Copy link
Contributor

alexec commented May 30, 2019

Note, I think you still need to sync with master.

@jannfis
Copy link
Member Author

jannfis commented May 30, 2019

Shall I commit above mentioned protobuf generated files as well?

@alexec
Copy link
Contributor

alexec commented Jun 3, 2019

hi - the codegen build checks you've generated the code right, can you double check - you may have different versions of the protoc tool installed (should be 3.7.1)

@alexec alexec merged commit 64a1ea9 into argoproj:master Jun 3, 2019
@alexec alexec added this to the v1.1 milestone Jun 3, 2019
@alexec
Copy link
Contributor

alexec commented Jun 3, 2019

I've merged so we can move forward.

@jannfis
Copy link
Member Author

jannfis commented Jun 10, 2019

@alexec Thanks and sorry for the delay in my answer, I was away for some days.

Checked the version of my protoc toolchain, guess I'm lagging a bit behind (3.6.1). Will upgrade for the next PRs, thank you for the hint.

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.

3 participants