Skip to content

feat(helm): auto-set cloud_provider env to skip cloud detection probe#82

Merged
RobinDuhan merged 1 commit into
jfrog:mainfrom
m-barczyk:feat/auto-set-cloud-provider-env
Jun 8, 2026
Merged

feat(helm): auto-set cloud_provider env to skip cloud detection probe#82
RobinDuhan merged 1 commit into
jfrog:mainfrom
m-barczyk:feat/auto-set-cloud-provider-env

Conversation

@m-barczyk
Copy link
Copy Markdown
Contributor

The binary's getCloudProvider() function probes AWS, Azure, and GCP metadata endpoints to detect which cloud the node runs on:

func getCloudProvider(svc *service.Service, ctx context.Context, logs *logger.Logger) string {
cloudProvider := utils.GetEnvs(logs, "cloud_provider", "")
logs.Info("cloud_provider from env:" + cloudProvider)
if cloudProvider == "" {
// if cloud_provider is not set, check if the cloud provider is AWS, Azure, or Google
isAWS, errAWS := handlers.CheckIfAWS(svc, ctx)
if isAWS {
cloudProvider = utils.CloudProviderAWS
}

However, the Helm chart never sets cloud_provider in the provider config env array, even though the cloud is already known at template time (the user explicitly enables aws.enabled, gcp.enabled, or azure.enabled).
cloudProvider := utils.GetEnvs(logs, "cloud_provider", "")
Never sets cloudProvider because there is not ENV for it. Auto detection mechanism must always run.

@m-barczyk m-barczyk requested a review from a team June 5, 2026 16:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@m-barczyk m-barczyk force-pushed the feat/auto-set-cloud-provider-env branch from a649e35 to 894a0b9 Compare June 5, 2026 16:52
@m-barczyk
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

The binary's getCloudProvider() function (internal/provider/provider.go#L129)
probes IMDS, Azure, and GCP metadata endpoints to detect which cloud the
node runs on:

    cloudProvider := utils.GetEnvs(logs, "cloud_provider", "")
    if cloudProvider == "" {
        isAWS, _ := handlers.CheckIfAWS(svc, ctx)
        isAzure, _ := handlers.CheckIfAzure(svc, ctx)
        isGoogle, _ := handlers.CheckIfGoogle(svc, ctx)
    }

However, the Helm chart never sets cloud_provider in the provider config env
array, even though the cloud is already known at template time (the user
explicitly enables aws.enabled, gcp.enabled, or azure.enabled).
cloudProvider := utils.GetEnvs(logs, "cloud_provider", "")
Never sets cloudProvider because there is not ENV for it. Auto detection
mechanism must always run.
@RobinDuhan RobinDuhan merged commit 66a8551 into jfrog:main Jun 8, 2026
1 check passed
@m-barczyk m-barczyk deleted the feat/auto-set-cloud-provider-env branch June 8, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants