@@ -14,7 +14,9 @@ import (
1414 "github.com/openshift/assisted-image-service/pkg/isoeditor"
1515 hiveext "github.com/openshift/assisted-service/api/hiveextension/v1beta1"
1616 "github.com/openshift/installer/pkg/asset"
17+ "github.com/openshift/installer/pkg/asset/agent/joiner"
1718 "github.com/openshift/installer/pkg/asset/agent/manifests"
19+ "github.com/openshift/installer/pkg/asset/agent/workflow"
1820)
1921
2022const (
@@ -39,6 +41,8 @@ var _ asset.WritableAsset = (*AgentImage)(nil)
3941// Dependencies returns the assets on which the Bootstrap asset depends.
4042func (a * AgentImage ) Dependencies () []asset.Asset {
4143 return []asset.Asset {
44+ & workflow.AgentWorkflow {},
45+ & joiner.ClusterInfo {},
4246 & AgentArtifacts {},
4347 & manifests.AgentManifests {},
4448 & BaseIso {},
@@ -47,10 +51,23 @@ func (a *AgentImage) Dependencies() []asset.Asset {
4751
4852// Generate generates the image file for to ISO asset.
4953func (a * AgentImage ) Generate (dependencies asset.Parents ) error {
54+ agentWorkflow := & workflow.AgentWorkflow {}
55+ clusterInfo := & joiner.ClusterInfo {}
5056 agentArtifacts := & AgentArtifacts {}
5157 agentManifests := & manifests.AgentManifests {}
5258 baseIso := & BaseIso {}
53- dependencies .Get (agentArtifacts , agentManifests , baseIso )
59+ dependencies .Get (agentArtifacts , agentManifests , baseIso , agentWorkflow , clusterInfo )
60+
61+ switch agentWorkflow .Workflow {
62+ case workflow .AgentWorkflowTypeInstall :
63+ a .platform = agentManifests .AgentClusterInstall .Spec .PlatformType
64+
65+ case workflow .AgentWorkflowTypeAddNodes :
66+ a .platform = clusterInfo .PlatformType
67+
68+ default :
69+ return fmt .Errorf ("AgentWorkflowType value not supported: %s" , agentWorkflow .Workflow )
70+ }
5471
5572 a .cpuArch = agentArtifacts .CPUArch
5673 a .rendezvousIP = agentArtifacts .RendezvousIP
@@ -64,7 +81,6 @@ func (a *AgentImage) Generate(dependencies asset.Parents) error {
6481 }
6582 a .volumeID = volumeID
6683
67- a .platform = agentManifests .AgentClusterInstall .Spec .PlatformType
6884 if a .platform == hiveext .ExternalPlatformType {
6985 // when the bootArtifactsBaseURL is specified, construct the custom rootfs URL
7086 if a .bootArtifactsBaseURL != "" {
0 commit comments