Upgrading Configs 升级配置

Occasionally, there are changes made to Ignition’s configuration that break backward compatibility. While this is not a concern for running machines (since Ignition only runs one time during first boot), it is a concern for those who maintain configuration files. This document serves to detail each of the breaking changes and tries to provide some reasoning for the change. This does not cover all of the changes to the spec - just those that need to be considered when migrating from one version to the next.
偶尔,Ignition 的配置会发生变化,破坏向后兼容性。虽然这对于运行中的机器不是问题(因为 Ignition 只在第一次启动时运行一次),但对于那些维护配置文件的人来说是一个问题。本文档旨在详细说明每个破坏性变化,并尝试为更改提供一些理由。这并不涵盖规范的所有更改 - 只涵盖了在从一个版本迁移到下一个版本时需要考虑的更改。

  1. From Version 3.3.0 to 3.4.0
    从版本 3.3.0 到 3.4.0
    1. Offline Tang provisioning
      离线 Tang 配置
    2. LUKS discard LUKS 丢弃
    3. LUKS open options LUKS 打开选项
    4. Special mode bits supported
      支持特殊模式位
    5. AWS S3 access point ARN support
      AWS S3 访问点 ARN 支持
  2. From Version 3.2.0 to 3.3.0
    从版本 3.2.0 到 3.3.0
    1. Kernel arguments 内核参数
    2. New filesystem format none
      新文件系统格式 none
  3. From Version 3.1.0 to 3.2.0
    从版本 3.1.0 到 3.2.0
    1. Partition resizing 分区调整大小
    2. LUKS encrypted storage LUKS 加密存储
    3. User/group deletion 用户/组删除
    4. Google Cloud Storage URL support
      Google Cloud 存储 URL 支持
  4. From Version 3.0.0 to 3.1.0
    从版本 3.0.0 到 3.1.0
    1. SHA-256 resource verification
      SHA-256 资源验证
    2. Compression support for certificate authorities and merged configs
      证书颁发机构和合并配置的压缩支持
    3. Filesystem mount options
      文件系统挂载选项
    4. Custom HTTP headers 自定义 HTTP 标头
    5. HTTP proxies HTTP 代理
  5. From Version 2.3.0 to 3.0.0
    从版本 2.3.0 到 3.0.0
    1. All deprecated fields are dropped
      所有弃用的字段都被删除
    2. Filesystems now specify path
      文件系统现在指定路径
    3. Files now default to overwrite=false
      文件现在默认为 overwrite=false
    4. File permissions now default to 0644
      文件权限现在默认为 0644
    5. Directories now create leading directories with mode 0755 and uid/gid 0
      目录现在使用模式 0755 和 uid/gid 0 创建前导目录
    6. Duplicate entries are no longer allowed
      不再允许重复条目
    7. Configuration appending is replaced by configuration merging
      配置追加已被配置合并取代
    8. Files now have a list of sources to append
      文件现在有一个要追加的源列表
    9. Networkd section is removed
      网络部分已移除
  6. From 2.x.0 to 2.3.0
    从 2.x.0 到 2.3.0

From Version 3.3.0 to 3.4.0
从版本 3.3.0 到 3.4.0

There are not any breaking changes between versions 3.3.0 and 3.4.0 of the configuration specification. Any valid 3.3.0 configuration can be updated to a 3.4.0 configuration by simply changing the version string in the config.
在配置规范的 3.3.0 版本和 3.4.0 版本之间没有任何破坏性变化。 任何有效的 3.3.0 配置都可以通过简单地更改配置中的版本字符串来更新为 3.4.0 配置。

The following is a list of notable new features, deprecations, and changes.
以下是一些值得注意的新功能、弃用功能和更改的列表。

Offline Tang provisioning
离线 Tang 配置

The tang section gained a new advertisement field. If specified, Ignition will use it to provision the Tang server binding rather than fetching the advertisement from the server at runtime. This allows the server to be unavailable at provisioning time. The advertisement can be obtained from the server with curl http://tang.example.com/adv.
" tang 部分获得了一个新的 advertisement 字段。如果指定,Ignition 将使用它来配置 Tang 服务器绑定,而不是在运行时从服务器获取广告。这允许服务器在配置时不可用。可以使用 curl http://tang.example.com/adv 从服务器获取广告。

