Skip to content
Closed
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
17 changes: 16 additions & 1 deletion lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ pub(crate) struct UpgradeOpts {
/// a userspace-only restart.
#[clap(long, conflicts_with = "check")]
pub(crate) apply: bool,

/// Skip TLS and certificate verification.
/// This is very insecure and should only be used in testing environments
#[clap(long)]
pub(crate) insecure_disable_tls_verification: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should always be part of the source spec; unlike podman I'm trying here to be declarative where we can.

This means that once you do a bootc switch --insecure-disable-tls-verification, it is "sticky" and applied automatically on subsequent bootc upgrades.

So we can just drop this hunk I believe.

}

/// Perform an switch operation
Expand All @@ -63,6 +68,11 @@ pub(crate) struct SwitchOpts {
#[clap(long, hide = true)]
pub(crate) no_signature_verification: bool,

/// Skip TLS and certificate verification.
/// This is very insecure and should only be used in testing environments
#[clap(long)]
pub(crate) insecure_disable_tls_verification: bool,

/// This is the inverse of the previous `--target-no-signature-verification` (which is now
/// a no-op).
///
Expand Down Expand Up @@ -103,6 +113,11 @@ pub(crate) struct EditOpts {
/// Don't display progress
#[clap(long)]
pub(crate) quiet: bool,

/// Skip TLS and certificate verification.
/// This is very insecure and should only be used in testing environments
#[clap(long)]
pub(crate) insecure_disable_tls_verification: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one makes sense; edit just lets you edit the spec directly.

}

/// Perform an status operation
Expand Down Expand Up @@ -494,7 +509,7 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
!opts.enforce_container_sigpolicy,
opts.ostree_remote.as_deref(),
);
let target = ostree_container::OstreeImageReference { sigverify, imgref };
let target = ostree_container::OstreeImageReference { sigverify, imgref, opts: opts.insecure_disable_tls_verification };
let target = ImageReference::from(target);

// If we're doing an in-place mutation, we shortcut most of the rest of the work here
Expand Down
1 change: 1 addition & 0 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ async fn initialize_ostree_root_from_self(
None
};
let proxy_cfg = ostree_container::store::ImageProxyConfig {
insecure_skip_tls_verification: src_imageref.insecure_disable_tls_verification,
skopeo_cmd,
..Default::default()
};
Expand Down
3 changes: 3 additions & 0 deletions lib/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ pub struct ImageReference {
/// Signature verification type
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<ImageSignature>,
/// Skip TLS and certificate verification; this is very insecure and
/// should only be used in testing environments.
pub insecure_disable_tls_verification: bool,
}

/// The status of the booted image
Expand Down
2 changes: 2 additions & 0 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl From<OstreeImageReference> for ImageReference {
signature,
transport: transport_to_string(imgref.imgref.transport),
image: imgref.imgref.name,
insecure_disable_tls_verification: imgref.insecure_disable_tls_verification,
}
}
}
Expand All @@ -71,6 +72,7 @@ impl From<ImageReference> for OstreeImageReference {
};
Self {
sigverify,
insecure_disable_tls_verification: img.insecure_disable_tls_verification,
imgref: ostree_container::ImageReference {
// SAFETY: We validated the schema in kube-rs
transport: img.transport.as_str().try_into().unwrap(),
Expand Down