Skip to main content

Driver

Struct Driver 

Source
pub struct Driver;

Implementations§

Source§

impl Driver

Source

pub fn init(args: DriverArgs)

Initializes the Strategy with user provided credentials.

If you want to take advantage of a user’s credentials, you will want to run init before trying to use any of the strategies.

§Panics

Will panic if it is unable to initialize drivers.

Source

pub fn get_build_id() -> Uuid

Gets the current build’s UUID

Source

pub fn get_build_driver() -> BuildDriverType

Source

pub fn get_signing_driver() -> SigningDriverType

Source

pub fn get_run_driver() -> RunDriverType

Source

pub fn get_ci_driver() -> CiDriverType

Source

pub fn get_boot_driver() -> BootDriverType

Source

pub fn get_os_version<'f1>() -> DriverGetOsVersionBuilder<'f1>

Retrieve the os_version for an image.

This gets cached for faster resolution if it’s required in another part of the program.

§Errors

Will error if the image doesn’t have OS version info or we are unable to lock a mutex.

§Panics

Panics if the mutex fails to lock.

Trait Implementations§

Source§

impl BootDriver for Driver

Source§

fn status() -> Result<Box<dyn BootStatus>>

Get the status of the current booted image. Read more
Source§

fn switch(opts: SwitchOpts<'_>) -> Result<()>

Switch to a new image. Read more
Source§

fn upgrade(opts: SwitchOpts<'_>) -> Result<()>

Upgrade an image. Read more
Source§

impl BuildChunkedOciDriver for Driver

Source§

fn manifest_create_with_runner( runner: &RpmOstreeRunner, opts: ManifestCreateOpts<'_>, ) -> Result<()>

Create a manifest containing all the built images. Runs within the same context as rpm-ostree. Read more
Source§

fn manifest_push_with_runner( runner: &RpmOstreeRunner, opts: ManifestPushOpts<'_>, ) -> Result<()>

Pushes a manifest containing all the built images. Runs within the same context as rpm-ostree. Read more
Source§

fn pull_with_runner( runner: &RpmOstreeRunner, opts: PullOpts<'_>, ) -> Result<ContainerId>

Pull an image from a remote registry. Runs within the same context as rpm-ostree. Read more
Source§

fn remove_image_with_runner( runner: &RpmOstreeRunner, image_ref: &str, ) -> Result<()>

Removes an image from local storage. Runs within the same context as rpm-ostree. Read more
Source§

fn build_chunked_oci( runner: &RpmOstreeRunner, unchunked_image: &ImageRef<'_>, final_image: &ImageRef<'_>, opts: BuildChunkedOciOpts, ) -> Result<()>

Runs build-chunked-oci on an image. Read more
Source§

fn build_rechunk_tag_push( opts: BuildRechunkTagPushOpts<'_>, ) -> Result<Vec<String>>

Runs the logic for building, rechunking, tagging, and pushing an image. Read more
Source§

impl BuildDriver for Driver

Source§

fn build(opts: BuildOpts<'_>) -> Result<()>

Runs the build logic for the driver. Read more
Source§

fn tag(opts: TagOpts<'_>) -> Result<()>

Runs the tag logic for the driver. Read more
Source§

fn untag(opts: UntagOpts<'_>) -> Result<()>

Runs the untag logic for the driver. Read more
Source§

fn push(opts: PushOpts<'_>) -> Result<()>

Runs the push logic for the driver Read more
Source§

fn pull(opts: PullOpts<'_>) -> Result<ContainerId>

Runs the pull logic for the driver Read more
Source§

fn login(server: &str) -> Result<()>

Runs the login logic for the driver. Read more
Source§

fn prune(opts: PruneOpts) -> Result<()>

Runs prune commands for the driver. Read more
Source§

fn manifest_create(opts: ManifestCreateOpts<'_>) -> Result<()>

Create a manifest containing all the built images. Read more
Source§

fn manifest_push(opts: ManifestPushOpts<'_>) -> Result<()>

Pushes a manifest containing all the built images. Read more
Source§

fn build_tag_push(opts: BuildTagPushOpts<'_>) -> Result<Vec<String>>

Runs the logic for building, tagging, and pushing an image. Read more
Source§

impl CiDriver for Driver

Source§

fn on_default_branch() -> bool

Determines if we’re on the main branch of a repository.
Source§

fn keyless_cert_identity() -> Result<String>

Retrieve the certificate identity for keyless signing. Read more
Source§

fn oidc_provider() -> Result<String>

Retrieve the OIDC Provider for keyless signing. Read more
Source§

fn generate_tags(opts: GenerateTagsOpts<'_>) -> Result<Vec<Tag>>

Generate a list of tags based on the OS version. Read more
Source§

fn get_repo_url() -> Result<String>

Get the URL for the repository. Read more
Source§

fn get_registry() -> Result<String>

Get the registry ref for the image. Read more
Source§

fn generate_image_name<'a, O>(opts: O) -> Result<Reference>

Generates the image name based on CI. Read more
Source§

fn default_ci_file_path() -> PathBuf

Source§

impl ImageStorageDriver for Driver

Source§

fn remove_image(opts: RemoveImageOpts<'_>) -> Result<()>

Removes an image Read more
Source§

fn list_images(privileged: bool) -> Result<Vec<Reference>>

List all images in the local image registry. Read more
Source§

impl InspectDriver for Driver

Source§

fn get_metadata(opts: GetMetadataOpts<'_>) -> Result<ImageMetadata>

Gets the metadata on an image tag. Read more
Source§

impl OciCopy for Driver

Source§

fn copy_oci(&self, opts: CopyOciOpts<'_>) -> Result<()>

Copy an OCI image. Read more
Source§

impl RechunkDriver for Driver

Source§

fn rechunk(opts: RechunkOpts<'_>) -> Result<Vec<String>>

Perform a rechunk build of a recipe. Read more
Source§

const RECHUNK_IMAGE: &str = "ghcr.io/hhd-dev/rechunk:v1.0.1"

Source§

fn prune_image( mount: &MountId, container: &ContainerId, image: &Reference, opts: RechunkOpts<'_>, ) -> Result<(), Error>

Step 1 of the rechunk process that prunes excess files. Read more
Source§

fn create_ostree_commit( mount: &MountId, ostree_cache_id: &str, container: &ContainerId, image: &Reference, opts: RechunkOpts<'_>, ) -> Result<()>

Step 2 of the rechunk process that creates the ostree commit. Read more
Source§

fn rechunk_image( ostree_cache_id: &str, temp_dir_str: &str, current_dir: &str, opts: RechunkOpts<'_>, ) -> Result<()>

Step 3 of the rechunk process that generates the final chunked image. Read more
Source§

impl RunDriver for Driver

Source§

fn run(opts: RunOpts<'_>) -> Result<ExitStatus>

Run a container to perform an action. Read more
Source§

fn run_output(opts: RunOpts<'_>) -> Result<Output>

Run a container to perform an action and capturing output. Read more
Source§

fn run_detached(opts: RunOpts<'_>) -> Result<DetachedContainer>

Run a container to perform an action in the background. The container will be stopped when the returned DetachedContainer value is dropped. Read more
Source§

fn create_container(opts: CreateContainerOpts<'_>) -> Result<ContainerId>

Creates container Read more
Source§

fn remove_container(opts: RemoveContainerOpts<'_>) -> Result<()>

Removes a container Read more
Source§

impl SigningDriver for Driver

Source§

fn generate_key_pair(opts: GenerateKeyPairOpts<'_>) -> Result<()>

Generate a new private/public key pair. Read more
Source§

fn check_signing_files(opts: CheckKeyPairOpts<'_>) -> Result<()>

Checks the signing key files to ensure they match. Read more
Source§

fn sign(opts: SignOpts<'_>) -> Result<()>

Signs the image digest. Read more
Source§

fn verify(opts: VerifyOpts<'_>) -> Result<()>

Verifies the image. Read more
Source§

fn signing_login(server: &str) -> Result<()>

Runs the login logic for the signing driver. Read more
Source§

fn sign_and_verify(opts: SignVerifyOpts<'_>) -> Result<()>

Sign an image given the image name and tag. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> UnsafeAny for T
where T: Any,