Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set env variables to execute commands #49

Merged
merged 1 commit into from
Feb 27, 2025
Merged

Conversation

lstocchi
Copy link
Collaborator

@lstocchi lstocchi commented Feb 6, 2025

before executing any action we need to update the environment variables PODMAN_CONNECTIONS_CONF, PODMAN_DATA_DIR and PODMAN_RUNTIME_DIR to define a specific location where to store macadam data. This way we prevent to write macadam stuff within podman-related folders

This works with cfergeau/podman#1

@lstocchi
Copy link
Collaborator Author

lstocchi commented Feb 6, 2025

Everything seems to work fine except the remove action which does not remove the connection from the macadam-connections.json file and so we are unable to recreate it later as it still detect an existing instance

@lstocchi
Copy link
Collaborator Author

lstocchi commented Feb 6, 2025

Everything seems to work fine except the remove action which does not remove the connection from the macadam-connections.json file and so we are unable to recreate it later as it still detect an existing instance

I think i had some dirty env bc now it works perfectly


connsFile := filepath.Join(filepath.Dir(path), connectionsFile)
// set the path used for storing connection of macadam vms
err = os.Setenv("PODMAN_CONNECTIONS_CONF", connsFile)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we'll be able to remove the use of connections files in macadam, I don't think we need them (just a comment for the future, nothing actionable right now)

// userConfigPath returns the path to the users local config that is
// not shared with other users. It uses $XDG_CONFIG_HOME/containers...
// if set or $HOME/.config/containers... if not.
func UserConfigPath() (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated. I copy/pasted this func from the podman common lib. I removed everything in favor of homedir. I agree the connections file would not be very useful in our case so it is just a temporary way to set it

Copy link
Collaborator

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

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

/lgtm
It's missing a go module update, but this can only be done after the cfergeau/podman PR is merged.

@lstocchi
Copy link
Collaborator Author

/lgtm It's missing a go module update, but this can only be done after the cfergeau/podman PR is merged.

updated with the missing go modules

@lstocchi lstocchi requested a review from cfergeau February 24, 2025 13:53
before executing any action we need to update the environment variables
PODMAN_CONNECTIONS_CONF, PODMAN_DATA_DIR and PODMAN_RUNTIME_DIR to
define a specific location where to store macadam data. This way we
prevent to write macadam stuff within podman-related folders

Signed-off-by: lstocchi <[email protected]>
@lstocchi
Copy link
Collaborator Author

@cfergeau rebased so the lint succeed

@cfergeau cfergeau merged commit dc5774b into crc-org:main Feb 27, 2025
12 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.

2 participants