debian-forge-composer/internal/osbuild2/ostree_input.go
Christian Kellner f8c8f28ac8 osbuild2: new org.osbuild.ostree.passwd stage
Add support for the `org.osbuild.ostree.passwd` and with it also
support for the `org.osbuild.ostree.checkout` input.
This stage can be used to pre-load the user and groups database
from an existing commit to ensure that uids/gids are stable.
2021-08-27 12:56:54 +02:00

42 lines
1 KiB
Go

package osbuild2
// Inputs for ostree commits
type OSTreeInput struct {
inputCommon
}
func (OSTreeInput) isInput() {}
func NewOSTreeInput() *OSTreeInput {
input := new(OSTreeInput)
input.Type = "org.osbuild.ostree"
input.Origin = "org.osbuild.source"
return input
}
// Inputs of type org.osbuild.ostree.checkout
type OSTreeCheckoutInput struct {
inputCommon
References OSTreeCheckoutReferences `json:"references"`
}
func (OSTreeCheckoutInput) isStageInput() {}
type OSTreeCheckoutReferences []string
func (OSTreeCheckoutReferences) isReferences() {}
// NewOSTreeCommitsInput creates a new OSTreeCommitsInputs
// where `origin` is either "org.osbuild.source" or "org.osbuild.pipeline
// `name` is the id of the commit, i.e. its digest or the pipeline name that
// produced it)
func NewOSTreeCheckoutInput(origin, name string) *OSTreeCheckoutInput {
input := new(OSTreeCheckoutInput)
input.Type = "org.osbuild.ostree.checkout"
input.Origin = origin
inputRefs := make([]string, 1)
inputRefs[0] = name
input.References = inputRefs
return input
}