Skip to content

Commit

Permalink
feat: add --devmode to collector osv
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron authored and bobmcwhirter committed Sep 7, 2023
1 parent 8c0263e commit bbfa135
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions collector/osv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use tokio::sync::RwLock;

use trustification_auth::client::{OpenIdTokenProviderConfigArguments, TokenProvider};
use trustification_infrastructure::{
endpoint::{self, Endpoint},
endpoint::{CollectorOsv, EndpointServerConfig},
endpoint::{self, CollectorOsv, Endpoint, EndpointServerConfig},
Infrastructure, InfrastructureConfig,
};

Expand Down Expand Up @@ -52,7 +51,12 @@ pub struct Run {
}

impl Run {
pub async fn run(self) -> anyhow::Result<ExitCode> {
pub async fn run(mut self) -> anyhow::Result<ExitCode> {
if self.devmode {
self.v11y_url = Url::parse("http://localhost:8087").unwrap();
self.collectorist_url = Url::parse("http://localhost:8088").unwrap();
}

Infrastructure::from(self.infra)
.run("collector-osv", |_metrics| async move {
let provider = self.oidc.into_provider_or_devmode(self.devmode).await?;
Expand Down

0 comments on commit bbfa135

Please sign in to comment.