Skip to content

Commit

Permalink
interface: add the default value for profile api
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiying-lin committed Sep 11, 2024
1 parent 7c5b6bf commit 8d933da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/trafficmanagerbackend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const (
//
// * "Invalid"
// * "Pending"
TrafficManagerBackendConditionAccepted TrafficManagerBackendConditionReason = "Accepted"
TrafficManagerBackendConditionAccepted TrafficManagerBackendConditionType = "Accepted"

// TrafficManagerBackendReasonAccepted is used with the "Accepted" condition when the condition is True.
TrafficManagerBackendReasonAccepted TrafficManagerBackendConditionReason = "Accepted"
Expand Down
7 changes: 6 additions & 1 deletion api/v1alpha1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,23 @@ type MonitorConfig struct {
// of each endpoint in this profile.
// You can specify two values here: 30 seconds (normal probing) and 10 seconds (fast probing).
// +optional
// +kubebuilder:default=30
IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"`

// The path relative to the endpoint domain name used to probe for endpoint health.
// +optional
// +kubebuilder:default="/"
Path *string `json:"path,omitempty"`

// The TCP port used to probe for endpoint health.
// +optional
// +kubebuilder:default=80
Port *int64 `json:"port,omitempty"`

// The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health.
// +kubebuilder:validation:Enum=HTTP;HTTPS;TCP
// +optional
// +kubebuilder:default="HTTP"
Protocol *TrafficManagerMonitorProtocol `json:"protocol,omitempty"`

// The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile
Expand All @@ -70,6 +74,7 @@ type MonitorConfig struct {
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=9
// +kubebuilder:default=3
ToleratedNumberOfFailures *int64 `json:"toleratedNumberOfFailures,omitempty"`
}

Expand All @@ -86,7 +91,7 @@ type TrafficManagerProfileStatus struct {
// DNSName is the fully-qualified domain name (FQDN) of the Traffic Manager profile.
// It consists of profile name and the DNS domain name used by Azure Traffic Manager to form the fully-qualified
// domain name (FQDN) of the profile.
// For example, "<TrafficManagerProfileName>.trafficmanager.net"
// For example, "<TrafficManagerProfileNamespace>-<TrafficManagerProfileName>.trafficmanager.net"
// +optional
DNSName *string `json:"dnsName,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,25 @@ spec:
profile.
properties:
intervalInSeconds:
default: 30
description: |-
The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health
of each endpoint in this profile.
You can specify two values here: 30 seconds (normal probing) and 10 seconds (fast probing).
format: int64
type: integer
path:
default: /
description: The path relative to the endpoint domain name used
to probe for endpoint health.
type: string
port:
default: 80
description: The TCP port used to probe for endpoint health.
format: int64
type: integer
protocol:
default: HTTP
description: The protocol (HTTP, HTTPS or TCP) used to probe for
endpoint health.
enum:
Expand All @@ -93,6 +97,7 @@ spec:
format: int64
type: integer
toleratedNumberOfFailures:
default: 3
description: |-
The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile
Degraded after the next failed health check.
Expand Down Expand Up @@ -183,7 +188,7 @@ spec:
DNSName is the fully-qualified domain name (FQDN) of the Traffic Manager profile.
It consists of profile name and the DNS domain name used by Azure Traffic Manager to form the fully-qualified
domain name (FQDN) of the profile.
For example, "<TrafficManagerProfileName>.trafficmanager.net"
For example, "<TrafficManagerProfileNamespace>-<TrafficManagerProfileName>.trafficmanager.net"
type: string
type: object
required:
Expand Down

0 comments on commit 8d933da

Please sign in to comment.