Skip to content

Commit 8ea9b93

Browse files
committed
use different iso name for node-joiner add-nodes command
1 parent 13c8db4 commit 8ea9b93

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/asset/agent/image/agentimage.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ import (
2020
)
2121

2222
const (
23-
agentISOFilename = "agent.%s.iso"
24-
iso9660Level1ExtLen = 3
23+
agentISOFilename = "agent.%s.iso"
24+
agentAddNodesISOFilename = "agent-addnodes.%s.iso"
25+
iso9660Level1ExtLen = 3
2526
)
2627

2728
// AgentImage is an asset that generates the bootable image used to install clusters.
@@ -34,6 +35,7 @@ type AgentImage struct {
3435
rootFSURL string
3536
bootArtifactsBaseURL string
3637
platform hiveext.PlatformType
38+
isoFilename string
3739
}
3840

3941
var _ asset.WritableAsset = (*AgentImage)(nil)
@@ -61,9 +63,11 @@ func (a *AgentImage) Generate(dependencies asset.Parents) error {
6163
switch agentWorkflow.Workflow {
6264
case workflow.AgentWorkflowTypeInstall:
6365
a.platform = agentManifests.AgentClusterInstall.Spec.PlatformType
66+
a.isoFilename = agentISOFilename
6467

6568
case workflow.AgentWorkflowTypeAddNodes:
6669
a.platform = clusterInfo.PlatformType
70+
a.isoFilename = agentAddNodesISOFilename
6771

6872
default:
6973
return fmt.Errorf("AgentWorkflowType value not supported: %s", agentWorkflow.Workflow)
@@ -239,7 +243,7 @@ func (a *AgentImage) PersistToFile(directory string) error {
239243
return errors.New("cannot generate ISO image due to configuration errors")
240244
}
241245

242-
agentIsoFile := filepath.Join(directory, fmt.Sprintf(agentISOFilename, a.cpuArch))
246+
agentIsoFile := filepath.Join(directory, fmt.Sprintf(a.isoFilename, a.cpuArch))
243247

244248
// Remove symlink if it exists
245249
os.Remove(agentIsoFile)

0 commit comments

Comments
 (0)