diff --git a/pkg/cmd/get/packages.go b/pkg/cmd/get/packages.go index 6fe5d33c..e9c2232e 100644 --- a/pkg/cmd/get/packages.go +++ b/pkg/cmd/get/packages.go @@ -14,6 +14,7 @@ import ( "os" "path/filepath" "sigs.k8s.io/controller-runtime/pkg/client" + "strconv" ) var PackagesCmd = &cobra.Command{ @@ -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) } diff --git a/pkg/entity/package.go b/pkg/entity/package.go index 41c9320c..b4acee6c 100644 --- a/pkg/entity/package.go +++ b/pkg/entity/package.go @@ -5,4 +5,5 @@ type Package struct { Namespace string Type string GitRepository string + Status string } diff --git a/pkg/printer/package.go b/pkg/printer/package.go index 6e3f9caf..a86b8a8d 100644 --- a/pkg/printer/package.go +++ b/pkg/printer/package.go @@ -31,6 +31,7 @@ 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{ @@ -38,6 +39,7 @@ func generatePackageTable(packagesTable []entity.Package) metav1.Table { p.Name, p.Namespace, p.GitRepository, + p.Status, }, } table.Rows = append(table.Rows, row)