Skip to content

Commit

Permalink
Fix provisioner tenant overrides (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraliv13 authored Jul 4, 2023
1 parent d019f0a commit 0302e90
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/controllers/provisioning/provisioning_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type ProvisioningResource interface {
GetSpec() any
GetName() string
GetNamespace() string
Clone() any
}

func getPlatformAndDomain[R ProvisioningResource](res R) (platform, domain string, ok bool) {
Expand All @@ -32,7 +33,8 @@ func selectItemsInPlatformAndDomain[R ProvisioningResource](platform, domain str
result := []R{}
for _, res := range source {
if res.GetProvisioningMeta().PlatformRef == platform && res.GetProvisioningMeta().DomainRef == domain {
result = append(result, res)

result = append(result, res.Clone().(R))
}
}
return result
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ func (db *AzureDatabase) GetProvisioningMeta() *ProvisioningMeta {
func (db *AzureDatabase) GetSpec() any {
return &db.Spec
}

func (db *AzureDatabase) Clone() any {
return db.DeepCopy()
}
4 changes: 4 additions & 0 deletions pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ func (db *AzureManagedDatabase) GetProvisioningMeta() *ProvisioningMeta {
func (db *AzureManagedDatabase) GetSpec() any {
return &db.Spec
}

func (db *AzureManagedDatabase) Clone() any {
return db.DeepCopy()
}
4 changes: 4 additions & 0 deletions pkg/apis/provisioning/v1alpha1/azureVirtualDesktopTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ func (db *AzureVirtualDesktop) GetProvisioningMeta() *ProvisioningMeta {
func (db *AzureVirtualDesktop) GetSpec() any {
return &db.Spec
}

func (db *AzureVirtualDesktop) Clone() any {
return db.DeepCopy()
}
4 changes: 4 additions & 0 deletions pkg/apis/provisioning/v1alpha1/azureVirtualMachineTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ func (db *AzureVirtualMachine) GetProvisioningMeta() *ProvisioningMeta {
func (db *AzureVirtualMachine) GetSpec() any {
return &db.Spec
}

func (db *AzureVirtualMachine) Clone() any {
return db.DeepCopy()
}
4 changes: 4 additions & 0 deletions pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ func (db *HelmRelease) GetProvisioningMeta() *ProvisioningMeta {
func (db *HelmRelease) GetSpec() any {
return &db.Spec
}

func (db *HelmRelease) Clone() any {
return db.DeepCopy()
}

0 comments on commit 0302e90

Please sign in to comment.