Skip to content

Propagate Kubernetes reconciliation context into mapt calls and upgrade mapt library#2

Draft
jangel97 wants to merge 1 commit into
mapt-oss:mainfrom
jangel97:feat/add-context-propagation
Draft

Propagate Kubernetes reconciliation context into mapt calls and upgrade mapt library#2
jangel97 wants to merge 1 commit into
mapt-oss:mainfrom
jangel97:feat/add-context-propagation

Conversation

@jangel97

@jangel97 jangel97 commented Dec 5, 2025

Copy link
Copy Markdown

Propagate Kubernetes reconciliation context through to mapt library calls to enable proper cancellation and timeout handling for cluster provisioning operations.

Additionally, upgrade mapt library to latest version (cd3e65f621c8) which introduced breaking API changes that required updates to provisioner code.

Changes:

  • Update GenericMaptProvisioner interface to accept context.Context
  • Update KindProvisioner and OpenshiftProvisioner interfaces
  • Pass Kubernetes context from adapters to provisioners
  • Propagate context to mapt ContextArgs for all Create/Destroy operations
  • Upgrade mapt library and adapt to new API:
    • Move SpotPriceIncreaseRate from ContextArgs to SpotArgs
    • Update to use utilKind.KindK8sVersions and utilKind.KindArgs
    • Handle pointer return types in metadata structs
    • Update test mocks with context parameter

This enables:

  • Graceful cancellation when operator pod is deleted
  • Respect for Kubernetes reconciliation timeouts
  • Proper resource cleanup on cancelled operations
  • Distributed tracing support (future)

Context flow: K8s Reconcile → Adapter → Provisioner → mapt.Init → Pulumi/AWS SDK

Propagate Kubernetes reconciliation context through to mapt library calls
to enable proper cancellation and timeout handling for cluster provisioning
operations.

Additionally, upgrade mapt library to latest version (cd3e65f621c8) which
introduced breaking API changes that required updates to provisioner code.

Changes:
- Update GenericMaptProvisioner interface to accept context.Context
- Update KindProvisioner and OpenshiftProvisioner interfaces
- Pass Kubernetes context from adapters to provisioners
- Propagate context to mapt ContextArgs for all Create/Destroy operations
- Upgrade mapt library and adapt to new API:
  - Move SpotPriceIncreaseRate from ContextArgs to SpotArgs
  - Update to use utilKind.KindK8sVersions and utilKind.KindArgs
  - Handle pointer return types in metadata structs
  - Update test mocks with context parameter

This enables:
- Graceful cancellation when operator pod is deleted
- Respect for Kubernetes reconciliation timeouts
- Proper resource cleanup on cancelled operations
- Distributed tracing support (future)

Context flow: K8s Reconcile → Adapter → Provisioner → mapt.Init → Pulumi/AWS SDK
@jangel97 jangel97 force-pushed the feat/add-context-propagation branch from bd3ea89 to e8ba0fd Compare December 5, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant