Skip to content

Commit

Permalink
fix: Normalize authenticated endpoint (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe authored Apr 15, 2024
1 parent 91345e4 commit 56cd2c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 4 additions & 10 deletions bootstrap/crds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ resource "kubernetes_manifest" "customresourcedefinition_cardanonodeports_demete
"type" = "string"
},
{
"jsonPath" = ".status.authenticatedEndpoint"
"name" = "Authenticated Endpoint"
"jsonPath" = ".status.authenticatedEndpointUrl"
"name" = "Authenticated Endpoint URL"
"type" = "string"
},
{
Expand All @@ -52,12 +52,6 @@ resource "kubernetes_manifest" "customresourcedefinition_cardanonodeports_demete
"spec" = {
"properties" = {
"network" = {
"enum" = [
"mainnet",
"preprod",
"preview",
"sanchonet",
]
"type" = "string"
}
"throughputTier" = {
Expand All @@ -80,13 +74,13 @@ resource "kubernetes_manifest" "customresourcedefinition_cardanonodeports_demete
"authToken" = {
"type" = "string"
}
"authenticatedEndpoint" = {
"authenticatedEndpointUrl" = {
"type" = "string"
}
}
"required" = [
"authToken",
"authenticatedEndpoint",
"authenticatedEndpointUrl",
]
"type" = "object"
}
Expand Down
6 changes: 3 additions & 3 deletions operator/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub static CARDANO_NODE_PORT_FINALIZER: &str = "cardanonodeports.demeter.run";
{"name": "Network", "jsonPath": ".spec.network", "type": "string"},
{"name": "Version", "jsonPath": ".spec.version", "type": "string"},
{"name": "Throughput Tier", "jsonPath": ".spec.throughputTier", "type": "string"},
{"name": "Authenticated Endpoint", "jsonPath": ".status.authenticatedEndpoint", "type": "string"},
{"name": "Authenticated Endpoint URL", "jsonPath": ".status.authenticatedEndpointUrl", "type": "string"},
{"name": "Auth Token", "jsonPath": ".status.authToken", "type": "string"}
"#)]
#[serde(rename_all = "camelCase")]
Expand All @@ -38,7 +38,7 @@ pub struct CardanoNodePortSpec {
#[derive(Deserialize, Serialize, Clone, Default, Debug, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct CardanoNodePortStatus {
pub authenticated_endpoint: String,
pub authenticated_endpoint_url: String,
pub auth_token: String,
}

Expand All @@ -56,7 +56,7 @@ async fn reconcile(crd: Arc<CardanoNodePort>, ctx: Arc<Context>) -> Result<Actio
let key = build_api_key(&crd).await?;

let status = CardanoNodePortStatus {
authenticated_endpoint: build_hostname(&crd.spec.network, &crd.spec.version, &key),
authenticated_endpoint_url: build_hostname(&crd.spec.network, &crd.spec.version, &key),
auth_token: key,
};

Expand Down

0 comments on commit 56cd2c3

Please sign in to comment.