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

Porchctl repo command issues #755

Open
dgeorgievski opened this issue Jun 17, 2024 · 1 comment
Open

Porchctl repo command issues #755

dgeorgievski opened this issue Jun 17, 2024 · 1 comment
Labels
area/platform area/porch Porch related issues

Comments

@dgeorgievski
Copy link

While reviewing the fix for Porch support of private Git repos
#488
nephio-project/porch#58

I came across the following potential bugs in porchctl repo command

The result of porchctl repo get -A/--all-namespaces misses the NAMESPACE column

 $ porchctl repo get -A
NAME               TYPE   CONTENT   DEPLOYMENT   READY   ADDRESS
my-app             git    Package   false        True    https://gitlab.myprivaterepo.com/dimitar.georgievski/my-app.git
testrepo           git    Package   false        True    http://gitea-http.gitea.svc.cluster.local:3000/nephio/testrepo.git

# the desired output
$ kubectl get repositories -A
NAMESPACE    NAME               TYPE   CONTENT   DEPLOYMENT   READY   ADDRESS
gitlab       my-app             git    Package   false        True    https://gitlab.myprivaterepo.com/dimitar.georgievski/my-app.git
porch-test   testrepo           git    Package   false        True    http://gitea-http.gitea.svc.cluster.local:3000/nephio/testrepo.git

A simple fix for adding the missing column could be like
https://github.com/dgeorgievski/porch/blob/fix-porchctl-repo/pkg/cli/commands/repo/get/command.go#L84-L91

Invoking of porchctl repo reg without -n/--namespace fails

The intent is to register a new Git repo in the current namespace

$ porchctl repo reg https://gitlab.myprivaterepo.com/dimitar.georgievski/my-app.git --branch master
Error: an empty namespace may not be set when a resource name is provided

The same error is displayed in the case of porchctl repo unreg invocation

$ porchctl repo unreg my-app
Error: an empty namespace may not be set when a resource name is provided 

Again, these simple fixes would help address the issues
repo reg : https://github.com/dgeorgievski/porch/blob/fix-porchctl-repo/pkg/cli/commands/repo/reg/command.go#L93-L100
repo unreg: https://github.com/dgeorgievski/porch/blob/fix-porchctl-repo/pkg/cli/commands/repo/unreg/command.go#L75-L82

@kispaljr kispaljr added area/porch Porch related issues area/platform labels Jun 20, 2024
@dgeorgievski
Copy link
Author

I can create a PR if you are OK with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform area/porch Porch related issues
Projects
None yet
Development

No branches or pull requests

2 participants