Skip to content
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
4 changes: 2 additions & 2 deletions installer/pkg/config-generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ go_library(
importpath = "github.com/openshift/installer/installer/pkg/config-generator",
visibility = ["//visibility:public"],
deps = [
"//installer/pkg/config:go_default_library",
"//installer/pkg/copy:go_default_library",
"//pkg/asset/tls:go_default_library",
"//pkg/ipnet:go_default_library",
"//pkg/rhcos:go_default_library",
"//pkg/types:go_default_library",
"//pkg/types/config:go_default_library",
"//vendor/github.com/apparentlymart/go-cidr/cidr:go_default_library",
"//vendor/github.com/coreos/ignition/config/v2_2:go_default_library",
"//vendor/github.com/coreos/ignition/config/v2_2/types:go_default_library",
Expand All @@ -36,8 +36,8 @@ go_test(
data = glob(["fixtures/**"]),
embed = [":go_default_library"],
deps = [
"//installer/pkg/config:go_default_library",
"//pkg/asset/tls:go_default_library",
"//pkg/types/config:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
],
)
4 changes: 2 additions & 2 deletions installer/pkg/config-generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"github.com/ghodss/yaml"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/rhcos"
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/config"
)

const (
Expand Down Expand Up @@ -119,7 +119,7 @@ func (c *ConfigGenerator) maoConfig(clusterDir string) (*maoOperatorConfig, erro
if c.AWS.EC2AMIOverride != "" {
ami = c.AWS.EC2AMIOverride
} else {
ami, err = rhcos.AMI(config.DefaultChannel, c.Region)
ami, err = rhcos.AMI(rhcos.DefaultChannel, c.Region)
if err != nil {
return nil, fmt.Errorf("failed to lookup RHCOS AMI: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/config-generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"testing"

"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/asset/tls"
"github.com/openshift/installer/pkg/types/config"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/config-generator/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

ignconfig "github.com/coreos/ignition/config/v2_2"
ignconfigtypes "github.com/coreos/ignition/config/v2_2/types"
"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/types/config"
"github.com/vincent-petithory/dataurl"
)

Expand Down
153 changes: 0 additions & 153 deletions installer/pkg/config/cluster.go

This file was deleted.

4 changes: 2 additions & 2 deletions installer/pkg/workflow/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ go_library(
importpath = "github.com/openshift/installer/installer/pkg/workflow",
visibility = ["//visibility:public"],
deps = [
"//installer/pkg/config:go_default_library",
"//installer/pkg/config-generator:go_default_library",
"//installer/pkg/copy:go_default_library",
"//pkg/types/config:go_default_library",
"//vendor/github.com/Sirupsen/logrus:go_default_library",
"//vendor/gopkg.in/yaml.v2:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
Expand All @@ -37,5 +37,5 @@ go_test(
],
data = glob(["fixtures/**"]),
embed = [":go_default_library"],
deps = ["//installer/pkg/config:go_default_library"],
deps = ["//pkg/types/config:go_default_library"],
)
2 changes: 1 addition & 1 deletion installer/pkg/workflow/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io/ioutil"

"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/types/config"
)

// ConvertWorkflow creates new instances of the 'convert' workflow,
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

yaml "gopkg.in/yaml.v2"

"github.com/openshift/installer/installer/pkg/config"
configgenerator "github.com/openshift/installer/installer/pkg/config-generator"
"github.com/openshift/installer/installer/pkg/copy"
"github.com/openshift/installer/pkg/types/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"regexp"
"testing"

"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/types/config"
)

func initTestCluster(cfg string) (*config.Cluster, error) {
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path"
"path/filepath"

"github.com/openshift/installer/installer/pkg/config"
configgenerator "github.com/openshift/installer/installer/pkg/config-generator"
"github.com/openshift/installer/pkg/types/config"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion installer/pkg/workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package workflow

import (
log "github.com/Sirupsen/logrus"
"github.com/openshift/installer/installer/pkg/config"
"github.com/openshift/installer/pkg/types/config"
)

// metadata is the state store of the current workflow execution.
Expand Down
3 changes: 3 additions & 0 deletions pkg/asset/cluster/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package cluster contains asset targets that generates the terraform file,
// prepare the infra, and bootstrap the cluster.
package cluster
34 changes: 34 additions & 0 deletions pkg/asset/cluster/stock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package cluster

import (
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/ignition"
"github.com/openshift/installer/pkg/asset/installconfig"
)

// Stock is the stock of the cluster assets that can be generated.
type Stock interface {
// TFVars is the asset that generates the terraform.tfvar file
TFVars() asset.Asset
}

// StockImpl is the implementation of the cluster asset stock.
type StockImpl struct {
tfvars asset.Asset
}

var _ Stock = (*StockImpl)(nil)

// EstablishStock establishes the stock of assets in the specified directory.
func (s *StockImpl) EstablishStock(rootDir string, installConfigStock installconfig.Stock, ignitionStock ignition.Stock) {
s.tfvars = &TerraformVariables{
rootDir: rootDir,
installConfig: installConfigStock.InstallConfig(),
bootstrapIgnition: ignitionStock.BootstrapIgnition(),
masterIgnition: ignitionStock.MasterIgnition(),
workerIgnition: ignitionStock.WorkerIgnition(),
}
}

// TFVars returns the terraform tfvar asset.
func (s *StockImpl) TFVars() asset.Asset { return s.tfvars }
Loading