Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolPtr ¶
BoolPtr returns a pointer to the given bool value This is a utility function for creating pointers to bool values
func RegisterDefaults ¶
RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.
Types ¶
type BadgeStatus ¶
type BadgeStatus string
BadgeStatus badge status used to indicate if/when a ReleaseQualifier badge should be displayed
const ( BadgeStatusYes BadgeStatus = "Yes" BadgeStatusNo BadgeStatus = "No" BadgeStatusOnSuccess BadgeStatus = "OnSuccess" BadgeStatusOnFailure BadgeStatus = "OnFailure" )
type ConfigAccessor ¶
type ConfigAccessor interface {
Get() ReleaseQualifiers
}
ConfigAccessor provides thread-safe access to release qualifiers configuration
type ConfigFile ¶
type ConfigFile struct {
Qualifiers ReleaseQualifiers `yaml:"qualifiers"`
}
ConfigFile represents the top-level structure of the release-qualifiers.yaml file
type ConfigLoader ¶
type ConfigLoader struct {
// contains filtered or unexported fields
}
ConfigLoader loads and watches release qualifiers configuration file
func NewConfigLoader ¶
func NewConfigLoader(configPath string) (*ConfigLoader, error)
NewConfigLoader creates a new ConfigLoader If configPath is empty or file doesn't exist, starts with empty config and logs warning
func (*ConfigLoader) Get ¶
func (cl *ConfigLoader) Get() ReleaseQualifiers
Get returns the current configuration (thread-safe)
func (*ConfigLoader) StartWatching ¶
func (cl *ConfigLoader) StartWatching(ctx context.Context) error
StartWatching begins watching the config file for changes Supports both regular files and Kubernetes ConfigMap mounts (..data symlink)
func (*ConfigLoader) Subscribe ¶
func (cl *ConfigLoader) Subscribe(callback func(ReleaseQualifiers))
Subscribe adds a callback to be notified when config changes
type QualifierId ¶
type QualifierId string
QualifierId is a unique name that corresponds to a specific ReleaseQualifier definition
type ReleaseQualifier ¶
type ReleaseQualifier struct {
// Enabled indicates whether this qualifier is currently active
// Using a pointer to distinguish between "not set" and "set to false"
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
// Approval indicates whether this qualifier is earned via Team Approval
// Using a pointer to distinguish between "not set" and "set to false"
Approval *bool `json:"approval,omitempty" yaml:"approval,omitempty"`
// BadgeName short name displayed, as UI badges, in job level summaries
BadgeName string `json:"badgeName,omitempty" yaml:"badgeName,omitempty"`
// Summary provides a brief description of what this qualifier represents
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
// Description contains detailed information about the qualifier for display in tooltips or detailed views
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// PayloadBadgeStatus indicates if/when the qualifier's BadgeName should be displayed at the ReleasePayload level
PayloadBadgeStatus BadgeStatus `json:"payloadBadgeStatus,omitempty" yaml:"payloadBadgeStatus,omitempty"`
// FailureLabels labels to apply when qualifying jobs fail
FailureLabels []string `json:"failureLabels,omitempty" yaml:"failureLabels,omitempty"`
// Notifications contains configuration for notification channels
Notifications *notifications.Notifications `json:"notifications,omitempty" yaml:"notifications,omitempty"`
}
ReleaseQualifier defines the configuration for a single release qualifier It contains metadata about the qualifier and its notification settings +k8s:deepcopy-gen=true
func (*ReleaseQualifier) DeepCopy ¶
func (in *ReleaseQualifier) DeepCopy() *ReleaseQualifier
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseQualifier.
func (*ReleaseQualifier) DeepCopyInto ¶
func (in *ReleaseQualifier) DeepCopyInto(out *ReleaseQualifier)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ReleaseQualifier) Merge ¶
func (rq ReleaseQualifier) Merge(override ReleaseQualifier) ReleaseQualifier
Merge takes a ReleaseQualifier object and returns a new ReleaseQualifier that is the union of both Override values take precedence when both are defined Deep merge is performed for nested structures
func (ReleaseQualifier) PrettyPrint ¶
func (rq ReleaseQualifier) PrettyPrint() (string, error)
PrettyPrint returns a pretty-printed JSON representation of ReleaseQualifier with alphabetically sorted keys for consistent output
func (ReleaseQualifier) Validate ¶
func (rq ReleaseQualifier) Validate() error
Validate enforces any rules that all ReleaseQualifier objects must adhere to
type ReleaseQualifiers ¶
type ReleaseQualifiers map[QualifierId]ReleaseQualifier
ReleaseQualifiers represents a collection of release qualifiers indexed by their unique names Each qualifier defines configuration for a specific component or feature
func (ReleaseQualifiers) Merge ¶
func (rqs ReleaseQualifiers) Merge(overrides ReleaseQualifiers) ReleaseQualifiers
Merge returns a new ReleaseQualifiers by selecting global qualifiers that have a matching override entry. Each override opts in to a global qualifier; override values take precedence via mergeQualifier deep merge. Qualifiers not present in overrides are excluded from the result.
func (ReleaseQualifiers) PrettyPrint ¶
func (rqs ReleaseQualifiers) PrettyPrint() (string, error)
PrettyPrint returns a pretty-printed JSON representation of ReleaseQualifiers with alphabetically sorted keys for consistent output