Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions rust/stackable-cockpit/src/platform/release/spec.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use futures::{StreamExt as _, TryStreamExt};
use indexmap::IndexMap;
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use snafu::{ResultExt, Snafu};
use tokio::task::JoinError;
use tracing::{Instrument, Span, info, instrument};
use tracing::{Instrument, Span, debug, info, instrument};
use tracing_indicatif::span_ext::IndicatifSpanExt as _;
#[cfg(feature = "openapi")]
use utoipa::ToSchema;
Expand Down Expand Up @@ -181,18 +182,38 @@ impl ReleaseSpec {
}
};

let request_url = &format!(
let request_url_string = &format!(
"https://raw.githubusercontent.com/stackabletech/{product_name}-operator/{release_branch}/deploy/helm/{product_name}-operator/crds/crds.yaml"
);
let request_url = request_url.into_path_or_url().context(ParsePathOrUrlSnafu {
path_or_url: request_url.clone(),
let request_url = request_url_string.into_path_or_url().context(ParsePathOrUrlSnafu {
path_or_url: request_url_string,
})?;

// Get CRD manifests from request_url
let crd_manifests: String = transfer_client
let crd_manifests = transfer_client
.get(&request_url, &Text)
.await
.context(FileTransferSnafu)?;
.await;
let crd_manifests = match crd_manifests {
Ok(crd_manifests) => crd_manifests,
Err(crate::xfer::Error::FetchRemoteContent{source: reqwest_error})
if reqwest_error.status() == Some(StatusCode::NOT_FOUND) => {
// Ignore 404, as CRD versioning is rolled out to operators.
// Starting with secret-operator 25.11.0, the CRD is maintained by the operator,
// making this entire functionality obsolete.
// As only some of the operators are migrated yet, some operator crds.yaml's
// return a 404, others don't.
debug!(
product = product_name,
// https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client-span
url.full = request_url_string,
"Skipped updating CRD, as it doesn't exist in the upstream GitHub repo because the operator most likely uses CRD versioning"
);
return Ok(());
},
Err(err) => {
return Err(Error::FileTransfer { source: err });
},
};

// Upgrade CRDs
k8s_client
Expand Down
7 changes: 7 additions & 0 deletions rust/stackablectl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Fixed

- Don't crash during `release upgrade` for SDP 25.11.
Previously it errored with `HTTP status client error (404 Not Found) for url (https://raw.githubusercontent.com/stackabletech/secret-operator/main/deploy/helm/secret-operator/crds/crds.yaml)`, as the secret-operator now maintains the CRD itself ([#418]).

[#418]: https://github.com/stackabletech/stackable-cockpit/pull/418

## [1.2.0] - 2025-10-29

### Added
Expand Down