Skip to content

Commit cfde5c0

Browse files
author
datacore-bolt-ci
committed
ci(stability): merge the develop branch
2 parents ac38411 + 9ea6869 commit cfde5c0

File tree

8 files changed

+25
-23
lines changed

8 files changed

+25
-23
lines changed

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

k8s/plugin/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ console-logger = { path = "../../console-logger" }
2525
supportability = { path = "../supportability" }
2626
upgrade = { path = "../upgrade" }
2727
kube-proxy = { path = "../../dependencies/control-plane/k8s/proxy" }
28+
kube-forward = { path = "../../dependencies/control-plane/k8s/forward" }
2829
tokio = { version = "1.41.0" }
2930
anyhow = "1.0.92"
3031
clap = { version = "4.5.20", features = ["color", "derive"] }

k8s/plugin/src/resources/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use anyhow::anyhow;
12
use clap::Parser;
23
use openapi::tower::client::Url;
34
use plugin::{
@@ -160,6 +161,18 @@ impl From<anyhow::Error> for Error {
160161
}
161162
}
162163

164+
impl From<kube_proxy::Error> for Error {
165+
fn from(e: kube_proxy::Error) -> Self {
166+
if let error @ kube_proxy::Error::Forward {
167+
source: kube_forward::Error::ServiceNotFound { .. },
168+
} = e
169+
{
170+
return Error::Generic(anyhow!("{error}\n Are you on the correct namespace?"));
171+
}
172+
Error::Generic(anyhow!(e))
173+
}
174+
}
175+
163176
/// Initialise the REST client.
164177
pub async fn init_rest(cli_args: &CliArgs) -> Result<(), Error> {
165178
// Use the supplied URL if there is one otherwise obtain one from the kubeconfig file.

k8s/supportability/src/collect/persistent_store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) enum EtcdError {
1313
K8sResource(K8sResourceError),
1414
IOError(std::io::Error),
1515
Custom(String),
16-
CreateClient(anyhow::Error),
16+
CreateClient(kube_proxy::Error),
1717
}
1818

1919
impl From<StoreError> for EtcdError {

k8s/upgrade/src/plugin/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub enum Error {
206206

207207
/// Openapi configuration error.
208208
#[snafu(display("openapi configuration Error: {}", source))]
209-
OpenapiClientConfiguration { source: anyhow::Error },
209+
OpenapiClientConfiguration { source: kube_proxy::Error },
210210

211211
/// Error when opening a file.
212212
#[snafu(display("Failed to open file {}: {}", filepath.display(), source))]

nix/lib/rust.nix

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ pkgs }:
22
let
33
lib = pkgs.lib;
4+
sources = import ../sources.nix;
45
in
56
rec {
67
makeRustTarget = platform: pkgs.rust.toRustTargetSpec platform;
@@ -30,7 +31,7 @@ rec {
3031
os = platform: builtins.replaceStrings [ "${platform.qemuArch}-" ] [ "" ] platform.system;
3132
hostPlatform = "${pkgs.rust.toRustTargetSpec pkgs.pkgsStatic.hostPlatform}";
3233
targetPlatform = "${pkgs.rust.toRustTargetSpec pkgs.pkgsCross."${target}".hostPlatform}";
33-
pkgsTarget = if hostPlatform == targetPlatform then pkgs.pkgsStatic else pkgs.pkgsCross."${target}";
34+
pkgsTarget = if hostPlatform == targetPlatform then pkgs else pkgs.pkgsCross."${target}";
3435
pkgsTargetNative = if hostPlatform == targetPlatform then pkgs else if hostOs == targetOs then
3536
import sources.nixpkgs
3637
{
@@ -63,14 +64,7 @@ rec {
6364
addPreBuild = "";
6465
nativeBuildInputs = with pkgs;
6566
[ pkg-config protobuf paperclip which git ] ++
66-
[ rustPlatformDeps.pkgsTarget.stdenv.cc ] ++
67-
lib.optional (rustPlatformDeps.pkgsTarget.hostPlatform.isDarwin)
68-
[
69-
(rustPlatformDeps.pkgsTarget.libiconv.override {
70-
enableStatic = true;
71-
enableShared = false;
72-
})
73-
];
67+
[ rustPlatformDeps.pkgsTarget.stdenv.cc ];
7468
addNativeBuildInputs = [ ];
7569
buildInputs = if (rustPlatformDeps.pkgsTarget.hostPlatform.isWindows) then with rustPlatformDeps.pkgsTargetNative.windows; [ mingw_w64_pthreads pthreads ] else [ ];
7670
};

nix/pkgs/utils/default.nix

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,9 @@ let
1515
buildKubectlPlugin = { target, release, addBuildOptions ? [ ] }:
1616
let
1717
platformDeps = channel.rustPlatformDeps { inherit target sources; };
18-
# required for darwin because its pkgsStatic is not static!
19-
static_ssl = (platformDeps.pkgsTarget.pkgsStatic.openssl.override {
20-
static = true;
21-
});
2218
rustBuildOpts = channel.rustBuilderOpts { rustPlatformDeps = platformDeps; } // {
2319
buildOptions = [ "-p" "kubectl-plugin" ] ++ addBuildOptions;
24-
${if !pkgs.hostPlatform.isDarwin then "addNativeBuildInputs" else null} = [ platformDeps.pkgsTargetNative.pkgsStatic.openssl.dev ];
25-
addPreBuild = preBuildOpenApi + ''
26-
export OPENSSL_STATIC=1
27-
'' + lib.optionalString (pkgs.hostPlatform.isDarwin) ''
28-
export OPENSSL_LIB_DIR=${static_ssl.out}/lib
29-
export OPENSSL_INCLUDE_DIR=${static_ssl.dev}/include
30-
'';
20+
addPreBuild = preBuildOpenApi;
3121
};
3222
name = "kubectl-plugin";
3323
in

0 commit comments

Comments
 (0)