mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-24 19:38:02 +00:00
kubeadm: simplify fuzzing of ClusterConfiguration
- Pin the ClusterConfiguration when fuzzing the internal InitConfiguration that embeds it. Kubeadm includes separate constructs for this embedding in the internal type and this round trip is not viable. - Remove the artificial calls to SetDefaults_ClusterConfiguration() in v1beta{2|3}'s converters from public to internal InitConfiguration. - Make sure the internal InitConfiguration.ClusterConfiguration is defaulted in initconfiguration.go instead.
This commit is contained in:
@@ -340,6 +340,13 @@ func documentMapToInitConfiguration(gvkmap kubeadmapi.DocumentMap, allowDeprecat
|
||||
// If ClusterConfiguration was given, populate it in the InitConfiguration struct
|
||||
if clustercfg != nil {
|
||||
initcfg.ClusterConfiguration = *clustercfg
|
||||
} else {
|
||||
// Populate the internal InitConfiguration.ClusterConfiguration with defaults
|
||||
extclustercfg := &kubeadmapiv1.ClusterConfiguration{}
|
||||
kubeadmscheme.Scheme.Default(extclustercfg)
|
||||
if err := kubeadmscheme.Scheme.Convert(extclustercfg, &initcfg.ClusterConfiguration, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Load any component configs
|
||||
|
Reference in New Issue
Block a user