Skip to content

Commit 87bd657

Browse files
committed
refactor: use v2 Port
1 parent d233f17 commit 87bd657

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

rust/operator-binary/src/controller/build/resource/daemonset.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ use stackable_operator::{
5252
pod::container::{EnvVarSet, new_container_builder},
5353
},
5454
product_logging::framework::vector_container,
55-
types::kubernetes::{ContainerName, VolumeName},
55+
types::{
56+
common::Port,
57+
kubernetes::{ContainerName, VolumeName},
58+
},
5659
},
5760
};
5861

@@ -68,7 +71,7 @@ pub const CONFIG_FILE: &str = "config.json";
6871
pub const BUNDLES_ACTIVE_DIR: &str = "/bundles/active";
6972
pub const BUNDLES_INCOMING_DIR: &str = "/bundles/incoming";
7073
pub const BUNDLES_TMP_DIR: &str = "/bundles/tmp";
71-
pub const BUNDLE_BUILDER_PORT: i32 = 3030;
74+
pub const BUNDLE_BUILDER_PORT: Port = Port(3030);
7275

7376
stackable_operator::constant!(CONFIG_VOLUME_NAME: VolumeName = "config");
7477
const CONFIG_DIR: &str = "/stackable/config";
@@ -293,12 +296,12 @@ pub fn build_server_rolegroup_daemonset(
293296
)
294297
.readiness_probe(http_readiness_probe(
295298
BUNDLE_BUILDER_PROBE_PATH,
296-
IntOrString::Int(BUNDLE_BUILDER_PORT),
299+
IntOrString::Int(BUNDLE_BUILDER_PORT.into()),
297300
None,
298301
))
299302
.liveness_probe(http_liveness_probe(
300303
BUNDLE_BUILDER_PROBE_PATH,
301-
IntOrString::Int(BUNDLE_BUILDER_PORT),
304+
IntOrString::Int(BUNDLE_BUILDER_PORT.into()),
302305
None,
303306
));
304307
add_stackable_rust_cli_env_vars(

rust/operator-binary/src/controller/build/resource/service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use stackable_operator::{
44
builder::meta::ObjectMetaBuilder,
55
k8s_openapi::api::core::v1::{Service, ServicePort, ServiceSpec},
66
kvp::{Annotations, Labels},
7-
v2::builder::meta::ownerreference_from_resource,
7+
v2::{builder::meta::ownerreference_from_resource, types::common::Port},
88
};
99

1010
use crate::controller::{RoleGroupName, ValidatedCluster};
1111

12-
pub const APP_PORT: u16 = 8081;
13-
pub const APP_TLS_PORT: u16 = 8443;
12+
pub const APP_PORT: Port = Port(8081);
13+
pub const APP_TLS_PORT: Port = Port(8443);
1414
pub const APP_PORT_NAME: &str = "http";
1515
pub const APP_TLS_PORT_NAME: &str = "https";
1616
pub const METRICS_PORT_NAME: &str = "metrics";

0 commit comments

Comments
 (0)