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

feat: make etcd_bin_prefix customizable #1

Merged
merged 4 commits into from
Mar 1, 2023

Conversation

EtienneM
Copy link
Member

@EtienneM EtienneM commented Feb 27, 2023

Related to sous-chefs#139

I tested it in staging. PR on the kitchen incoming.

@EtienneM EtienneM self-assigned this Feb 27, 2023
@EtienneM EtienneM changed the title feat: make etcd_bin_prefix customizable feat: make etcd_bin_prefix customizable Feb 27, 2023
@EtienneM EtienneM force-pushed the fix/kitchen/1633/different_etcd_versions branch from d7b933e to ca37a55 Compare February 27, 2023 17:40
@EtienneM EtienneM force-pushed the fix/kitchen/1633/different_etcd_versions branch from ca37a55 to 3a2a64a Compare March 1, 2023 10:10
@@ -16,8 +16,9 @@ def self.included(base)
#####################
# set default service name like etcd.service
property :default_service_name, kind_of: [TrueClass, FalseClass], default: false
property :etcd_bin_prefix, String, default: '/usr/local/bin', desired_state: false
Copy link
Member Author

Choose a reason for hiding this comment

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

Default used to be /usr/bin. But from what I understand that is not what /usr/bin is for (https://unix.stackexchange.com/a/259238). /usr/local/bin seems more appropriate.

Comment on lines +37 to +40
file 'etcd_checksum' do
path "#{new_resource.etcd_bin_prefix}/.etcd_checksum"
content new_resource.checksum
end
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to store the checksum in a file so that we trigger the extraction of etcd and etcdctl when the checksum (hence the etcd version) changes.

Comment on lines -79 to -93
def etcd_bin
"#{etcd_bin_prefix}/etcd"
end

def etcd_bin_prefix
'/usr/bin'
end

def etcdctl_bin
"#{etcdctl_bin_prefix}/etcdctl"
end

def etcdctl_bin_prefix
etcd_bin_prefix
end
Copy link
Member Author

Choose a reason for hiding this comment

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

These are now only declared in a single place, libraries/helpers_service.rb, rather than duplicated.

@EtienneM EtienneM requested a review from Soulou March 1, 2023 10:49
@EtienneM EtienneM marked this pull request as ready for review March 1, 2023 10:49
@EtienneM EtienneM enabled auto-merge March 1, 2023 10:49
@EtienneM EtienneM requested review from brandon-welsch and removed request for Soulou March 1, 2023 11:21
Copy link
Member

@brandon-welsch brandon-welsch left a comment

Choose a reason for hiding this comment

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

LGTM

@EtienneM EtienneM merged commit 97588dd into master Mar 1, 2023
@EtienneM EtienneM deleted the fix/kitchen/1633/different_etcd_versions branch March 1, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants