Skip to content

Commit

Permalink
Print also the status of the CustomPackage
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Dec 24, 2024
1 parent cf21fc8 commit ac3d6c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cmd/get/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"os"
"path/filepath"
"sigs.k8s.io/controller-runtime/pkg/client"
"strconv"
)

var PackagesCmd = &cobra.Command{
Expand Down Expand Up @@ -94,6 +95,9 @@ func printPackages(ctx context.Context, outWriter io.Writer, kubeClient client.C
}
newPackage.GitRepository = cp.Spec.RemoteRepository.Url + "/tree/" + ref + "/" + cp.Spec.RemoteRepository.Path
}

newPackage.Status = strconv.FormatBool(cp.Status.Synced)

packageList = append(packageList, newPackage)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/entity/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ type Package struct {
Namespace string
Type string
GitRepository string
Status string
}
2 changes: 2 additions & 0 deletions pkg/printer/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ func generatePackageTable(packagesTable []entity.Package) metav1.Table {
{Name: "Custom package name", Type: "string"},
{Name: "idp namespace", Type: "string"},
{Name: "Git Repository", Type: "string"},
{Name: "Status", Type: "string"},
}
for _, p := range packagesTable {
row := metav1.TableRow{
Cells: []interface{}{
p.Name,
p.Namespace,
p.GitRepository,
p.Status,
},
}
table.Rows = append(table.Rows, row)
Expand Down

0 comments on commit ac3d6c1

Please sign in to comment.