-
Notifications
You must be signed in to change notification settings - Fork 30
CF-3930 : Return structured savepoint schema from create -o json/yaml to match describe/list #3396
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
Paras Negi (paras-negi-flink)
wants to merge
3
commits into
main
Choose a base branch
from
cf-3930-savepoint-create-output-shape
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
867744f
CF-3930 : Return structured savepoint schema from create -o json/yaml…
paras-negi-flink 915f25f
CF-3930 : Use nil-safe GetName in savepoint converters and add serial…
paras-negi-flink 279dcb2
[CF-3930] Extend structured savepoint output to detach; add output-va…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/fixtures/output/flink/detached-savepoint/create-savepoint-json.golden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "apiVersion": "cmf.confluent.io/v1", | ||
| "kind": "Savepoint", | ||
| "metadata": { | ||
| "name": "savepoint1", | ||
| "creationTimestamp": "2025-03-12 23:42:00 +0000 UTC", | ||
| "uid": "id1" | ||
| }, | ||
| "spec": { | ||
| "path": "abc/def", | ||
| "backoffLimit": 10, | ||
| "formatType": "Canonical" | ||
| }, | ||
| "status": { | ||
| "path": "abc/def" | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
test/fixtures/output/flink/detached-savepoint/create-savepoint-yaml.golden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| apiVersion: cmf.confluent.io/v1 | ||
| kind: Savepoint | ||
| metadata: | ||
| name: savepoint1 | ||
| creationTimestamp: 2025-03-12 23:42:00 +0000 UTC | ||
| uid: id1 | ||
| spec: | ||
| path: abc/def | ||
| backoffLimit: 10 | ||
| formatType: Canonical | ||
| status: | ||
| path: abc/def |
15 changes: 15 additions & 0 deletions
15
test/fixtures/output/flink/savepoint/create-savepoint-json.golden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "apiVersion": "cmf.confluent.io/v1", | ||
| "kind": "Savepoint", | ||
| "metadata": { | ||
| "name": "savepoint1", | ||
| "creationTimestamp": "2025-03-12 23:42:00 +0000 UTC" | ||
| }, | ||
| "spec": { | ||
| "backoffLimit": 0, | ||
| "formatType": "CANONICAL" | ||
| }, | ||
| "status": { | ||
| "path": "" | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
test/fixtures/output/flink/savepoint/create-savepoint-yaml.golden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: cmf.confluent.io/v1 | ||
| kind: Savepoint | ||
| metadata: | ||
| name: savepoint1 | ||
| creationTimestamp: 2025-03-12 23:42:00 +0000 UTC | ||
| spec: | ||
| backoffLimit: 0 | ||
| formatType: CANONICAL | ||
| status: | ||
| path: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,8 @@ func (s *CLITestSuite) TestFlinkEnvironmentDelete() { | |
| func (s *CLITestSuite) TestFlinkSavepointCreate() { | ||
| tests := []CLITest{ | ||
| {args: "flink savepoint create savepoint1 --environment default --application application1", fixture: "flink/savepoint/create-savepoint.golden"}, | ||
| {args: "flink savepoint create savepoint1 --environment default --application application1 --output json", fixture: "flink/savepoint/create-savepoint-json.golden"}, | ||
| {args: "flink savepoint create savepoint1 --environment default --application application1 --output yaml", fixture: "flink/savepoint/create-savepoint-yaml.golden"}, | ||
| {args: "flink savepoint create --environment default --application application2", fixture: "flink/savepoint/create-savepoint-no-name.golden"}, | ||
| {args: "flink savepoint create savepointS --environment default --statement test-stmt", fixture: "flink/savepoint/create-savepoint-statement.golden"}, | ||
| {args: "flink savepoint create savepointS --environment default --statement test-stmt --path abc/def --format NATIVE --backoff-limit 10", fixture: "flink/savepoint/create-savepoint-statement-values.golden"}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check if making additional |
||
|
|
@@ -184,6 +186,8 @@ func (s *CLITestSuite) TestFlinkSavepointDelete() { | |
| func (s *CLITestSuite) TestFlinkDetachedSavepointCreate() { | ||
| tests := []CLITest{ | ||
| {args: "flink detached-savepoint create savepoint1 --path abc/def", fixture: "flink/detached-savepoint/create-savepoint.golden"}, | ||
| {args: "flink detached-savepoint create savepoint1 --path abc/def --output json", fixture: "flink/detached-savepoint/create-savepoint-json.golden"}, | ||
| {args: "flink detached-savepoint create savepoint1 --path abc/def --output yaml", fixture: "flink/detached-savepoint/create-savepoint-yaml.golden"}, | ||
| {args: "flink detached-savepoint create savepoint1", fixture: "flink/detached-savepoint/create-savepoint-nopath.golden", exitCode: 1}, | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check if the
nilcheck can be handled elegantly using the SDK in some way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is handled by the SDK's own getter. Both converters now use
sdkSavepoint.Metadata.GetName(), and GetName() is nil-safe