Skip to content

Commit

Permalink
Cleanup: make conversion functions private
Browse files Browse the repository at this point in the history
Now some functions in "conversion" module are public but they are
used only inside the module, so it is reasonable to make them
private.

Also this commit fixes typos in deprecated properties descriptions.
  • Loading branch information
Fedosin committed Nov 13, 2020
1 parent 9be316b commit ae4f082
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/data/install.openshift.io_installconfigs.yaml
Expand Up @@ -664,7 +664,7 @@ spec:
description: NetworkType is the type of network to install. The default is OpenShiftSDN
type: string
serviceCIDR:
description: Depcreated name for ServiceNetwork
description: Deprecated name for ServiceNetwork
type: Any
serviceNetwork:
description: 'ServiceNetwork is the list of IP address pools for services. Default is 172.30.0.0/16. NOTE: currently only one entry is supported.'
Expand Down
12 changes: 6 additions & 6 deletions pkg/types/conversion/installconfig.go
Expand Up @@ -27,11 +27,11 @@ func ConvertInstallConfig(config *types.InstallConfig) error {
default:
return field.Invalid(field.NewPath("apiVersion"), config.APIVersion, fmt.Sprintf("cannot upconvert from version %s", config.APIVersion))
}
ConvertNetworking(config)
convertNetworking(config)

switch config.Platform.Name() {
case baremetal.Name:
ConvertBaremetal(config)
convertBaremetal(config)
case openstack.Name:
err := convertOpenStack(config)
if err != nil {
Expand All @@ -43,8 +43,8 @@ func ConvertInstallConfig(config *types.InstallConfig) error {
return nil
}

// ConvertNetworking upconverts deprecated fields in networking
func ConvertNetworking(config *types.InstallConfig) {
// convertNetworking upconverts deprecated fields in networking
func convertNetworking(config *types.InstallConfig) {
if config.Networking == nil {
return
}
Expand Down Expand Up @@ -85,10 +85,10 @@ func ConvertNetworking(config *types.InstallConfig) {
}
}

// ConvertBaremetal upconverts deprecated fields in the baremetal
// convertBaremetal upconverts deprecated fields in the baremetal
// platform. ProvisioningDHCPExternal has been replaced by setting
// the ProvisioningNetwork field to "Unmanaged"
func ConvertBaremetal(config *types.InstallConfig) {
func convertBaremetal(config *types.InstallConfig) {
if config.Platform.BareMetal.DeprecatedProvisioningDHCPExternal && config.Platform.BareMetal.ProvisioningNetwork == "" {
config.Platform.BareMetal.ProvisioningNetwork = baremetal.UnmanagedProvisioningNetwork
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/installconfig.go
Expand Up @@ -247,7 +247,7 @@ type Networking struct {
// +optional
ServiceNetwork []ipnet.IPNet `json:"serviceNetwork,omitempty"`

// Deprected types, scheduled to be removed
// Deprecated types, scheduled to be removed

// Deprecated name for MachineCIDRs. If set, MachineCIDRs must
// be empty or the first index must match.
Expand All @@ -258,7 +258,7 @@ type Networking struct {
// +optional
DeprecatedType string `json:"type,omitempty"`

// Depcreated name for ServiceNetwork
// Deprecated name for ServiceNetwork
// +optional
DeprecatedServiceCIDR *ipnet.IPNet `json:"serviceCIDR,omitempty"`

Expand Down

0 comments on commit ae4f082

Please sign in to comment.