Skip to content

create_cluster sample is broken due to autogenerate samples bug #12757

Closed
@acocuzzo

Description

Thanks for stopping by to let us know something could be better!

Please include as much information as possible:

In which file did you encounter the issue?

managedkafka/snippets/clusters/create_cluster.py

Describe the issue

The network_configs field is a repeated field (array) and therefore this:

    cluster.gcp_config.access_config.network_configs.subnet = subnet

results in cluster.gcp_config being unset (and the request fails)

cluster {
  name: "XXX"
  capacity_config {
    vcpu_count: 3
    memory_bytes: 3221225472
  }
  rebalance_config {
    mode: AUTO_REBALANCE_ON_SCALE_UP
  }
}

The correct way to set this field would be:

    cluster.gcp_config.access_config.network_configs.append(
            managedkafka_v1.NetworkConfig(
                subnet = subnet
                )
            )

or

    cluster.gcp_config.access_config.network_configs = [
            managedkafka_v1.NetworkConfig(
                subnet = subnet
                ]
            )

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions