Skip to content

Commit

Permalink
fix bool parameters for kubelet
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Feb 6, 2017
1 parent 8847fa8 commit d7bec03
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
2 changes: 0 additions & 2 deletions manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
$manage_package = true,
$ensure = 'present',
) {
validate_legacy('NotUndef[String]', 'validate_re', $ensure, ['.'])

include ::kubernetes::client

if $manage_package {
Expand Down
14 changes: 13 additions & 1 deletion manifests/node/kubelet.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# [*cloud_provider*]
# The provider for cloud services. By default, kubelet will attempt to auto-detect the cloud provider.
# Specify empty string for running with no cloud provider. [default=auto-detect]
# Default undef. (default "auto-detect")
# Default undef.
#
# [*cluster_dns*]
# IP address for a cluster DNS server. This value is used for containers' DNS server in case of Pods with "dnsPolicy=ClusterFirst"
Expand Down Expand Up @@ -556,6 +556,18 @@
) inherits kubernetes::node::params {
validate_re($ensure, '^(running|stopped)$')
validate_bool($enable)
if $allow_privileged { validate_bool($allow_privileged) }
if $containerized { validate_bool($containerized) }
if $cpu_cfs_quota { validate_bool($cpu_cfs_quota) }
if $enable_controller_attach_detach { validate_bool($enable_controller_attach_detach) }
if $enable_custom_metrics { validate_bool($enable_custom_metrics) }
if $enable_debugging_handlers { validate_bool($enable_debugging_handlers) }
if $enable_server { validate_bool($enable_server) }
if $register_node { validate_bool($register_node) }
if $register_schedulable { validate_bool($register_schedulable) }
if $require_kubeconfig { validate_bool($require_kubeconfig) }
if $runonce { validate_bool($runonce) }
if $serialize_image_pulls { validate_bool($serialize_image_pulls) }

include ::kubernetes::node

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-kubernetes",
"version": "3.4.2",
"version": "3.5.0",
"author": "Cristian Falcas",
"license": "Apache-2.0",
"summary": "Configuring and installing kubernetes",
Expand Down
24 changes: 14 additions & 10 deletions templates/etc/kubernetes/kubelet.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ KUBELET_API_SERVER="--api-servers=<%= Array(scope['kubernetes::node::kubelet::ap

# Add your own!
KUBELET_ARGS="<% -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::allow_privileged')) -%>
--allow-privileged=<%= scope['kubernetes::node::kubelet::allow_privileged'] -%>
<% end -%>
<% if @cadvisor_port -%>
--cadvisor-port=<%= scope['kubernetes::node::kubelet::cadvisor_port'] -%>
<% end -%>
Expand Down Expand Up @@ -52,10 +54,10 @@ KUBELET_ARGS="<% -%>
<% if @container_runtime_endpoint -%>
--container-runtime-endpoint=<%= scope['kubernetes::node::kubelet::container_runtime_endpoint'] -%>
<% end -%>
<% if @containerized -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::containerized')) -%>
--containerized=<%= scope['kubernetes::node::kubelet::containerized'] -%>
<% end -%>
<% if @cpu_cfs_quota -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::cpu_cfs_quota')) -%>
--cpu-cfs-quota=<%= scope['kubernetes::node::kubelet::cpu_cfs_quota'] -%>
<% end -%>
<% if @docker_endpoint -%>
Expand All @@ -64,16 +66,16 @@ KUBELET_ARGS="<% -%>
<% if @docker_exec_handler -%>
--docker-exec-handler=<%= scope['kubernetes::node::kubelet::docker_exec_handler'] -%>
<% end -%>
<% if @enable_controller_attach_detach -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::enable_controller_attach_detach')) -%>
--enable-controller-attach-detach=<%= scope['kubernetes::node::kubelet::enable_controller_attach_detach'] -%>
<% end -%>
<% if @enable_custom_metrics -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::enable_custom_metrics')) -%>
--enable-custom-metrics=<%= scope['kubernetes::node::kubelet::enable_custom_metrics'] -%>
<% end -%>
<% if @enable_debugging_handlers -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::enable_debugging_handlers')) -%>
--enable-debugging-handlers=<%= scope['kubernetes::node::kubelet::enable_debugging_handlers'] -%>
<% end -%>
<% if @enable_server -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::enable_server')) -%>
--enable-server=<%= scope['kubernetes::node::kubelet::enable_server'] -%>
<% end -%>
<% if @event_burst -%>
Expand Down Expand Up @@ -213,10 +215,10 @@ KUBELET_ARGS="<% -%>
<% if @reconcile_cidr -%>
--reconcile-cidr=<%= scope['kubernetes::node::kubelet::reconcile_cidr'] -%>
<% end -%>
<% if @register_node -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::register_node')) -%>
--register-node=<%= scope['kubernetes::node::kubelet::register_node'] -%>
<% end -%>
<% if @register_schedulable -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::register_schedulable')) -%>
--register-schedulable=<%= scope['kubernetes::node::kubelet::register_schedulable'] -%>
<% end -%>
<% if @registry_burst -%>
Expand All @@ -225,7 +227,7 @@ KUBELET_ARGS="<% -%>
<% if @registry_qps -%>
--registry-qps=<%= scope['kubernetes::node::kubelet::registry_qps'] -%>
<% end -%>
<% if @require_kubeconfig -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::require_kubeconfig')) -%>
--require-kubeconfig=<%= scope['kubernetes::node::kubelet::require_kubeconfig'] -%>
<% end -%>
<% if @resolv_conf -%>
Expand All @@ -240,7 +242,7 @@ KUBELET_ARGS="<% -%>
<% if @root_dir -%>
--root-dir=<%= scope['kubernetes::node::kubelet::root_dir'] -%>
<% end -%>
<% if @runonce -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::runonce')) -%>
--runonce=<%= scope['kubernetes::node::kubelet::runonce'] -%>
<% end -%>
<% if @runtime_cgroups -%>
Expand All @@ -249,7 +251,9 @@ KUBELET_ARGS="<% -%>
<% if @runtime_request_timeout -%>
--runtime-request-timeout=<%= scope['kubernetes::node::kubelet::runtime_request_timeout'] -%>
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('kubernetes::node::kubelet::serialize_image_pulls')) -%>
--serialize-image-pulls=<%= scope['kubernetes::node::kubelet::serialize_image_pulls'] -%>
<% end -%>
<% if @streaming_connection_idle_timeout -%>
--streaming-connection-idle-timeout=<%= scope['kubernetes::node::kubelet::streaming_connection_idle_timeout'] -%>
<% end -%>
Expand Down

0 comments on commit d7bec03

Please sign in to comment.