Skip to content

Commit e0cfcf4

Browse files
committed
skip (temporary) NMStateConfig manifest generation
1 parent ac8191c commit e0cfcf4

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

pkg/asset/agent/joiner/clusterinfo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"net/url"
66

7-
configclient "github.com/openshift/client-go/config/clientset/versioned"
87
"k8s.io/apimachinery/pkg/api/errors"
98
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
109
"k8s.io/client-go/kubernetes"

pkg/asset/agent/manifests/nmstateconfig.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import (
2121
"github.com/openshift/installer/pkg/asset"
2222
"github.com/openshift/installer/pkg/asset/agent"
2323
"github.com/openshift/installer/pkg/asset/agent/agentconfig"
24+
"github.com/openshift/installer/pkg/asset/agent/joiner"
2425
"github.com/openshift/installer/pkg/asset/agent/manifests/staticnetworkconfig"
26+
"github.com/openshift/installer/pkg/asset/agent/workflow"
2527
"github.com/openshift/installer/pkg/types"
2628
agenttype "github.com/openshift/installer/pkg/types/agent"
2729
)
@@ -63,17 +65,26 @@ func (*NMStateConfig) Name() string {
6365
// the asset.
6466
func (*NMStateConfig) Dependencies() []asset.Asset {
6567
return []asset.Asset{
68+
&workflow.AgentWorkflow{},
69+
&joiner.ClusterInfo{},
6670
&agentconfig.AgentHosts{},
6771
&agent.OptionalInstallConfig{},
6872
}
6973
}
7074

7175
// Generate generates the NMStateConfig manifest.
7276
func (n *NMStateConfig) Generate(dependencies asset.Parents) error {
73-
77+
agentWorkflow := &workflow.AgentWorkflow{}
78+
clusterInfo := &joiner.ClusterInfo{}
7479
agentHosts := &agentconfig.AgentHosts{}
7580
installConfig := &agent.OptionalInstallConfig{}
76-
dependencies.Get(agentHosts, installConfig)
81+
dependencies.Get(agentHosts, installConfig, agentWorkflow, clusterInfo)
82+
83+
// Temporary skip in case of add nodes workflow. Main input for this
84+
// asset will be retrieved from the nodes-config.yaml asset
85+
if agentWorkflow.Workflow == workflow.AgentWorkflowTypeAddNodes {
86+
return nil
87+
}
7788

7889
staticNetworkConfig := []*models.HostStaticNetworkConfig{}
7990
nmStateConfigs := []*aiv1beta1.NMStateConfig{}

pkg/asset/agent/manifests/nmstateconfig_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
aiv1beta1 "github.com/openshift/assisted-service/api/v1beta1"
1515
"github.com/openshift/assisted-service/models"
1616
"github.com/openshift/installer/pkg/asset"
17+
"github.com/openshift/installer/pkg/asset/agent/joiner"
18+
"github.com/openshift/installer/pkg/asset/agent/workflow"
1719
"github.com/openshift/installer/pkg/asset/mock"
1820
"github.com/openshift/installer/pkg/types/agent"
1921
)
@@ -29,6 +31,8 @@ func TestNMStateConfig_Generate(t *testing.T) {
2931
{
3032
name: "agentHosts does not contain networkConfig",
3133
dependencies: []asset.Asset{
34+
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
35+
&joiner.ClusterInfo{},
3236
getAgentHostsNoHosts(),
3337
getValidOptionalInstallConfig(),
3438
},
@@ -39,6 +43,8 @@ func TestNMStateConfig_Generate(t *testing.T) {
3943
{
4044
name: "agentHosts with some hosts without networkconfig",
4145
dependencies: []asset.Asset{
46+
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
47+
&joiner.ClusterInfo{},
4248
getAgentHostsWithSomeHostsWithoutNetworkConfig(),
4349
getValidOptionalInstallConfig(),
4450
},
@@ -72,6 +78,8 @@ func TestNMStateConfig_Generate(t *testing.T) {
7278
{
7379
name: "valid config",
7480
dependencies: []asset.Asset{
81+
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
82+
&joiner.ClusterInfo{},
7583
getValidAgentHostsConfig(),
7684
getValidOptionalInstallConfig(),
7785
},
@@ -153,6 +161,8 @@ func TestNMStateConfig_Generate(t *testing.T) {
153161
{
154162
name: "invalid networkConfig",
155163
dependencies: []asset.Asset{
164+
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
165+
&joiner.ClusterInfo{},
156166
getInValidAgentHostsConfig(),
157167
getValidOptionalInstallConfig(),
158168
},

0 commit comments

Comments
 (0)