This commit is contained in:
@@ -394,11 +394,7 @@ impl CertificateManagement for K8sAnywhereTopology {
|
|||||||
};
|
};
|
||||||
//TODO make this generic across k8s distributions using k8s family
|
//TODO make this generic across k8s distributions using k8s family
|
||||||
match k8s_client
|
match k8s_client
|
||||||
.get_resource_json_value(
|
.get_resource_json_value("cert-manager.openshift-operators", None, &gvk)
|
||||||
"cert-manager.openshift-operators",
|
|
||||||
None,
|
|
||||||
&gvk,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(_ready) => Ok(PreparationOutcome::Success {
|
Ok(_ready) => Ok(PreparationOutcome::Success {
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ use crate::{
|
|||||||
///TODO rust doc explaining issuer, certificate etc
|
///TODO rust doc explaining issuer, certificate etc
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait CertificateManagement: Send + Sync {
|
pub trait CertificateManagement: Send + Sync {
|
||||||
async fn install(
|
async fn install(&self) -> Result<PreparationOutcome, PreparationError>;
|
||||||
&self,
|
|
||||||
) -> Result<PreparationOutcome, PreparationError>;
|
|
||||||
|
|
||||||
async fn ensure_certificate_management_ready(
|
async fn ensure_certificate_management_ready(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ pub mod cluster_issuer;
|
|||||||
pub mod crd;
|
pub mod crd;
|
||||||
mod helm;
|
mod helm;
|
||||||
pub mod operator;
|
pub mod operator;
|
||||||
pub mod score_operator;
|
|
||||||
pub mod score_create_cert;
|
pub mod score_create_cert;
|
||||||
pub mod score_create_issuer;
|
pub mod score_create_issuer;
|
||||||
|
pub mod score_operator;
|
||||||
pub use helm::*;
|
pub use helm::*;
|
||||||
|
|||||||
@@ -47,7 +47,11 @@ impl<T: Topology + CertificateManagement> Interpret<T> for CertificateCreationIn
|
|||||||
topology: &T,
|
topology: &T,
|
||||||
) -> Result<Outcome, InterpretError> {
|
) -> Result<Outcome, InterpretError> {
|
||||||
let _certificate = topology
|
let _certificate = topology
|
||||||
.create_certificate(self.cert_name.clone(), self.issuer_name.clone(), &self.config)
|
.create_certificate(
|
||||||
|
self.cert_name.clone(),
|
||||||
|
self.issuer_name.clone(),
|
||||||
|
&self.config,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| InterpretError::new(e.to_string()))?;
|
.map_err(|e| InterpretError::new(e.to_string()))?;
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ use harmony_types::id::Id;
|
|||||||
use log::debug;
|
use log::debug;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::{data::Version, interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome}, inventory::Inventory, modules::cert_manager::capability::{CertificateManagement, CertificateManagementConfig}, score::Score, topology::Topology};
|
use crate::{
|
||||||
|
data::Version,
|
||||||
|
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
||||||
|
inventory::Inventory,
|
||||||
|
modules::cert_manager::capability::{CertificateManagement, CertificateManagementConfig},
|
||||||
|
score::Score,
|
||||||
|
topology::Topology,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
pub struct CertificateIssuerScore {
|
pub struct CertificateIssuerScore {
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ impl<T: Topology + CertificateManagement> Interpret<T> for CertificateManagement
|
|||||||
inventory: &Inventory,
|
inventory: &Inventory,
|
||||||
topology: &T,
|
topology: &T,
|
||||||
) -> Result<Outcome, InterpretError> {
|
) -> Result<Outcome, InterpretError> {
|
||||||
|
|
||||||
topology
|
topology
|
||||||
.ensure_certificate_management_ready(&self.config)
|
.ensure_certificate_management_ready(&self.config)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user