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

Errors when building generated main.go #113

Open
amalic opened this issue Apr 25, 2022 · 0 comments
Open

Errors when building generated main.go #113

amalic opened this issue Apr 25, 2022 · 0 comments

Comments

@amalic
Copy link
Contributor

amalic commented Apr 25, 2022

Dislaimer: I come from JavaLand. Applolgies if I am reporting something that would be easy to solve for people living in GoLand.

I am trying out NAML to cofify an existing deployment

  1. I exported our deployment to yaml first via kubectl get all -n <my_namespace> -o yaml | tee out/all.yaml which resulted in a yaml file with 24031 lines
  2. Then I switched to the out folder and converted it to go via cat all.yaml | naml codify > main.go which resulted in a go file with 26986 lines
  3. Now that I tried go build main.go I am getting following errors
> naml build -o app
2022-04-25T11:14:16+02:00 [Warning   ]  ⚠ naml build alpha feature ⚠
2022-04-25T11:14:16+02:00 [Warning   ]  if this is a feature you plan on using please make your use case known in the issue tracker
2022-04-25T11:14:16+02:00 [Warning   ]  ⚠ naml build alpha feature ⚠
2022-04-25T11:14:17+02:00 [Critical  ]  unable to build NAML binary from source: 

+-------------------------+---------------------------------
| Codify Compile Failure  |
+-------------------------+
| 
| 
| # command-line-arguments
/tmp/3648555560.go:171:9: unknown field 'i' in struct literal of type resource.Quantity
/tmp/3648555560.go:171:21: int64Amount not exported by package resource
/tmp/3648555560.go:172:10: unknown field 'value' in struct literal of type resource.int64Amount
/tmp/3648555560.go:173:10: unknown field 'scale' in struct literal of type resource.int64Amount
/tmp/3648555560.go:175:9: unknown field 's' in struct literal of type resource.Quantity
/tmp/3648555560.go:179:9: unknown field 'i' in struct literal of type resource.Quantity
/tmp/3648555560.go:179:26: int64Amount not exported by package resource
/tmp/3648555560.go:179:38: unknown field 'value' in struct literal of type resource.int64Amount
/tmp/3648555560.go:180:9: unknown field 's' in struct literal of type resource.Quantity
/tmp/3648555560.go:186:21: int64Amount not exported by package resource
/tmp/3648555560.go:186:21: too many errors
+----------------------------------------------------------

Another thing that was quite strange to me was that NAML generated properties like NodeName: with the node a certain pod is currently running on. Haven't looked further but my gut feeling tells me that it generates code for pods resulting from staeful/daemon/replica-sets which doesn't feel right.

@amalic amalic changed the title Errors building resulting main.go Errors when building main.go Apr 25, 2022
@amalic amalic changed the title Errors when building main.go Errors when building generated main.go Apr 25, 2022
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

No branches or pull requests

1 participant