Skip to content

Commit 934be63

Browse files
mayastor-borstiagolobocastro
andcommitted
chore(bors): merge pull request #874
874: ci: specify opentel receiver endpoint r=tiagolobocastro a=tiagolobocastro When running on the CI we an opentel receiver to push the traces to an external collector. With recent versions of the receiver, it now listens only on localhost which was prevent it from receiving the traces to begin with. Now we specify the domain name of the receiver. Co-authored-by: Tiago Castro <[email protected]>
2 parents 1406608 + 6088f61 commit 934be63

File tree

3 files changed

+38
-30
lines changed

3 files changed

+38
-30
lines changed

deployer/misc/otel_agent_config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ receivers:
22
otlp:
33
protocols:
44
grpc:
5+
endpoint: jaeger:4317
56

67
processors:
78
batch:
@@ -15,6 +16,6 @@ exporters:
1516
service:
1617
pipelines:
1718
traces:
18-
receivers: [otlp]
19-
processors: [batch]
20-
exporters: [otlp]
19+
receivers: [ otlp ]
20+
processors: [ batch ]
21+
exporters: [ otlp ]

k8s/operators/Cargo.toml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,38 @@ name = "k8s-operators"
33
description = "K8S Operator"
44
version = "1.0.0"
55
edition = "2018"
6-
authors = ["Jeffry Molanus <[email protected]>"]
76

87
[[bin]]
98
name = "operator-diskpool"
109
path = "src/pool/main.rs"
10+
required-features = ["bin"]
1111

1212
[lib]
1313
name = "k8s_operators"
1414
path = "src/lib.rs"
1515

16-
1716
[features]
18-
default = [ "rls" ]
19-
rls = [ "openapi/tower-client-rls" ]
20-
tls = [ "openapi/tower-client-tls" ]
21-
17+
default = ["rls", "bin"]
18+
bin = ["openapi", "utils", "anyhow", "chrono", "clap", "futures", "snafu", "tokio", "humantime", "tracing"]
19+
rls = ["openapi/tower-client-rls"]
20+
tls = ["openapi/tower-client-tls"]
2221

2322
[dependencies]
24-
openapi = { path = "../../openapi", default-features = false, features = [ "tower-client", "tower-trace" ] }
25-
utils = { path = "../../utils/utils-lib" }
26-
anyhow = "1.0.75"
27-
chrono = "0.4.31"
28-
clap = { version = "4.4.6", features = ["color", "env", "string"] }
29-
futures = "0.3.28"
23+
# CRD
3024
k8s-openapi = { version = "0.20.0", features = ["v1_22"] }
3125
kube = { version = "0.87.0", features = ["derive", "runtime"] }
32-
schemars = "0.8.15"
33-
serde = "1.0.188"
34-
serde_json = "1.0.107"
35-
snafu = "0.7.5"
36-
tokio = { version = "1.32.0", features = ["full"] }
37-
humantime = "2.1.0"
38-
tracing = "0.1.37"
26+
schemars = { version = "0.8.15" }
27+
serde = { version = "1.0.188" }
28+
serde_json = { version = "1.0.107" }
29+
30+
# Binary
31+
openapi = { path = "../../openapi", default-features = false, features = ["tower-client", "tower-trace"], optional = true }
32+
utils = { path = "../../utils/utils-lib", optional = true }
33+
anyhow = { version = "1.0.75", optional = true }
34+
chrono = { version = "0.4.31", optional = true }
35+
clap = { version = "4.4.6", features = ["color", "env", "string"], optional = true }
36+
futures = { version = "0.3.28", optional = true }
37+
snafu = { version = "0.7.5", optional = true }
38+
tokio = { version = "1.32.0", features = ["full"], optional = true }
39+
humantime = { version = "2.1.0", optional = true }
40+
tracing = { version = "0.1.37", optional = true }

k8s/operators/src/pool/diskpool/crd/v1beta2.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use kube::CustomResource;
2-
use openapi::models::{pool_status::PoolStatus as RestPoolStatus, Pool};
32
use schemars::JsonSchema;
43
use serde::{Deserialize, Serialize};
54
use std::collections::HashMap;
65

6+
#[cfg(feature = "openapi")]
7+
use openapi::models::{pool_status::PoolStatus as RestPoolStatus, Pool};
8+
79
#[derive(
810
CustomResource, Serialize, Deserialize, Default, Debug, Eq, PartialEq, Clone, JsonSchema,
911
)]
@@ -29,11 +31,11 @@ printcolumn = r#"{ "name":"available", "type":"integer", "format": "int64", "min
2931
/// The pool spec which contains the parameters we use when creating the pool
3032
pub struct DiskPoolSpec {
3133
/// The node the pool is placed on
32-
node: String,
34+
pub node: String,
3335
/// The disk device the pool is located on
34-
disks: Vec<String>,
36+
pub disks: Vec<String>,
3537
/// The topology for data placement.
36-
topology: Option<Topology>,
38+
pub topology: Option<Topology>,
3739
}
3840

3941
/// Placement pool topology used by volume operations.
@@ -104,11 +106,11 @@ pub struct DiskPoolStatus {
104106
/// Pool status from respective control plane object.
105107
pub pool_status: Option<PoolStatus>,
106108
/// Capacity as number of bytes.
107-
capacity: u64,
109+
pub capacity: u64,
108110
/// Used number of bytes.
109-
used: u64,
111+
pub used: u64,
110112
/// Available number of bytes.
111-
available: u64,
113+
pub available: u64,
112114
}
113115

114116
impl Default for DiskPoolStatus {
@@ -133,7 +135,8 @@ impl DiskPoolStatus {
133135
}
134136
}
135137

136-
/// Set when operator is attempting delete on pool.
138+
/// Set when operator is attempting to delete on pool.
139+
#[cfg(feature = "openapi")]
137140
pub fn terminating(p: Pool) -> Self {
138141
let state = p.state.unwrap_or_default();
139142
let free = if state.capacity > state.used {
@@ -168,6 +171,7 @@ impl DiskPoolStatus {
168171
}
169172
}
170173

174+
#[cfg(feature = "openapi")]
171175
impl From<RestPoolStatus> for PoolStatus {
172176
fn from(p: RestPoolStatus) -> Self {
173177
match p {
@@ -180,6 +184,7 @@ impl From<RestPoolStatus> for PoolStatus {
180184
}
181185

182186
/// Returns DiskPoolStatus from Control plane pool object.
187+
#[cfg(feature = "openapi")]
183188
impl From<Pool> for DiskPoolStatus {
184189
fn from(p: Pool) -> Self {
185190
if let Some(state) = p.state {

0 commit comments

Comments
 (0)