add support for KEDA ScaledObjects via ScaledObjectReconciler

Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
This commit is contained in:
Sanskar Jaiswal
2022-06-09 21:36:57 +05:30
parent 498f065dea
commit b2dc762937
31 changed files with 1841 additions and 15 deletions
+19 -1
View File
@@ -74,7 +74,7 @@ type CanarySpec struct {
// AutoscalerRef references an autoscaling resource
// +optional
AutoscalerRef *LocalObjectReference `json:"autoscalerRef,omitempty"`
AutoscalerRef *AutoscalerRefernce `json:"autoscalerRef,omitempty"`
// Reference to NGINX ingress resource
// +optional
@@ -413,6 +413,24 @@ type LocalObjectReference struct {
Name string `json:"name"`
}
type AutoscalerRefernce struct {
// API version of the scaler
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Kind of the scaler
// +optional
Kind string `json:"kind,omitempty"`
// Name of the scaler
Name string `json:"name"`
// PrimaryScalerQuery is the query to use for the primary scaler, if
// Flagger generates one.
// +optional
PrimaryScalerQuery string `json:"primaryScalerQuery"`
}
// CustomMetadata holds labels and annotations to set on generated objects.
type CustomMetadata struct {
Labels map[string]string `json:"labels,omitempty"`
@@ -151,6 +151,22 @@ func (in *AlertProviderStatus) DeepCopy() *AlertProviderStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AutoscalerRefernce) DeepCopyInto(out *AutoscalerRefernce) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerRefernce.
func (in *AutoscalerRefernce) DeepCopy() *AutoscalerRefernce {
if in == nil {
return nil
}
out := new(AutoscalerRefernce)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Canary) DeepCopyInto(out *Canary) {
*out = *in
@@ -422,7 +438,7 @@ func (in *CanarySpec) DeepCopyInto(out *CanarySpec) {
out.TargetRef = in.TargetRef
if in.AutoscalerRef != nil {
in, out := &in.AutoscalerRef, &out.AutoscalerRef
*out = new(LocalObjectReference)
*out = new(AutoscalerRefernce)
**out = **in
}
if in.IngressRef != nil {