update primary scaler query handling to consider mutliple triggers

Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
This commit is contained in:
Sanskar Jaiswal
2022-06-30 17:06:45 +05:30
parent b01e4cf9ec
commit a098d04d64
7 changed files with 94 additions and 42 deletions
+3 -3
View File
@@ -425,10 +425,10 @@ type AutoscalerRefernce struct {
// Name of the scaler
Name string `json:"name"`
// PrimaryScalerQuery is the query to use for the primary scaler, if
// Flagger generates one.
// PrimaryScalerQueries maps a unique id to a query for the primary
// scaler, if a scaler supports scaling using queries.
// +optional
PrimaryScalerQuery string `json:"primaryScalerQuery"`
PrimaryScalerQueries map[string]string `json:"primaryScalerQueries"`
}
// CustomMetadata holds labels and annotations to set on generated objects.
@@ -154,6 +154,13 @@ func (in *AlertProviderStatus) DeepCopy() *AlertProviderStatus {
// 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
if in.PrimaryScalerQueries != nil {
in, out := &in.PrimaryScalerQueries, &out.PrimaryScalerQueries
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
@@ -439,7 +446,7 @@ func (in *CanarySpec) DeepCopyInto(out *CanarySpec) {
if in.AutoscalerRef != nil {
in, out := &in.AutoscalerRef, &out.AutoscalerRef
*out = new(AutoscalerRefernce)
**out = **in
(*in).DeepCopyInto(*out)
}
if in.IngressRef != nil {
in, out := &in.IngressRef, &out.IngressRef