373 Commits

Author SHA1 Message Date
Mike Graves
f5eb0625d6 Release 1.2.1 (#406) 1.2.1 2021-04-01 08:53:03 -04:00
Mike Graves
0432fe6a51 Add requirements.txt to downstream build (#401)
* Add requirements.txt to downstream build

This file is needed for execution environments.

* Add changelog fragment
2021-03-31 09:25:50 -04:00
Mike Graves
1754405bb4 [bp/1.2] Restrict molecule version to <3.3.0
The 3.3.0 version of molecule broke the test suite. Restricting the
version until we can either fix upstream or decide on the best
workaround.
2021-03-31 10:01:47 +05:30
Mike Graves
5eb280f35a Prep for 1.2 release (#370) 2021-02-19 13:02:07 -05:00
Mike Graves
a4ac078625 Add support for helm template (#368)
* Add support for helm template
This commit adds basic support for helm template. The functionality
allows one to either render a chart's templates to a specific directory,
or capture the rendered templates as a string of concatenated yaml
documents.
* Add changelog fragment
* Address PR feedback
* Set changed to true
2021-02-17 08:01:49 -05:00
Abhijeet Kasurde
dc80c418e9 Update minimum version of Ansible required (#366)
https://github.com/ansible-collections/community.kubernetes/pull/276
is backported to 2.9.17
Any Ansible version lesser than this will not work due to
Kubernetes-python compatibility issues.

Fixes: #314
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-02-16 15:05:53 -05:00
Joshua Hügli
8f098b14f2 make has_plugin detection method more reliable (#362)
* fix has_plugin detection method
* use even better method :)
* add changelog fragment
* fix forgotten file extension
* Double Backticks ;)
* Add PR link to changelog
Co-authored-by: Mike Graves <mgraves@redhat.com>
2021-02-16 12:38:29 -05:00
Mike Graves
9f7b6fb3ff Honor wait_timeout in k8s_info for missing resource (#360)
* Honor wait in k8s_info for missing resource

The wait logic in the k8s_info module immediately returns when no
resources are found, regardless whether a wait_timeout has been
specified. This expands the logic to wait when a name has been provided.
The case this is specifically meant to address is when querying for a
resource that is indirectly created by another resource, for example, a
pod created by a deployment or an operator.

The existing logic in every other case should remain as it was before.
This means if a query might return more than one resource--all pods with
some label, for example--the module will return immediately if no pods
are found, even if a wait_timeout has been provided.

* Add changelog fragment
2021-02-16 10:19:22 -07:00
Mike Graves
80b914021f Add skip_crds option to helm (#349)
This adds an option to skip the installation of CRDs when installing or
upgrading a chart.

Closes: #296
2021-02-09 09:51:10 +05:30
Mike Graves
981493dfb6 Add note about required permissions for k8s_exec (#361) 2021-02-08 19:42:13 -05:00
Abhijeet Kasurde
92e373239c k8s: Add example for download and apply manifest from URL (#359)
Fixes: #352

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-02-03 21:16:44 +05:30
Mike Graves
2640084143 Add optional support for helm diff (#355)
There are some cases where the existing module has difficulty
determining if an upgrade would result in changes. This can particularly
be a problem when changes are made to a local chart.

This adds optional support for helm diff. If the plugin is present it
will be used. Otherwise, the default implementation will be used and a
warning will be issued. One caveat: helm diff does not currently support
using a repo url, so the default implementation will be used in this
case, as well.

Closes: #248
2021-02-03 13:46:26 +05:30
Abhijeet Kasurde
86c5c446dd Make unused release_namespace parameter as optional (#358) 2021-02-03 13:45:25 +05:30
Gonéri Le Bouder
5a5ed79b89 Revert "helm - remove trailing whitespaces (#337) (#345)" (#346)
This reverts commit 003d802065.

See: https://github.com/ansible-collections/community.kubernetes/pull/345#issuecomment-760291333
2021-01-14 11:19:12 -05:00
Mike Graves
b26afc3518 Fix Secret check_mode (#343)
When adding a Secret and using stringData, check_mode will always show
changes. An existing resource fetched from Kubernetes will have the
stringData already base64 encoded and merged into the data attribute.
This change performs the base64 encoding and merging with the provided
definition to more accurately represent the current state of the
cluster.

This change only affects check_mode. When making any changes to the
cluster the stringData is passed along as provided in the definition.

Closes #282.
2021-01-14 11:05:11 -05:00
Alina Buzachis
003d802065 helm - remove trailing whitespaces (#337) (#345)
Add remove_trailing_spaces() to remove trailing whitespaces for each helm_repository parameter.
2021-01-14 10:52:33 -05:00
Mike Graves
a9b8cc68d5 Add support for configuring garbage collection (#334)
* Add support for configuring garbage collection

This surfaces deleteOptions functionality in a top-level delete_options
parameter.

* Add changelog fragment

* Remove kind and apiVersion from delete_options

* Add release version to docs
2021-01-12 14:17:18 -05:00
Abhijeet Kasurde
9059f2c526 k8s: Handle ValueError raised (#330) 2021-01-12 21:38:58 +05:30
Gonéri Le Bouder
a6cb6c4821 action/k8s_info: refactoring to simplify the code base (#331)
Break down the long `run()` method to simplify the readability of the
plugin.
2021-01-11 11:04:11 +05:30
Gonéri Le Bouder
01ee3e603c helm: 'changed' flag takes 'values' in consideration (#332)
Return `changed` `False` is the `values_files` match the `values` of
the existing deployment.

Closes: #274
2021-01-05 13:53:20 -06:00
Gonéri Le Bouder
221631c06a helm: add support for the K8S_ envvars (#319)
Add support for:

- K8S_AUTH_HOST
- K8S_AUTH_API_KEY
- K8S_AUTH_VERIFY_SSL
- K8S_AUTH_SSL_CA_CERT

This commit also refactor the way we pass K8S related configuration to `helm`:

All the calls are now done in a new module_utils module (`helm.py`).
The handling of the `kube_*` variables has also been moved in this new
module.

We need https://github.com/helm/helm/pull/8622 to be able to ignore the
certificate validation. As a workaround, the generate a temporary
kubeconfig configuration file.

Closes: #279
2020-12-11 11:41:08 -05:00
Abhijeet Kasurde
5d3e465672 k8s: handle remote src and kubeconfig (#320)
* k8s: Add a parameter remote_src

remote_src is boolean parameter to specify if
src file is located on remote node or Ansible Controller.

Fixes: #307

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* remove parameters

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-12-10 10:58:33 -07:00
Gonéri Le Bouder
befc0f6853 helm and helm_info: adjust the name of two parameters (#324) 2020-12-10 09:28:27 +05:30
Abhijeet Kasurde
549dd262d2 Loosen strictness for boolean (#326) 2020-12-08 20:01:44 +05:30
Gonéri Le Bouder
486a179c7a add 3 doc-default-does-not-match-spec errors (#325)
Address the following error with the test-suite:

- plugins/modules/k8s.py:0:0: doc-default-does-not-match-spec: Argument 'append_hash' in argument_spec defines default as (False) but documentation defines default as (None)
- plugins/modules/k8s.py:0:0: doc-default-does-not-match-spec: Argument 'apply' in argument_spec defines default as (False) but documentation defines default as (None)
- plugins/modules/k8s_service.py:0:0: doc-default-does-not-match-spec: Argument 'apply' in argument_spec defines default as (False) but documentation defines default as (None)
2020-12-08 09:20:20 +05:30
Abhijeet Kasurde
4b447cc301 CI fix (#322)
Fixes: #316
2020-12-04 12:33:10 +05:30
Gonéri Le Bouder
11191e40b0 molecule: conditional statements should not include jinja2 templating (#305)
This address the following warning:
```
[WARNING]: conditional statements should not include jinja2 templating
delimiters such as {{ }} or {% %}. Found: {{ scale_down_no_wait_pods.resources
| length == 1 }
```
2020-12-02 14:10:07 -05:00
Abhijeet Kasurde
86ce0b5556 add changelog and version added information. (#312)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-11-30 12:46:02 +05:30
Fabian von Feilitzsch
2474ef1b2c k8s_info now outputs whether the api was found (#308) 2020-11-30 10:26:54 +05:30
Gonéri Le Bouder
8f14bf6c46 The type of wait_condition.status is str (#310)
The `wait_condition.status` key is a string.

- Use actually string in the documentation
- Use core's `boolean()` method to convert the value internally to
  boolean
2020-11-25 13:01:38 -06:00
Abhijeet Kasurde
4d94cb9439 tests: remove old openshift tests (#311)
Older openshift test cases are no longer valid for this
collection. Removing them for now.

Fixes: #300

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-11-25 11:27:13 -06:00
Gonéri Le Bouder
1513bced36 test: k8s's merge_type expect a list (#309)
The `merge_type` parameter of `k8s` is a list, not a string.
2020-11-23 15:39:25 -05:00
Gonéri Le Bouder
fac0478293 molecule: clone the chart repos with depth=1 (#303) 2020-11-19 13:31:51 -05:00
Jeff Geerling
b97c5ce85b Update to latest version of kind action so kind cluster setup succeeds. (#306) 2020-11-18 11:32:02 -06:00
Abhijeet Kasurde
108efaf065 Properly format list in README.md (#302) 2020-11-11 14:39:25 +05:30
Abhijeet Kasurde
90a1c626a2 Fix CI (#301)
Missing variables in Chart local_path testing.
2020-11-11 10:29:10 +05:30
Gonéri Le Bouder
eff6759660 test: older_openshift_fail.yml fails with py3.7+ (#291)
The `older_openshift_fail.yml` test playbook fails with Python 3.7 because the old `kubernetes.client.apis.admissionregistration_api` module uses the new `async` keyword as a function parameter name. From: https://docs.python.org/3/whatsnew/3.7.html

Backwards incompatible syntax changes:

    `async` and `await` are now reserved keywords.

In this case, we get a `SyntaxError` exception instead of the expected `Failed to import the required Python library (openshift >= 0.7.2)`.
2020-11-10 14:27:23 -05:00
Abhijeet Kasurde
c76aa6e45a Use runtime.yml for action plugin redirection (#299)
Previously, kubernetes collection used symlink for action plugin redirection. It is problematic when FQCN
is not provided. Using runtime.yml to redirect the action plugin.

Fixes: #278
2020-11-10 14:15:58 -05:00
Abhijeet Kasurde
66494890ba Enable validate_certs test for kubernetes (#298)
Fixes: #24
2020-11-10 14:14:54 -05:00
Abhijeet Kasurde
e2d4cff952 Updated chart repo URLs (#297) 2020-11-10 14:13:09 -05:00
Abhijeet Kasurde
77e48d0c97 helm: return correct information in check mode (#281)
Fixes: #280

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-22 15:22:17 -05:00
jaydesl
aad4696f20 Fix default configuration getter in client v12.0.0 (#276)
Fixes #273
2020-10-22 15:41:51 -04:00
Abhijeet Kasurde
d03823794e helm_repository: Add information about 'RETURN' (#269)
Fixes: #256

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-10-12 11:20:53 -04:00
Jeff Geerling
9a2e29acd2 Issue #263: Prepare for 1.1.1 release. (#268) 2020-10-09 13:46:20 -05:00
Jeff Geerling
d60a726e6d Fix sed command for README fix in downstream build. (#267) 2020-10-09 13:19:53 -05:00
Timothy Appnel
1486ffd6e6 Fixes #262 downstream.sh README page edits (#266) 2020-10-09 13:49:26 -04:00
Jeff Geerling
f01644a565 Fix the downstream build and release process (#259)
* Issue #254: Fix 'unbound variable' error with empty array.

* Issue #254: Make downstream-release work completely.

* Make sed commands cross-platform.
2020-10-09 11:06:55 -05:00
Jeff Geerling
cbd3a2554e Issue #260: Sanity test 'compile' failing because of positional args. (#261)
* Issue #260: Sanity test 'compile' failing because of positional args.

* Issue #260: Run integration tests on older Python 3.6 still.

* Issue #260: Add changelog fragment.
2020-10-09 10:17:52 -05:00
Jeff Geerling
9ff259c638 Issue #254: Prepare for 1.1.0 release. (#257)
* Issue #254: Add changelogs for 1.1.0.

* Issue #254: Two of the changes are major.

* Update CHANGELOG and galaxy tag version.

* Issue #254: Document kubernetes.core release process.
2020-10-08 15:35:42 -05:00
Timothy Appnel
f0dacc083c Embedded docs clarifications and refinements. (#258)
* Another embedded docs clarifications in k8s_rollback

* Embedded docs clarification in helm_pljugin_info

* Embedded docs clarification in k8s

* More embedded docs clarification in k8s inventory plugin

* Fixed markdown formatting to RST in k8s_rollback
2020-10-08 15:32:54 -05:00