Bump cmf-sdk-go v0.0.5 to v0.0.6 and fix breaking changes#3320
Bump cmf-sdk-go v0.0.5 to v0.0.6 and fix breaking changes#3320Paras Negi (paras-negi-flink) wants to merge 4 commits intomainfrom
Conversation
ComputePool.Status changed from *ComputePoolStatus to
*map[string]map[string]interface{} and PostEnvironment.Name changed
from string to *string. This updates all call sites to use SDK
getters/setters, adds extractComputePoolPhase() helper for the
generic status map, adds empty-name guards to environment create/update,
and updates test handler and golden files accordingly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Updates the CLI to accommodate breaking changes introduced in cmf-sdk-go v0.0.6, specifically around PostEnvironment.Name becoming a pointer and ComputePool.Status becoming a generic nested map. This keeps on-prem Flink environment and compute-pool commands working and aligns test fixtures with the updated API shapes.
Changes:
- Bump
github.com/confluentinc/cmf-sdk-gofromv0.0.5tov0.0.6(go.mod/go.sum). - Update environment create/update to use SDK getters/setters and add empty-name validation in the CMF REST client.
- Add
extractComputePoolPhase()to read compute pool phase from the new generic status map, and update on-prem compute-pool commands + test server + golden fixtures accordingly.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/flink/cmf_rest_client.go |
Uses PostEnvironment.GetName() and validates non-empty environment names for create/update. |
internal/flink/command_environment_create.go |
Uses postEnvironment.SetName() to match pointer-based SDK field. |
internal/flink/command_environment_update.go |
Uses postEnvironment.SetName() to match pointer-based SDK field. |
internal/flink/command_compute_pool.go |
Adds extractComputePoolPhase() and updates compute-pool serialization to use it. |
internal/flink/command_compute_pool_list_onprem.go |
Uses extractComputePoolPhase() for list output. |
internal/flink/command_compute_pool_describe_onprem.go |
Uses extractComputePoolPhase() for describe output. |
internal/flink/command_compute_pool_create_onprem.go |
Uses extractComputePoolPhase() for create output. |
test/test-server/flink_onprem_handler.go |
Updates compute-pool and environment handlers to emit/consume new SDK shapes. |
test/fixtures/output/flink/compute-pool/list-json.golden |
Updates expected JSON (clusterSpec now {} instead of null). |
test/fixtures/output/flink/compute-pool/describe-success-json.golden |
Updates expected JSON (clusterSpec now {} instead of null). |
go.mod |
Bumps cmf-sdk-go dependency version. |
go.sum |
Updates checksums for cmf-sdk-go v0.0.6. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The JSON marshal/unmarshal fallback path can never succeed given the SDK
type map[string]map[string]interface{} — marshaling always produces
nested objects which cannot unmarshal into map[string]string. Remove the
unreachable code and stderr warnings to keep the function side-effect free.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SDK v0.0.6 types ComputePool.Status as *map[string]map[string]interface{}
but the API returns a flat object like {"phase":"RUNNING"}, causing the
SDK's Execute() to fail on valid 200 responses. Add fallback helpers that
re-parse the buffered response body when this occurs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|




ComputePool.Status changed from *ComputePoolStatus to *map[string]map[string]interface{} and PostEnvironment.Name changed from string to *string. The SDK's Execute() conveniently re-buffers the response body before returning. We add a fallback in ListComputePools, DescribeComputePool, and CreateComputePool: when the SDK returns an error but the HTTP status is 2xx, we re-read the buffered body and parse it ourselves using json.RawMessage to intercept the status field. We extract the phase and encode it into the nested map format that the downstream extractComputePoolPhase expects.
Release Notes
Breaking Changes
New Features
Bug Fixes
Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Blast Radius
Scope is limited to on-prem Flink compute pool and environment commands; Confluent Cloud commands (which use ccloud-sdk-go-v2, not cmf-sdk-go) are completely unaffected.
References
Tests