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: kustomize plugin fails with deprecation warnings #728

Conversation

qcu266
Copy link
Contributor

@qcu266 qcu266 commented May 24, 2024

SUMMARY

error judgments are based on the exit codes of command execution, where 0 represents success and non-zero represents failure.

Optimize the run_command function to return a tuple like the run_command method of AnsibleModule.

Fixes #639

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

kustomize lookup plugin

ADDITIONAL INFORMATION

Copy link

@qcu266 qcu266 force-pushed the fix/kustomize-deprecation-warnings branch from 64fe1e3 to 8b43cdf Compare May 25, 2024 10:59
Copy link

Copy link
Member

@gravesm gravesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add changelog fragment please?

qcu266 added a commit to qcu266/kubernetes.core that referenced this pull request Jun 20, 2024
Copy link

@qcu266
Copy link
Contributor Author

qcu266 commented Jun 24, 2024

@gravesm I have already added the changelog fragment. please review again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog fragment is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

qcu266 added a commit to qcu266/kubernetes.core that referenced this pull request Jul 10, 2024
@qcu266 qcu266 force-pushed the fix/kustomize-deprecation-warnings branch from 0f0fc84 to c1a884e Compare July 10, 2024 14:52
Copy link

Copy link
Member

@gravesm gravesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some spacing and indentation issues that are causing linters to fail. I think the one integration test failure should be solved by rebasing.

@@ -94,7 +94,8 @@ def get_binary_from_path(name, opt_dirs=None):

def run_command(command):
cmd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return cmd.communicate()
stdout, stderr = cmd.communicate()
return cmd.returncode, stdout, stderr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return cmd.returncode, stdout, stderr
return cmd.returncode, stdout, stderr

Comment on lines 146 to 152
if err:
raise AnsibleLookupError(
"kustomize command failed with: {0}".format(err.decode("utf-8"))
"kustomize command failed. exit code: {0}, error: {1}".format(ret, err.decode("utf-8"))
)
else:
raise AnsibleLookupError(
"kustomize command failed with unknown error. exit code: {0}".format(ret)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a full indentation.

@qcu266 qcu266 force-pushed the fix/kustomize-deprecation-warnings branch from c1a884e to b6b9762 Compare July 11, 2024 12:25
@qcu266 qcu266 force-pushed the fix/kustomize-deprecation-warnings branch from b6b9762 to 47f5e2a Compare July 11, 2024 12:26
Copy link

Copy link

Copy link

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

✔️ ansible-galaxy-importer SUCCESS in 4m 31s
✔️ build-ansible-collection SUCCESS in 6m 45s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 5bc53db into ansible-collections:main Jul 15, 2024
39 checks passed
Copy link

patchback bot commented Jul 15, 2024

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/5bc53dba7ceb75a5fb998f04d10bec7a20b27ee9/pr-728

Backported as #763

🤖 @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 Jul 15, 2024
SUMMARY

error judgments are based on the exit codes of command execution, where 0 represents success and non-zero represents failure.
Optimize the run_command function to return a tuple like the run_command method of AnsibleModule.

Fixes #639
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

kustomize lookup plugin
ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: QCU
(cherry picked from commit 5bc53db)
Copy link

patchback bot commented Jul 15, 2024

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/5bc53dba7ceb75a5fb998f04d10bec7a20b27ee9/pr-728

Backported as #764

🤖 @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 Jul 15, 2024
SUMMARY

error judgments are based on the exit codes of command execution, where 0 represents success and non-zero represents failure.
Optimize the run_command function to return a tuple like the run_command method of AnsibleModule.

Fixes #639
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

kustomize lookup plugin
ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: QCU
(cherry picked from commit 5bc53db)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jul 15, 2024
This is a backport of PR #728 as merged into main (5bc53db).
SUMMARY

error judgments are based on the exit codes of command execution, where 0 represents success and non-zero represents failure.
Optimize the run_command function to return a tuple like the run_command method of AnsibleModule.

Fixes #639
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

kustomize lookup plugin
ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <[email protected]>
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jul 15, 2024
This is a backport of PR #728 as merged into main (5bc53db).
SUMMARY

error judgments are based on the exit codes of command execution, where 0 represents success and non-zero represents failure.
Optimize the run_command function to return a tuple like the run_command method of AnsibleModule.

Fixes #639
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

kustomize lookup plugin
ADDITIONAL INFORMATION

Reviewed-by: Mike Graves <[email protected]>
@qcu266 qcu266 deleted the fix/kustomize-deprecation-warnings branch July 16, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kustomize plugin fails with deprecation warnings
2 participants