{
  "ignition": { "version": "3.4.0" },
  "storage": {
    "luks": [{
      "name": "luks-tang",
      "device": "/dev/sdb",
      "clevis": {
        "tang": [{
          "url": "https://tang.example.com",
          "thumbprint": "REPLACE-THIS-WITH-YOUR-TANG-THUMBPRINT",
          "advertisement": "{\"payload\": \"...\", \"protected\": \"...\", \"signature\": \"...\"}"
        }]
      }
    }]
  }
}

LUKS discard LUKS 丢弃

The luks section gained a new discard field. If specified and true, the LUKS volume will issue discard commands to the underlying block device when blocks are freed. This improves performance and device longevity on SSDs and space utilization on thinly provisioned SAN devices, but leaks information about which disk blocks contain data.
luks 部分获得了一个新的 discard 字段。如果指定为 true,则 LUKS 卷在释放块时将向底层块设备发出丢弃命令。这可以提高 SSD 的性能和设备寿命,以及在薄利用 SAN 设备上的空间利用率,但会泄露包含数据的磁盘块的信息。

{
  "ignition": { "version": "3.4.0" },
  "storage": {
    "luks": [{
      "name": "luks-tpm",
      "device": "/dev/sdb",
      "discard": true,
      "clevis": {
        "tpm2": true
      }
    }]
  }
}

LUKS open options LUKS 打开选项

The luks section gained a new openOptions field. It is a list of options Ignition should pass to cryptsetup luksOpen when unlocking the volume. Ignition also passes --persistent, so any options that support persistence will be saved to the volume and automatically used for future unlocks. Any options that do not support persistence will only be applied to Ignition’s initial unlock of the volume.
" luks "部分新增了一个" openOptions "字段。这是 Ignition 在解锁卷时应传递给" cryptsetup luksOpen "的选项列表。Ignition 还传递了" --persistent ",因此任何支持持久性的选项都将保存到卷中,并自动用于未来的解锁。不支持持久性的选项只会应用于 Ignition 对卷的初始解锁。

{
  "ignition": { "version": "3.4.0" },
  "storage": {
    "luks": [{
      "name": "luks-tpm",
      "device": "/dev/sdb",
      "openOptions": ["--perf-no_read_workqueue", "--perf-no_write_workqueue"],
      "clevis": {
        "tpm2": true
      }
    }]
  }
}

Special mode bits supported
支持特殊模式位

The mode field of the files and directories sections now respects the setuid, setgid, and sticky bits. Previous spec versions ignore these bits, but will generate a warning on Ignition ≥ 2.14.0.
mode 字段现在尊重 setuid、setgid 和粘滞位。之前的规范版本忽略这些位,但在 Ignition ≥ 2.14.0 上会生成警告。

{
  "ignition": {
    "version": "3.4.0"
  },
  "storage": {
    "files": [{
      "path": "/usr/local/bin/setuid",
      "contents": {
        "source": "https://rootkit.example.com/setuid"
      },
      "mode": 2541
    }],
    "directories": [{
      "path": "/var/local/tmp",
      "mode": 1023
    }]
  }
}

AWS S3 access point ARN support
AWS S3 访问点 ARN 支持

The sections which allow fetching a remote URL now accept AWS S3 access point ARNs (arn:aws:s3:<region>:<account>:accesspoint/<accesspoint>/object/<path>) in the source field.
允许获取远程 URL 的部分现在在 source 字段中接受 AWS S3 访问点 ARN( arn:aws:s3:<region>:<account>:accesspoint/<accesspoint>/object/<path> )。

{
  "ignition": { "version": "3.4.0" },
  "storage": {
    "files": [{
      "path": "/etc/example",
      "mode": 420,
      "contents": {
        "source": "arn:aws:s3:us-west-1:123456789012:accesspoint/test/object/some/path"
      }
    }]
  }
}

From Version 3.2.0 to 3.3.0
从版本 3.2.0 到 3.3.0

