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

File overwrite fails with ignition format #410

Closed
hardys opened this issue Aug 21, 2024 · 1 comment · Fixed by #411
Closed

File overwrite fails with ignition format #410

hardys opened this issue Aug 21, 2024 · 1 comment · Fixed by #411
Assignees
Labels
kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@hardys
Copy link
Contributor

hardys commented Aug 21, 2024

What happened:

During deployment it's possible to define additional files with a configuration like the following, which when using cloud-init results in default behavior to overwrite any existing files

---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha1
kind: RKE2ConfigTemplate
metadata:
  name: sample-cluster-workers
  namespace: default
spec:
  template:
    spec:
      files:
        - path: "/etc/motd"
          owner: "root:root"
          permissions: "0640"
          content: |
            hello 123

The behavior with format: ignition however is different and any attempt to overwrite an existing file will fail during the OS firstboot:

[   17.691712] worker-0 ignition[1180]: Ignition failed: failed to create files: failed to create files: error creating /sysroot/etc/motd: error creating file "/sysroot/etc/motd": A file exists there already and overwrite is false

What did you expect to happen:
The behavior between cloud-init and ignition should be consistent from the perspective of the user of the RKE2 provider API, even if the default behavior of the underlying tool may be different.

I think we can likely adapt the configuration during the translation from cloud-init to butane/ignition so that we set the overwrite flag to true.

How to reproduce it:
Deploy with a similar configuration described above and format: ignition

Environment:
I reproduced using Leap Micro 6.0 with CAPM3.

@hardys hardys added kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 21, 2024
@hardys
Copy link
Contributor Author

hardys commented Aug 21, 2024

I'll work on a fix for this, please assign to me thanks!

@furkatgofurov7 furkatgofurov7 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants