Skip to content

internet gateway support#853

Merged
ahl merged 2 commits into
mainfrom
igw
Oct 2, 2024
Merged

internet gateway support#853
ahl merged 2 commits into
mainfrom
igw

Conversation

@rcgoodfellow

Copy link
Copy Markdown
Contributor

@rcgoodfellow

rcgoodfellow commented Sep 29, 2024

Copy link
Copy Markdown
Contributor Author

Something odd is going on here. I had to do the following to get the generated code for internet-gateway ip-pool attach to work

diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs
index 6a37e0f..f2d84e1 100644
--- a/cli/src/generated_cli.rs
+++ b/cli/src/generated_cli.rs
@@ -8788,7 +8788,8 @@ impl<T: CliConfig> Cli<T> {
         }

         if let Some(value) = matches.get_one::<types::NameOrId>("gateway") {
-            request = request.body_map(|body| body.gateway(value.clone()))
+            request = request.body_map(|body| body.gateway(value.clone()));
+            request = request.gateway(value.clone())
         }

         if let Some(value) = matches.get_one::<types::NameOrId>("ip-pool") {

Otherwise I get the following

$ oxide internet-gateway ip-pool attach  \
  --gateway sv2 \
  --project 'test' \
  --vpc default \
  --ip-pool sv2 \
  --name sv2 \
  --description 'asdf'
error
Invalid Request: gateway was not initialized

@rcgoodfellow rcgoodfellow marked this pull request as ready for review September 30, 2024 05:07
@rcgoodfellow rcgoodfellow requested a review from ahl September 30, 2024 05:07
@ahl ahl merged commit d075bb7 into main Oct 2, 2024
@ahl ahl deleted the igw branch October 2, 2024 21:03
@ahl

ahl commented Oct 2, 2024

Copy link
Copy Markdown
Collaborator

That's a huge problem. I'll investigate async

@ahl

ahl commented Oct 2, 2024

Copy link
Copy Markdown
Collaborator

And I'm amazed that CI passed.

@ahl

ahl commented Oct 2, 2024

Copy link
Copy Markdown
Collaborator

Something odd is going on here. I had to do the following to get the generated code for internet-gateway ip-pool attach to work

This is a bug in progenitor. In this case we have both a query parameter and a top-level body field named gateway. In such a case, I would expect either for generation to fail or to generate a CLI parameter that corresponded to the query parameter with the --json-body parameter being mandatory (i.e. because that's the only way to specify that mandatory value).

I think this is also reflective of a problem with oxidecomputer/omicron#6475 in that it seems unlikely that we want to specify the target gateway in two places with possibly different values.

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.

2 participants