From 8d933da1fb8f01a0071e61b91420d260f60a087f Mon Sep 17 00:00:00 2001 From: Zhiying Lin Date: Wed, 11 Sep 2024 18:02:38 +0800 Subject: [PATCH] interface: add the default value for profile api --- api/v1alpha1/trafficmanagerbackend_types.go | 2 +- api/v1alpha1/trafficmanagerprofile_types.go | 7 ++++++- .../networking.fleet.azure.com_trafficmanagerprofiles.yaml | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/trafficmanagerbackend_types.go b/api/v1alpha1/trafficmanagerbackend_types.go index b3e1084c..ec586c21 100644 --- a/api/v1alpha1/trafficmanagerbackend_types.go +++ b/api/v1alpha1/trafficmanagerbackend_types.go @@ -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" diff --git a/api/v1alpha1/trafficmanagerprofile_types.go b/api/v1alpha1/trafficmanagerprofile_types.go index 888c2b5f..5286268b 100644 --- a/api/v1alpha1/trafficmanagerprofile_types.go +++ b/api/v1alpha1/trafficmanagerprofile_types.go @@ -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 @@ -70,6 +74,7 @@ type MonitorConfig struct { // +optional // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=9 + // +kubebuilder:default=3 ToleratedNumberOfFailures *int64 `json:"toleratedNumberOfFailures,omitempty"` } @@ -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, ".trafficmanager.net" + // For example, "-.trafficmanager.net" // +optional DNSName *string `json:"dnsName,omitempty"` diff --git a/config/crd/bases/networking.fleet.azure.com_trafficmanagerprofiles.yaml b/config/crd/bases/networking.fleet.azure.com_trafficmanagerprofiles.yaml index f86470bb..2920c9f4 100644 --- a/config/crd/bases/networking.fleet.azure.com_trafficmanagerprofiles.yaml +++ b/config/crd/bases/networking.fleet.azure.com_trafficmanagerprofiles.yaml @@ -60,6 +60,7 @@ 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. @@ -67,14 +68,17 @@ spec: 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: @@ -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. @@ -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, ".trafficmanager.net" + For example, "-.trafficmanager.net" type: string type: object required: