Update to Rust 1.63 (#9196)

Also, restore the go-lint timeout (10m)

Signed-off-by: Oliver Gould <ver@buoyant.io>
This commit is contained in:
Oliver Gould 2022-08-17 16:27:27 -07:00 committed by GitHub
parent fdf1f9c404
commit 695f843914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 44 additions and 34 deletions

View File

@ -1,5 +1,5 @@
ARG GO_VERSION=1.18.5
ARG RUST_TOOLCHAIN=1.62.1
ARG RUST_TOOLCHAIN=1.63.0
##
## Base

View File

@ -1,6 +1,6 @@
{
"name": "linkerd2",
"image": "ghcr.io/linkerd/dev:v28",
"image": "ghcr.io/linkerd/dev:v29",
// "dockerFile": "./Dockerfile",
// "context": "..",
"extensions": [

View File

@ -13,7 +13,7 @@ jobs:
actionlint:
runs-on: ubuntu-20.04
timeout-minutes: 10
container: ghcr.io/linkerd/dev:v28-tools
container: ghcr.io/linkerd/dev:v29-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run actionlint
@ -21,7 +21,7 @@ jobs:
devcontainer-versions:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v28-tools
container: ghcr.io/linkerd/dev:v29-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just action-dev-check

View File

@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
container:
image: docker://rust:1.62.1
image: docker://rust:1.63.0
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

View File

@ -16,15 +16,15 @@ jobs:
go-lint:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v28-go
container: ghcr.io/linkerd/dev:v29-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just go-lint --verbose
- run: just go-lint --verbose --timeout=10m
go-format:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v28-go
container: ghcr.io/linkerd/dev:v29-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just go-fmt
@ -32,7 +32,7 @@ jobs:
go-test:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v28-go
container: ghcr.io/linkerd/dev:v29-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just go-fetch

View File

@ -15,7 +15,7 @@ jobs:
helm-docs-diff:
runs-on: ubuntu-20.04
timeout-minutes: 5
container: ghcr.io/linkerd/dev:v28-tools
container: ghcr.io/linkerd/dev:v29-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/helm-docs-diff

View File

@ -15,7 +15,7 @@ jobs:
proto-diff:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v28-go
container: ghcr.io/linkerd/dev:v29-go
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: bin/protoc-diff

View File

@ -42,7 +42,7 @@ jobs:
fmt:
timeout-minutes: 5
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v28-rust
container: ghcr.io/linkerd/dev:v29-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-check-fmt
@ -50,7 +50,7 @@ jobs:
clippy:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v28-rust
container: ghcr.io/linkerd/dev:v29-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch
@ -60,7 +60,7 @@ jobs:
check:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v28-rust
container: ghcr.io/linkerd/dev:v29-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch
@ -70,7 +70,7 @@ jobs:
name: test
runs-on: ubuntu-latest
timeout-minutes: 15
container: ghcr.io/linkerd/dev:v28-rust
container: ghcr.io/linkerd/dev:v29-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just rs-fetch

View File

@ -15,7 +15,7 @@ jobs:
shellcheck:
timeout-minutes: 10
runs-on: ubuntu-20.04
container: ghcr.io/linkerd/dev:v28-tools
container: ghcr.io/linkerd/dev:v29-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just sh-lint

View File

@ -1,4 +1,4 @@
ARG RUST_IMAGE=docker.io/library/rust:1.62.1
ARG RUST_IMAGE=docker.io/library/rust:1.63.0
ARG RUNTIME_IMAGE=gcr.io/distroless/cc
# Builds the controller binary.
@ -11,10 +11,10 @@ COPY Cargo.toml Cargo.lock .
COPY policy-controller policy-controller
RUN cargo new policy-test --lib
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo fetch
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
if [ "$BUILD_TYPE" = debug ]; then \
cargo build --frozen --target=x86_64-unknown-linux-gnu --package=linkerd-policy-controller && \
mv target/x86_64-unknown-linux-gnu/debug/linkerd-policy-controller /tmp/ ; \

View File

@ -1,4 +1,4 @@
ARG RUST_IMAGE=docker.io/library/rust:1.62.1
ARG RUST_IMAGE=docker.io/library/rust:1.63.0
ARG RUNTIME_IMAGE=gcr.io/distroless/cc
FROM $RUST_IMAGE as build
@ -13,11 +13,11 @@ COPY Cargo.toml Cargo.lock .
COPY policy-controller policy-controller
RUN cargo new policy-test --lib
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo fetch
# XXX(ver) we can't easily cross-compile against openssl, so use rustls on arm.
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo build --frozen --release --target=armv7-unknown-linux-gnueabihf \
--package=linkerd-policy-controller --no-default-features --features="rustls-tls" && \
mv target/armv7-unknown-linux-gnueabihf/release/linkerd-policy-controller /tmp/

View File

@ -1,4 +1,4 @@
ARG RUST_IMAGE=docker.io/library/rust:1.62.1
ARG RUST_IMAGE=docker.io/library/rust:1.63.0
ARG RUNTIME_IMAGE=gcr.io/distroless/cc
FROM $RUST_IMAGE as build
@ -13,11 +13,11 @@ COPY Cargo.toml Cargo.lock .
COPY policy-controller policy-controller
RUN cargo new policy-test --lib
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo fetch
# XXX(ver) we can't easily cross-compile against openssl, so use rustls on arm.
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.62.1,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.63.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo build --frozen --release --target=aarch64-unknown-linux-gnu \
--package=linkerd-policy-controller --no-default-features --features="rustls-tls" && \
mv target/aarch64-unknown-linux-gnu/release/linkerd-policy-controller /tmp/

View File

@ -4,6 +4,7 @@ use super::NamespacedTargetRef;
Clone,
Debug,
Default,
Eq,
PartialEq,
kube::CustomResource,
serde::Deserialize,

View File

@ -1,4 +1,6 @@
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema)]
#[derive(
Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
)]
#[serde(rename_all = "camelCase")]
pub struct Network {
pub cidr: Cidr,
@ -6,7 +8,7 @@ pub struct Network {
}
#[derive(
Copy, Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
Copy, Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
)]
#[serde(untagged)]
pub enum Cidr {

View File

@ -4,6 +4,7 @@ pub use super::Network;
Clone,
Debug,
Default,
Eq,
PartialEq,
kube::CustomResource,
serde::Deserialize,

View File

@ -1,20 +1,26 @@
use super::targets_kind;
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema)]
#[derive(
Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
)]
pub struct ClusterTargetRef {
pub group: Option<String>,
pub kind: String,
pub name: String,
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema)]
#[derive(
Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
)]
pub struct LocalTargetRef {
pub group: Option<String>,
pub kind: String,
pub name: String,
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema)]
#[derive(
Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
)]
pub struct NamespacedTargetRef {
pub group: Option<String>,
pub kind: String,

View File

@ -8,13 +8,13 @@ use linkerd_policy_controller_k8s_api::{
};
use std::num::NonZeroU16;
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct InboundRouteBinding {
pub parents: Vec<InboundParentRef>,
pub route: http_route::InboundHttpRoute,
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum InboundParentRef {
Server(String),
}

View File

@ -86,7 +86,7 @@ fn container_http_probe_paths(
fn get_port(port: &k8s::IntOrString, container: &k8s::Container) -> Option<NonZeroU16> {
match port {
k8s::IntOrString::Int(p) => u16::try_from(*p).ok()?.try_into().ok(),
k8s::IntOrString::String(n) => find_by_name(n, &*container.ports.as_ref()?),
k8s::IntOrString::String(n) => find_by_name(n, container.ports.as_ref()?),
}
}

View File

@ -1 +1 @@
1.62.1
1.63.0