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
5 changes: 3 additions & 2 deletions cmd/static-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ func (f *fakeImageFileSystem) RemoveImage(name string) {}
func TestLoadStaticNMState(t *testing.T) {
fifs := &fakeImageFileSystem{imagesServed: []string{}}
env := &env.EnvInputs{
DeployISO: "foo.iso",
IronicBaseURL: "http://example.com",
DeployISO: "foo.iso",
IronicBaseURL: "http://example.com",
IronicAgentImage: "quay.io/tantsur/ironic-agent",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing "d" before "tantsur" :)

}
if err := loadStaticNMState(env, "../../test/data", fifs); err != nil {
t.Errorf("loadStaticNMState() error = %v", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type EnvInputs struct {
DeployISO string `envconfig:"DEPLOY_ISO" required:"true"`
DeployInitrd string `envconfig:"DEPLOY_INITRD" required:"true"`
IronicBaseURL string `envconfig:"IRONIC_BASE_URL" required:"true"`
IronicAgentImage string `envconfig:"IRONIC_AGENT_IMAGE"`
IronicAgentImage string `envconfig:"IRONIC_AGENT_IMAGE" required:"true"`
IronicAgentPullSecret string `envconfig:"IRONIC_AGENT_PULL_SECRET"`
IronicRAMDiskSSHKey string `envconfig:"IRONIC_RAMDISK_SSH_KEY"`
RegistriesConfPath string `envconfig:"REGISTRIES_CONF_PATH"`
Expand Down
8 changes: 3 additions & 5 deletions pkg/ignition/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ type ignitionBuilder struct {
}

func New(nmStateData, registriesConf []byte, ironicBaseURL, ironicAgentImage, ironicAgentPullSecret, ironicRAMDiskSSHKey string) *ignitionBuilder {
if ironicAgentImage == "" {
// https://github.com/openshift/ironic-image/blob/master/scripts/configure-coreos-ipa#L13
ironicAgentImage = "quay.io/dtantsur/ironic-agent" // TODO check
}

return &ignitionBuilder{
nmStateData: nmStateData,
registriesConf: registriesConf,
Expand All @@ -44,6 +39,9 @@ func New(nmStateData, registriesConf []byte, ironicBaseURL, ironicAgentImage, ir
}

func (b *ignitionBuilder) Generate() ([]byte, error) {
if b.ironicAgentImage == "" {
return nil, errors.New("ironicAgentImage is required")
}
if b.ironicBaseURL == "" {
return nil, errors.New("ironicBaseURL is required")
}
Expand Down