...

Source file src/github.com/openshift/api/project/v1/types.go

Documentation: github.com/openshift/api/project/v1

     1  package v1
     2  
     3  import (
     4  	corev1 "k8s.io/api/core/v1"
     5  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     6  )
     7  
     8  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
     9  
    10  // ProjectList is a list of Project objects.
    11  //
    12  // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
    13  // +openshift:compatibility-gen:level=1
    14  type ProjectList struct {
    15  	metav1.TypeMeta `json:",inline"`
    16  
    17  	// metadata is the standard list's metadata.
    18  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    19  	metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
    20  
    21  	// Items is the list of projects
    22  	Items []Project `json:"items" protobuf:"bytes,2,rep,name=items"`
    23  }
    24  
    25  const (
    26  	// These are internal finalizer values to Origin
    27  	FinalizerOrigin corev1.FinalizerName = "openshift.io/origin"
    28  	// ProjectNodeSelector is an annotation that holds the node selector;
    29  	// the node selector annotation determines which nodes will have pods from this project scheduled to them
    30  	ProjectNodeSelector = "openshift.io/node-selector"
    31  
    32  	// ProjectRequesterAnnotation is the username that requested a given project.  Its not guaranteed to be present,
    33  	// but it is set by the default project template.
    34  	ProjectRequesterAnnotation = "openshift.io/requester"
    35  )
    36  
    37  // ProjectSpec describes the attributes on a Project
    38  type ProjectSpec struct {
    39  	// Finalizers is an opaque list of values that must be empty to permanently remove object from storage
    40  	Finalizers []corev1.FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=k8s.io/api/core/v1.FinalizerName"`
    41  }
    42  
    43  // ProjectStatus is information about the current status of a Project
    44  type ProjectStatus struct {
    45  	// Phase is the current lifecycle phase of the project
    46  	// +optional
    47  	Phase corev1.NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=k8s.io/api/core/v1.NamespacePhase"`
    48  
    49  	// Represents the latest available observations of the project current state.
    50  	// +optional
    51  	// +patchMergeKey=type
    52  	// +patchStrategy=merge
    53  	Conditions []corev1.NamespaceCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
    54  }
    55  
    56  // +genclient
    57  // +genclient:nonNamespaced
    58  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    59  
    60  // Projects are the unit of isolation and collaboration in OpenShift. A project has one or more members,
    61  // a quota on the resources that the project may consume, and the security controls on the resources in
    62  // the project. Within a project, members may have different roles - project administrators can set
    63  // membership, editors can create and manage the resources, and viewers can see but not access running
    64  // containers. In a normal cluster project administrators are not able to alter their quotas - that is
    65  // restricted to cluster administrators.
    66  //
    67  // Listing or watching projects will return only projects the user has the reader role on.
    68  //
    69  // An OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed
    70  // as editable to end users while namespaces are not. Direct creation of a project is typically restricted
    71  // to administrators, while end users should use the requestproject resource.
    72  //
    73  // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
    74  // +openshift:compatibility-gen:level=1
    75  type Project struct {
    76  	metav1.TypeMeta `json:",inline"`
    77  
    78  	// metadata is the standard object's metadata.
    79  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    80  	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
    81  
    82  	// Spec defines the behavior of the Namespace.
    83  	Spec ProjectSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
    84  
    85  	// Status describes the current status of a Namespace
    86  	// +optional
    87  	Status ProjectStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
    88  }
    89  
    90  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    91  // +genclient
    92  // +genclient:nonNamespaced
    93  // +genclient:skipVerbs=get,list,create,update,patch,delete,deleteCollection,watch
    94  // +genclient:method=Create,verb=create,result=Project
    95  
    96  // ProjectRequest is the set of options necessary to fully qualify a project request
    97  //
    98  // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
    99  // +openshift:compatibility-gen:level=1
   100  type ProjectRequest struct {
   101  	metav1.TypeMeta `json:",inline"`
   102  
   103  	// metadata is the standard object's metadata.
   104  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   105  	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
   106  
   107  	// DisplayName is the display name to apply to a project
   108  	DisplayName string `json:"displayName,omitempty" protobuf:"bytes,2,opt,name=displayName"`
   109  	// Description is the description to apply to a project
   110  	Description string `json:"description,omitempty" protobuf:"bytes,3,opt,name=description"`
   111  }
   112  

View as plain text