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: create analysisrun cmd using template generated name #1471

Merged
merged 2 commits into from
Sep 10, 2021

Conversation

huikang
Copy link
Member

@huikang huikang commented Sep 4, 2021

  • set templateName if analsysit template has name in metadata
  • remove resourceVersion and fix spec.args

Signed-off-by: Hui Kang hui.kang@salesforce.com

fix #1473

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@codecov
Copy link

codecov bot commented Sep 4, 2021

Codecov Report

Merging #1471 (4082dbe) into master (ba9af78) will increase coverage by 0.14%.
The diff coverage is 81.25%.

❗ Current head 4082dbe differs from pull request most recent head 90290f6. Consider uploading reports for the commit 90290f6 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1471      +/-   ##
==========================================
+ Coverage   81.35%   81.49%   +0.14%     
==========================================
  Files         108      108              
  Lines       14505    14518      +13     
==========================================
+ Hits        11801    11832      +31     
+ Misses       2089     2058      -31     
- Partials      615      628      +13     
Impacted Files Coverage Δ
utils/analysis/helpers.go 76.99% <72.72%> (+5.47%) ⬆️
pkg/kubectl-argo-rollouts/cmd/create/create.go 64.96% <100.00%> (+1.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba9af78...90290f6. Read the comment docs.

- set templateName if analsysis template has name in metadata
- add unit test

Signed-off-by: Hui Kang <hui.kang@salesforce.com>
@huikang huikang force-pushed the fix-cmd-analyaisrun-create-name branch 2 times, most recently from 4082dbe to ceb8e09 Compare September 6, 2021 20:17
- unit test

Signed-off-by: Hui Kang <hui.kang@salesforce.com>
@huikang huikang force-pushed the fix-cmd-analyaisrun-create-name branch from ceb8e09 to 90290f6 Compare September 6, 2021 20:27
@sonarcloud
Copy link

sonarcloud bot commented Sep 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
11.4% 11.4% Duplication

Comment on lines -277 to +281
objName, notFound, err := unstructured.NestedString(obj.Object, "metadata", "name")
objName, found, err := unstructured.NestedString(obj.Object, "metadata", "name")
if err != nil {
return err
}
if !notFound {
if found {
Copy link
Member

Choose a reason for hiding this comment

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

oops!

Comment on lines +375 to +376
// Remove resourceVersion if exists
_, found, err := unstructured.NestedString(obj.Object, "metadata", "resourceVersion")
Copy link
Member

Choose a reason for hiding this comment

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

Does this fix imply we never had --from in-cluster-analysis-template working properly?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, the unit test failed to catch that because of the fake client.

@jessesuen jessesuen changed the title fix: create analsysrun cmd using template generated name fix: create analysisrun cmd using template generated name Sep 9, 2021
@huikang huikang added kubectl-plugin bug Something isn't working labels Sep 10, 2021
@jessesuen jessesuen merged commit 2d3cd2a into argoproj:master Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kubectl-plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

command create analysisrun fails to create analysisrun
2 participants