Skip to content

Conversation

ahussein3
Copy link
Contributor

@ahussein3 ahussein3 requested review from AlinaGoaga and foot October 17, 2022 13:38
@ahussein3 ahussein3 added enhancement New feature or request exclude from release notes Use this label to exclude a PR from the release notes and removed enhancement New feature or request labels Oct 17, 2022
@AlinaGoaga
Copy link
Contributor

AlinaGoaga commented Oct 19, 2022

Hey @ahussein3, the cost estimate was missing from the RenderTemplate function return that's why we were getting null. I've added a commit to fix it.

return &capiv1_proto.RenderTemplateResponse{RenderedTemplate: files.RenderedTemplate, ProfileFiles: profileFiles, KustomizationFiles: kustomizationFiles, CostEstimate: files.CostEstimate}, err

It won't be on the test clusters but if you have a local cluster you can apply the capa template manifest to that and test.

If you do ./tools/reboot.sh TILT will set up a cluster for you: wge-dev. Then do kubectl apply -f capa-template.yaml to apply the manifest to wge-dev.

To start the BE: run CAPI_CLUSTERS_NAMESPACE=default CAPI_TEMPLATES_NAMESPACE=default CAPI_TEMPLATES_REPOSITORY_URL=https://github.com/AlinaGoaga/wge-dev GIT_PROVIDER_TYPE=github GIT_PROVIDER_HOSTNAME=github.com RUNTIME_NAMESPACE=flux-system go run cmd/clusters-service/main.go (obvs replacing the REPOSITORY URL with yours). This will run on port 8000.

In another window start the frontend with PROXY_HOST=https://localhost:8000 yarn start. In any case, I've attached a screenshot here also.

Screenshot 2022-10-19 at 16 07 23

@ahussein3 ahussein3 requested a review from AlinaGoaga October 21, 2022 00:55
Copy link
Contributor

@AlinaGoaga AlinaGoaga left a comment

Choose a reason for hiding this comment

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

Thanks @ahussein3 this looks good! I've updated it with namespace in render template as the API changed a bit. I'd wait for Kevin's BE PR before merging as it's not clear to me how the data will come through (for example in the helper function we check amount !== undefined - not sure if the amount will come through as undefined though, might be null?)

@ahussein3
Copy link
Contributor Author

@AlinaGoaga as it's mentioned in the ticket the it will be either amount or range. So here if there is no amount it will be undefined. but yes we can sure merge when we see Data and Test it first. Thanks Alina

@ahussein3 ahussein3 merged commit 2efeeee into main Oct 24, 2022
@ahussein3 ahussein3 deleted the UI-1678-AddCostEstimationComponentToCreateClusterForm branch October 24, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from release notes Use this label to exclude a PR from the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] Add "Estimate cost button" to templates form
2 participants