// Copyright 2020-2026 Project Capsule Authors
// SPDX-License-Identifier: Apache-2.0

package rules

import corev1 "k8s.io/api/core/v1"

// ResourceQuotaRule defines a named ResourceQuota specification generated by a
// Tenant rule. Name is the durable identity of the generated
// GlobalResourceQuota and must be unique across all rules of a Tenant.
// +kubebuilder:object:generate=true
type ResourceQuotaRule struct {
	corev1.ResourceQuotaSpec `json:",inline"`

	// Name is the stable identity of this quota within the Tenant. Changing the
	// name replaces the generated GlobalResourceQuota; changing the quota or its
	// namespace selector updates the existing object.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	Name string `json:"name"`
}
