-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add release channel support for pulsar cluster #44
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e76e42a
feat: add release channel support for pulsar cluster
urfreespace 03ff5c4
update
urfreespace 0418880
update
urfreespace 958c5ee
update
urfreespace 10df243
update
urfreespace 836ce1a
update
urfreespace dbb188b
updatee
urfreespace 7f1aa0c
update
urfreespace 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 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 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 |
---|---|---|
|
@@ -84,6 +84,13 @@ func resourcePulsarCluster() *schema.Resource { | |
Description: descriptions["location"], | ||
ValidateFunc: validateNotBlank, | ||
}, | ||
"release_channel": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "rapid", | ||
Description: descriptions["release_channel"], | ||
ValidateFunc: validateNotBlank, | ||
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. Maybe you can add a function 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. fixed, thanks. |
||
}, | ||
"bookie_replicas": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
|
@@ -232,6 +239,7 @@ func resourcePulsarClusterCreate(ctx context.Context, d *schema.ResourceData, me | |
name := d.Get("name").(string) | ||
instanceName := d.Get("instance_name").(string) | ||
location := d.Get("location").(string) | ||
releaseChannel := d.Get("release_channel").(string) | ||
bookieReplicas := int32(d.Get("bookie_replicas").(int)) | ||
brokerReplicas := int32(d.Get("broker_replicas").(int)) | ||
computeUnit := d.Get("compute_unit").(float64) | ||
|
@@ -272,8 +280,9 @@ func resourcePulsarClusterCreate(ctx context.Context, d *schema.ResourceData, me | |
Namespace: namespace, | ||
}, | ||
Spec: cloudv1alpha1.PulsarClusterSpec{ | ||
InstanceName: instanceName, | ||
Location: location, | ||
InstanceName: instanceName, | ||
Location: location, | ||
ReleaseChannel: releaseChannel, | ||
BookKeeper: &cloudv1alpha1.BookKeeper{ | ||
Replicas: &bookieReplicas, | ||
Resources: &cloudv1alpha1.BookkeeperNodeResource{ | ||
|
@@ -375,6 +384,10 @@ func resourcePulsarClusterRead(ctx context.Context, d *schema.ResourceData, meta | |
_ = d.Set("pulsar_version", brokerImage[1]) | ||
bookkeeperImage := strings.Split(pulsarCluster.Spec.BookKeeper.Image, ":") | ||
_ = d.Set("bookkeeper_version", bookkeeperImage[1]) | ||
releaseChannel := pulsarCluster.Spec.ReleaseChannel | ||
if releaseChannel != "" { | ||
_ = d.Set("release_channel", releaseChannel) | ||
} | ||
d.SetId(fmt.Sprintf("%s/%s", pulsarCluster.Namespace, pulsarCluster.Name)) | ||
return nil | ||
} | ||
|
@@ -396,6 +409,10 @@ func resourcePulsarClusterUpdate(ctx context.Context, d *schema.ResourceData, me | |
return diag.FromErr(fmt.Errorf("ERROR_UPDATE_PULSAR_CLUSTER: " + | ||
"The pulsar cluster location does not support updates")) | ||
} | ||
if d.HasChange("release_channel") { | ||
return diag.FromErr(fmt.Errorf("ERROR_UPDATE_PULSAR_CLUSTER: " + | ||
"The pulsar cluster release channel does not support updates")) | ||
} | ||
namespace := d.Get("organization").(string) | ||
name := d.Get("name").(string) | ||
clientSet, err := getClientSet(getFactoryFromMeta(meta)) | ||
|
This file contains 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 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
Oops, something went wrong.
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.
Is the rapid channel used by default?
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.
yes, on UI also uses the rapid as default
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.
yes, keep consistent with console UI