automatic image updates from public repos with selected tags feature added
This commit is contained in:
@@ -39,6 +39,30 @@ type ResourceDefaults struct {
|
||||
MemoryLimit string `json:"memoryLimit,omitempty"`
|
||||
}
|
||||
|
||||
// ImageUpdatePolicy defines the policy for automatic image updates.
|
||||
type ImageUpdatePolicy struct {
|
||||
// Enabled toggles the image update feature.
|
||||
// +optional
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
||||
// CheckInterval specifies how often to check for image updates (e.g., "5m", "1h", "15m").
|
||||
// Minimum interval recommended: 5m to avoid rate limiting.
|
||||
// +kubebuilder:validation:Pattern=`^([0-9]+(s|m|h))+$`
|
||||
// +kubebuilder:default="1h"
|
||||
// +optional
|
||||
CheckInterval string `json:"checkInterval,omitempty"`
|
||||
|
||||
// MonitoredTags is a list of keywords found in image tags that trigger update checks.
|
||||
// Example: ["latest", "master", "dev"]
|
||||
// +optional
|
||||
MonitoredTags []string `json:"monitoredTags,omitempty"`
|
||||
|
||||
// RestartAnnotation is the annotation key used to trigger deployment restarts.
|
||||
// If empty, a default will be used (e.g., "image-updater.my-operator.com/restartedAt").
|
||||
// +optional
|
||||
RestartAnnotation string `json:"restartAnnotation,omitempty"`
|
||||
}
|
||||
|
||||
// NodeTainterConfigSpec defines the desired state of NodeTainterConfig.
|
||||
type NodeTainterConfigSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
@@ -68,6 +92,9 @@ type NodeTainterConfigSpec struct {
|
||||
// Example: "my-operator.example.com/skip-resource-defaults"
|
||||
// +optional
|
||||
OptOutLabelKey string `json:"optOutLabelKey,omitempty"`
|
||||
|
||||
// +optional
|
||||
ImageUpdatePolicy *ImageUpdatePolicy `json:"imageUpdatePolicy,omitempty"`
|
||||
}
|
||||
|
||||
// NodeTainterConfigStatus defines the observed state of NodeTainterConfig.
|
||||
|
@@ -25,6 +25,26 @@ import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageUpdatePolicy) DeepCopyInto(out *ImageUpdatePolicy) {
|
||||
*out = *in
|
||||
if in.MonitoredTags != nil {
|
||||
in, out := &in.MonitoredTags, &out.MonitoredTags
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdatePolicy.
|
||||
func (in *ImageUpdatePolicy) DeepCopy() *ImageUpdatePolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageUpdatePolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NodeTaintInfo) DeepCopyInto(out *NodeTaintInfo) {
|
||||
*out = *in
|
||||
@@ -119,6 +139,11 @@ func (in *NodeTainterConfigSpec) DeepCopyInto(out *NodeTainterConfigSpec) {
|
||||
*out = new(ResourceDefaults)
|
||||
**out = **in
|
||||
}
|
||||
if in.ImageUpdatePolicy != nil {
|
||||
in, out := &in.ImageUpdatePolicy, &out.ImageUpdatePolicy
|
||||
*out = new(ImageUpdatePolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTainterConfigSpec.
|
||||
|
Reference in New Issue
Block a user