Skip to content

feat(RELEASE-2092): get snapshot from kubearchive if deleted#657

Merged
querti merged 1 commit intokonflux-ci:mainfrom
querti:kubearchive-snapshot
Feb 17, 2026
Merged

feat(RELEASE-2092): get snapshot from kubearchive if deleted#657
querti merged 1 commit intokonflux-ci:mainfrom
querti:kubearchive-snapshot

Conversation

@querti
Copy link
Contributor

@querti querti commented Feb 12, 2026

Modify the get-resource script to fallback to kubearchive if the resource is deleted. This functionality is restricted to snapshots since I don't know the side effects if it was enabled for every resource. But theoretically it can be enabled for other resources as well.

Kubearchive needs to be configured before it can be used. The script performs the configuration - it is semi-automatic, the resources are gathered from kubectl config + cluster by the interactive script. Temporary kubearchive config file is used (in the /tmp dir) so that the script would work in container/kubernetes environment and so that it wouldn't interfere with the hosts environment.

The script allows jsonpath, but this is not supported by kubearchive. To simulate the functionality, jq is used for kubearchive. jq is different from kubernetes jsonpath, so some substitutions had to be used. It will work for the common cases (the ones found in release-service catalog), but it may break if a more complex expression is used.

Assisted-by: Cursor

@snyk-io
Copy link

snyk-io bot commented Feb 12, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

querti added a commit to querti/release-service-catalog that referenced this pull request Feb 12, 2026
The catalog tasks mostly use the get-resource script in
release-utils-repo to get Kubernetes resources. For snapshots, this
script has been modified to fallback to kubearchive if the resource
had been deleted [1].

This approach doesn't work if the get-resource script isn't used to
get the snapshot. This commit modifies the one instance where this
happens to use the get-resource script, ensuring that the kubearchive
fallback is used.

[1] konflux-ci/release-service-utils#657

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
@querti
Copy link
Contributor Author

querti commented Feb 12, 2026

There is also a related PR in the catalog repo that ensures that this script is used for every instance of getting the snapshot: konflux-ci/release-service-catalog#1986

Modify the get-resource script to fallback to kubearchive if the
resource is deleted. This functionality is restricted to snapshots
since I don't know the side effects if it was enabled for every
resource. But theoretically it can be enabled for other resources as
well.

Kubearchive needs to be configured before it can be used. The script
performs the configuration - it is semi-automatic, the resources are
gathered from kubectl config + cluster by the interactive script.
Temporary kubearchive config file is used (in the /tmp dir) so that
the script would work in container/kubernetes environment and so that
it wouldn't interfere with the hosts environment.

The script allows jsonpath, but this is not supported by kubearchive.
To simulate the functionality, jq is used for kubearchive. jq is
different from kubernetes jsonpath, so some substitutions had to be
used. It will work for the common cases (the ones found in
release-service catalog), but it may break if a more complex
expression is used.

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
@querti querti force-pushed the kubearchive-snapshot branch from e06a99b to 2d3f3da Compare February 12, 2026 08:56
querti added a commit to querti/release-service-catalog that referenced this pull request Feb 12, 2026
The catalog tasks mostly use the get-resource script in
release-utils-repo to get Kubernetes resources. For snapshots, this
script has been modified to fallback to kubearchive if the resource
had been deleted [1].

This approach doesn't work if the get-resource script isn't used to
get the snapshot. This commit modifies the one instance where this
happens to use the get-resource script, ensuring that the kubearchive
fallback is used.

[1] konflux-ci/release-service-utils#657

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
querti added a commit to querti/release-service-catalog that referenced this pull request Feb 12, 2026
The catalog tasks mostly use the get-resource script in
release-utils-repo to get Kubernetes resources. For snapshots, this
script has been modified to fallback to kubearchive if the resource
had been deleted [1].

This approach doesn't work if the get-resource script isn't used to
get the snapshot. This commit modifies the one instance where this
happens to use the get-resource script, ensuring that the kubearchive
fallback is used.

[1] konflux-ci/release-service-utils#657

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
@querti querti marked this pull request as ready for review February 12, 2026 11:06
@querti querti added this pull request to the merge queue Feb 17, 2026
Merged via the queue into konflux-ci:main with commit 4d33e7d Feb 17, 2026
10 checks passed
@querti querti deleted the kubearchive-snapshot branch February 17, 2026 08:42
querti added a commit to querti/release-service-catalog that referenced this pull request Feb 17, 2026
The catalog tasks mostly use the get-resource script in
release-utils-repo to get Kubernetes resources. For snapshots, this
script has been modified to fallback to kubearchive if the resource
had been deleted [1].

This approach doesn't work if the get-resource script isn't used to
get the snapshot. This commit modifies the one instance where this
happens to use the get-resource script, ensuring that the kubearchive
fallback is used.

[1] konflux-ci/release-service-utils#657

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
querti added a commit to querti/release-service-catalog that referenced this pull request Feb 17, 2026
The catalog tasks mostly use the get-resource script in
release-utils-repo to get Kubernetes resources. For snapshots, this
script has been modified to fallback to kubearchive if the resource
had been deleted [1].

This approach doesn't work if the get-resource script isn't used to
get the snapshot. This commit modifies the one instance where this
happens to use the get-resource script, ensuring that the kubearchive
fallback is used.

[1] konflux-ci/release-service-utils#657

Assisted-by: Cursor
Signed-off-by: Lubomir Gallovic <lgallovi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants