Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve deprecation warnings from clap #798

Merged
merged 3 commits into from
Mar 30, 2022
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/integration_tests_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
wget -q https://github.com/opencontainers/runc/releases/download/v1.1.0/runc.amd64
sudo mv runc.amd64 /usr/bin/runc
sudo chmod 755 /usr/bin/runc
- name: Build youki and tests
run: ./scripts/build.sh -o "$(git rev-parse --show-toplevel)"/scripts -r
- name: Validate tests on runc
run: cd scripts && ./rust_integration_tests.sh runc
run: make validate-rust-tests
- name: Validate tests on youki
run: make integration-test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ oci-integration-test: release-build
integration-test: release-build
./scripts/rust_integration_tests.sh $(ROOT)/youki

validate-rust-tests: release-build
./scripts/rust_integration_tests.sh runc

clean:
./scripts/clean.sh $(ROOT)
12 changes: 1 addition & 11 deletions crates/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/liboci-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub enum CommonCmd {
Exec(Exec),
List(List),
Pause(Pause),
#[clap(setting = clap::AppSettings::AllowLeadingHyphen)]
#[clap(allow_hyphen_values = true)]
Ps(Ps),
Resume(Resume),
Run(Run),
Expand Down
2 changes: 1 addition & 1 deletion crates/liboci-cli/src/ps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ pub struct Ps {
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
/// options will be passed to the ps utility
#[clap(setting = clap::ArgSettings::Last)]
#[clap(last = true)]
pub ps_options: Vec<String>,
}
2 changes: 1 addition & 1 deletion crates/youki/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ procfs = "0.12.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tabwriter = "1"
clap_generate = { version = "3.0.0-beta.5" }
clap_complete = "3.1.1"

[dev-dependencies]
serial_test = "0.6.0"
Expand Down
7 changes: 4 additions & 3 deletions crates/youki/src/commands/completion.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::Result;
use clap::{App, Parser};
use clap_generate::{generate, Shell};
use clap::{Command, Parser};

use clap_complete::{generate, Shell};
use std::io;

#[derive(Debug, Parser)]
Expand All @@ -10,7 +11,7 @@ pub struct Completion {
pub shell: Shell,
}

pub fn completion(args: Completion, app: &mut App) -> Result<()> {
pub fn completion(args: Completion, app: &mut Command) -> Result<()> {
generate(
args.shell,
app,
Expand Down
2 changes: 1 addition & 1 deletion crates/youki/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn main() -> Result<()> {
pentacle::ensure_sealed().context("failed to seal /proc/self/exe")?;

let opts = Opts::parse();
let mut app = Opts::into_app();
let mut app = Opts::command();

if let Err(e) = crate::logger::init(opts.global.debug, opts.global.log, opts.global.log_format)
{
Expand Down
17 changes: 12 additions & 5 deletions tests/rust-integration-tests/integration_test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.