Open ipochi opened 4 years ago
I think it's fine to do the inheritance. I can imagine the case where different SSH keys are desired for worker nodes. It seems we can also use optional
for []string
in HCL, which allows passing empty array explicitly in the configuration, so SSH keys can be completely disabled for workers, if desired.
So I'd say:
ssh_pubkeys
to be not-empty: len(c.SSHPubKeys) > 0
if workerPool.SSHPubKeys == nil { workerPool.SSHPubKeys = c.SSHPubKeys }
.I agree with @invidian.
I agree with the above. To emphasize, I think the default behavior should be the simplest, most common use case (one key to rule them all :ring:) and at the same time the user should be able to specify key A for controllers, key B for worker pool 1 and key C for worker pool 2.
In terms of implementation, I'm for the "implicit approach" (worker pools use the controller keys unless specified otherwise).
This issue is about how to inherit the values of duplicate fields that exist in worker pools and controllers, if not provided by the user.
variable
This would mean thatworker_pool.ssh_pubkeys
is required and must be provided by the user.Example of an AWS configuration:
lokoctl
check if the field is provided or not and then inherit from the controller.This would mean that
worker_pool.ssh_pubkeys
is optional and if not present in the configuration, the value is inherited from the controller configuration.Current status in the supported non-managed platforms:
Packet:
worker_pool.ssh_pubkeys
field not present but there should be as part of feature and platform parity. AWS:worker_pool.ssh_pubkeys
is required and explicitly duplicated by the user. Baremetal: no worker_pool concept yet.