Skip to content

Commit

Permalink
Roll back unrelated changes
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Jan 18, 2023
1 parent 45aa516 commit 542152c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pkg/provider/aci.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type ACIProvider struct {
resourceManager *manager.ResourceManager
containerGroupExtensions []*client2.Extension
enabledFeatures *featureflag.FlagIdentifier
ProviderNetwork network.ProviderNetwork
providerNetwork network.ProviderNetwork

resourceGroup string
region string
Expand Down Expand Up @@ -196,8 +196,8 @@ func NewACIProvider(ctx context.Context, config string, azConfig auth.Config, az

}

if p.ProviderNetwork.VnetResourceGroup == "" {
p.ProviderNetwork.VnetResourceGroup = p.resourceGroup
if p.providerNetwork.VnetResourceGroup == "" {
p.providerNetwork.VnetResourceGroup = p.resourceGroup
}
// If the log analytics file has been specified, load workspace credentials from the file
if logAnalyticsAuthFile := os.Getenv("LOG_ANALYTICS_AUTH_LOCATION"); logAnalyticsAuthFile != "" {
Expand Down Expand Up @@ -250,11 +250,11 @@ func NewACIProvider(ctx context.Context, config string, azConfig auth.Config, az
return nil, err
}

if err := p.ProviderNetwork.SetVNETConfig(ctx, &azConfig); err != nil {
if err := p.providerNetwork.SetVNETConfig(ctx, &azConfig); err != nil {
return nil, err
}

if p.ProviderNetwork.SubnetName != "" {
if p.providerNetwork.SubnetName != "" {
// windows containers don't support kube-proxy nor realtime metrics
if p.operatingSystem != string(azaci.OperatingSystemTypesWindows) {
err = p.setACIExtensions(ctx)
Expand Down Expand Up @@ -342,7 +342,7 @@ func (p *ACIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error {
})
}
}
if len(ports) > 0 && p.ProviderNetwork.SubnetName == "" {
if len(ports) > 0 && p.providerNetwork.SubnetName == "" {
cg.ContainerGroupPropertiesWrapper.ContainerGroupProperties.IPAddress = &azaci.IPAddress{
Ports: &ports,
Type: azaci.ContainerGroupIPAddressTypePublic,
Expand All @@ -364,7 +364,7 @@ func (p *ACIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error {
"CreationTimestamp": &podCreationTimestamp,
}

p.ProviderNetwork.AmendVnetResources(ctx, *cg, pod, p.clusterDomain)
p.providerNetwork.AmendVnetResources(ctx, *cg, pod, p.clusterDomain)

// windows containers don't support kube-proxy nor realtime metrics
if cg.ContainerGroupPropertiesWrapper.ContainerGroupProperties.OsType != azaci.OperatingSystemTypesWindows {
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (p *ACIProvider) loadConfig(r io.Reader) error {

// default subnet name
if config.SubnetName != "" {
p.ProviderNetwork.SubnetName = config.SubnetName
p.providerNetwork.SubnetName = config.SubnetName
}
if config.SubnetCIDR != "" {
if config.SubnetName == "" {
Expand Down

0 comments on commit 542152c

Please sign in to comment.