There are not any breaking changes between versions 3.2.0 and 3.3.0 of the configuration specification. Any valid 3.2.0 configuration can be updated to a 3.3.0 configuration by simply changing the version string in the config.
在配置规范的 3.2.0 版本和 3.3.0 版本之间没有任何破坏性变化。 任何有效的 3.2.0 配置都可以通过简单地更改配置中的版本字符串来更新为 3.3.0 配置。

The following is a list of notable new features, deprecations, and changes.
以下是一些值得注意的新功能、弃用功能和更改的列表。

Kernel arguments 内核参数

The config gained a new top-level kernelArguments section. It allows specifying arguments that should be included or excluded from the kernel command line.
配置增加了一个新的顶层 kernelArguments 部分。它允许指定应包含或排除在内核命令行中的参数。

{
  "ignition": { "version": "3.3.0" },
  "kernelArguments": {
    "shouldExist": [
      "foobar",
      "baz boo"
    ],
    "shouldNotExist": [
      "raboof"
    ]
  }
}

The config above will ensure that the kernel argument foobar is present, and the kernel argument raboof is absent. It will also ensure that the kernel arguments baz boo are present exactly in that order.
上面的配置将确保内核参数 foobar 存在,并且内核参数 raboof 不存在。它还将确保内核参数 baz boo 以确切的顺序存在。

This feature requires integration with the distribution where Ignition is used. See the [distributor notes][distributor-notes] for details.
此功能需要与使用 Ignition 的分发进行集成。有关详细信息,请参阅[分发商说明][distributor-notes]。

New filesystem format none
新文件系统格式 none

The format field of the filesystems section can now be set to none. This setting erases an existing filesystem signature without creating a new filesystem (if wipeFilesystem is true), or fails if there is any existing filesystem (if wipeFilesystem is false).
filesystems 部分的 format 字段现在可以设置为 none 。此设置会擦除现有文件系统签名,而不会创建新文件系统(如果 wipeFilesystem 为真),或者如果存在任何现有文件系统(如果 wipeFilesystem 为假)则失败。

{
  "ignition": { "version": "3.3.0" },
  "storage": {
    "filesystems": [{
      "device": "/dev/vdb1",
      "wipeFilesystem": true,
      "format": "none"
    }]
  }
}

Refer to the filesystem reuse semantics for more information.
有关更多信息,请参考文件系统重用语义。

From Version 3.1.0 to 3.2.0
从版本 3.1.0 到 3.2.0

There are not any breaking changes between versions 3.1.0 and 3.2.0 of the configuration specification. Any valid 3.1.0 configuration can be updated to a 3.2.0 configuration by simply changing the version string in the config.
在配置规范的 3.1.0 版本和 3.2.0 版本之间没有任何破坏性变化。可以通过简单地在配置中更改版本字符串,将任何有效的 3.1.0 配置更新为 3.2.0 配置。

The following is a list of notable new features, deprecations, and changes.
以下是一些值得注意的新功能、弃用功能和更改的列表。

Partition resizing 分区调整大小

The partition section gained a new resize field. When true, Ignition will resize an existing partition if it matches the config in all respects except the partition size.
partition 部分新增了一个新的 resize 字段。当为 true 时,Ignition 将调整现有分区的大小,如果它在所有方面与配置匹配,除了分区大小。

{
  "ignition": { "version": "3.2.0" },
  "storage": {
    "disks": [{
      "device": "/dev/sda",
      "partitions": [{
        "label": "root",
        "sizeMiB": 16384,
        "resize": true
      }]
    }]
  }
}

LUKS encrypted storage LUKS 加密存储

Ignition now supports creating LUKS2 encrypted storage volumes. Volumes can be configured to allow unlocking with any combination of a TPM2 device via Clevis, network Tang servers via Clevis, and static key files. Alternatively, the Clevis configuration can be manually specified with a custom PIN and CFG. If a key file is not specified for a device, an ephemeral one will be created.
点火现在支持创建 LUKS2 加密存储卷。可以配置卷以允许使用 TPM2 设备通过 Clevis、通过 Clevis 的网络 Tang 服务器以及静态密钥文件进行解锁。或者,可以使用自定义 PIN 和 CFG 手动指定 Clevis 配置。如果未为设备指定密钥文件,则将创建一个临时密钥文件。

