mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
kubeadm: fix export comments to make golangci-lint happy
This commit is contained in:
parent
8caa6fb2e0
commit
c2a04fa1cf
@ -24,14 +24,17 @@ import (
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
||||
)
|
||||
|
||||
// Convert_kubeadm_InitConfiguration_To_v1beta3_InitConfiguration converts a private InitConfiguration to public InitConfiguration.
|
||||
func Convert_kubeadm_InitConfiguration_To_v1beta3_InitConfiguration(in *kubeadm.InitConfiguration, out *InitConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_kubeadm_InitConfiguration_To_v1beta3_InitConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_kubeadm_JoinConfiguration_To_v1beta3_JoinConfiguration converts a private JoinConfiguration to public JoinConfiguration.
|
||||
func Convert_kubeadm_JoinConfiguration_To_v1beta3_JoinConfiguration(in *kubeadm.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_kubeadm_JoinConfiguration_To_v1beta3_JoinConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1beta3_InitConfiguration_To_kubeadm_InitConfiguration converts a public InitConfiguration to private InitConfiguration.
|
||||
func Convert_v1beta3_InitConfiguration_To_kubeadm_InitConfiguration(in *InitConfiguration, out *kubeadm.InitConfiguration, s conversion.Scope) error {
|
||||
err := autoConvert_v1beta3_InitConfiguration_To_kubeadm_InitConfiguration(in, out, s)
|
||||
if err != nil {
|
||||
@ -65,6 +68,7 @@ func Convert_v1beta3_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(in *
|
||||
return autoConvert_v1beta3_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_kubeadm_ControlPlaneComponent_To_v1beta3_ControlPlaneComponent converts a private ControlPlaneComponent to public ControlPlaneComponent.
|
||||
func Convert_kubeadm_ControlPlaneComponent_To_v1beta3_ControlPlaneComponent(in *kubeadm.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error {
|
||||
out.ExtraArgs = convertFromArgs(in.ExtraArgs)
|
||||
return autoConvert_kubeadm_ControlPlaneComponent_To_v1beta3_ControlPlaneComponent(in, out, s)
|
||||
@ -77,16 +81,19 @@ func Convert_v1beta3_LocalEtcd_To_kubeadm_LocalEtcd(in *LocalEtcd, out *kubeadm.
|
||||
return autoConvert_v1beta3_LocalEtcd_To_kubeadm_LocalEtcd(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_kubeadm_LocalEtcd_To_v1beta3_LocalEtcd converts a private LocalEtcd to public LocalEtcd.
|
||||
func Convert_kubeadm_LocalEtcd_To_v1beta3_LocalEtcd(in *kubeadm.LocalEtcd, out *LocalEtcd, s conversion.Scope) error {
|
||||
out.ExtraArgs = convertFromArgs(in.ExtraArgs)
|
||||
return autoConvert_kubeadm_LocalEtcd_To_v1beta3_LocalEtcd(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1beta3_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions converts a public NodeRegistrationOptions to private NodeRegistrationOptions.
|
||||
func Convert_v1beta3_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(in *NodeRegistrationOptions, out *kubeadm.NodeRegistrationOptions, s conversion.Scope) error {
|
||||
out.KubeletExtraArgs = convertToArgs(in.KubeletExtraArgs)
|
||||
return autoConvert_v1beta3_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_kubeadm_NodeRegistrationOptions_To_v1beta3_NodeRegistrationOptions converts a private NodeRegistrationOptions to public NodeRegistrationOptions.
|
||||
func Convert_kubeadm_NodeRegistrationOptions_To_v1beta3_NodeRegistrationOptions(in *kubeadm.NodeRegistrationOptions, out *NodeRegistrationOptions, s conversion.Scope) error {
|
||||
out.KubeletExtraArgs = convertFromArgs(in.KubeletExtraArgs)
|
||||
return autoConvert_kubeadm_NodeRegistrationOptions_To_v1beta3_NodeRegistrationOptions(in, out, s)
|
||||
|
@ -135,6 +135,7 @@ func SetDefaults_JoinConfiguration(obj *JoinConfiguration) {
|
||||
SetDefaults_NodeRegistration(&obj.NodeRegistration)
|
||||
}
|
||||
|
||||
// SetDefaults_JoinControlPlane assigns default values for a joining control plane node
|
||||
func SetDefaults_JoinControlPlane(obj *JoinControlPlane) {
|
||||
if obj != nil {
|
||||
SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint)
|
||||
|
@ -22,10 +22,12 @@ import (
|
||||
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
|
||||
)
|
||||
|
||||
// Convert_kubeadm_InitConfiguration_To_v1beta4_InitConfiguration converts a private InitConfiguration to a public InitConfiguration.
|
||||
func Convert_kubeadm_InitConfiguration_To_v1beta4_InitConfiguration(in *kubeadm.InitConfiguration, out *InitConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_kubeadm_InitConfiguration_To_v1beta4_InitConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1beta4_InitConfiguration_To_kubeadm_InitConfiguration converts a public InitConfiguration to a private InitConfiguration.
|
||||
func Convert_v1beta4_InitConfiguration_To_kubeadm_InitConfiguration(in *InitConfiguration, out *kubeadm.InitConfiguration, s conversion.Scope) error {
|
||||
err := autoConvert_v1beta4_InitConfiguration_To_kubeadm_InitConfiguration(in, out, s)
|
||||
if err != nil {
|
||||
|
@ -142,6 +142,7 @@ func SetDefaults_JoinConfiguration(obj *JoinConfiguration) {
|
||||
SetDefaults_NodeRegistration(&obj.NodeRegistration)
|
||||
}
|
||||
|
||||
// SetDefaults_JoinControlPlane assigns default values for a joining control plane node
|
||||
func SetDefaults_JoinControlPlane(obj *JoinControlPlane) {
|
||||
if obj != nil {
|
||||
SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint)
|
||||
|
@ -212,6 +212,7 @@ func CleanDir(filePath string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsDirEmpty returns true if a directory is empty
|
||||
func IsDirEmpty(dir string) (bool, error) {
|
||||
d, err := os.Open(dir)
|
||||
if err != nil {
|
||||
|
@ -120,6 +120,7 @@ func loadConfig(cfgPath string, client clientset.Interface, skipComponentConfigs
|
||||
return initCfg, false, nil
|
||||
}
|
||||
|
||||
// LoadConfigFunc is a function type that loads configuration from a file and/or the cluster.
|
||||
type LoadConfigFunc func(cfgPath string, client clientset.Interface, skipComponentConfigs bool, printer output.Printer) (*kubeadmapi.InitConfiguration, bool, error)
|
||||
|
||||
// enforceRequirements verifies that it's okay to upgrade and then returns the variables needed for the rest of the procedure
|
||||
|
@ -248,6 +248,7 @@ func unupgradedControlPlaneInstances(client clientset.Interface, nodeName string
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// WriteKubeletConfigFiles writes the kubelet config file to disk, but first creates a backup of any existing one.
|
||||
func WriteKubeletConfigFiles(cfg *kubeadmapi.InitConfiguration, patchesDir string, dryRun bool, out io.Writer) error {
|
||||
// Set up the kubelet directory to use. If dry-running, this will return a fake directory
|
||||
kubeletDir, err := GetKubeletDir(dryRun)
|
||||
|
@ -893,6 +893,7 @@ func (MemCheck) Name() string {
|
||||
return "Mem"
|
||||
}
|
||||
|
||||
// InitNodeChecks returns checks specific to "kubeadm init"
|
||||
func InitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.Set[string], isSecondaryControlPlane bool, downloadCerts bool) ([]Checker, error) {
|
||||
if !isSecondaryControlPlane {
|
||||
// First, check if we're root separately from the other preflight checks and fail fast
|
||||
@ -1013,6 +1014,7 @@ func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigura
|
||||
return RunChecks(checks, os.Stderr, ignorePreflightErrors)
|
||||
}
|
||||
|
||||
// JoinNodeChecks returns checks specific to "kubeadm join"
|
||||
func JoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfiguration, ignorePreflightErrors sets.Set[string]) ([]Checker, error) {
|
||||
// First, check if we're root separately from the other preflight checks and fail fast
|
||||
if err := RunRootCheckOnly(ignorePreflightErrors); err != nil {
|
||||
|
@ -38,8 +38,10 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrInvalidSubCommandMsg is an error message returned on invalid subcommands
|
||||
ErrInvalidSubCommandMsg = "invalid subcommand"
|
||||
ErrExit = errors.New("exit")
|
||||
// ErrExit is an error returned when kubeadm is about to exit
|
||||
ErrExit = errors.New("exit")
|
||||
)
|
||||
|
||||
// fatal prints the message if set and then exits.
|
||||
|
@ -53,6 +53,8 @@ var etcdBackoff = wait.Backoff{
|
||||
Jitter: 0.1,
|
||||
}
|
||||
|
||||
// ErrNoMemberIDForPeerURL is returned when it is not possible to obtain a member ID
|
||||
// from a given peer URL
|
||||
var ErrNoMemberIDForPeerURL = errors.New("no member id found for peer URL")
|
||||
|
||||
// ClusterInterrogator is an interface to get etcd cluster related information
|
||||
|
@ -75,6 +75,7 @@ func (ps *patchSet) String() string {
|
||||
)
|
||||
}
|
||||
|
||||
// KubeletConfiguration defines the kubeletconfiguration patch target.
|
||||
const KubeletConfiguration = "kubeletconfiguration"
|
||||
|
||||
var (
|
||||
@ -102,6 +103,7 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
// KnownTargets returns the locally defined knownTargets.
|
||||
func KnownTargets() []string {
|
||||
return knownTargets
|
||||
}
|
||||
|
@ -623,6 +623,7 @@ func EncodePublicKeyPEM(key crypto.PublicKey) ([]byte, error) {
|
||||
// NewPrivateKey returns a new private key.
|
||||
var NewPrivateKey = GeneratePrivateKey
|
||||
|
||||
// GeneratePrivateKey is the default function for generating private keys.
|
||||
func GeneratePrivateKey(keyType kubeadmapi.EncryptionAlgorithmType) (crypto.Signer, error) {
|
||||
if keyType == kubeadmapi.EncryptionAlgorithmECDSA {
|
||||
return ecdsa.GenerateKey(elliptic.P256(), cryptorand.Reader)
|
||||
|
@ -411,6 +411,8 @@ func getProbeAddress(addr string) string {
|
||||
return addr
|
||||
}
|
||||
|
||||
// GetUsersAndGroups returns the local usersAndGroups, but first creates it
|
||||
// in a thread safe way once.
|
||||
func GetUsersAndGroups() (*users.UsersAndGroups, error) {
|
||||
var err error
|
||||
usersAndGroupsOnce.Do(func() {
|
||||
|
@ -129,7 +129,7 @@ func (u *EntryMap) String() string {
|
||||
return strings.Join(lines, "")
|
||||
}
|
||||
|
||||
// Is a public wrapper around addUsersAndGroupsImpl with default system file paths.
|
||||
// AddUsersAndGroups is a public wrapper around addUsersAndGroupsImpl with default system file paths.
|
||||
func AddUsersAndGroups() (*UsersAndGroups, error) {
|
||||
return addUsersAndGroupsImpl(fileEtcLoginDefs, fileEtcPasswd, fileEtcGroup)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user