Skip to content
Closed
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
7 changes: 3 additions & 4 deletions pkg/asset/manifests/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var (

// Ingress generates the cluster-ingress-*.yml files.
type Ingress struct {
config *configv1.Ingress
FileList []*asset.File
}

Expand All @@ -47,7 +46,7 @@ func (ing *Ingress) Generate(dependencies asset.Parents) error {
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)

ing.config = &configv1.Ingress{
config := &configv1.Ingress{
TypeMeta: metav1.TypeMeta{
APIVersion: configv1.SchemeGroupVersion.String(),
Kind: "Ingress",
Expand All @@ -61,7 +60,7 @@ func (ing *Ingress) Generate(dependencies asset.Parents) error {
},
}

configData, err := yaml.Marshal(ing.config)
configData, err := yaml.Marshal(config)
if err != nil {
return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", ing.Name())
}
Expand Down Expand Up @@ -116,7 +115,7 @@ func (ing *Ingress) Load(f asset.FileFetcher) (bool, error) {

fileList := []*asset.File{crdFile, cfgFile}

ing.FileList, ing.config = fileList, ingressConfig
ing.FileList = fileList

return true, nil
}
14 changes: 7 additions & 7 deletions pkg/asset/manifests/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:

// Networking generates the cluster-network-*.yml files.
type Networking struct {
config *netopv1.NetworkConfig
Config *netopv1.NetworkConfig
FileList []*asset.File
}

Expand Down Expand Up @@ -104,7 +104,7 @@ func (no *Networking) Generate(dependencies asset.Parents) error {
}
}

no.config = &netopv1.NetworkConfig{
no.Config = &netopv1.NetworkConfig{
TypeMeta: metav1.TypeMeta{
APIVersion: netopv1.SchemeGroupVersion.String(),
Kind: "NetworkConfig",
Expand All @@ -121,7 +121,7 @@ func (no *Networking) Generate(dependencies asset.Parents) error {
},
}

configData, err := yaml.Marshal(no.config)
configData, err := yaml.Marshal(no.Config)
if err != nil {
return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", no.Name())
}
Expand Down Expand Up @@ -149,19 +149,19 @@ func (no *Networking) Files() []*asset.File {
// object. This is called by ClusterK8sIO, which captures generalized cluster
// state but shouldn't need to be fully networking aware.
func (no *Networking) ClusterNetwork() (*clusterv1a1.ClusterNetworkingConfig, error) {
if no.config == nil {
if no.Config == nil {
// should be unreachable.
return nil, errors.Errorf("ClusterNetwork called before initialization")
}

pods := []string{}
for _, cn := range no.config.Spec.ClusterNetworks {
for _, cn := range no.Config.Spec.ClusterNetworks {
pods = append(pods, cn.CIDR)
}

cn := &clusterv1a1.ClusterNetworkingConfig{
Services: clusterv1a1.NetworkRanges{
CIDRBlocks: []string{no.config.Spec.ServiceNetwork},
CIDRBlocks: []string{no.Config.Spec.ServiceNetwork},
},
Pods: clusterv1a1.NetworkRanges{
CIDRBlocks: pods,
Expand Down Expand Up @@ -196,7 +196,7 @@ func (no *Networking) Load(f asset.FileFetcher) (bool, error) {

fileList := []*asset.File{crdFile, cfgFile}

no.FileList, no.config = fileList, netConfig
no.FileList, no.Config = fileList, netConfig

return true, nil
}