Skip to content

Commit

Permalink
feat: add the resource group name to the TrafficManagerProfile spec (#…
Browse files Browse the repository at this point in the history
…252)

add the resource group name in traffic profile

Co-authored-by: Ryan Zhang <[email protected]>
  • Loading branch information
ryanzhang-oss and Ryan Zhang authored Jan 25, 2025
1 parent 1497a02 commit 230bcc6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/v1alpha1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// The name of the resource group to contain the Azure Traffic Manager resource corresponding to this profile.
// When this profile is created, updated, or deleted, the corresponding traffic manager with the same name will be created, updated, or deleted
// in the specified resource group.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`

// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// The name of the resource group to contain the Azure Traffic Manager resource corresponding to this profile.
// When this profile is created, updated, or deleted, the corresponding traffic manager with the same name will be created, updated, or deleted
// in the specified resource group.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`

// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ spec:
minimum: 0
type: integer
type: object
resourceGroup:
description: |-
The name of the resource group to contain the Azure Traffic Manager resource corresponding to this profile.
When this profile is created, updated, or deleted, the corresponding traffic manager with the same name will be created, updated, or deleted
in the specified resource group.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down Expand Up @@ -291,6 +302,17 @@ spec:
minimum: 0
type: integer
type: object
resourceGroup:
description: |-
The name of the resource group to contain the Azure Traffic Manager resource corresponding to this profile.
When this profile is created, updated, or deleted, the corresponding traffic manager with the same name will be created, updated, or deleted
in the specified resource group.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down

0 comments on commit 230bcc6

Please sign in to comment.