Skip to content
Draft
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
2 changes: 1 addition & 1 deletion data/data/agent/systemd/units/agent-ui.service.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EnvironmentFile=/etc/assisted/rendezvous-host.env
Restart=on-failure
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStartPre=/usr/local/bin/wait-for-assisted-service.sh
ExecStart=/usr/bin/podman run --sdnotify=conmon --net host --cidfile=%t/%n.ctr-id --cgroups=no-conmon --log-driver=journald --rm --pod-id-file=%t/assisted-service-pod.pod-id --replace -d --name=agent-installer-ui --env AIUI_APP_API_URL $INSTALLER_UI_IMAGE
ExecStart=/usr/bin/podman run --sdnotify=conmon --net host --cidfile=%t/%n.ctr-id --cgroups=no-conmon --log-driver=journald --rm --pod-id-file=%t/assisted-service-pod.pod-id --replace -d --name=agent-installer-ui --env AIUI_APP_API_URL --env USER_AUTH_TOKEN $INSTALLER_UI_IMAGE
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id

Expand Down
5 changes: 1 addition & 4 deletions pkg/asset/agent/image/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ type agentTemplateData struct {
AgentAuthToken string
UserAuthToken string
WatcherAuthToken string
TokenExpiry string
AuthType string
CaBundleMount string
DisableImagePolicy bool
Expand Down Expand Up @@ -291,7 +290,6 @@ func (a *Ignition) Generate(ctx context.Context, dependencies asset.Parents) err
authConfig.AgentAuthToken,
authConfig.UserAuthToken,
authConfig.WatcherAuthToken,
authConfig.AuthTokenExpiry,
caBundleMount,
len(registriesConfig.MirrorConfig) > 0,
numMasters, numArbiters, numWorkers,
Expand Down Expand Up @@ -437,7 +435,7 @@ func shouldDisableImagePolicy() bool {
}

func getTemplateData(name, pullSecret, releaseImageList, releaseImage, releaseImageMirror, publicContainerRegistries,
imageTypeISO, infraEnvID, publicKey, authType, agentAuthToken, userAuthToken, watcherAuthToken, tokenExpiry, caBundleMount string,
imageTypeISO, infraEnvID, publicKey, authType, agentAuthToken, userAuthToken, watcherAuthToken, caBundleMount string,
haveMirrorConfig bool,
numMasters, numArbiters, numWorkers int,
osImage *models.OsImage,
Expand All @@ -463,7 +461,6 @@ func getTemplateData(name, pullSecret, releaseImageList, releaseImage, releaseIm
AgentAuthToken: agentAuthToken,
UserAuthToken: userAuthToken,
WatcherAuthToken: watcherAuthToken,
TokenExpiry: tokenExpiry,
CaBundleMount: caBundleMount,
DisableImagePolicy: shouldDisableImagePolicy(),
}
Expand Down
11 changes: 9 additions & 2 deletions pkg/asset/agent/image/unconfigured_ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent/agentconfig"
"github.com/openshift/installer/pkg/asset/agent/common"
"github.com/openshift/installer/pkg/asset/agent/gencrypto"
"github.com/openshift/installer/pkg/asset/agent/manifests"
"github.com/openshift/installer/pkg/asset/agent/workflow"
"github.com/openshift/installer/pkg/asset/ignition"
Expand Down Expand Up @@ -83,6 +84,7 @@ func (a *UnconfiguredIgnition) Dependencies() []asset.Asset {
&manifests.AgentPullSecret{},
&manifests.ClusterImageSet{},
&manifests.NMStateConfig{},
&gencrypto.AuthConfig{},
&common.InfraEnvID{},
}
}
Expand All @@ -98,7 +100,8 @@ func (a *UnconfiguredIgnition) Generate(ctx context.Context, dependencies asset.
pullSecretAsset := &manifests.AgentPullSecret{}
nmStateConfigs := &manifests.NMStateConfig{}
agentConfig := &agentconfig.AgentConfig{}
dependencies.Get(agentWorkflow, infraEnvAsset, clusterImageSetAsset, pullSecretAsset, nmStateConfigs, infraEnvIDAsset, agentConfig)
authConfig := &gencrypto.AuthConfig{}
dependencies.Get(agentWorkflow, infraEnvAsset, clusterImageSetAsset, pullSecretAsset, nmStateConfigs, infraEnvIDAsset, agentConfig, authConfig)

if agentWorkflow.Workflow != workflow.AgentWorkflowTypeInstall {
return fmt.Errorf("AgentWorkflowType value not supported: %s", agentWorkflow.Workflow)
Expand Down Expand Up @@ -160,7 +163,11 @@ func (a *UnconfiguredIgnition) Generate(ctx context.Context, dependencies asset.
InfraEnvID: infraEnvID,
OSImage: osImage,
Proxy: infraEnv.Spec.Proxy,
AuthType: "none",
PublicKeyPEM: authConfig.PublicKey,
AgentAuthToken: authConfig.AgentAuthToken,
UserAuthToken: authConfig.UserAuthToken,
WatcherAuthToken: authConfig.WatcherAuthToken,
AuthType: authConfig.AuthType,
DisableImagePolicy: shouldDisableImagePolicy(),
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/asset/agent/image/unconfigured_ignition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent/agentconfig"
"github.com/openshift/installer/pkg/asset/agent/common"
"github.com/openshift/installer/pkg/asset/agent/gencrypto"
"github.com/openshift/installer/pkg/asset/agent/manifests"
"github.com/openshift/installer/pkg/asset/agent/workflow"
)
Expand Down Expand Up @@ -96,6 +97,7 @@ func buildUnconfiguredIgnitionAssetDefaultDependencies(t *testing.T) []asset.Ass
&manifests.NMStateConfig{},
&common.InfraEnvID{},
&agentconfig.AgentConfig{},
&gencrypto.AuthConfig{},
}
}

Expand Down