Skip to content

Commit

Permalink
inteface: support BYO resource group for atm
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiying-lin committed Jan 24, 2025
1 parent 1497a02 commit 4d32a0d
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/v1alpha1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// BringYourOwn defines the Azure Traffic Manager in your own resource group.
// +required
BringYourOwn *BringYourOwn `json:"bringYourOwn"`

// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
}

// BringYourOwn configures the existing Azure resource.
type BringYourOwn struct {
// The Azure Resource Group of the existing resource.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`
}

// MonitorConfig defines the endpoint monitoring settings of the Traffic Manager profile.
// https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-monitoring
type MonitorConfig struct {
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions api/v1beta1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,23 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// BringYourOwn defines the Azure Traffic Manager in your own resource group.
// +required
BringYourOwn *BringYourOwn `json:"bringYourOwn"`

// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
}

// BringYourOwn configures the existing Azure resource.
type BringYourOwn struct {
// The Azure Resource Group of the existing resource.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`
}

// MonitorConfig defines the endpoint monitoring settings of the Traffic Manager profile.
// https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-monitoring
type MonitorConfig struct {
Expand Down
20 changes: 20 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ spec:
spec:
description: The desired state of TrafficManagerProfile.
properties:
bringYourOwn:
description: BringYourOwn defines the Azure Traffic Manager in your
own resource group.
properties:
resourceGroup:
description: The Azure Resource Group of the existing resource.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
monitorConfig:
description: The endpoint monitoring settings of the Traffic Manager
profile.
Expand Down Expand Up @@ -111,6 +124,8 @@ spec:
minimum: 0
type: integer
type: object
required:
- bringYourOwn
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down Expand Up @@ -235,6 +250,19 @@ spec:
spec:
description: The desired state of TrafficManagerProfile.
properties:
bringYourOwn:
description: BringYourOwn defines the Azure Traffic Manager in your
own resource group.
properties:
resourceGroup:
description: The Azure Resource Group of the existing resource.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
monitorConfig:
description: The endpoint monitoring settings of the Traffic Manager
profile.
Expand Down Expand Up @@ -291,6 +319,8 @@ spec:
minimum: 0
type: integer
type: object
required:
- bringYourOwn
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down

0 comments on commit 4d32a0d

Please sign in to comment.