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

fix(Collection's util resource discovery fails when complex subresources present #659) #676

Conversation

bastienbosser
Copy link
Contributor

SUMMARY

Hi,
We have the same problem and on our side we have fixed the code, specifying to the split to do it only on the first /.

resource, name = subresource["name"].split("/", 1)

It seems more logical to add this control, since the current code doesn't support more than two elements

ISSUE TYPE
COMPONENT NAME

discovery.py

Copy link

@gravesm
Copy link
Member

gravesm commented Feb 19, 2024

@bastienbosser Thanks for your PR. Could you include a changelog please?

Copy link

@bastienbosser
Copy link
Contributor Author

Hello,
I've added a changelog fragment. Do you think the PR will be merged soon? If so, will a new release be created soon?
Regards,

@gravesm gravesm added the test-all-the-targets In order to tell to the integration test splitter to test all targets label Feb 28, 2024
Copy link

@abikouo
Copy link
Contributor

abikouo commented Feb 28, 2024

@bastienbosser you need to rebase your branch with the main branch in order to fix the integration tests issue.
The corresponding targets were fixed into #670
Thanks

Note: I have also added a test case to validate your fix

@gravesm gravesm force-pushed the Collections-util-resource-discovery-fails-when-complex-subresources-present branch from 836c034 to a7f4e45 Compare February 29, 2024 12:38
Copy link

Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/e2f10d7bb789464c9eafdad28160e94f

✔️ ansible-galaxy-importer SUCCESS in 5m 09s
✔️ build-ansible-collection SUCCESS in 7m 30s

Copy link

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@gravesm
Copy link
Member

gravesm commented Feb 29, 2024

regate

Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/59772d1fbceb4d2f909f73f0e926c1e6

✔️ ansible-galaxy-importer SUCCESS in 4m 54s
✔️ build-ansible-collection SUCCESS in 8m 25s

Copy link

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@abikouo abikouo merged commit 1955989 into ansible-collections:main Feb 29, 2024
70 checks passed
Copy link

patchback bot commented Feb 29, 2024

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/1955989278e3c3084c8a6fdebedf129a89041237/pr-676

Backported as #687

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Feb 29, 2024

Backport to stable-2: 💔 cherry-picking failed — target branch does not exist

❌ Failed to find branch stable-2

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 29, 2024
…ces present #659) (#676)

* fix(Collection's util resource discovery fails when complex subresources present #659)

* fix(add changelog fragment)

* update node image

* Create discovery.yml

* Update main.yml

---------

Co-authored-by: Bastien Bosser <bastien.bosser@eviden.com>
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
(cherry picked from commit 1955989)
abikouo added a commit that referenced this pull request Mar 1, 2024
…discovery fails when complex subresources present #659) (#687)

* fix(Collection's util resource discovery fails when complex subresources present #659) (#676)

* fix(Collection's util resource discovery fails when complex subresources present #659)

* fix(add changelog fragment)

* update node image

* Create discovery.yml

* Update main.yml

---------

Co-authored-by: Bastien Bosser <bastien.bosser@eviden.com>
Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
(cherry picked from commit 1955989)

* adding sanity ignore file

* Remove refresh_ignore_files

* Update ignore files content

---------

Co-authored-by: bastienbosser <55381632+bastienbosser@users.noreply.github.com>
Co-authored-by: abikouo <abikouo@redhat.com>
abikouo added a commit that referenced this pull request Mar 1, 2024
…e discovery fails when complex subresources present #659) (#688)

* update node image

* fix(Collection's util resource discovery fails when complex subresources present #659)

* fix(add changelog fragment)

* Create discovery.yml

* Update main.yml

* Backport PR659

* fix sanity issues

---------

Co-authored-by: Bastien Bosser <bastien.bosser@eviden.com>
sp3nx0r referenced this pull request in sp3nx0r/homelab Jun 22, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[kubernetes.core](https://togithub.com/ansible-collections/kubernetes.core)
| galaxy-collection | major | `3.0.1` -> `5.0.0` |

---

### Release Notes

<details>
<summary>ansible-collections/kubernetes.core (kubernetes.core)</summary>

###
[`v5.0.0`](https://togithub.com/ansible-collections/kubernetes.core/blob/HEAD/CHANGELOG.rst#v500)

[Compare
Source](https://togithub.com/ansible-collections/kubernetes.core/compare/4.0.0...5.0.0)

\======

## Release Summary

This major release drops support for `ansible-core<2.15`.

## Minor Changes

- inventory/k8s.py - Defer removal of k8s inventory plugin to version
6.0.0
([https://github.com/ansible-collections/kubernetes.core/pull/734](https://togithub.com/ansible-collections/kubernetes.core/pull/734)).

## Breaking Changes / Porting Guide

- Remove support for `ansible-core<2.15`
([https://github.com/ansible-collections/kubernetes.core/pull/737](https://togithub.com/ansible-collections/kubernetes.core/pull/737)).

###
[`v4.0.0`](https://togithub.com/ansible-collections/kubernetes.core/blob/HEAD/CHANGELOG.rst#v400)

[Compare
Source](https://togithub.com/ansible-collections/kubernetes.core/compare/3.2.0...4.0.0)

\======

## Release Summary

This major release brings several bug fixes. We have also removed
support for `ansible-core<2.15` and deprecated functions and class from
`module_utils/common.py`.

## Minor Changes

- inventory/k8s.py - Defer removal of k8s inventory plugin to version
5.0
([https://github.com/ansible-collections/kubernetes.core/pull/723](https://togithub.com/ansible-collections/kubernetes.core/pull/723)).
- k8s - The module and K8sService were changed so warnings returned by
the K8S API are now displayed to the user.

## Removed Features (previously deprecated)

- k8s - Support for `merge_type=json` has been removed in version 4.0.0.
Please use `kubernetes.core.k8s_json_patch` instead
([https://github.com/ansible-collections/kubernetes.core/pull/722](https://togithub.com/ansible-collections/kubernetes.core/pull/722)).
- k8s_exec - the previously deprecated `result.return_code` return value
has been removed, consider using `result.rc` instead
([https://github.com/ansible-collections/kubernetes.core/pull/726](https://togithub.com/ansible-collections/kubernetes.core/pull/726)).
- module_utils/common.py - the previously deprecated `K8sAnsibleMixin`
class has been removed
([https://github.com/ansible-collections/kubernetes.core/pull/726](https://togithub.com/ansible-collections/kubernetes.core/pull/726)).
- module_utils/common.py - the previously deprecated
`configuration_digest()` function has been removed
([https://github.com/ansible-collections/kubernetes.core/pull/726](https://togithub.com/ansible-collections/kubernetes.core/pull/726)).
- module_utils/common.py - the previously deprecated `get_api_client()`
function has been removed
([https://github.com/ansible-collections/kubernetes.core/pull/726](https://togithub.com/ansible-collections/kubernetes.core/pull/726)).
- module_utils/common.py - the previously deprecated `unique_string()`
function has been removed
([https://github.com/ansible-collections/kubernetes.core/pull/726](https://togithub.com/ansible-collections/kubernetes.core/pull/726)).

## Bugfixes

- Resolve Collections util resource discovery fails when complex
subresources present
([https://github.com/ansible-collections/kubernetes.core/pull/676](https://togithub.com/ansible-collections/kubernetes.core/pull/676)).
- align `helmdiff_check()` function commandline rendering with the
`deploy()` function
([https://github.com/ansible-collections/kubernetes.core/pull/670](https://togithub.com/ansible-collections/kubernetes.core/pull/670)).
- avoid unsafe conditions in integration tests
([https://github.com/ansible-collections/kubernetes.core/pull/665](https://togithub.com/ansible-collections/kubernetes.core/pull/665)).
- helm - use `reuse-values` when running `helm diff` command
([https://github.com/ansible-collections/kubernetes.core/issues/680](https://togithub.com/ansible-collections/kubernetes.core/issues/680)).
- integrations test helm_kubeconfig - set helm version to v3.10.3 to
avoid incompatability with new bitnami charts
([https://github.com/ansible-collections/kubernetes.core/pull/670](https://togithub.com/ansible-collections/kubernetes.core/pull/670)).

###
[`v3.2.0`](https://togithub.com/ansible-collections/kubernetes.core/compare/3.1.0...3.2.0)

[Compare
Source](https://togithub.com/ansible-collections/kubernetes.core/compare/3.1.0...3.2.0)

###
[`v3.1.0`](https://togithub.com/ansible-collections/kubernetes.core/blob/HEAD/CHANGELOG.rst#v310)

[Compare
Source](https://togithub.com/ansible-collections/kubernetes.core/compare/3.0.1...3.1.0)

\======

## Release Summary

This release comes with some bugfixes and documentation updates. It also
adds new features to the kubectl connection plugin and the kustomize
lookup plugin.

## Minor Changes

- kubectl - added support of local enviroment variable that will be used
for kubectl and may be requried for establishing connections ifself
([https://github.com/ansible-collections/kubernetes.core/pull/702](https://togithub.com/ansible-collections/kubernetes.core/pull/702))
- kustomize - new parameter added to --enable-helm
([https://github.com/ansible-collections/kubernetes.core/issues/568](https://togithub.com/ansible-collections/kubernetes.core/issues/568))

## Bugfixes

- helm - expand kubeconfig path with user's home directory for
consistency with k8s
- k8s_json_patch - rename action symlink to ensure k8s action plugin is
used
([https://github.com/ansible-collections/kubernetes.core/pull/652](https://togithub.com/ansible-collections/kubernetes.core/pull/652)).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on saturday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/sp3nx0r/homelab).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9hbnNpYmxlIiwidHlwZS9tYWpvciJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2 backport-3 mergeit test-all-the-targets In order to tell to the integration test splitter to test all targets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants