mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
fix: Require SMI TrafficSplit Service and Weight
In the SMI TrafficSplit spec, Weight and Service are required values for TrafficSplit Backend. In flagger's SMI v1alpha2 implementation, Service and Weight have the omitempty json option. During canary analysis, flagger initially creates a SMI TrafficSplit custom resource in which the canary backend service has a Weight of 0. The omitempty option causes Go to omit Weight when it sends the custom resource to Kubernetes. This throws an error during canary analysis. Signed-off-by: Johnson Shi <Johnson.Shi@microsoft.com>
This commit is contained in:
@@ -33,8 +33,8 @@ type TrafficSplitSpec struct {
|
||||
|
||||
// TrafficSplitBackend defines a backend
|
||||
type TrafficSplitBackend struct {
|
||||
Service string `json:"service,omitempty"`
|
||||
Weight int `json:"weight,omitempty"`
|
||||
Service string `json:"service"`
|
||||
Weight int `json:"weight"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
Reference in New Issue
Block a user