Skip to content

feat(extensions): propagate opensandbox.extensions.* to Pod annotations#772

Merged
Pangjiping merged 4 commits intoalibaba:mainfrom
504097723:feat/support-k8s-labels-annotations-
Apr 25, 2026
Merged

feat(extensions): propagate opensandbox.extensions.* to Pod annotations#772
Pangjiping merged 4 commits intoalibaba:mainfrom
504097723:feat/support-k8s-labels-annotations-

Conversation

@504097723
Copy link
Copy Markdown
Contributor

Add mechanism to propagate user-specified extensions with opensandbox.extensions. prefix to Pod annotations with opensandbox.io/extensions. prefix. This enables custom metadata from Kotlin SDK to be visible on Kubernetes Pod annotations.

Also fix BatchSandbox provider to include labels and annotations in Pod template metadata, ensuring they are passed to created Pods.

Summary

  • What is changing and why?

    This change enables custom metadata from Kotlin SDK extensions to be propagated to Kubernetes Pod annotations. Previously, user-specified extensions were only used for server-side logic (like poolRef) and were not visible on the created Pod. Now, extensions with opensandbox.extensions. prefix are automatically
    copied to Pod annotations with opensandbox.io/extensions. prefix.

    Additionally, fixed a bug where BatchSandbox provider did not include metadata in Pod template, causing labels and annotations to not be passed to created Pods.

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efef0f4d09

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/opensandbox_server/services/k8s/batchsandbox_provider.py
Comment thread server/opensandbox_server/extensions/codec.py
@Pangjiping Pangjiping self-assigned this Apr 24, 2026
@Pangjiping Pangjiping added feature New feature or request component/server labels Apr 24, 2026
504097723 and others added 4 commits April 24, 2026 16:01
Add mechanism to propagate user-specified extensions with opensandbox.extensions.
prefix to Pod annotations with opensandbox.io/extensions. prefix. This enables
custom metadata from Kotlin SDK to be visible on Kubernetes Pod annotations.

Also fix BatchSandbox provider to include labels and annotations in Pod template
metadata, ensuring they are passed to created Pods.
…ns propagation

Add unit tests for apply_extensions_to_annotations covering:
- Single and multiple extensions propagation
- Non-prefix keys not propagated
- Empty extensions handling
- Preservation of existing annotations

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove EXTENSIONS_ANNOTATION_PREFIX and ANNOTATION_METADATA_PREFIX imports
that were not used in the test file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@504097723 504097723 force-pushed the feat/support-k8s-labels-annotations- branch from c38dddb to 23ba097 Compare April 24, 2026 08:04
@Pangjiping Pangjiping merged commit 2a52b8f into alibaba:main Apr 25, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/server feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants