Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Cannot generate provider crds #306

Open
IvanTurgenev1 opened this issue Oct 19, 2022 · 2 comments
Open

Cannot generate provider crds #306

IvanTurgenev1 opened this issue Oct 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@IvanTurgenev1
Copy link

IvanTurgenev1 commented Oct 19, 2022

What happened?

I'm trying to generate CRDS with make generate with custom provider

cannot generate crd for resource lb_instance: cannot build types for Instance: cannot build the Types: cannot infer type from schema of field listeners: invalid schema type TypeInvalid

there is my json schema:

              "listeners": {
                "nested_type": {
                  "attributes": {
                    "connection_limit": {
                      "type": "number",
                      "description_kind": "plain",
                      "required": true
                    },
                    "description": {
                      "type": "string",
                      "description_kind": "plain",
                      "computed": true
                    },
                    "headers": {
                      "nested_type": {
                        "attributes": {
                          "x_forwarded_for": {
                            "type": "bool",
                            "description_kind": "plain",
                            "optional": true
                          },
                          "x_forwarded_port": {
                            "type": "bool",
                            "description_kind": "plain",
                            "optional": true
                          },
                          "x_forwarded_proto": {
                            "type": "bool",
                            "description_kind": "plain",
                            "optional": true
                          }
                        },
                        "nesting_mode": "single"
                      },
                      "description_kind": "plain",
                      "optional": true
                    },
                    "id": {
                      "type": "string",
                      "description_kind": "plain",
                      "computed": true
                    },
                    "name": {
                      "type": "string",
                      "description": "displayed name",
                      "description_kind": "plain",
                      "required": true
                    },
                    "pool": {
                      "nested_type": {
                        "attributes": {
                          "algorithm": {
                            "type": "string",
                            "description": "\"LEAST_CONNECTIONS\", \"ROUND_ROBIN\", \"SOURCE_IP\"",
                            "description_kind": "plain",
                            "required": true
                          },
                          "description": {
                            "type": "string",
                            "description_kind": "plain",
                            "computed": true
                          },
                          "id": {
                            "type": "string",
                            "description_kind": "plain",
                            "computed": true
                          },
                          "members": {
                            "nested_type": {
                              "attributes": {
                                "address": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "backup": {
                                  "type": "bool",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "monitor_address": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "optional": true
                                },
                                "monitor_port": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "optional": true
                                },
                                "name": {
                                  "type": "string",
                                  "description": "name of the existed instance",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "network_name": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "port": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "weight": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                }
                              },
                              "nesting_mode": "list"
                            },
                            "description_kind": "plain",
                            "required": true
                          },
                          "monitor": {
                            "nested_type": {
                              "attributes": {
                                "delay": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "expected_codes": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "optional": true
                                },
                                "id": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "computed": true
                                },
                                "max_retries": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "max_retries_down": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "name": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "optional": true
                                },
                                "timeout": {
                                  "type": "number",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "type": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "required": true
                                },
                                "url_path": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "optional": true
                                }
                              },
                              "nesting_mode": "single"
                            },
                            "description_kind": "plain",
                            "optional": true
                          },
                          "name": {
                            "type": "string",
                            "description_kind": "plain",
                            "computed": true
                          },
                          "session_persistence": {
                            "nested_type": {
                              "attributes": {
                                "cookie_name": {
                                  "type": "string",
                                  "description_kind": "plain",
                                  "optional": true
                                },
                                "type": {
                                  "type": "string",
                                  "description": "\"NONE\", \"HTTP_COOKIE\", \"APP_COOKIE\", \"SOURCE_IP\"",
                                  "description_kind": "plain",
                                  "required": true
                                }
                              },
                              "nesting_mode": "single"
                            },
                            "description_kind": "plain",
                            "required": true
                          }
                        },
                        "nesting_mode": "single"
                      },
                      "description_kind": "plain",
                      "required": true
                    },
                    "port": {
                      "type": "number",
                      "description_kind": "plain",
                      "required": true
                    },
                    "protocol": {
                      "type": "string",
                      "description": "\"HTTP\", \"HTTPS\", \"TCP\", \"UDP\", \"TERMINATED_HTTPS\"",
                      "description_kind": "plain",
                      "required": true
                    },
                    "timeout_client_data": {
                      "type": "number",
                      "description_kind": "plain",
                      "optional": true
                    },
                    "timeout_member_connect": {
                      "type": "number",
                      "description_kind": "plain",
                      "optional": true
                    },
                    "timeout_member_data": {
                      "type": "number",
                      "description_kind": "plain",
                      "optional": true
                    },
                    "timeout_tcp_inspect": {
                      "type": "number",
                      "description_kind": "plain",
                      "optional": true
                    },
                    "tls_container_id": {
                      "type": "string",
                      "description_kind": "plain",
                      "optional": true
                    }
                  },
                  "nesting_mode": "list"
                },
                "description_kind": "plain",
                "required": true
              }

Can you please give me a tip what wrong with this schema and how i can fix this issue?

@IvanTurgenev1 IvanTurgenev1 added the bug Something isn't working label Oct 19, 2022
@ytsarev
Copy link
Member

ytsarev commented Oct 19, 2022

@IvanTurgenev1 I suggest switching to recently open-sourced https://github.com/upbound/upjet/ which is a much more advanced derivative of the terrajet

@IvanTurgenev1
Copy link
Author

IvanTurgenev1 commented Oct 20, 2022

which is a much more advanced derivative of the terrajet

thanks for you response!
at the moment, the documentation on generating a provider using upjet is not up to date.
still need help with this error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants