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

knife cookbook upload --all does not upload all cookbooks if any one of the cookbook version is frozen. #9157

Open
Vasu1105 opened this issue Dec 12, 2019 · 4 comments

Comments

@Vasu1105
Copy link
Contributor

@Vasu1105 Vasu1105 commented Dec 12, 2019

Description

knife cookbook upload --all does not upload all the cookbooks if anyone of the cookbook's version is frozen. And as per current behaviour knife cookbook upload --alll shows wrong message at the end of command execution i.e. Uploaded all cookbooks. which confuse the user.

We either need to fix the message or the functionality to fix this.

Chef Version

ChefDK version: 4.6.35
Chef Infra Client version: 15.5.17
Chef InSpec version: 4.18.39
Test Kitchen version: 2.3.4
Foodcritic version: 16.2.0
Cookstyle version: 5.13.7

Present in Chef 14 too.

Platform Version

Replication Case

I have one of the cookbook in repo whose version is frozen.
Then I try to upload all cookbooks from my cookbook repo using --all option

Client Output


knife cookbook upload --all
Uploading berks-test [0.1.0]
Uploading one-more-test [0.1.0]
Uploading one-moret-test [0.1.0]
Uploading starter [1.3.0]
Uploading test-cookbook [0.1.0]
Uploading test-one [0.1.0]
Uploading test-two [0.1.0]
ERROR: Version 0.1.0 of cookbook berks-test is frozen. Use --force to override.
WARNING: Not updating version constraints for some cookbooks in the environment as the cookbook is frozen.
Uploaded all cookbooks.

Stacktrace

@Vasu1105 Vasu1105 changed the title knife cookbook upload --all do not upload all cookbooks if any one of the cookbook version is frozen. knife cookbook upload --all do not upload all cookbooks if anyone of the cookbook version is frozen. Dec 12, 2019
@lamont-granquist

This comment has been minimized.

Copy link
Contributor

@lamont-granquist lamont-granquist commented Dec 12, 2019

that seems to be the correct behavior though. frozen cookbooks need to never be overwritten unless the user specifies --force.

seems like a semantic issue where "uploaded all cookbooks" really means "uploaded all the cookbook that i could".

@Vasu1105

This comment has been minimized.

Copy link
Contributor Author

@Vasu1105 Vasu1105 commented Dec 12, 2019

@lamont-granquist it does not upload some of the cookbook but says "Uploaded all cookbooks"

@Vasu1105

This comment has been minimized.

Copy link
Contributor Author

@Vasu1105 Vasu1105 commented Dec 13, 2019

@lamont-granquist Adding more command execution logs

$ knife cookbook list
berks-test       0.1.0
one-moret-test   0.1.0
registry_key     0.1.0
starter          1.3.0

$ knife cookbook upload starter
Uploading starter        [1.3.0]
ERROR: Version 1.3.0 of cookbook starter is frozen. Use --force to override.
WARNING: Not updating version constraints for starter in the environment as the cookbook is frozen.
ERROR: Failed to upload 1 cookbook.

$ knife cookbook upload --all
Uploading one-more       [0.1.0]
Uploading one-more-test  [0.1.0]
Uploading one-moret-test [0.1.0]
Uploading starter        [1.3.0]
Uploading test-cookbook  [0.1.0]
Uploading test-one       [0.1.0]
Uploading test-two       [0.1.0]
ERROR: Version 1.3.0 of cookbook starter is frozen. Use --force to override.
WARNING: Not updating version constraints for some cookbooks in the environment as the cookbook is frozen.
Uploaded all cookbooks.

$ knife cookbook list
berks-test       0.1.0
one-more         0.1.0
one-more-test    0.1.0
one-moret-test   0.1.0
registry_key     0.1.0
starter          1.3.0

You can see cookbook list at the end
does not show test-one, test-two, test-cookbook.

@Vasu1105 Vasu1105 changed the title knife cookbook upload --all do not upload all cookbooks if anyone of the cookbook version is frozen. knife cookbook upload --all does not upload all cookbooks if anyone of the cookbook version is frozen. Dec 13, 2019
@Vasu1105 Vasu1105 changed the title knife cookbook upload --all does not upload all cookbooks if anyone of the cookbook version is frozen. knife cookbook upload --all does not upload all cookbooks if any one of the cookbook version is frozen. Dec 13, 2019
@lamont-granquist

This comment has been minimized.

Copy link
Contributor

@lamont-granquist lamont-granquist commented Dec 13, 2019

That's still very low priority. People should really be using Berkshelf or PolicyFiles, and if they're trying to upload everything they can still see the error and override it with --force which is probably what they're going to want to do. Until a user error comes in based on this, I'm not sure what the correct behavior would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.