Skip to content

Fix bug where invalid labels were created due to forbidden label characters #1075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maltesander
Copy link
Member

Description

When using custom images like:

---
apiVersion: spark.stackable.tech/v1alpha1
kind: SparkApplication
metadata:
  name: spark-ny-cm
spec:
  sparkImage:
    productVersion: 3.5.6
    custom: oci.stackable.tech/sdp/spark-k8s:3.5.6-stackable25.7.0@sha256:c8b77ba72de6f8ddb99cb484b5ee79c43623cc2514d1448243f7d65d0ef66212
    #custom: oci.stackable.tech/sdp/spark-k8s@sha256:c8b77ba72de6f8ddb99cb484b5ee79c43623cc2514d1448243f7d65d0ef66212

the operator errors out due to creating invalid labels:

2025-08-07T10:52:54.347504Z ERROR app_controller: stackable_operator::logging::controller: Failed to reconcile object controller.name="sparkapplication.spark.stackable.tech" error=reconciler for object SparkApplication.v1alpha1.spark.stackable.tech/spark-ny-cm.default failed error.sources=[failed to build Metadata, failed to set recommended labels, failed to parse value "3.5.2-sha256:15725cf7ee1d648dd81e3bcbf8bcfff8e34d922182d5101abc" of key "app.kubernetes.io/version", value violates kubernetes format]

This is a quick and dirty fix replacing all ":" in the hash_or_tag_image used for creating the label with "-".

Parsing the image is tested properly in the code, but this only turned up in the consuming product (spark-operator) in this case when creating the labels.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

@maltesander maltesander self-assigned this Aug 7, 2025
@lfrancke lfrancke moved this to Development: In Progress in Stackable Engineering Aug 7, 2025
@Techassi Techassi self-requested a review August 7, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Development: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant