mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
[traefik] Remove TraefikService metadata from canary spec
This commit is contained in:
@@ -542,18 +542,6 @@ spec:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
traefikService:
|
||||
description: Metadata to add to the TraefikService
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
annotations:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
skipAnalysis:
|
||||
description: Skip analysis and promote canary
|
||||
type: boolean
|
||||
|
||||
@@ -542,18 +542,6 @@ spec:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
traefikService:
|
||||
description: Metadata to add to the TraefikService
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
annotations:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
skipAnalysis:
|
||||
description: Skip analysis and promote canary
|
||||
type: boolean
|
||||
|
||||
@@ -542,18 +542,6 @@ spec:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
traefikService:
|
||||
description: Metadata to add to the TraefikService
|
||||
type: object
|
||||
properties:
|
||||
labels:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
annotations:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
skipAnalysis:
|
||||
description: Skip analysis and promote canary
|
||||
type: boolean
|
||||
|
||||
@@ -175,10 +175,6 @@ type CanaryService struct {
|
||||
// +optional
|
||||
Backends []string `json:"backends,omitempty"`
|
||||
|
||||
// TraefikService is metadata to add to the traefik service
|
||||
// +optional
|
||||
TraefikService *CustomMetadata `json:"traefikService,omitempty"`
|
||||
|
||||
// Apex is metadata to add to the apex service
|
||||
// +optional
|
||||
Apex *CustomMetadata `json:"apex,omitempty"`
|
||||
|
||||
@@ -369,11 +369,6 @@ func (in *CanaryService) DeepCopyInto(out *CanaryService) {
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.TraefikService != nil {
|
||||
in, out := &in.TraefikService, &out.TraefikService
|
||||
*out = new(CustomMetadata)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Apex != nil {
|
||||
in, out := &in.Apex, &out.Apex
|
||||
*out = new(CustomMetadata)
|
||||
|
||||
@@ -40,7 +40,7 @@ func (tr *TraefikRouter) Reconcile(canary *flaggerv1.Canary) error {
|
||||
|
||||
traefikService, err := tr.traefikClient.TraefikV1alpha1().TraefikServices(canary.Namespace).Get(context.TODO(), apexName, metav1.GetOptions{})
|
||||
if errors.IsNotFound(err) {
|
||||
tsMetadata := canary.Spec.Service.TraefikService
|
||||
tsMetadata := canary.Spec.Service.Apex
|
||||
if tsMetadata == nil {
|
||||
tsMetadata = &flaggerv1.CustomMetadata{}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func TestTraefikRouter_Reconcile(t *testing.T) {
|
||||
mocks := newFixture(nil)
|
||||
mocks.canary.Spec.Service.TraefikService = &flaggerv1.CustomMetadata{
|
||||
mocks.canary.Spec.Service.Apex = &flaggerv1.CustomMetadata{
|
||||
Labels: map[string]string{
|
||||
"test": "label",
|
||||
},
|
||||
@@ -35,8 +35,8 @@ func TestTraefikRouter_Reconcile(t *testing.T) {
|
||||
assert.Len(t, services, 1)
|
||||
assert.Equal(t, uint(100), services[0].Weight)
|
||||
|
||||
assert.Equal(t, ts.ObjectMeta.Labels, mocks.canary.Spec.Service.TraefikService.Labels)
|
||||
assert.Equal(t, ts.ObjectMeta.Annotations, mocks.canary.Spec.Service.TraefikService.Annotations)
|
||||
assert.Equal(t, ts.ObjectMeta.Labels, mocks.canary.Spec.Service.Apex.Labels)
|
||||
assert.Equal(t, ts.ObjectMeta.Annotations, mocks.canary.Spec.Service.Apex.Annotations)
|
||||
|
||||
for _, tt := range []struct {
|
||||
name string
|
||||
|
||||
@@ -51,7 +51,7 @@ spec:
|
||||
service:
|
||||
port: 80
|
||||
targetPort: 9898
|
||||
traefikService:
|
||||
apex:
|
||||
labels:
|
||||
test: test-label
|
||||
annotations:
|
||||
|
||||
Reference in New Issue
Block a user