Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/bootstrap/kubeadm/v1beta2/kubeadm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ type LocalEtcd struct {
type ExternalEtcd struct {
// endpoints of etcd members. Required for ExternalEtcd.
// +required
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=50
// +kubebuilder:validation:items:MinLength=1
// +kubebuilder:validation:items:MaxLength=512
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions controlplane/kubeadm/internal/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ func dropOmittableFields(spec *bootstrapv1.KubeadmConfigSpec) {
}
// NOTE: we are not dropping spec.ClusterConfiguration.Etcd.ExternalEtcd.Endpoints because this field
// doesn't have omitempty, so [] array is different from nil when serialized.
// But this field is also required and has MinItems=1, so it will
// never actually be nil or an empty array so that difference also won't trigger any rollouts.
if len(spec.ClusterConfiguration.APIServer.ExtraArgs) == 0 {
spec.ClusterConfiguration.APIServer.ExtraArgs = nil
}
Expand Down
4 changes: 3 additions & 1 deletion controlplane/kubeadm/internal/filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,9 @@ func TestOmittableFieldsClusterConfiguration(t *testing.T) {
PeerCertSANs: nil,
},
External: &bootstrapv1.ExternalEtcd{
Endpoints: []string{}, // The field doesn't have omit empty.
// The field doesn't have omit empty. It also is required and has MinItems=1, so it will
// never actually be nil or an empty array so that difference also won't trigger any rollouts.
Endpoints: []string{},
},
},
APIServer: bootstrapv1.APIServer{
Expand Down