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

Unexpected result during execution of kubernetes module #322

Closed
raman-babich opened this issue Nov 26, 2023 · 0 comments · Fixed by #331
Closed

Unexpected result during execution of kubernetes module #322

raman-babich opened this issue Nov 26, 2023 · 0 comments · Fixed by #331

Comments

@raman-babich
Copy link
Contributor

SUMMARY

There is unnecessary erasure of resulting data in the digital_ocean_kubernetes module

# Add the kubeconfig to the return
if self.return_kubeconfig:
    json_data["kubeconfig"] = self.get_kubernetes_kubeconfig()
self.module.exit_json(changed=True, data=json_data["kubernetes_cluster"])

It looks like the last line of the snippet should be.

self.module.exit_json(changed=True, data=json_data)

To have kubeconfig correctly included.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

digital_ocean_kubernetes

ANSIBLE VERSION
any
COLLECTION VERSION
1.24.0
CONFIGURATION
Not important
OS / ENVIRONMENT

Any

STEPS TO REPRODUCE

From examples.

- name: Create a new DigitalOcean Kubernetes cluster in New York 1
  community.digitalocean.digital_ocean_kubernetes:
    state: present
    oauth_token: "{{ lookup('env', 'DO_API_TOKEN') }}"
    name: hacktoberfest
    region: nyc1
    node_pools:
      - name: hacktoberfest-workers
        size: s-1vcpu-2gb
        count: 3
    return_kubeconfig: true
    wait_timeout: 600
  register: my_cluster
EXPECTED RESULTS

A kubeconfig is returned.

ACTUAL RESULTS

A kubeconfig is not returned.

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 a pull request may close this issue.

1 participant