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

cscli machines add: don't overwrite existing credential file #2625

Merged
merged 2 commits into from Dec 4, 2023

Conversation

mmetc
Copy link
Contributor

@mmetc mmetc commented Nov 29, 2023

Simpler alternative to #2594
to fix #2567

The command returns with an error if a file is not specified and the local credentials file already exists. Explicitly providing a path will happily overwrite. Using --force will also overwrite.

Copy link

@mmetc: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

@mmetc: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (7e5ab34) 58.22% compared to head (d8092db) 58.23%.

Files Patch % Lines
cmd/crowdsec-cli/machines.go 73.68% 4 Missing and 1 partial ⚠️
cmd/crowdsec-cli/config_restore.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2625   +/-   ##
=======================================
  Coverage   58.22%   58.23%           
=======================================
  Files         201      201           
  Lines       27048    27056    +8     
=======================================
+ Hits        15750    15757    +7     
- Misses       9753     9755    +2     
+ Partials     1545     1544    -1     
Flag Coverage Δ
bats 38.41% <73.91%> (+0.01%) ⬆️
unit-linux 55.24% <ø> (+0.01%) ⬆️
unit-windows 51.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mmetc mmetc force-pushed the machines-add-local branch 4 times, most recently from 5ea0564 to 6264fc3 Compare November 29, 2023 20:35
@mmetc mmetc added the kind/enhancement New feature or request label Nov 29, 2023
@mmetc mmetc marked this pull request as ready for review November 30, 2023 09:27
@mmetc mmetc added this to the 1.5.6 milestone Nov 30, 2023
@mmetc mmetc requested a review from buixor December 1, 2023 09:06
Now --force is used both to override the replacement of and existing machine,
and an existing credentials file. To retain the old behavior, the
existence of the file is only checked for the default configuration, not
if explicitly specified.
@mmetc mmetc merged commit a5ab73d into master Dec 4, 2023
13 of 14 checks passed
@mmetc mmetc deleted the machines-add-local branch December 4, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request needs/area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A default behavior of cscli machines add is very misleading
2 participants