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

Bug 1833483: Revert "baremetal: send full ignition to masters" #3589

Merged
merged 1 commit into from
May 12, 2020
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
16 changes: 7 additions & 9 deletions data/data/baremetal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ module "bootstrap" {
module "masters" {
source = "./masters"

master_count = var.master_count
ignition = var.ignition_master
hosts = var.hosts
properties = var.properties
root_devices = var.root_devices
driver_infos = var.driver_infos
instance_infos = var.instance_infos
ignition_url = var.ignition_url
ignition_url_ca_cert = var.ignition_url_ca_cert
master_count = var.master_count
ignition = var.ignition_master
hosts = var.hosts
properties = var.properties
root_devices = var.root_devices
driver_infos = var.driver_infos
instance_infos = var.instance_infos
}
5 changes: 2 additions & 3 deletions data/data/baremetal/masters/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ resource "ironic_deployment" "openshift-master-deployment" {
count.index,
)

instance_info = var.instance_infos[count.index]
user_data_url = var.ignition_url
user_data_url_ca_cert = var.ignition_url_ca_cert
instance_info = var.instance_infos[count.index]
user_data = var.ignition
}

10 changes: 0 additions & 10 deletions data/data/baremetal/masters/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,3 @@ variable "instance_infos" {
type = list(map(string))
description = "Instance information for hosts"
}

variable "ignition_url" {
type = string
description = "The URL of the full ignition"
}

variable "ignition_url_ca_cert" {
type = string
description = "Root CA cert of the full ignition URL"
}
10 changes: 0 additions & 10 deletions data/data/baremetal/variables-baremetal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,3 @@ variable "instance_infos" {
type = list(map(string))
description = "Instance information for hosts"
}

variable "ignition_url" {
type = string
description = "The URL of the full ignition"
}

variable "ignition_url_ca_cert" {
type = string
description = "Root CA cert of the full ignition URL"
}
15 changes: 1 addition & 14 deletions pkg/asset/cluster/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ package cluster

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/url"
"os"
"strings"

Expand All @@ -33,7 +30,6 @@ import (
"github.com/openshift/installer/pkg/asset/machines"
"github.com/openshift/installer/pkg/asset/openshiftinstall"
"github.com/openshift/installer/pkg/asset/rhcos"
"github.com/openshift/installer/pkg/asset/tls"
"github.com/openshift/installer/pkg/tfvars"
awstfvars "github.com/openshift/installer/pkg/tfvars/aws"
azuretfvars "github.com/openshift/installer/pkg/tfvars/azure"
Expand Down Expand Up @@ -93,7 +89,6 @@ func (t *TerraformVariables) Dependencies() []asset.Asset {
&machine.Master{},
&machines.Master{},
&machines.Worker{},
&tls.RootCA{},
}
}

Expand All @@ -108,8 +103,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
workersAsset := &machines.Worker{}
rhcosImage := new(rhcos.Image)
rhcosBootstrapImage := new(rhcos.BootstrapImage)
rootCA := &tls.RootCA{}
parents.Get(clusterID, installConfig, bootstrapIgnAsset, masterIgnAsset, mastersAsset, workersAsset, rhcosImage, rhcosBootstrapImage, rootCA)
parents.Get(clusterID, installConfig, bootstrapIgnAsset, masterIgnAsset, mastersAsset, workersAsset, rhcosImage, rhcosBootstrapImage)

platform := installConfig.Config.Platform.Name()
switch platform {
Expand Down Expand Up @@ -405,11 +399,6 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
Data: data,
})
case baremetal.Name:
ignitionURL := &url.URL{
Scheme: "https",
Host: net.JoinHostPort(installConfig.Config.Platform.BareMetal.APIVIP, "22623"),
Path: "config/master",
}
data, err = baremetaltfvars.TFVars(
installConfig.Config.Platform.BareMetal.LibvirtURI,
installConfig.Config.Platform.BareMetal.BootstrapProvisioningIP,
Expand All @@ -418,8 +407,6 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
installConfig.Config.Platform.BareMetal.ProvisioningBridge,
installConfig.Config.Platform.BareMetal.Hosts,
string(*rhcosImage),
ignitionURL.String(),
base64.StdEncoding.EncodeToString(rootCA.Cert()),
)
if err != nil {
return errors.Wrapf(err, "failed to get %s Terraform variables", platform)
Expand Down
6 changes: 1 addition & 5 deletions pkg/tfvars/baremetal/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ type config struct {
BootstrapOSImage string `json:"bootstrap_os_image,omitempty"`
ExternalBridge string `json:"external_bridge,omitempty"`
ProvisioningBridge string `json:"provisioning_bridge,omitempty"`
IgnitionURL string `json:"ignition_url,omitempty"`
IgnitionURLCACert string `json:"ignition_url_ca_cert,omitempty"`

// Data required for control plane deployment - several maps per host, because of terraform's limitations
Hosts []map[string]interface{} `json:"hosts"`
Expand All @@ -34,7 +32,7 @@ type config struct {
}

// TFVars generates bare metal specific Terraform variables.
func TFVars(libvirtURI, bootstrapProvisioningIP, bootstrapOSImage, externalBridge, provisioningBridge string, platformHosts []*baremetal.Host, image string, ignitionURL string, ignitionURLCACert string) ([]byte, error) {
func TFVars(libvirtURI, bootstrapProvisioningIP, bootstrapOSImage, externalBridge, provisioningBridge string, platformHosts []*baremetal.Host, image string) ([]byte, error) {
bootstrapOSImage, err := cache.DownloadImageFile(bootstrapOSImage)
if err != nil {
return nil, errors.Wrap(err, "failed to use cached bootstrap libvirt image")
Expand Down Expand Up @@ -134,8 +132,6 @@ func TFVars(libvirtURI, bootstrapProvisioningIP, bootstrapOSImage, externalBridg
DriverInfos: driverInfos,
RootDevices: rootDevices,
InstanceInfos: instanceInfos,
IgnitionURL: ignitionURL,
IgnitionURLCACert: ignitionURLCACert,
}

return json.MarshalIndent(cfg, "", " ")
Expand Down