coreos / coreos/ignition

RFE: systemd units able to specify contents:source:data like files section

Open
#884 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

jira
Dominant language
Go
Stars
974
Forks
296
Avg merge
6d 14h
Merged PRs (30d)
9

Description

Feature Request

With the files section we have:

* **_contents_** (object): options related to the contents of the file.
    * **_compression_** (string): the type of compression used on the contents (null or gzip). Compression cannot be used with S3.
    * **_source_** (string): the URL of the file contents. Supported schemes are `http`, `https`, `tftp`, `s3`, and [`data`][rfc2397].

But with the systemd unit section we only have:

* **_contents_** (string): the contents of the unit.

This means that I can't use a single way to define file contents for files vs systemd units. I end up with doing something like:

#!/bin/bash
SCRIPT_CONTENTS=$(base64 --wrap 0 public-ipv4.sh)
SYSTEMD_UNIT_CONTENTS=$(sed 's|$|\\\\n|g' < issuegen-public-ipv4.service | tr -d '\n')
sed -e "s|SYSTEMD_UNIT_CONTENTS|${SYSTEMD_UNIT_CONTENTS}|" \
    -e "s|SCRIPT_CONTENTS|${SCRIPT_CONTENTS}|" < config.ign.in > config.ign

where in one case I can use base64 and the other I have to replace newlines with \n.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the files section's contents.source handling with the systemd unit section's contents field, starting with the configuration schema and the code that processes both forms. Done means systemd units can accept contents.source with the data scheme in the same way as files, with behavior covered by the repository's relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.