
// This file was autogenerated by go-to-protobuf. Do not edit it manually!

syntax = "proto2";

package github.com.openshift.api.quota.v1;

import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";

// Package-wide variables from generator "generated".
option go_package = "github.com/openshift/api/quota/v1";

// AppliedClusterResourceQuota mirrors ClusterResourceQuota at a project scope, for projection
// into a project.  It allows a project-admin to know which ClusterResourceQuotas are applied to
// his project and their associated usage.
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
message AppliedClusterResourceQuota {
  // metadata is the standard object's metadata.
  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;

  // spec defines the desired quota
  optional ClusterResourceQuotaSpec spec = 2;

  // status defines the actual enforced quota and its current usage
  optional ClusterResourceQuotaStatus status = 3;
}

// AppliedClusterResourceQuotaList is a collection of AppliedClusterResourceQuotas
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
message AppliedClusterResourceQuotaList {
  // metadata is the standard list's metadata.
  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;

  // items is a list of AppliedClusterResourceQuota
  repeated AppliedClusterResourceQuota items = 2;
}

// ClusterResourceQuota mirrors ResourceQuota at a cluster scope.  This object is easily convertible to
// synthetic ResourceQuota object to allow quota evaluation re-use.
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=clusterresourcequotas,scope=Cluster
// +kubebuilder:subresource:status
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/470
// +openshift:file-pattern=cvoRunLevel=0000_00,operatorName=apiserver,operatorOrdering=01
// +openshift:compatibility-gen:level=1
// +kubebuilder:metadata:annotations=release.openshift.io/bootstrap-required=true
message ClusterResourceQuota {
  // metadata is the standard object's metadata.
  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;

  // spec defines the desired quota
  optional ClusterResourceQuotaSpec spec = 2;

  // status defines the actual enforced quota and its current usage
  optional ClusterResourceQuotaStatus status = 3;
}

// ClusterResourceQuotaList is a collection of ClusterResourceQuotas
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
message ClusterResourceQuotaList {
  // metadata is the standard list's metadata.
  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;

  // items is a list of ClusterResourceQuotas
  repeated ClusterResourceQuota items = 2;
}

// ClusterResourceQuotaSelector is used to select projects.  At least one of LabelSelector or AnnotationSelector
// must present.  If only one is present, it is the only selection criteria.  If both are specified,
// the project must match both restrictions.
message ClusterResourceQuotaSelector {
  // LabelSelector is used to select projects by label.
  // +optional
  // +nullable
  optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector labels = 1;

  // AnnotationSelector is used to select projects by annotation.
  // +optional
  // +nullable
  map<string, string> annotations = 2;
}

// ClusterResourceQuotaSpec defines the desired quota restrictions
message ClusterResourceQuotaSpec {
  // selector is the selector used to match projects.
  // It should only select active projects on the scale of dozens (though it can select
  // many more less active projects).  These projects will contend on object creation through
  // this resource.
  optional ClusterResourceQuotaSelector selector = 1;

  // quota defines the desired quota
  optional .k8s.io.api.core.v1.ResourceQuotaSpec quota = 2;
}

// ClusterResourceQuotaStatus defines the actual enforced quota and its current usage
message ClusterResourceQuotaStatus {
  // total defines the actual enforced quota and its current usage across all projects
  optional .k8s.io.api.core.v1.ResourceQuotaStatus total = 1;

  // namespaces slices the usage by project.  This division allows for quick resolution of
  // deletion reconciliation inside of a single project without requiring a recalculation
  // across all projects.  This can be used to pull the deltas for a given project.
  // +optional
  // +nullable
  repeated ResourceQuotaStatusByNamespace namespaces = 2;
}

// ResourceQuotaStatusByNamespace gives status for a particular project
message ResourceQuotaStatusByNamespace {
  // namespace the project this status applies to
  optional string namespace = 1;

  // status indicates how many resources have been consumed by this project
  optional .k8s.io.api.core.v1.ResourceQuotaStatus status = 2;
}

