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
6 changes: 3 additions & 3 deletions pkg/asset/agent/image/baseiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/pkg/errors"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/openshift/installer/pkg/rhcos"
)

Expand Down Expand Up @@ -87,16 +88,15 @@ func getIsoFromReleasePayload() (string, error) {
// Dependencies returns dependencies used by the asset.
func (i *BaseIso) Dependencies() []asset.Asset {
return []asset.Asset{
// TODO - will need to depend on installConfig for disconnected image registry
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate the baseIso
func (i *BaseIso) Generate(p asset.Parents) error {

// TODO - if image registry location is defined in InstallConfig,
// ic := &installconfig.InstallConfig{}
// ic := &agent.OptionalInstallConfig{}
// p.Get(ic)
// use the GetIso function to get the BaseIso from the release payload
isoGetter := newGetIso(GetIsoPluggable)
Expand Down
37 changes: 37 additions & 0 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package agent

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

// OptionalInstallConfig is an InstallConfig where the default is empty, rather
// than generated from running the survey.
type OptionalInstallConfig struct {
installconfig.InstallConfig
Supplied bool
}

// Dependencies returns all of the dependencies directly needed by an
// InstallConfig asset.
func (a *OptionalInstallConfig) Dependencies() []asset.Asset {
// Return no dependencies for the Agent install config, because it is
// optional. We don't need to run the survey if it doesn't exist, since the
// user may have supplied cluster-manifests that fully define the cluster.
return []asset.Asset{}
}

// Generate generates the install-config.yaml file.
func (a *OptionalInstallConfig) Generate(parents asset.Parents) error {
// Just generate an empty install config, since we have no dependencies.
return nil
}

// Load returns the installconfig from disk.
func (a *OptionalInstallConfig) Load(f asset.FileFetcher) (bool, error) {
found, err := a.InstallConfig.Load(f)
if found && err == nil {
a.Supplied = true
}
return found, err
}
5 changes: 3 additions & 2 deletions pkg/asset/agent/manifests/agentclusterinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

hiveext "github.com/openshift/assisted-service/api/hiveextension/v1beta1"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/pkg/errors"
"sigs.k8s.io/yaml"
)
Expand All @@ -32,13 +33,13 @@ func (*AgentClusterInstall) Name() string {
// the asset.
func (*AgentClusterInstall) Dependencies() []asset.Asset {
return []asset.Asset{
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate generates the AgentClusterInstall manifest.
func (a *AgentClusterInstall) Generate(dependencies asset.Parents) error {
// installConfig := &installconfig.InstallConfig{}
// installConfig := &agent.OptionalInstallConfig{}
// dependencies.Get(installConfig)

// agentClusterInstall := &hiveext.AgentClusterInstall{
Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/agent/manifests/agentclusterinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
// {
// name: "default",
// dependencies: []asset.Asset{
// &installconfig.InstallConfig{
// &agent.OptionalInstallConfig{
// Config: &types.InstallConfig{
// ObjectMeta: v1.ObjectMeta{
// Name: "ocp-edge-cluster-0",
Expand Down Expand Up @@ -104,7 +104,7 @@ func TestAgentClusterInstall_Generate(t *testing.T) {

// func TestAgentClusterInstall_Generate(t *testing.T) {

// installConfig := &installconfig.InstallConfig{
// installConfig := &agent.OptionalInstallConfig{
// Config: &types.InstallConfig{
// ObjectMeta: v1.ObjectMeta{
// Name: "cluster0-name",
Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/agent/manifests/agentpullsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"sigs.k8s.io/yaml"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/pkg/errors"
)

Expand All @@ -35,14 +36,14 @@ func (*AgentPullSecret) Name() string {
// the asset.
func (*AgentPullSecret) Dependencies() []asset.Asset {
return []asset.Asset{
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate generates the AgentPullSecret manifest.
func (a *AgentPullSecret) Generate(dependencies asset.Parents) error {

// installConfigAsset := &installconfig.InstallConfig{}
// installConfigAsset := &agent.OptionalInstallConfig{}
// dependencies.Get(installConfigAsset)

// secret := &corev1.Secret{
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/agent/manifests/agentpullsecret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAgentPullSecret_Generate(t *testing.T) {
// {
// name: "default",
// dependencies: []asset.Asset{
// &installconfig.InstallConfig{
// &agent.OptionalInstallConfig{
// Config: &types.InstallConfig{
// ObjectMeta: v1.ObjectMeta{
// Namespace: "cluster-0",
Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/agent/manifests/clusterdeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"sigs.k8s.io/yaml"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
)

var (
Expand All @@ -33,7 +34,7 @@ func (*ClusterDeployment) Name() string {
// the asset.
func (*ClusterDeployment) Dependencies() []asset.Asset {
return []asset.Asset{
// TODO: add dependency to InstallConfig when generation is implemented
&agent.OptionalInstallConfig{},
}
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/agent/manifests/clusterimageset.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

hivev1 "github.com/openshift/hive/apis/hive/v1"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/openshift/installer/pkg/asset/releaseimage"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/validation/field"
Expand Down Expand Up @@ -35,15 +36,15 @@ func (*ClusterImageSet) Name() string {
func (*ClusterImageSet) Dependencies() []asset.Asset {
return []asset.Asset{
// &releaseimage.Image{},
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate generates the ClusterImageSet manifest.
func (a *ClusterImageSet) Generate(dependencies asset.Parents) error {

// releaseImage := &releaseimage.Image{}
// installConfig := &installconfig.InstallConfig{}
// installConfig := &agent.OptionalInstallConfig{}
// dependencies.Get(releaseImage, installConfig)

// currentVersion, err := version.Version()
Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/agent/manifests/infraenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"sigs.k8s.io/yaml"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
)

var (
Expand All @@ -34,15 +35,15 @@ func (*InfraEnv) Name() string {
// the asset.
func (*InfraEnv) Dependencies() []asset.Asset {
return []asset.Asset{
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
// &AgentPullSecret{},
}
}

// Generate generates the InfraEnv manifest.
func (i *InfraEnv) Generate(dependencies asset.Parents) error {

// installConfig := &installconfig.InstallConfig{}
// installConfig := &agent.OptionalInstallConfig{}
// agentPullSecret := &AgentPullSecret{}
// dependencies.Get(installConfig, agentPullSecret)

Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/agent/manifests/infraenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestInfraEnv_Generate(t *testing.T) {
// {
// name: "default",
// dependencies: []asset.Asset{
// &installconfig.InstallConfig{
// &agent.OptionalInstallConfig{
// Config: &types.InstallConfig{
// ObjectMeta: v1.ObjectMeta{
// Name: "ocp-edge-cluster-0",
Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/agent/mirror/cabundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/pkg/errors"
)

Expand All @@ -30,14 +31,14 @@ func (*CaBundle) Name() string {
// the asset.
func (*CaBundle) Dependencies() []asset.Asset {
return []asset.Asset{
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate generates the Mirror Registries certificate file from install-config.
func (i *CaBundle) Generate(dependencies asset.Parents) error {

// installConfig := &installconfig.InstallConfig{}
// installConfig := &agent.OptionalInstallConfig{}
// dependencies.Get(installConfig)

// if installConfig.Config.AdditionalTrustBundle == "" {
Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/agent/mirror/registriesconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -38,14 +39,14 @@ func (*RegistriesConf) Name() string {
// the asset.
func (*RegistriesConf) Dependencies() []asset.Asset {
return []asset.Asset{
// &installconfig.InstallConfig{},
&agent.OptionalInstallConfig{},
}
}

// Generate generates the registries.conf file from install-config.
func (i *RegistriesConf) Generate(dependencies asset.Parents) error {

// installConfig := &installconfig.InstallConfig{}
// installConfig := &agent.OptionalInstallConfig{}

// registries := []sysregistriesv2.Registry{}
// for _, group := range bootstrap.MergedMirrorSets(installConfig.Config.ImageContentSources) {
Expand Down