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 several bugs regarding the module variables #171

Merged
merged 4 commits into from
Aug 31, 2023

Conversation

acolver
Copy link
Collaborator

@acolver acolver commented Aug 29, 2023

No description provided.

@github-actions
Copy link
Contributor

Thank you for raising the request! RAD Lab admins have been notified.

@github-actions
Copy link
Contributor

Apache 2.0 License check successful!

Copy link
Collaborator

@guptamukul-google guptamukul-google left a comment

Choose a reason for hiding this comment

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

Left a comment to clarify. Most of it is functionality so we can test it when its pushed to staging.

@@ -62,6 +62,13 @@ const MapField: React.FC<MapField> = ({ variable, validate }) => {
{(FieldArrayProps) => {
const { form } = FieldArrayProps
const { values } = form
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we set variable value to empty dictionary in UI when the variable default value in terraform is undefined/null/"" - Correct me if I am wrong ?

What happens when the module is submitted will the terraform.tfvars file will have {} as the value or the actual values like - undefined/null/"" ? The reason why we need this is terraform variables are also case sensitive therefore {} might not work in all cases.

Copy link
Collaborator Author

@acolver acolver Aug 30, 2023

Choose a reason for hiding this comment

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

It's coming as {}

Example: See billing_budget_labels below:

{
  "zone": "asia-northeast1-a",
  "organization_id": "348671237177",
  "billing_account_id": "019CE6-3B2BED-9DA554",
  "folder_id": "folders/411211453280",
  "region": "us-central1",
  "set_shielded_vm_policy": false,
  "billing_budget_notification_email_addresses": [
    "acolver@google.com"
  ],
  "billing_budget_alert_spend_basis": "CURRENT_SPEND",
  "billing_budget_credit_types_treatment": "INCLUDE_ALL_CREDITS",
  "set_domain_restricted_sharing_policy": false,
  "billing_budget_alert_spent_percents": [
    0.5,
    0.7,
    1
  ],
  "billing_budget_amount_currency_code": "USD",
  "create_budget": true,
  "set_external_ip_policy": false,
  "billing_budget_amount": 500,
  "billing_budget_services": [],
  "billing_budget_labels": {},
  "billing_budget_calendar_period": "MONTH",
  "billing_budget_pubsub_topic": false,
  "create_project": true,
  "enable_services": true,
  "owner_groups": [],
  "owner_users": [],
  "project_id_prefix": "radlab-billing-budget",
  "trusted_groups": [],
  "trusted_users": [
    "acolver@sakunchala.altostrat.com"
  ],
  "create_network": false,
  "ip_cidr_range": "10.142.190.0/24",
  "network_name": "radlab-network",
  "subnet_name": "radlab-subnet",
  "create_vm": false,
  "deployment_id": "4ea5"
}

Copy link
Collaborator

@guptamukul-google guptamukul-google Aug 30, 2023

Choose a reason for hiding this comment

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

billing_budget_labels themselves have default value of {} in terraform variables.tf so that is expected.

billing_budget_services which is set to null in variables.tf is correctly set to [] based on the field type

Also another variable called resource_creator_identity which has default value of "" I don't see that in above example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That said, Billing Budget module did deploy successfully

Copy link
Collaborator

@guptamukul-google guptamukul-google left a comment

Choose a reason for hiding this comment

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

Need some details on the the const variables.

Copy link
Collaborator

@guptamukul-google guptamukul-google left a comment

Choose a reason for hiding this comment

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

LGTM discussed offline. good to merge.

@acolver acolver merged commit 21e4217 into staging Aug 31, 2023
7 checks passed
@acolver acolver deleted the fix/module-variable-issues branch August 31, 2023 18:08
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