diff --git a/pkg/cmd/cli/describe/describer.go b/pkg/cmd/cli/describe/describer.go index be5f06c9fb6c..9f1fe47e235e 100644 --- a/pkg/cmd/cli/describe/describer.go +++ b/pkg/cmd/cli/describe/describer.go @@ -359,6 +359,7 @@ func (d *ProjectDescriber) Describe(namespace, name string) (string, error) { return tabbedString(func(out *tabwriter.Writer) error { formatMeta(out, project.ObjectMeta) formatString(out, "Display Name", project.DisplayName) + formatString(out, "Status", project.Status.Phase) return nil }) } diff --git a/pkg/cmd/cli/describe/printer.go b/pkg/cmd/cli/describe/printer.go index aa29c81e2963..6b7074543946 100644 --- a/pkg/cmd/cli/describe/printer.go +++ b/pkg/cmd/cli/describe/printer.go @@ -26,7 +26,7 @@ var ( buildConfigColumns = []string{"NAME", "TYPE", "SOURCE"} imageColumns = []string{"NAME", "DOCKER REF"} imageRepositoryColumns = []string{"NAME", "DOCKER REPO", "TAGS"} - projectColumns = []string{"NAME", "DISPLAY NAME"} + projectColumns = []string{"NAME", "DISPLAY NAME", "STATUS"} routeColumns = []string{"NAME", "HOST/PORT", "PATH", "SERVICE", "LABELS"} deploymentColumns = []string{"NAME", "STATUS", "CAUSE"} deploymentConfigColumns = []string{"NAME", "TRIGGERS", "LATEST VERSION"} @@ -219,7 +219,7 @@ func printImageRepositoryList(repos *imageapi.ImageRepositoryList, w io.Writer) } func printProject(project *projectapi.Project, w io.Writer) error { - _, err := fmt.Fprintf(w, "%s\t%s\n", project.Name, project.DisplayName) + _, err := fmt.Fprintf(w, "%s\t%s\t%s\n", project.Name, project.DisplayName, project.Status.Phase) return err } diff --git a/pkg/project/api/types.go b/pkg/project/api/types.go index 53ddfd72229a..0cccadede3cc 100644 --- a/pkg/project/api/types.go +++ b/pkg/project/api/types.go @@ -6,14 +6,27 @@ import ( // ProjectList is a list of Project objects. type ProjectList struct { - kapi.TypeMeta `json:",inline"` - kapi.ListMeta `json:"metadata,omitempty"` - Items []Project `json:"items"` + kapi.TypeMeta + kapi.ListMeta + Items []Project +} + +// ProjectSpec describes the attributes on a Project +type ProjectSpec struct { +} + +// ProjectStatus is information about the current status of a Project +type ProjectStatus struct { + Phase kapi.NamespacePhase } // Project is a logical top-level container for a set of origin resources type Project struct { - kapi.TypeMeta `json:",inline"` - kapi.ObjectMeta `json:"metadata,omitempty"` - DisplayName string `json:"displayName,omitempty"` + kapi.TypeMeta + kapi.ObjectMeta + + // TODO: remove me + DisplayName string + Spec ProjectSpec + Status ProjectStatus } diff --git a/pkg/project/api/v1beta1/types.go b/pkg/project/api/v1beta1/types.go index f2b2171b5fdb..5e4c45408848 100644 --- a/pkg/project/api/v1beta1/types.go +++ b/pkg/project/api/v1beta1/types.go @@ -11,9 +11,24 @@ type ProjectList struct { Items []Project `json:"items"` } +// ProjectSpec describes the attributes on a Project +type ProjectSpec struct { +} + +// ProjectStatus is information about the current status of a Project +type ProjectStatus struct { + Phase kapi.NamespacePhase `json:"phase,omitempty" description:"phase is the current lifecycle phase of the project"` +} + // Project is a logical top-level container for a set of origin resources type Project struct { kapi.TypeMeta `json:",inline"` kapi.ObjectMeta `json:"metadata,omitempty"` DisplayName string `json:"displayName,omitempty"` + + // Spec defines the behavior of the Namespace. + Spec ProjectSpec `json:"spec,omitempty" description:"spec defines the behavior of the Project"` + + // Status describes the current status of a Namespace + Status ProjectStatus `json:"status,omitempty" description:"status describes the current status of a Project; read-only"` } diff --git a/pkg/project/registry/project/rest.go b/pkg/project/registry/project/rest.go index 636bbaf57e8a..8cbaa02d0728 100644 --- a/pkg/project/registry/project/rest.go +++ b/pkg/project/registry/project/rest.go @@ -42,6 +42,10 @@ func convertNamespace(namespace *kapi.Namespace) *api.Project { return &api.Project{ ObjectMeta: namespace.ObjectMeta, DisplayName: displayName, + Spec: api.ProjectSpec{}, + Status: api.ProjectStatus{ + Phase: namespace.Status.Phase, + }, } }