Skip to content

Commit ff54fb4

Browse files
replaced instances (#5249)
Signed-off-by: Venkat Ramaraju <[email protected]>
1 parent fad014e commit ff54fb4

File tree

27 files changed

+81
-51
lines changed

27 files changed

+81
-51
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
Bumped community.kubernetes to kubernetes.core >= 2.2.0. Added the kubernetes.core collection to requirements.
6+
7+
# kind is one of:
8+
# - addition
9+
# - change
10+
# - deprecation
11+
# - removal
12+
# - bugfix
13+
kind: "change"
14+
15+
# Is this a breaking change?
16+
breaking: false
17+
18+
# Migration can be defined to automatically add a section to
19+
# the migration guide. This is required for breaking changes.
20+
migration:
21+
header: Update ansible collection ``community.kubernetes`` to ``kubernetes.core``
22+
body: >
23+
Add the ``kubernetes.core`` collection (>= 2.2.0) to the requrements.yml file
24+
25+
- name: kubernetes.core
26+
version: "2.2.0"

hack/generate/samples/internal/ansible/advanced_molecule.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (ma *AdvancedMolecule) Run() {
8888
const inventoryRoleTaskFragment = `
8989
- when: sentinel | test
9090
block:
91-
- community.kubernetes.k8s:
91+
- kubernetes.core.k8s:
9292
definition:
9393
apiVersion: v1
9494
kind: ConfigMap
@@ -274,7 +274,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
274274
- hosts: localhost
275275
gather_facts: no
276276
collections:
277-
- community.kubernetes
277+
- kubernetes.core
278278
tasks:
279279
- name: Get the decrypted message variable
280280
include_vars:
@@ -302,7 +302,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
302302
- hosts: localhost
303303
gather_facts: no
304304
collections:
305-
- community.kubernetes
305+
- kubernetes.core
306306
tasks:
307307
- name: Create configmap
308308
k8s:
@@ -336,7 +336,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
336336
- debug: msg='{{ "hello" | test }}'`
337337
err = kbutil.ReplaceInFile(
338338
filepath.Join(ma.ctx.Dir, "playbooks", "inventorytest.yml"),
339-
"---\n- hosts: localhost\n gather_facts: no\n collections:\n - community.kubernetes\n - operator_sdk.util\n tasks:\n - import_role:\n name: \"inventorytest\"",
339+
"---\n- hosts: localhost\n gather_facts: no\n collections:\n - kubernetes.core\n - operator_sdk.util\n tasks:\n - import_role:\n name: \"inventorytest\"",
340340
inventoryPlaybook)
341341
pkg.CheckError("adding playbook for inventorytest", err)
342342

@@ -345,7 +345,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
345345
- hosts: localhost
346346
gather_facts: no
347347
collections:
348-
- community.kubernetes
348+
- kubernetes.core
349349
tasks:
350350
- name: retrieve configmap
351351
k8s_info:
@@ -403,7 +403,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
403403
- hosts: localhost
404404
gather_facts: no
405405
collections:
406-
- community.kubernetes
406+
- kubernetes.core
407407
tasks:
408408
- name: Create configmap
409409
k8s:
@@ -427,7 +427,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
427427
- hosts: localhost
428428
gather_facts: no
429429
collections:
430-
- community.kubernetes
430+
- kubernetes.core
431431
- operator_sdk.util
432432
433433
tasks:
@@ -486,7 +486,7 @@ func (ma *AdvancedMolecule) updatePlaybooks() {
486486
- hosts: localhost
487487
gather_facts: no
488488
collections:
489-
- community.kubernetes
489+
- kubernetes.core
490490
tasks:
491491
492492
- name: create externalnamespace
@@ -556,7 +556,7 @@ const originalPlaybookFragment = `---
556556
- hosts: localhost
557557
gather_facts: no
558558
collections:
559-
- community.kubernetes
559+
- kubernetes.core
560560
- operator_sdk.util
561561
tasks: []
562562
`

hack/generate/samples/internal/ansible/constants.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package ansible
1616

1717
const roleFragment = `
1818
- name: start memcached
19-
community.kubernetes.k8s:
19+
kubernetes.core.k8s:
2020
definition:
2121
kind: Deployment
2222
apiVersion: apps/v1
@@ -222,7 +222,7 @@ const originalTaskSecret = `---
222222
// false positive: G101: Potential hardcoded credentials (gosec)
223223
// nolint:gosec
224224
const taskForSecret = `- name: Create test service
225-
community.kubernetes.k8s:
225+
kubernetes.core.k8s:
226226
definition:
227227
kind: Service
228228
api_version: v1
@@ -309,7 +309,7 @@ const memcachedWithBlackListTask = `
309309
status:
310310
test: "hello world"
311311
312-
- community.kubernetes.k8s:
312+
- kubernetes.core.k8s:
313313
definition:
314314
kind: Secret
315315
apiVersion: v1
@@ -320,10 +320,10 @@ const memcachedWithBlackListTask = `
320320
test: aGVsbG8K
321321
- name: Get cluster api_groups
322322
set_fact:
323-
api_groups: "{{ lookup('community.kubernetes.k8s', cluster_info='api_groups', kubeconfig=lookup('env', 'K8S_AUTH_KUBECONFIG')) }}"
323+
api_groups: "{{ lookup('kubernetes.core.k8s', cluster_info='api_groups', kubeconfig=lookup('env', 'K8S_AUTH_KUBECONFIG')) }}"
324324
325325
- name: create project if projects are available
326-
community.kubernetes.k8s:
326+
kubernetes.core.k8s:
327327
definition:
328328
apiVersion: project.openshift.io/v1
329329
kind: Project
@@ -332,7 +332,7 @@ const memcachedWithBlackListTask = `
332332
when: "'project.openshift.io' in api_groups"
333333
334334
- name: Create ConfigMap to test blacklisted watches
335-
community.kubernetes.k8s:
335+
kubernetes.core.k8s:
336336
definition:
337337
kind: ConfigMap
338338
apiVersion: v1
@@ -344,7 +344,7 @@ const memcachedWithBlackListTask = `
344344
state: present`
345345

346346
const taskToDeleteConfigMap = `- name: delete configmap for test
347-
community.kubernetes.k8s:
347+
kubernetes.core.k8s:
348348
kind: ConfigMap
349349
api_version: v1
350350
name: deleteme

hack/generate/samples/internal/ansible/testdata/fixture_collection/roles/dummy/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Create ConfigMap
3-
community.kubernetes.k8s:
3+
kubernetes.core.k8s:
44
definition:
55
kind: ConfigMap
66
apiVersion: v1

hack/generate/samples/internal/ansible/testdata/secret.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- hosts: localhost
33
gather_facts: no
44
collections:
5-
- community.kubernetes
5+
- kubernetes.core
66

77
tasks:
88
- meta: end_play

hack/tests/e2e-ansible-molecule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ trap_add "rm -rf $TMPDIR" EXIT
2929
pip3 install pyasn1==0.4.7 pyasn1-modules==0.2.6 idna==2.8 ipaddress==1.0.23
3030
pip3 install cryptography==3.3.2 molecule==3.0.2
3131
pip3 install ansible-lint yamllint
32-
pip3 install docker==4.2.2 openshift==0.11.2 jmespath
33-
ansible-galaxy collection install 'community.kubernetes:==1.1.1'
32+
pip3 install docker==4.2.2 openshift==0.12.1 jmespath
33+
ansible-galaxy collection install 'kubernetes.core:==2.2.0'
3434

3535
header_text "Copying molecule testdata scenarios"
3636
ROOTDIR="$(pwd)"

internal/plugins/ansible/v1/scaffolds/internal/templates/molecule/mdefault/converge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const convergeTemplate = `---
4242
connection: local
4343
gather_facts: no
4444
collections:
45-
- community.kubernetes
45+
- kubernetes.core
4646
4747
tasks:
4848
- name: Create Namespace

internal/plugins/ansible/v1/scaffolds/internal/templates/molecule/mdefault/destroy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const destroyTemplate = `---
4242
connection: local
4343
gather_facts: false
4444
collections:
45-
- community.kubernetes
45+
- kubernetes.core
4646
4747
tasks:
4848
- import_tasks: kustomize.yml

internal/plugins/ansible/v1/scaffolds/internal/templates/molecule/mdefault/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const verifyTemplate = `---
4242
connection: local
4343
gather_facts: no
4444
collections:
45-
- community.kubernetes
45+
- kubernetes.core
4646
4747
vars:
4848
ctrl_label: control-plane=controller-manager

internal/plugins/ansible/v1/scaffolds/internal/templates/molecule/mkind/destroy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const destroyTemplate = `---
4242
connection: local
4343
gather_facts: false
4444
collections:
45-
- community.kubernetes
45+
- kubernetes.core
4646
4747
tasks:
4848
- name: Destroy test kind cluster

0 commit comments

Comments
 (0)