Skip to content

Commit

Permalink
fix: validate that workers don't get cluster CA key
Browse files Browse the repository at this point in the history
Only the cert should be present on worker nodes, enforce this via
validation.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Apr 10, 2024
1 parent 3735add commit c6ad0fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/machinery/config/types/v1alpha1/v1alpha1_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ func (c *ClusterConfig) Validate(isControlPlane bool) error {
}
}

if c.ClusterCA != nil && !isControlPlane && len(c.ClusterCA.Key) > 0 {
result = multierror.Append(result, errors.New("cluster CA key is not allowed on non-controlplane nodes (.cluster.ca)"))
}

result = multierror.Append(
result,
c.ClusterInlineManifests.Validate(),
Expand Down

0 comments on commit c6ad0fc

Please sign in to comment.