{
  "ignition": {"version": "3.2.0"},
  "storage": {
    "luks": [{
      "name": "static-key-example",
      "device": "/dev/sdb",
      "keyFile": {
        "source": "data:,REPLACE-THIS-WITH-YOUR-KEY-MATERIAL"
      }
    },{
      "name": "tpm-example",
      "device": "/dev/sdc",
      "clevis": {
        "tpm2": true
      }
    },{
      "name": "tang-example",
      "device": "/dev/sdd",
      "clevis": {
        "tang": [{
          "url": "https://tang.example.com",
          "thumbprint": "REPLACE-THIS-WITH-YOUR-TANG-THUMBPRINT"
        }]
      }
    }],
    "filesystems": [{
      "path": "/var/lib/static_key_example",
      "device": "/dev/disk/by-id/dm-name-static-key-example",
      "format": "ext4",
      "label": "STATIC-EXAMPLE"
    },{
      "path": "/var/lib/tpm_example",
      "device": "/dev/disk/by-id/dm-name-tpm-example",
      "format": "ext4",
      "label": "TPM-EXAMPLE"
    },{
      "path": "/var/lib/tang_example",
      "device": "/dev/disk/by-id/dm-name-tang-example",
      "format": "ext4",
      "label": "TANG-EXAMPLE"
    }]
  },
  "systemd": {
    "units": [{
      "name": "var-lib-static_key_example.mount",
      "enabled": true,
      "contents": "[Mount]\nWhat=/dev/disk/by-label/STATIC-EXAMPLE\nWhere=/var/lib/static_key_example\nType=ext4\n\n[Install]\nWantedBy=local-fs.target"
    },{
      "name": "var-lib-tpm_example.mount",
      "enabled": true,
      "contents": "[Mount]\nWhat=/dev/disk/by-label/TPM-EXAMPLE\nWhere=/var/lib/tpm_example\nType=ext4\n\n[Install]\nWantedBy=local-fs.target"
    },{
      "name": "var-lib-tang_example.mount",
      "enabled": true,
      "contents": "[Mount]\nWhat=/dev/disk/by-label/TANG-EXAMPLE\nWhere=/var/lib/tang_example\nType=ext4\n\n[Install]\nWantedBy=remote-fs.target"
    }]
  }
}

User/group deletion 用户/组删除

The passwd users and groups sections have a new field shouldExist. If specified and false, Ignition will delete the specified user or group if it exists.
passwd usersgroups 部分新增了一个新字段 shouldExist 。如果指定为 false,则 Ignition 将删除指定的用户或组(如果存在)。

{
  "ignition": { "version": "3.2.0" },
  "passwd": {
    "users": [{
      "name": "core",
      "shouldExist": false
    }],
    "groups": [{
      "name": "core",
      "shouldExist": false
    }]
  }
}

Google Cloud Storage URL support
Google Cloud 存储 URL 支持

