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

aws_sdk_eks - update_nodegroup_config not working as expected #1072

Closed
MushiTheMoshi opened this issue Feb 20, 2024 · 3 comments
Closed

aws_sdk_eks - update_nodegroup_config not working as expected #1072

MushiTheMoshi opened this issue Feb 20, 2024 · 3 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@MushiTheMoshi
Copy link

Describe the bug

While running eks - update_nodegroup_config function, I get the error: error[E0639]: cannot create non-exhaustive struct using struct expression, despite the struct seems to be a non-exhaustive element

CODE

            let cmd = client
                .update_nodegroup_config()
                .cluster_name("MYCLUSTER")
                .nodegroup_name(n)
                .scaling_config(NodegroupScalingConfig{
                        min_size: Some(0),
                        max_size: Some(0),
                        desired_size: Some(0)})
                .send()
                .await
                .unwrap();

Expected Behavior

Function runs as expected

Current Behavior

it gives error

Reproduction Steps

            let config = aws_config::load_from_env().await;
            let client = EKSClient::new(&config);

            let cmd = client
                .update_nodegroup_config()
                .cluster_name("MYCLUSTER")
                .nodegroup_name(n)
                .scaling_config(NodegroupScalingConfig{
                        min_size: Some(0),
                        max_size: Some(0),
                        desired_size: Some(0)})
                .send()
                .await
                .unwrap();

Possible Solution

No response

Additional Information/Context

No response

Version

