Add service.targetPort field to Canary CRD

This commit is contained in:
stefanprodan
2019-10-06 10:04:21 +03:00
parent 5605fab740
commit 67a6366906
5 changed files with 22 additions and 4 deletions
+5
View File
@@ -118,6 +118,11 @@ spec:
portName:
description: Container port name
type: string
targetPort:
description: Container target port name
anyOf:
- type: string
- type: number
portDiscovery:
description: Enable port dicovery
type: boolean
+5
View File
@@ -119,6 +119,11 @@ spec:
portName:
description: Container port name
type: string
targetPort:
description: Container target port name
anyOf:
- type: string
- type: number
portDiscovery:
description: Enable port dicovery
type: boolean
+5
View File
@@ -118,6 +118,11 @@ spec:
portName:
description: Container port name
type: string
targetPort:
description: Container target port name
anyOf:
- type: string
- type: number
portDiscovery:
description: Enable port dicovery
type: boolean
+6 -4
View File
@@ -17,6 +17,7 @@ limitations under the License.
package v1alpha3
import (
"k8s.io/apimachinery/pkg/util/intstr"
"time"
istiov1alpha3 "github.com/weaveworks/flagger/pkg/apis/istio/v1alpha3"
@@ -88,10 +89,11 @@ type CanaryList struct {
// CanaryService is used to create ClusterIP services
// and Istio Virtual Service
type CanaryService struct {
Port int32 `json:"port"`
PortName string `json:"portName,omitempty"`
PortDiscovery bool `json:"portDiscovery"`
Timeout string `json:"timeout,omitempty"`
Port int32 `json:"port"`
PortName string `json:"portName,omitempty"`
TargetPort intstr.IntOrString `json:"targetPort,omitempty"`
PortDiscovery bool `json:"portDiscovery"`
Timeout string `json:"timeout,omitempty"`
// Istio
Gateways []string `json:"gateways,omitempty"`
Hosts []string `json:"hosts,omitempty"`
@@ -159,6 +159,7 @@ func (in *CanaryMetric) DeepCopy() *CanaryMetric {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CanaryService) DeepCopyInto(out *CanaryService) {
*out = *in
out.TargetPort = in.TargetPort
if in.Gateways != nil {
in, out := &in.Gateways, &out.Gateways
*out = make([]string, len(*in))