mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-05 06:34:12 +09:00
Tenants usually read Applications but not the HelmReleases behind them, and only Ready and Released were copied over. A client could therefore see that a release was failing but not how often it had failed, nor whether helm-controller had stopped retrying it. Copy the Stalled condition, which helm-controller sets once it stops reconciling a release (remediation retries exhausted, rollback target missing, invalid CEL, access denied), and surface the install and upgrade failure counters with the last attempted release action. Stalled is dropped when it was observed for an older generation than the HelmRelease's current one: the Application carries no generation, so after a spec update a client would otherwise read the previous spec's failure as terminal for the new values. With the RetryOnFailure policy the platform generates today, a failed release is retried rather than stalled, so the counters are the signal. That does not hold for every state: a release missing from storage while an install failure count is retained still stalls, and a release on a remediation policy stalls once its retries run out. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
119 lines
5.8 KiB
Go
119 lines
5.8 KiB
Go
/*
|
|
Copyright 2025 The Cozystack Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
|
|
|
package v1alpha1
|
|
|
|
import (
|
|
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
|
)
|
|
|
|
// ApplicationStatusApplyConfiguration represents a declarative configuration of the ApplicationStatus type for use
|
|
// with apply.
|
|
//
|
|
// ApplicationStatus is the status of a Application.
|
|
type ApplicationStatusApplyConfiguration struct {
|
|
// Conditions holds the conditions for the Application.
|
|
Version *string `json:"version,omitempty"`
|
|
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
|
// Namespace holds the computed namespace for Tenant applications.
|
|
Namespace *string `json:"namespace,omitempty"`
|
|
// ExternalIPsCount holds the number of LoadBalancer services with assigned external IPs for Tenant applications.
|
|
ExternalIPsCount *int32 `json:"externalIPsCount,omitempty"`
|
|
// InstallFailures is the install failure count of the underlying HelmRelease.
|
|
// It counts only attempts that recorded a Helm release, so a failure before
|
|
// Helm records one, such as a chart that fails to render, shows only as
|
|
// Ready=False; a failure to apply the rendered resources is counted. It
|
|
// resets when the desired state (generation, chart version, values) changes,
|
|
// and on success only under the RetryOnFailure strategy, so a Ready release
|
|
// may carry it.
|
|
InstallFailures *int64 `json:"installFailures,omitempty"`
|
|
// UpgradeFailures is the upgrade failure count of the underlying HelmRelease,
|
|
// with the same counting and reset rules as InstallFailures.
|
|
UpgradeFailures *int64 `json:"upgradeFailures,omitempty"`
|
|
// LastAttemptedReleaseAction is the last release action (install or upgrade)
|
|
// the underlying HelmRelease attempted.
|
|
LastAttemptedReleaseAction *string `json:"lastAttemptedReleaseAction,omitempty"`
|
|
}
|
|
|
|
// ApplicationStatusApplyConfiguration constructs a declarative configuration of the ApplicationStatus type for use with
|
|
// apply.
|
|
func ApplicationStatus() *ApplicationStatusApplyConfiguration {
|
|
return &ApplicationStatusApplyConfiguration{}
|
|
}
|
|
|
|
// WithVersion sets the Version field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Version field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithVersion(value string) *ApplicationStatusApplyConfiguration {
|
|
b.Version = &value
|
|
return b
|
|
}
|
|
|
|
// WithConditions adds the given value to the Conditions field in the declarative configuration
|
|
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
|
|
// If called multiple times, values provided by each call will be appended to the Conditions field.
|
|
func (b *ApplicationStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ApplicationStatusApplyConfiguration {
|
|
for i := range values {
|
|
if values[i] == nil {
|
|
panic("nil value passed to WithConditions")
|
|
}
|
|
b.Conditions = append(b.Conditions, *values[i])
|
|
}
|
|
return b
|
|
}
|
|
|
|
// WithNamespace sets the Namespace field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the Namespace field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithNamespace(value string) *ApplicationStatusApplyConfiguration {
|
|
b.Namespace = &value
|
|
return b
|
|
}
|
|
|
|
// WithExternalIPsCount sets the ExternalIPsCount field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the ExternalIPsCount field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithExternalIPsCount(value int32) *ApplicationStatusApplyConfiguration {
|
|
b.ExternalIPsCount = &value
|
|
return b
|
|
}
|
|
|
|
// WithInstallFailures sets the InstallFailures field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the InstallFailures field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithInstallFailures(value int64) *ApplicationStatusApplyConfiguration {
|
|
b.InstallFailures = &value
|
|
return b
|
|
}
|
|
|
|
// WithUpgradeFailures sets the UpgradeFailures field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the UpgradeFailures field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithUpgradeFailures(value int64) *ApplicationStatusApplyConfiguration {
|
|
b.UpgradeFailures = &value
|
|
return b
|
|
}
|
|
|
|
// WithLastAttemptedReleaseAction sets the LastAttemptedReleaseAction field in the declarative configuration to the given value
|
|
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
|
// If called multiple times, the LastAttemptedReleaseAction field is set to the value of the last call.
|
|
func (b *ApplicationStatusApplyConfiguration) WithLastAttemptedReleaseAction(value string) *ApplicationStatusApplyConfiguration {
|
|
b.LastAttemptedReleaseAction = &value
|
|
return b
|
|
}
|