Skip to content

Commit d2aeefc

Browse files
committed
Use k8s_info module instead of deprecated k8s_facts in molecule scaffold (#2168)
1 parent 79e6369 commit d2aeefc

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
### Changed
77
- Upgrade minimal Ansible version in the init projects from `2.4` to `2.6`. ([#2107](https://github.com/operator-framework/operator-sdk/pull/2107))
8+
- Use `k8s_info` module instead of deprecated `k8s_facts` module in molecule test scaffold. ([#2168](https://github.com/operator-framework/operator-sdk/issues/2168))
89

910
### Deprecated
1011

doc/ansible/dev/retroactively-owned-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ This file can be used as-is without user adjustments.
133133
- name: Import user variables
134134
include_vars: vars.yml
135135
- name: Retrieve owning resource
136-
k8s_facts:
136+
k8s_info:
137137
api_version: "{{ owning_resource.apiVersion }}"
138138
kind: "{{ owning_resource.kind }}"
139139
name: "{{ owning_resource.name }}"

internal/scaffold/ansible/molecule_default_asserts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const moleculeDefaultAssertsAnsibleTmpl = `---
4646
ansible_python_interpreter: '{{ ansible_playbook_python }}'
4747
tasks:
4848
- name: Get all pods in {{ namespace }}
49-
k8s_facts:
49+
k8s_info:
5050
api_version: v1
5151
kind: Pod
5252
namespace: '{{ namespace }}'

internal/scaffold/ansible/molecule_test_cluster_playbook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const moleculeTestClusterPlaybookAnsibleTmpl = `---
6060
msg: "{{ lookup('k8s', group='[[.Resource.FullGroup]]', api_version='[[.Resource.Version]]', kind='[[.Resource.Kind]]', namespace=namespace, resource_name=custom_resource.metadata.name) }}"
6161
6262
- name: Wait 2m for reconciliation to run
63-
k8s_facts:
63+
k8s_info:
6464
api_version: '[[.Resource.Version]]'
6565
kind: '[[.Resource.Kind]]'
6666
namespace: '{{ namespace }}'

internal/scaffold/ansible/molecule_test_local_playbook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const moleculeTestLocalPlaybookAnsibleTmpl = `---
7777
when: hostvars[groups.k8s.0].build_cmd.changed
7878
7979
- name: Wait 30s for Operator Deployment to terminate
80-
k8s_facts:
80+
k8s_info:
8181
api_version: '{{ definition.apiVersion }}'
8282
kind: '{{ definition.kind }}'
8383
namespace: '{{ namespace }}'
@@ -102,7 +102,7 @@ const moleculeTestLocalPlaybookAnsibleTmpl = `---
102102
definition: '{{ custom_resource }}'
103103
104104
- name: Wait 2m for reconciliation to run
105-
k8s_facts:
105+
k8s_info:
106106
api_version: '{{ custom_resource.apiVersion }}'
107107
kind: '{{ custom_resource.kind }}'
108108
namespace: '{{ namespace }}'

test/ansible-inventory/molecule/test-local/playbook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
when: hostvars[groups.k8s.0].build_cmd.changed
3636

3737
- name: Wait 30s for Operator Deployment to terminate
38-
k8s_facts:
38+
k8s_info:
3939
api_version: '{{ definition.apiVersion }}'
4040
kind: '{{ definition.kind }}'
4141
namespace: '{{ namespace }}'
@@ -60,7 +60,7 @@
6060
definition: "{{ custom_resource }}"
6161

6262
- name: Wait 2m for reconciliation to run
63-
k8s_facts:
63+
k8s_info:
6464
api_version: '{{ custom_resource.apiVersion }}'
6565
kind: '{{ custom_resource.kind }}'
6666
namespace: '{{ namespace }}'

test/ansible-memcached/asserts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
definition: '{{ custom_resource }}'
136136

137137
- name: Wait for the custom resource to be deleted
138-
k8s_facts:
138+
k8s_info:
139139
api_version: '{{ custom_resource.apiVersion }}'
140140
kind: '{{ custom_resource.kind }}'
141141
namespace: '{{ namespace }}'

0 commit comments

Comments
 (0)