-
Notifications
You must be signed in to change notification settings - Fork 53
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
Adding API calls to create a Fleet #1160
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
const client = new ContainerServiceFleetClient(getCredential(sessionProvider.result), subscriptionId); | ||
createFleet(client, "junyuqian", "vscode-fleet", { location: "Australia East" }); |
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.
Since the scope of this PR is now so much smaller, can we make a user-input right away?
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.
@Tatsinnit I'll leave it to you. I don't know how much complexity that would add. fine to merge and deal with it 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.
Indeed. Nice idea, It is not that complicated, in the earlier version demo shared, it was all flowing through the quickpick
et. al.
Since it's all backend, and anonymised - lets either at least make clear //TODO Comment please here for anyone else trying to understand why this createFleet
function is trying to do here, in case of folks want to help.
Future PR note: Also, from U/X we should make it simple pass it on from the web view of just quick pick kind of thing.
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 what I would do to make sure this is basically super early stage work and really avoid the hard-coded bits: :)
// Temporary code for incremental check-in.
// TODO: Replace hardcoded values with dynamic parameters or configuration settings.
// Initialize the ContainerServiceFleetClient with session credentials and subscription ID.
// Hardcoded 'subscriptionId' should be parameterized in future updates.
const client = new ContainerServiceFleetClient(
getCredential(sessionProvider.result), // Retrieve credentials from session provider.
subscriptionId // TODO: Ensure subscriptionId is dynamically passed or configured.
);
// Create a fleet using hardcoded parameters.
// TODO: Replace hardcoded 'junyuqian', 'vscode-fleet', and 'Australia East' with configurable inputs.
createFleet(
client,
"Fleet-Resrource-Name", // Fleet resource group name (hardcoded).
"Fleet-Name", // Fleet name (hardcoded).
{ location: "Australia East" } // Location (hardcoded).
);
// NOTE: This temporary implementation assumes static context for testing purposes.
// Ensure these hardcoded values are replaced with appropriate dynamic configurations
// before finalizing this code for production level work which will be user focused.
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.
Thank you so much Tats! It's so pleasant to read your code with all these neat comments! This will be the standard I'll align to when I write explanatory comments later :)
package.json
Outdated
@@ -331,6 +331,10 @@ | |||
{ | |||
"command": "aks.aksKaitoTest", | |||
"title": "Test KAITO models" | |||
}, | |||
{ | |||
"command": "aks.aksCreateFleet", |
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.
Might be better to remove these command/title changes from the PR (since they're related to the menu, not the API), and leave only the new package on line 646.
package.json
Outdated
@@ -541,6 +549,12 @@ | |||
"command": "aks.aksReconcileCluster", | |||
"group": "navigation" | |||
} | |||
], | |||
"aks.fleetMangerSubMenu": [ |
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.
💡Note please: I thought you are not hooking the command yet. and this is backend only kind of PR?
package.json
Outdated
@@ -442,6 +446,10 @@ | |||
"submenu": "aks.kaitoInstallSubMenu", | |||
"when": "view == kubernetes.cloudExplorer && viewItem =~ /aks\\.cluster/i", | |||
"group": "9@3" | |||
}, | |||
{ | |||
"submenu": "aks.fleetMangerSubMenu", |
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.
💡 Please note: same goes here, as a reference to this comment: https://github.com/Azure/vscode-aks-tools/pull/1160/files#r1906207748
I thought you are just adding backend code for now and classes and there submenu hooks are not needed?
package.json
Outdated
}, | ||
{ | ||
"command": "aks.aksCreateFleet", | ||
"title": "Create Fleet" |
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.
💡 Please note: Why do we need this with this checkin please? I think this change is not needed for this PR, only thing you need is the @azure/arm-containerservicefleet": "^1.1.0
which will get your supporting backend changes working. Please do correct me or add thoughts.
Hi @Tatsinnit @serbrech @dvadas, thank you all for your comments! All the problems have been addressed and please let me know if there is anything I can improve :) |
// TODO: Replace hardcoded 'junyuqian', 'vscode-fleet', and 'Australia East' with configurable inputs. | ||
createFleet( | ||
client, | ||
"Fleet-Resrource-Name", // Fleet resource group name (hardcoded). |
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.
💡 Minor: Please take care in the latter PR, spelling Fleet-Resource-Name
rather then Fleet-Resrource-Name
:) Thanks.
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.
Good work so far! It looks like your commits are unsigned so you might have some difficulty when you go to merge your PR. You'll likely need to generate a new GPG key and resign your commits. I dealt with this same issue recently, so if you have any questions feel free to reach out! |
This is the initial pull request, implementing the API call for fleet creation and the callback function triggered by the user’s right-click on the ‘Create Fleet’ button.
The entry point (the ‘Create Fleet’ button) for this function is not yet available in the UI. This ensures that users will not encounter features still under development, enabling seamless and incremental integrations.