Skip to content

change drop-ins to drop_ins #475

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

koflanx
Copy link

@koflanx koflanx commented Jun 30, 2025

What this PR does / why we need it:
CoreOS Cloud Init is not reading the drop-ins sections in cloud-config.yml since Flatcar 3975.2.0.

Which issue(s) this PR fixes:
Fixes flatcar/Flatcar#1567

What type of PR is this?
/kind bug

Does this PR introduce a user-facing change? Then add your Release Note here:

NONE

Documentation:

NONE

@kubermatic-bot kubermatic-bot added release-note-none Denotes a PR that doesn't merit a release note. docs/none Denotes a PR that doesn't need documentation (changes). kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels Jun 30, 2025
@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign julioc-p for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added dco-signoff: no Denotes that at least one commit in the pull request doesn't have a valid DCO signoff message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 30, 2025
@kubermatic-bot
Copy link
Contributor

Hi @koflanx. Thanks for your PR.

I'm waiting for a kubermatic member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubermatic-bot kubermatic-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 30, 2025
@kubermatic-bot kubermatic-bot added dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. and removed dco-signoff: no Denotes that at least one commit in the pull request doesn't have a valid DCO signoff message. labels Jun 30, 2025
@@ -258,7 +258,7 @@ coreos:
{{ $unit.Content | indent 6 }}
{{- end }}
{{ if $unit.Content }}

Choose a reason for hiding this comment

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

@koflanx Isn't this a bug as well?
Should be {{ if $unit.DropIns }} instead of {{ if $unit.Content }} imo.

Copy link

Choose a reason for hiding this comment

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

@kron4eg Maybe you can give your 2 cents about this?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, it's it definitely.

diff --git pkg/generator/generator.go pkg/generator/generator.go
index b158bcc..ac966fd 100644
--- pkg/generator/generator.go
+++ pkg/generator/generator.go
@@ -253,13 +253,13 @@ coreos:
 	command: start
 	{{- end }}
     mask: {{or $unit.Mask false}}
-{{ if $unit.Content }}
+{{ with $unit.Content }}
     content: |
-{{ $unit.Content | indent 6 }}
+{{ . | indent 6 }}
 {{- end }}
-{{ if $unit.Content }}
+{{ with $unit.DropIns }}
     drop_ins:
-{{- range $_, $dropIn := $unit.DropIns }}
+{{- range $_, $dropIn := . }}
       - name: "{{ $dropIn.Name }}"
         content: |
 {{ $dropIn.Content | indent 10 }}

This is how it should look like (using go's {{ with }} template operator to avoid such bugs in the future).

@adberger
Copy link

Is there anything missing for this MR to be merged?

@@ -258,7 +258,7 @@ coreos:
{{ $unit.Content | indent 6 }}
{{- end }}
{{ if $unit.Content }}
drop-ins:
drop_ins:
Copy link
Member

Choose a reason for hiding this comment

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

Let's make a copy, for have both drop-ins: and drop_ins:. For backward compatibility 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud Init not reading drop-ins sections since Flatcar 3975.2.0.
4 participants