Skip to content

Specify context in all microcluster methods#105

Merged
masnax merged 6 commits into
canonical:mainfrom
neoaggelos:feat/microcluster-app-context
Apr 18, 2024
Merged

Specify context in all microcluster methods#105
masnax merged 6 commits into
canonical:mainfrom
neoaggelos:feat/microcluster-app-context

Conversation

@neoaggelos
Copy link
Copy Markdown
Contributor

Summary

  • Remove context from *microcluster.MicroCluster struct
  • Pass context during (*MicroCluster).Start, not during creation
  • Update all (*MicroCluster) methods to accept a context and use that instead
  • Update microctl for new API, use cmd.Context() instead of context.Background()
  • Update microd for new API, use cmd.Context() instead of context.Background()

Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
@neoaggelos neoaggelos force-pushed the feat/microcluster-app-context branch from f55f80d to d4fc493 Compare April 15, 2024 15:50
masnax
masnax previously approved these changes Apr 15, 2024
Copy link
Copy Markdown
Contributor

@masnax masnax left a comment

Choose a reason for hiding this comment

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

Excellent, thanks so much for this :)

Copy link
Copy Markdown
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

Thanks, just one remark on the Ready() function.

Comment thread microcluster/app.go Outdated
Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
@neoaggelos neoaggelos force-pushed the feat/microcluster-app-context branch from a8f317d to 763315c Compare April 16, 2024 12:09
@neoaggelos
Copy link
Copy Markdown
Contributor Author

Force pushed because of missing signed-off-by in the new commits

roosterfish
roosterfish previously approved these changes Apr 16, 2024
Copy link
Copy Markdown
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread example/cmd/microctl/waitready.go Outdated
Copy link
Copy Markdown
Contributor

@markylaing markylaing left a comment

Choose a reason for hiding this comment

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

Just one nit :)

Copy link
Copy Markdown
Contributor

@markylaing markylaing left a comment

Choose a reason for hiding this comment

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

Hi @neoaggelos sorry to nitpick, we try to keep a linear git history to make cherry-picking easier when maintaining snap channels. Can you please amend the commit which changed the flag to a duration rather than adding a new one? Thanks.

Comment thread example/cmd/microctl/waitready.go
Signed-off-by: Angelos Kolaitis <angelos.kolaitis@canonical.com>
@neoaggelos neoaggelos force-pushed the feat/microcluster-app-context branch from c89b955 to 1c6c067 Compare April 16, 2024 14:41
@neoaggelos neoaggelos requested a review from markylaing April 16, 2024 14:41
Copy link
Copy Markdown
Contributor

@roosterfish roosterfish left a comment

Choose a reason for hiding this comment

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

I understand the commit for changing the flag's type is gone and instead you went with the approach suggested by @markylaing.

@masnax masnax dismissed markylaing’s stale review April 18, 2024 16:19

Dismissing as comments have been addressed.

Copy link
Copy Markdown
Contributor

@masnax masnax left a comment

Choose a reason for hiding this comment

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

Overall, this looks good to me so I'll be merging it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants