Skip to content

Commit

Permalink
load cloud config
Browse files Browse the repository at this point in the history
  • Loading branch information
britaniar committed Nov 7, 2024
1 parent 90599f7 commit d26c8fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/memberagent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
"go.goms.io/fleet/pkg/propertyprovider"
"go.goms.io/fleet/pkg/propertyprovider/azure"
"go.goms.io/fleet/pkg/utils"
azureCloudConfig "go.goms.io/fleet/pkg/utils/cloudconfig/azure"
"go.goms.io/fleet/pkg/utils/httpclient"
//+kubebuilder:scaffold:imports
)
Expand Down Expand Up @@ -366,10 +367,15 @@ func Start(ctx context.Context, hubCfg, memberConfig *rest.Config, hubOpts, memb
switch {
case propertyProvider != nil && *propertyProvider == azurePropertyProvider:
klog.V(2).Info("setting up the Azure property provider")
// TODO: Set cloud configuration.
// Note that the property provider, though initialized here, is not started until
// the specific instance wins the leader election.
klog.V(1).InfoS("Cloud config loaded successfully", "config", cloudConfigFile)
cloudConfig, err := azureCloudConfig.NewCloudConfigFromFile(*cloudConfigFile)
if err != nil {
klog.ErrorS(err, "Unable to load cloud config", "file name", *cloudConfigFile)
return fmt.Errorf("unable to load cloud config: %w", err)
}
cloudConfig.SetUserAgent("fleet-member-agent")
klog.V(1).InfoS("Cloud config loaded successfully", "config", cloudConfig)
pp = azure.New(region)
default:
// Fall back to not using any property provider if the provided type is none or
Expand Down

0 comments on commit d26c8fe

Please sign in to comment.