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

fix/disable-vertex-search #73

Merged

Conversation

hui-zheng
Copy link
Contributor

SUMMARY

this PR fixes a bug when apply terraform with vertex_serach disabled.

PROBLEM

When run terraform plan/apply with the following vars to disable Vertex_search

vertex_search = {
  enabled      = false
  ...
}

an error is thrown


│ Error: Invalid function argument
│
│   on main.tf line 69, in module "function":
│   69:   config = templatefile("${path.module}/slack-bot.yaml", merge({
│   70:     slack_token   = var.slack_token
│   71:     slack_app_id  = var.slack_app_id
│   72:     vertex_region = var.vertex_region
│   73:     vertex_model  = var.vertex_search.enabled == false ? var.vertex_model : var.vertex_model_multimodal
│   74:     api_enabled   = false
│   75:     }, var.vertex_search.enabled == true ? {
│   76:     api_enabled            = true
│   77:     vertex_search_function = module.api[""].run_service.url
│   78:   } : {}))
│     ├────────────────
│     │ while calling templatefile(path, vars)
│     │ module.api is object with no attributes
│     │ var.slack_app_id is "AxxxU"
│     │ var.slack_token is "xxxxXy"
│     │ var.vertex_model is "gemini-1.5-pro-preview-0409"
│     │ var.vertex_model_multimodal is "gemini-1.5-pro-preview-0409"
│     │ var.vertex_region is "uxxxl1"
│     │ var.vertex_search.enabled is false
│
│ Invalid value for "vars" parameter: vars map does not contain key "vertex_search_function", referenced at ./slack-bot.yaml:138,19-41.
╵

the issue is shown in the last line

vars map does not contain key "vertex_search_function", referenced at ./slack-bot.yaml:138,19-41.

FIX

add a default vertex_search_function value in terraform main

Copy link

google-cla bot commented May 8, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@rosmo rosmo left a comment

Choose a reason for hiding this comment

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

LGTM

@rosmo rosmo merged commit d3e8ccd into GoogleCloudPlatform:main May 9, 2024
4 checks passed
@hui-zheng hui-zheng deleted the fix/disable-vertex-search branch May 10, 2024 03:32
rosmo pushed a commit that referenced this pull request Sep 19, 2024
rosmo added a commit that referenced this pull request Sep 19, 2024
* Bump idna from 3.4 to 3.7

Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](kjd/idna@v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix (#73)

* --- (#74)

updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add possibility to disable TLS verify in Docker processor.

* Fix Python getaddresses changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hui Zheng <[email protected]>
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