The sections which allow fetching a remote URL now accept Google Cloud Storage (gs://) URLs in the source field.
允许获取远程 URL 的部分现在在 source 字段中接受 Google Cloud 存储( gs:// )URL。

{
  "ignition": { "version": "3.2.0" },
  "storage": {
    "files": [{
      "path": "/etc/example",
      "mode": 420,
      "contents": {
        "source": "gs://bucket/object"
      }
    }]
  }
}

From Version 3.0.0 to 3.1.0
从版本 3.0.0 到 3.1.0

There are not any breaking changes between versions 3.0.0 and 3.1.0 of the configuration specification. Any valid 3.0.0 configuration can be updated to a 3.1.0 configuration by simply changing the version string in the config.
在配置规范的 3.0.0 版本和 3.1.0 版本之间没有任何破坏性变化。 任何有效的 3.0.0 配置都可以通过简单地更改配置中的版本字符串来更新为 3.1.0 配置。

The following is a list of notable new features, deprecations, and changes.
以下是一些值得注意的新功能、弃用功能和更改。

SHA-256 resource verification
SHA-256 资源验证

All verification.hash fields now support the sha256 hash type.
所有 verification.hash 字段现在支持 sha256 哈希类型。

{
  "ignition": { "version": "3.1.0" },
  "storage": {
    "files": [{
      "path": "/etc/hosts",
      "mode": 420,
      "contents": {
        "source": "https://example.com/etc/hosts",
        "verification": {
          "hash": "sha256-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
        }
      }
    }]
  }
}

Compression support for certificate authorities and merged configs
证书颁发机构和合并配置的压缩支持

The config merge and replace sections and the certificateAuthorities section now support gzip-compressed resources via the compression field. gzip compression is supported for all URL schemes except s3.
配置 mergereplace 部分以及 certificateAuthorities 部分现在通过 compression 字段支持 gzip 压缩资源。 gzip 压缩支持所有 URL 方案,除了 s3

{
  "ignition": {
    "version": "3.1.0",
    "config": {
      "merge": [{
        "source": "https://secure.example.com/example.ign.gz",
        "compression": "gzip"
      }]
    },
    "security": {
      "tls": {
        "certificateAuthorities": [{
          "source": "https://example.com/ca.pem.gz",
          "compression": "gzip"
        }]
      }
    }
  }
}

Filesystem mount options
文件系统挂载选项

The filesystems section gained a new mountOptions field. It is a list of options Ignition should pass to mount -o when mounting the specified filesystem. This is useful for mounting btrfs subvolumes. This field only affects mounting performed by Ignition while it is running; it does not affect mounting of the filesystem by the provisioned system.
filesystems 部分新增了一个 mountOptions 字段。这是 Ignition 在挂载指定文件系统时应传递给 mount -o 的选项列表。这对于挂载 btrfs 子卷很有用。此字段仅影响 Ignition 运行时执行的挂载;它不影响系统配置的挂载。

{
  "ignition": { "version": "3.1.0" },
  "storage": {
    "filesystems": [{
      "path": "/var/data",
      "device": "/dev/vdb1",
      "wipeFilesystem": false,
      "format": "btrfs",
      "mountOptions": [
        "subvolid=5"
      ]
    }]
  }
}

Custom HTTP headers 自定义 HTTP 标头

The sections which allow fetching a remote URL — config merge and replace, certificateAuthorities, and file contents and append — gained a new field called httpHeaders. This field can be set to an array of HTTP headers which will be added to an HTTP or HTTPS request. Custom headers can override Ignition’s default headers, and will not be retained across HTTP redirects.
允许获取远程 URL 的部分 — 配置 mergereplacecertificateAuthorities ,以及文件 contentsappend — 增加了一个名为 httpHeaders 的新字段。此字段可以设置为一个 HTTP 标头数组,这些标头将被添加到 HTTP 或 HTTPS 请求中。自定义标头可以覆盖 Ignition 的默认标头,并且不会在 HTTP 重定向中保留。

During config merging, if a child config specifies a header name but not a corresponding value, any header with that name in the parent config will be removed.
在配置合并期间,如果子配置指定了一个标头 name ,但没有相应的 value ,则父配置中具有该 name 的任何标头将被移除。

{
  "ignition": { "version": "3.1.0" },
  "storage": {
    "files": [{
      "path": "/etc/hosts",
      "mode": 420,
      "contents": {
        "source": "https://example.com/etc/hosts",
        "httpHeaders": [
          {
            "name": "Authorization",
            "value": "Basic YWxhZGRpbjpvcGVuc2VzYW1l"
          },
          {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)"
          }
        ]
      }
    }]
  }
}

HTTP proxies HTTP 代理

The ignition section gained a new field called proxy. It allows configuring proxies for HTTP and HTTPS requests, as well as exempting certain hosts from proxying.
" ignition " 部分增加了一个名为 " proxy " 的新字段。它允许配置 HTTP 和 HTTPS 请求的代理,以及豁免某些主机不经过代理。

The httpsProxy field specifies the proxy URL for HTTPS requests. The httpProxy field specifies the proxy URL for HTTP requests, and also for HTTPS requests if httpsProxy is not specified. The noProxy field lists specifiers of hosts that should not be proxied, in any of several formats:
" httpsProxy " 字段指定 HTTPS 请求的代理 URL。 " httpProxy " 字段指定 HTTP 请求的代理 URL,并且如果未指定 " httpsProxy ",也用于 HTTPS 请求。 " noProxy " 字段列出了不应被代理的主机的指定符号,可以使用多种格式。

  • An IP address prefix (1.2.3.4)
    IP 地址前缀 ( 1.2.3.4 )
  • An IP address prefix in CIDR notation (1.2.3.4/8)
    CIDR 表示法中的 IP 地址前缀 ( 1.2.3.4/8 )
  • A domain name, matching the domain and its subdomains (example.com)
    与域名及其子域名匹配的域名 ( example.com )
  • A domain name, matching subdomains only (.example.com)
    一个域名,仅匹配子域 ( .example.com )
  • A wildcard matching all hosts (*)
    通配符匹配所有主机 ( * )

IP addresses and domain names can also include a port number (1.2.3.4:80).
IP 地址和域名也可以包括端口号 ( 1.2.3.4:80 )

{
  "ignition": {
    "version": "3.1.0",
    "proxy": {
      "httpProxy": "https://proxy.example.net/",
      "httpsProxy": "https://secure.proxy.example.net/",
      "noProxy": ["www.example.net"]
    }
  },
  "storage": {
    "files": [{
      "path": "/etc/hosts",
      "mode": 420,
      "contents": {
        "source": "https://example.com/etc/hosts"
      }
    }]
  }
}

From Version 2.3.0 to 3.0.0
从版本 2.3.0 到 3.0.0

The 3.0.0 version of the configuration is fully incompatible with prior versions (i.e. v1, v2.x.0) of the config. The previous versions had bugs that are not representable as a 3.0.0 config, so Ignition does not support older versions.
配置的 3.0.0 版本与之前版本(即 v1、v2.x.0)完全不兼容。之前的版本存在无法表示为 3.0.0 配置的错误,因此 Ignition 不支持旧版本。

All deprecated fields are dropped
所有已弃用的字段都已删除

All deprecated fields have been dropped. Refer to this migration guide in the spec2x branch for how to migrate to their replacements first.
所有已弃用的字段已被删除。首先参考 spec2x 分支中的迁移指南,了解如何迁移到它们的替代项。

Filesystems now specify path
文件系统现在指定路径

Ignition now will mount filesystems at the mountpoint specified by path when running. Filesystems no longer have the name field and files, links, and directories no longer specify the filesystem by name. To create a file on a specified filesystem, ensure that the specified path for that filesystem is below the mountpoint for that filesystem. The following two configs are equivalent and both specify /dev/disk/by-label/VAR should be an XFS filesystem with an empty file named example-file at that filesystem’s root. Note the path change in the files section to account for the filesystem’s mountpoint.
当运行时,Ignition 现在将在指定的挂载点 path 上挂载文件系统。文件系统不再具有 name 字段,文件、链接和目录也不再通过名称指定文件系统。要在指定的文件系统上创建文件,请确保该文件系统的指定 path 位于该文件系统的挂载点以下。以下两个配置是等效的,都指定 /dev/disk/by-label/VAR 应为一个 XFS 文件系统,该文件系统的根目录中有一个名为 example-file 的空文件。请注意文件部分中的路径更改,以考虑文件系统的挂载点。

{
  "ignition": { "version": "2.3.0" },
  "storage": {
    "filesystems": [{
      "name": "var",
      "mount": {
        "device": "/dev/disk/by-label/VAR",
        "format": "xfs",
        "wipeFilesystem": true,
        "label": "var"
      }
    }],
    "files": [{
      "filesystem": "var",
      "path": "/example-file",
      "mode": 420,
      "contents": { "source": "" }
    }]
  }
}
{
  "ignition": { "version": "3.0.0" },
  "storage": {
    "filesystems": [{
      "path": "/var",
      "device": "/dev/disk/by-label/VAR",
      "format": "xfs",
      "wipeFilesystem": true,
      "label": "var"
    }],
    "files": [{
      "path": "/var/example-file",
      "mode": 420,
      "contents": { "source": "" }
    }]
  }
}

Files now default to overwrite=false
文件现在默认为 overwrite=false

Files do not overwrite existing files by default. If no source is specified, Ignition will simply ensure a file exists at that path, creating an empty file if necessary.
默认情况下,文件不会覆盖现有文件。如果未指定源,则 Ignition 将简单地确保该路径处存在文件,必要时创建一个空文件。

File permissions now default to 0644
文件权限现在默认为 0644

If file permissions are unspecified, the permissions default to 0644. If Ignition does not need to create or overwrite the file (i.e. overwrite is false, a file exists at that path, and source is nil), it will not change the mode, owner or group.
如果文件权限未指定,则权限默认为 0644。如果 Ignition 不需要创建或覆盖文件(即 overwrite 为 false,该路径下存在文件,并且 source 为 nil),它将不会更改模式、所有者或组。

Directories now create leading directories with mode 0755 and uid/gid 0
现在,目录会使用模式 0755 和 uid/gid 0 创建前导目录

When a file, directory, or link is specified but the parent directory does not exist, Ignition will create the directory(ies) leading up to it. Previously, when a directory was specified, any leading directories were created with the same mode/uid/gid as the specified directory. Now they are created with mode 0755, uid 0, and gid 0. This ensures the behavior is consistent with files and links.
当指定文件、目录或链接但父目录不存在时,Ignition 将创建通往该文件的目录。以前,当指定目录时,任何前导目录都会以与指定目录相同的模式/uid/gid 创建。现在它们将以模式 0755、uid 0 和 gid 0 创建。这确保了行为与文件和链接一致。

Duplicate entries are no longer allowed
不再允许重复条目

Configs cannot specify contradictory entries. This means a config cannot contain two file entries with the same path, or specify a path as both a link and a file.
配置不能指定矛盾的条目。这意味着配置不能包含两个具有相同 path 的文件条目,也不能将路径同时指定为链接和文件。

Configuration appending is replaced by configuration merging
配置追加已被配置合并所取代

ignition.config.append has been replaced by ignition.config.merge. Instead of appending entries from the child configs, Ignition merges them. Refer to the operator notes for more information.
ignition.config.append 已被 ignition.config.merge 替换。Ignition 现在会合并子配置的条目,而不是追加它们。有关更多信息,请参考操作员说明。

Files now have a list of sources to append
现在文件有一个要追加的源列表

Files now have a list of contents to append instead of multiple entries with append=true. The following two configs are equivalent. Since overwrite is false and contents.source is unspecified, Ignition will first ensure a file exists at the path (creating it if necessary) and then append both contents to it.
现在文件有一个要追加的内容列表,而不是多个带有 append=true 的条目。以下两个配置是等效的。由于 overwrite 为 false, contents.source 未指定,Ignition 将首先确保路径处存在文件(必要时创建),然后将两个内容追加到其中。

{
  "ignition": { "version": "2.3.0" },
  "storage": {
    "files": [{
      "filesystem": "root",
      "path": "/example-file",
      "mode": 420,
      "append": true,
      "contents": { "source": "data:,hello" }
    },
    {
      "filesystem": "root",
      "path": "/example-file",
      "mode": 420,
      "append": true,
      "contents": { "source": "data:,world" }
    }]
  }
}
{
  "ignition": { "version": "3.0.0" },
  "storage": {
    "files": [{
      "path": "/example-file",
      "mode": 420,
      "append": [
        { "source": "data:,hello" },
        { "source": "data:,world" }
      ]
    }]
  }
}

Networkd section is removed
网络部分已移除

The networkd section has been removed. Use the files section instead. Refer to the networkd documentation for more information.
网络部分已被移除。请改用文件部分。有关更多信息,请参考网络文档。

From 2.x.0 to 2.3.0
从 2.x.0 到 2.3.0

Refer to this doc in the spec2x branch of this repository. That doc also describes specification version 2.4.0, a parallel development which shares some enhancements with spec 3.1.0.
请参考此存储库的 spec2x 分支中的文档。该文档还描述了规范版本 2.4.0,这是一个并行开发,与规范 3.1.0 共享一些增强功能。