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

feat: add support for custom and auto agent size #272

Merged
merged 18 commits into from
Dec 17, 2024
Merged

feat: add support for custom and auto agent size #272

merged 18 commits into from
Dec 17, 2024

Conversation

hanxiaop
Copy link
Contributor

Fixes #259

@@ -152,7 +152,9 @@ Required:
Optional:

- `app_replication` (Boolean) Enables Argo CD state replication to the managed cluster that allows disconnecting the cluster from Akuity Platform without losing core Argocd features
- `auto_agent_size_config` (Attributes) Autoscaler config for auto agent size (see [below for nested schema](#nestedatt--spec--data--auto_agent_size_config))
Copy link
Member

Choose a reason for hiding this comment

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

@@ -0,0 +1,50 @@
data "akp_instance" "example" {
Copy link
Member

Choose a reason for hiding this comment

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

let's modify the template to include this and custom agent size example in the generated docs. We can just add them after here: https://github.com/akuity/terraform-provider-akp/blob/main/templates/resources/cluster.md.tmpl#L14-L20

@junzebao
Copy link

junzebao commented Dec 12, 2024

one nitpick: I would use memory instead of mem like how UI shows it.

@hanxiaop
Copy link
Contributor Author

hanxiaop commented Dec 13, 2024

one nitpick: I would use memory instead of mem like how UI shows it.

@junzebao Thank you! Fixed.


func getResourcesDataSourceAttributes() map[string]schema.Attribute {
return map[string]schema.Attribute{
"mem": schema.StringAttribute{
Copy link
Member

@jiachengxu jiachengxu Dec 13, 2024

Choose a reason for hiding this comment

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

based on @junzebao 's comment, this also needs to be "memory“?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised. Was only revised custom agent size config, and now I've also revised auto agent size config. Thank you!

@@ -275,6 +276,9 @@ func buildClusterApplyRequest(ctx context.Context, diagnostics *diag.Diagnostics
func buildClusters(ctx context.Context, diagnostics *diag.Diagnostics, cluster *types.Cluster) []*structpb.Struct {
var cs []*structpb.Struct
apiCluster := cluster.ToClusterAPIModel(ctx, diagnostics)
if diagnostics.HasError() {
Copy link
Member

Choose a reason for hiding this comment

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

what is the reason that we ignore the error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jiachengxu This doesn't ignore error but rather exits early when having errors, for example input validation error. And then the diagnostic errors will be reported to users.

@hanxiaop hanxiaop requested a review from jiachengxu December 13, 2024 05:12
@hanxiaop hanxiaop merged commit e5fd5f1 into main Dec 17, 2024
7 checks passed
@hanxiaop hanxiaop deleted the autoscaler branch December 17, 2024 07:58
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.

Custom agent size support in terraform
3 participants