├── aws-config v1.1.5
│   ├── aws-credential-types v1.1.5
│   │   ├── aws-smithy-async v1.1.6
│   │   ├── aws-smithy-runtime-api v1.1.6
│   │   │   ├── aws-smithy-async v1.1.6 (*)
│   │   │   ├── aws-smithy-types v1.1.6
│   │   ├── aws-smithy-types v1.1.6 (*)
│   ├── aws-runtime v1.1.5
│   │   ├── aws-credential-types v1.1.5 (*)
│   │   ├── aws-sigv4 v1.1.5
│   │   │   ├── aws-credential-types v1.1.5 (*)
│   │   │   ├── aws-smithy-http v0.60.5
│   │   │   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   │   │   ├── aws-smithy-types v1.1.6 (*)
│   │   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-smithy-async v1.1.6 (*)
│   │   ├── aws-smithy-http v0.60.5 (*)
│   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-types v1.1.5
│   │   │   ├── aws-credential-types v1.1.5 (*)
│   │   │   ├── aws-smithy-async v1.1.6 (*)
│   │   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   │   ├── aws-smithy-types v1.1.6 (*)
│   ├── aws-sdk-sso v1.13.0
│   │   ├── aws-credential-types v1.1.5 (*)
│   │   ├── aws-runtime v1.1.5 (*)
│   │   ├── aws-smithy-async v1.1.6 (*)
│   │   ├── aws-smithy-http v0.60.5 (*)
│   │   ├── aws-smithy-json v0.60.5
│   │   │   └── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-smithy-runtime v1.1.6
│   │   │   ├── aws-smithy-async v1.1.6 (*)
│   │   │   ├── aws-smithy-http v0.60.5 (*)
│   │   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-types v1.1.5 (*)
│   ├── aws-sdk-ssooidc v1.13.0
│   │   ├── aws-credential-types v1.1.5 (*)
│   │   ├── aws-runtime v1.1.5 (*)
│   │   ├── aws-smithy-async v1.1.6 (*)
│   │   ├── aws-smithy-http v0.60.5 (*)
│   │   ├── aws-smithy-json v0.60.5 (*)
│   │   ├── aws-smithy-runtime v1.1.6 (*)
│   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-types v1.1.5 (*)
│   ├── aws-sdk-sts v1.13.0
│   │   ├── aws-credential-types v1.1.5 (*)
│   │   ├── aws-runtime v1.1.5 (*)
│   │   ├── aws-smithy-async v1.1.6 (*)
│   │   ├── aws-smithy-http v0.60.5 (*)
│   │   ├── aws-smithy-json v0.60.5 (*)
│   │   ├── aws-smithy-query v0.60.5
│   │   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-smithy-runtime v1.1.6 (*)
│   │   ├── aws-smithy-runtime-api v1.1.6 (*)
│   │   ├── aws-smithy-types v1.1.6 (*)
│   │   ├── aws-smithy-xml v0.60.5
│   │   ├── aws-types v1.1.5 (*)
│   ├── aws-smithy-async v1.1.6 (*)
│   ├── aws-smithy-http v0.60.5 (*)
│   ├── aws-smithy-json v0.60.5 (*)
│   ├── aws-smithy-runtime v1.1.6 (*)
│   ├── aws-smithy-runtime-api v1.1.6 (*)
│   ├── aws-smithy-types v1.1.6 (*)
│   ├── aws-types v1.1.5 (*)
├── aws-credential-types v1.1.5 (*)
├── aws-sdk-eks v1.14.0
│   ├── aws-credential-types v1.1.5 (*)
│   ├── aws-runtime v1.1.5 (*)
│   ├── aws-smithy-async v1.1.6 (*)
│   ├── aws-smithy-http v0.60.5 (*)
│   ├── aws-smithy-json v0.60.5 (*)
│   ├── aws-smithy-runtime v1.1.6 (*)
│   ├── aws-smithy-runtime-api v1.1.6 (*)
│   ├── aws-smithy-types v1.1.6 (*)
│   ├── aws-types v1.1.5 (*)
├── aws-sdk-eksauth v1.11.0
│   ├── aws-credential-types v1.1.5 (*)
│   ├── aws-runtime v1.1.5 (*)
│   ├── aws-smithy-async v1.1.6 (*)
│   ├── aws-smithy-http v0.60.5 (*)
│   ├── aws-smithy-json v0.60.5 (*)
│   ├── aws-smithy-runtime v1.1.6 (*)
│   ├── aws-smithy-runtime-api v1.1.6 (*)
│   ├── aws-smithy-types v1.1.6 (*)
│   ├── aws-types v1.1.5 (*)
├── aws-sdk-sts v0.30.0
│   ├── aws-credential-types v0.56.1
│   │   ├── aws-smithy-async v0.56.1
│   │   ├── aws-smithy-types v0.56.1
│   ├── aws-http v0.56.1
│   │   ├── aws-credential-types v0.56.1 (*)
│   │   ├── aws-smithy-http v0.56.1
│   │   │   ├── aws-smithy-types v0.56.1 (*)
│   │   ├── aws-smithy-types v0.56.1 (*)
│   │   ├── aws-types v0.56.1
│   │   │   ├── aws-credential-types v0.56.1 (*)
│   │   │   ├── aws-smithy-async v0.56.1 (*)
│   │   │   ├── aws-smithy-client v0.56.1
│   │   │   │   ├── aws-smithy-async v0.56.1 (*)
│   │   │   │   ├── aws-smithy-http v0.56.1 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.56.1
│   │   │   │   │   ├── aws-smithy-http v0.56.1 (*)
│   │   │   │   │   ├── aws-smithy-types v0.56.1 (*)
│   │   │   │   ├── aws-smithy-types v0.56.1 (*)
│   │   │   ├── aws-smithy-http v0.56.1 (*)
│   │   │   ├── aws-smithy-types v0.56.1 (*)
│   ├── aws-runtime v0.56.1
│   │   ├── aws-credential-types v0.56.1 (*)
│   │   ├── aws-http v0.56.1 (*)
│   │   ├── aws-sigv4 v0.56.1
│   │   │   ├── aws-smithy-http v0.56.1 (*)
│   │   ├── aws-smithy-async v0.56.1 (*)
│   │   ├── aws-smithy-http v0.56.1 (*)
│   │   ├── aws-smithy-runtime-api v0.56.1
│   │   │   ├── aws-smithy-async v0.56.1 (*)
│   │   │   ├── aws-smithy-http v0.56.1 (*)
│   │   │   ├── aws-smithy-types v0.56.1 (*)
│   │   ├── aws-smithy-types v0.56.1 (*)
│   │   ├── aws-types v0.56.1 (*)
│   ├── aws-smithy-async v0.56.1 (*)
│   ├── aws-smithy-client v0.56.1 (*)
│   ├── aws-smithy-http v0.56.1 (*)
│   ├── aws-smithy-json v0.56.1
│   │   └── aws-smithy-types v0.56.1 (*)
│   ├── aws-smithy-query v0.56.1
│   │   ├── aws-smithy-types v0.56.1 (*)
│   ├── aws-smithy-runtime v0.56.1
│   │   ├── aws-smithy-async v0.56.1 (*)
│   │   ├── aws-smithy-client v0.56.1 (*)
│   │   ├── aws-smithy-http v0.56.1 (*)
│   │   ├── aws-smithy-runtime-api v0.56.1 (*)
│   │   ├── aws-smithy-types v0.56.1 (*)
│   ├── aws-smithy-runtime-api v0.56.1 (*)
│   ├── aws-smithy-types v0.56.1 (*)
│   ├── aws-smithy-xml v0.56.1
│   ├── aws-types v0.56.1 (*)
├── aws-sigv4 v1.1.5 (*)
├── aws-smithy-runtime-api v1.1.6 (*)
├── aws-types v1.1.5 (*)

Environment details (OS name and version, etc.)

linux

Logs

ERROR

error[E0639]: cannot create non-exhaustive struct using struct expression                                                                                                                         --> src/main.rs:50:17                                                                                                                                                                            |                                                                                                                                                                                            50 | ...=  NodegroupScalingConfig{min_size: Some(0), max_size: Some(0), desired_size: Some(0...
@MushiTheMoshi MushiTheMoshi added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 20, 2024
@jdisanti
Copy link
Contributor

Hello,

It looks like you just need to switch over to using the builder to construct the NodegroupScalingConfig:

            let cmd = client
                .update_nodegroup_config()
                // -- snip --
                .scaling_config(
                    NodegroupScalingConfig::builder()
                        .min_size(0)
                        .max_size(0)
                        .desired_size(0)
                        .build()
                )
                // -- snip --

@MushiTheMoshi
Copy link
Author

ah! thank you so much for your quick response! it worked!

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants