Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/container-ignition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Build ignition container images for f43 and c9s

name: Build Ignition Container Images

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

# avoid races when pushing containers built from main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-container:
name: Build container image (${{ matrix.base-name }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- base-name: fedora
base-image: fedora:latest
image-suffix: -f43
- base-name: centos-stream-9
base-image: quay.io/centos/centos:stream9
image-suffix: -c9s
steps:
- name: Check out repository
uses: actions/checkout@v5
with:
# fetch tags too
# https://github.com/actions/checkout/issues/290
fetch-depth: 0
- name: Fix actions/checkout synthetic tag
run: git fetch --tags --force
- name: Generate tags
id: tags
run: |
DATE=$(date +%Y%m%d)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
echo "tags=latest ${DATE}-${SHORT_SHA}" >> $GITHUB_OUTPUT
- name: Build and push container
uses: coreos/actions-lib/build-container@main
with:
credentials: ${{ secrets.QUAY_AUTH }}
file: Containerfile.ignition
push: ${{ github.event_name == 'push' && github.repository_owner == 'trusted-execution-clusters' && format('quay.io/trusted-execution-clusters/ignition{0}', matrix.image-suffix) || '' }}
arches: amd64
build-args: BASE=${{ matrix.base-image }}
tags: ${{ steps.tags.outputs.tags }}
13 changes: 13 additions & 0 deletions Containerfile.ignition
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG BASE=fedora:f43
FROM $BASE AS builder

RUN dnf install -y golang git-core libblkid-devel make

WORKDIR /usr/src/ignition
COPY . .

RUN ./build

FROM scratch
COPY --from=builder /usr/src/ignition/bin/amd64/ignition /usr/bin/ignition

6 changes: 5 additions & 1 deletion config/v3_5/translate/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func Translate(old old_types.Config) (ret types.Config) {
tr := translate.NewTranslator()
tr.AddCustomTranslator(translateIgnition)
tr.AddCustomTranslator(translateLuks)
tr.Translate(&old, &ret)
tr.Translate(&old.Ignition, &ret.Ignition)
tr.Translate(&old.KernelArguments, &ret.KernelArguments)
tr.Translate(&old.Passwd, &ret.Passwd)
tr.Translate(&old.Storage, &ret.Storage)
tr.Translate(&old.Systemd, &ret.Systemd)
return
}
14 changes: 14 additions & 0 deletions config/v3_5/types/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Config struct {
Passwd Passwd `json:"passwd,omitempty"`
Storage Storage `json:"storage,omitempty"`
Systemd Systemd `json:"systemd,omitempty"`
Attestation Attestation `json:"attestation,omitempty"`
}

type Device string
Expand Down Expand Up @@ -262,3 +263,16 @@ type Unit struct {
type Verification struct {
Hash *string `json:"hash,omitempty"`
}

type Attestation struct {
AttestationKey AttestationKey `json:"attestation_key,omitempty"`
}

type AttestationKey struct {
Registration Registration `json:"registration,omitempty"`
}

type Registration struct {
Url *string `json:"url,omitempty"`
Certificate *string `json:"certificat,omitempty"`
}