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

New command to list the custom packages #466

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cmoulliard
Copy link
Contributor

@cmoulliard
Copy link
Contributor Author

cmoulliard commented Dec 24, 2024

Example of what the code produce now

Custom packages added

❯ idp create --color --recreate --name dummy --port 9443 \
   -p https://github.com/cnoe-io/stacks//basic/package1 \
   -p https://github.com/cnoe-io/stacks//basic/package2

What the command idp get packages prints

// A custom package
❯ ./idpbuilder get packages -p app-my-app
CUSTOM PACKAGE NAME   IDP NAMESPACE      GIT REPOSITORY                                                                      STATUS
app-my-app            idpbuilder-dummy   https://gitea.cnoe.localtest.me:9443/giteaAdmin/idpbuilder-dummy-my-app-manifests   true

// All the custom packages
~/code/cnoe/fork-idpbuilder on list-packages •
❯ ./idpbuilder get packages
CUSTOM PACKAGE NAME   IDP NAMESPACE      GIT REPOSITORY                                                                      STATUS
app-guestbook         idpbuilder-dummy   https://github.com/cnoe-io/stacks/tree/main/basic/package2                          true
app-my-app            idpbuilder-dummy   https://gitea.cnoe.localtest.me:9443/giteaAdmin/idpbuilder-dummy-my-app-manifests   true
app2-guestbook2       idpbuilder-dummy   https://github.com/cnoe-io/stacks/tree/main/basic/package2                          true

~/code/cnoe/fork-idpbuilder on list-packages •

Copy link
Collaborator

@nabuskey nabuskey left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we merge all structs in separate files into one file? Is the entity package for types? If so, we should name the package as types instead of entity.


idpbuilderNamespace, err := getIDPNamespace(ctx, kubeClient)
if err != nil {
return fmt.Errorf("calculating idp namespace: %w", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("calculating idp namespace: %w", err)
return fmt.Errorf("getting namespace: %w", err)

for _, name := range packages {
cp, err := getPackageByName(ctx, kubeClient, idpbuilderNamespace, name)
if err != nil {
return fmt.Errorf("get custom package: %w", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("get custom package: %w", err)
return fmt.Errorf("getting custom package %s: %w", name, err)

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