Skip to content
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

better streamline plural up --cloud #566

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

zreigz
Copy link
Member

@zreigz zreigz commented Oct 7, 2024

Summary

  • replace the cluster name field with querying all the console instances for a user, using a select to choose the one they want to use, and use that name for the cluster name

  • no longer ask for the az spread (just chose one as a default and ignore)

  • make the bucket prefix automatically plrl-cloud-${name}.

Labels

Test Plan

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • I have added relevant labels to this PR to help with categorization for release notes.

@zreigz zreigz added the enhancement New feature or request label Oct 7, 2024
Copy link
Member

@michaeljguarino michaeljguarino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a few small nits


func getCluster(cd *cd.Plural) (id string, name string, err error) {
if cd == nil {
return "", "", fmt.Errorf("please provide a plural client")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should change this error message to something like:

You're cli is not logged into Plural, try running `plural login` to generate local credentials.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -118,19 +118,12 @@ func (p *Plural) cdClusterCommands() []cli.Command {
}

func (p *Plural) handleListClusters(_ *cli.Context) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually does work, but we can also use the consoleInstances query, which just selects Plural cloud clusters.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched the whole schema.graphql and couldn't find this query

@@ -159,17 +159,20 @@ func getEC2Client(ctx context.Context, region string) (*ec2.Client, error) {
}

// TODO: during Plural init we should ask the user to choose which AZs they want to use (first 3, random, manual, look at how CAPA does that). There should be a minimum limit of 3.
func getAvailabilityZones(ctx context.Context, region string) ([]string, error) {
func getAvailabilityZones(ctx context.Context, region string, cloudFlag bool) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just have this default to first3 entirely? It's not piped into plural up at all so is actually irrelevant at the moment. Was only for CAPI if i remember

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@zreigz
Copy link
Member Author

zreigz commented Oct 8, 2024

@michaeljguarino PTAL

@michaeljguarino michaeljguarino merged commit 1081c79 into main Oct 8, 2024
10 checks passed
@michaeljguarino michaeljguarino deleted the plural-up-cloud branch October 8, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants