Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support specifying the status and EOL date for CMPV releases #8770

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions apis/apps/v1/componentversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package v1

import (
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -120,6 +122,7 @@ type ComponentVersionCompatibilityRule struct {
// ComponentVersionRelease represents a release of component instances within a ComponentVersion.
type ComponentVersionRelease struct {
// Name is a unique identifier for this release.
//
// Cannot be updated.
//
// +kubebuilder:validation:Required
Expand All @@ -133,8 +136,10 @@ type ComponentVersionRelease struct {
Changes string `json:"changes,omitempty"`

// ServiceVersion defines the version of the well-known service that the component provides.
//
// The version should follow the syntax and semantics of the "Semantic Versioning" specification (http://semver.org/).
// If the release is used, it will serve as the service version for component instances, overriding the one defined in the component definition.
//
// Cannot be updated.
//
// +kubebuilder:validation:Required
Expand All @@ -152,4 +157,49 @@ type ComponentVersionRelease struct {
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) <= 32)",message="Container, action or external application name may not exceed maximum length of 32 characters"
// +kubebuilder:validation:XValidation:rule="self.all(key, size(self[key]) <= 256)",message="Image name may not exceed maximum length of 256 characters"
Images map[string]string `json:"images"`

// Status represents the status of the release (e.g., "alpha", "beta", "stable", "deprecated").
//
// For a release in the "deprecated" state, the release is no longer supported and the controller will prevent new instances from employing it.
//
// +kubebuilder:validation:Required
Status ReleaseStatus `json:"status"`

// Reason is the detailed reason for the release status.
//
// For a release in the "deprecated" state, the reason should explain why the release is deprecated. For example:
// {
// Description: "Vulnerability in logging library",
// Severity: "high",
// Mitigation: "Upgrade to logging library v2.0.0",
// CVE: "CVE-2024-12345",
// }
//
// +kubebuilder:validation:MaxLength=256
// +optional
Reason string `json:"reason,omitempty"`

// ReleaseDate is the date when this version was released.
//
// +optional
ReleaseDate time.Time `json:"releaseDate,omitempty"`

// EndOfLifeDate is the date when this version is no longer supported.
//
// When this field is set and the release has passed its end-of-life (EOL) date, the controller will prevent new instances from employing it.
//
// +optional
EndOfLifeDate time.Time `json:"endOfLifeDate,omitempty"`
}

// ReleaseStatus represents the status of a release.
//
// +kubebuilder:validation:Enum={alpha,beta,stable,deprecated}
type ReleaseStatus string

const (
ReleaseStatusAlpha ReleaseStatus = "alpha"
ReleaseStatusBeta ReleaseStatus = "beta"
ReleaseStatusStable ReleaseStatus = "stable"
ReleaseStatusDeprecated ReleaseStatus = "deprecated"
)
Loading