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

Allow cloud-config to Work on Distros with Read-Only /usr Partitions #253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

justdan96
Copy link

This PR is to allow cloud-config to work on distros with read-only /usr partitions, such as Flatcar. It simply changes the hard-coded path from under the /usr tree to under the /var/run tree, which is more portable.

Please note that without this change bootstrapping Flatcar RKE2 nodes in Rancher is not possible.

@rvdh
Copy link

rvdh commented Sep 23, 2024

@jiaqiluo @kinarashah Could this get some attention? :) Running into this issue as well.

@jiaqiluo jiaqiluo requested a review from a team September 24, 2024 17:30
@@ -451,7 +451,8 @@ func updateUserdataFile(driverOpts *rpcdriver.RPCFlags, machineName, hostname, u
// on how hostnames are set in cloud-config (userdata)
func writeCloudConfig(machineName, encodedData, machineOS, hostname string, cf map[interface{}]interface{}, newUserDataFile *os.File) error {
command := "sh"
path := "/usr/local/custom_script/install.sh"
// allow the script to work on distros with read-only /usr partitions
path := "/var/run/install.sh"

Choose a reason for hiding this comment

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

Suggested change
path := "/var/run/install.sh"
path := "/opt/rancher-system-agent/install.sh"

I believe we install the system agent within that directory anyway if /usr is not writable, so I'd rather reuse that if possible.

Copy link
Author

Choose a reason for hiding this comment

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

That path wouldn't exist on the machine initially. /var/run is the most portable path that could be used, since it will definitely exist and will always be writable.

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