Skip to content

Get eden home path from environment variable#1055

Merged
milan-zededa merged 1 commit intolf-edge:masterfrom
shjala:eden.home
Mar 13, 2025
Merged

Get eden home path from environment variable#1055
milan-zededa merged 1 commit intolf-edge:masterfrom
shjala:eden.home

Conversation

@shjala
Copy link
Copy Markdown
Member

@shjala shjala commented Mar 12, 2025

Read from the environment variable EDEN_HOME. If the environment variable is not set, then use the default path.

@shjala shjala requested a review from uncleDecart as a code owner March 12, 2025 12:36
@shjala shjala requested review from Copilot and removed request for uncleDecart March 12, 2025 12:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@shjala shjala requested review from Copilot and milan-zededa March 12, 2025 12:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to prioritize the EDEN_HOME environment variable when determining the Eden home path, falling back to a default path if not set.

  • Reads the EDEN_HOME environment variable.
  • Returns the EDEN_HOME value if set, otherwise returns a default constructed from the user's home directory.
Comments suppressed due to low confidence (1)

pkg/utils/config.go:153

  • [nitpick] Consider trimming whitespace from 'edenHome' (e.g., using strings.TrimSpace) to avoid potential issues when the environment variable contains accidental leading or trailing spaces.
edenHome := os.Getenv("EDEN_HOME")

@shjala shjala requested a review from Copilot March 12, 2025 12:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for setting the Eden home directory via the EDEN_HOME environment variable, falling back to a default path if the variable is not set.

  • Added environment variable reading in pkg/utils/config.go
  • Returns the EDEN_HOME value directly if set, otherwise constructs the default home directory

Read from the environment variable EDEN_HOME. If the environment variable
is not set, then use the default path.

Signed-off-by: Shahriyar Jalayeri <shahriyar@zededa.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for specifying the Eden home directory via the EDEN_HOME environment variable. If EDEN_HOME is set (after trimming whitespace), that value is used; otherwise, the default path based on the user's home directory is returned.

  • Read EDEN_HOME from the environment.
  • Use a default path when EDEN_HOME is not provided.

@milan-zededa
Copy link
Copy Markdown
Contributor

Merging, failures are not related to this change.

@milan-zededa milan-zededa merged commit e99ecb5 into lf-edge:master Mar 13, 2025
14 of 19 checks passed
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.

3 participants