Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v1.4] config: Unmarshal to versioned KubeOneCluster #1861

Merged
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
78 changes: 3 additions & 75 deletions pkg/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"github.com/spf13/pflag"
yaml "gopkg.in/yaml.v2"

kubeoneapi "k8c.io/kubeone/pkg/apis/kubeone"
"k8c.io/kubeone/pkg/apis/kubeone/config"
kubeonev1beta2 "k8c.io/kubeone/pkg/apis/kubeone/v1beta2"
"k8c.io/kubeone/pkg/containerruntime"
"k8c.io/kubeone/pkg/templates/machinecontroller"
"k8c.io/kubeone/pkg/yamled"
Expand Down Expand Up @@ -272,7 +272,7 @@ func runPrint(printOptions *printOpts) error {
return errors.Wrap(err, "unable to run the example manifest template")
}

cfg := &kubeoneapi.KubeOneCluster{}
cfg := &kubeonev1beta2.KubeOneCluster{}
err = kyaml.UnmarshalStrict(buffer.Bytes(), &cfg)
if err != nil {
return errors.Wrap(err, "failed to decode new config")
Expand Down Expand Up @@ -502,7 +502,7 @@ func validateAndPrintConfig(cfgYaml interface{}) error {
return errors.Wrap(err, "failed to encode new config as YAML")
}

cfg := &kubeoneapi.KubeOneCluster{}
cfg := &kubeonev1beta2.KubeOneCluster{}
err = kyaml.UnmarshalStrict(buffer.Bytes(), &cfg)
if err != nil {
return errors.Wrap(err, "failed to decode new config")
Expand Down Expand Up @@ -749,78 +749,6 @@ systemPackages:
# will add Docker and Kubernetes repositories to OS package manager
configureRepositories: true # it's true by default

# assetConfiguration controls how assets (e.g. CNI, Kubelet, kube-apiserver, and more) are pulled.
# The AssetConfiguration API is an alpha API currently working only on Amazon Linux 2.
assetConfiguration:
# kubernetes configures the image registry and repository for the core Kubernetes
# images (kube-apiserver, kube-controller-manager, kube-scheduler, and kube-proxy).
# kubernetes respects only ImageRepository (ImageTag is ignored).
# Default image repository and tag: defaulted dynamically by Kubeadm.
# Defaults to RegistryConfiguration.OverwriteRegistry if left empty
# and RegistryConfiguration.OverwriteRegistry is specified.
kubernetes:
# imageRepository customizes the registry/repository
imageRepository: ""
# pause configures the sandbox (pause) image to be used by Kubelet.
# Default image repository and tag: defaulted dynamically by Kubeadm.
# Defaults to RegistryConfiguration.OverwriteRegistry if left empty
# and RegistryConfiguration.OverwriteRegistry is specified.
pause:
# imageRepository customizes the registry/repository
imageRepository: ""
# imageTag customizes the image tag
imageTag: ""
# coreDNS configures the image registry and tag to be used for deploying
# the CoreDNS component.
# Default image repository and tag: defaulted dynamically by Kubeadm.
# Defaults to RegistryConfiguration.OverwriteRegistry if left empty
# and RegistryConfiguration.OverwriteRegistry is specified.
coreDNS:
# imageRepository customizes the registry/repository
imageRepository: ""
# imageTag customizes the image tag
imageTag: ""
# etcd configures the image registry and tag to be used for deploying
# the Etcd component.
# Default image repository and tag: defaulted dynamically by Kubeadm.
# Defaults to RegistryConfiguration.OverwriteRegistry if left empty
# and RegistryConfiguration.OverwriteRegistry is specified.
etcd:
# imageRepository customizes the registry/repository
imageRepository: ""
# imageTag customizes the image tag
imageTag: ""
# metricsServer configures the image registry and tag to be used for deploying
# the metrics-server component.
# Default image repository and tag: defaulted dynamically by Kubeadm.
# Defaults to RegistryConfiguration.OverwriteRegistry if left empty
# and RegistryConfiguration.OverwriteRegistry is specified.
metricsServer:
# imageRepository customizes the registry/repository
imageRepository: ""
# imageTag customizes the image tag
imageTag: ""
# cni configures the source for downloading the CNI binaries.
# If not specified, kubernetes-cni package will be installed.
# Default: none
cni:
url: ""
# nodeBinaries configures the source for downloading the
# Kubernetes Node Binaries tarball (e.g. kubernetes-node-linux-amd64.tar.gz).
# The tarball must have .tar.gz as the extension and must contain the
# following files:
# - kubernetes/node/bin/kubelet
# - kubernetes/node/bin/kubeadm
# If not specified, kubelet and kubeadm packages will be installed.
# Default: none
nodeBinaries:
url: ""
# kubectl configures the source for downloading the Kubectl binary.
# If not specified, kubelet package will be installed.
# Default: none
kubectl:
url: ""

# registryConfiguration controls how images used for components deployed by
# KubeOne and kubeadm are pulled from an image registry
registryConfiguration:
Expand Down