Skip to content

Commit 6b4bcf7

Browse files
committed
Add image-based installer command
Signed-off-by: Michail Resvanis <[email protected]>
1 parent 58bbbe2 commit 6b4bcf7

File tree

1 file changed

+32
-27
lines changed

1 file changed

+32
-27
lines changed

cmd/openshift-install/imagebased.go

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ package main
33
import (
44
"context"
55

6-
"github.com/sirupsen/logrus"
76
"github.com/spf13/cobra"
87

98
"github.com/openshift/installer/pkg/asset"
9+
"github.com/openshift/installer/pkg/asset/imagebased/configimage"
1010
"github.com/openshift/installer/pkg/asset/imagebased/image"
11+
"github.com/openshift/installer/pkg/asset/kubeconfig"
12+
"github.com/openshift/installer/pkg/asset/password"
1113
)
1214

1315
func newImageBasedCmd(ctx context.Context) *cobra.Command {
1416
imagebasedCmd := &cobra.Command{
1517
Use: "image-based",
16-
Short: "Commands for supporting cluster installation using the Image-based installer",
18+
Short: "Commands for supporting cluster installation using the image-based installer",
1719
RunE: func(cmd *cobra.Command, args []string) error {
1820
return cmd.Help()
1921
},
@@ -48,9 +50,37 @@ var (
4850
},
4951
}
5052

53+
imageBasedConfigTemplateTarget = target{
54+
name: "Image-based Installer Config ISO Configuration Template",
55+
command: &cobra.Command{
56+
Use: "config-template",
57+
Short: "Generates a template of the Image-based Config ISO config manifest used by the image-based installer",
58+
Args: cobra.ExactArgs(0),
59+
},
60+
assets: []asset.WritableAsset{
61+
&configimage.ImageBasedConfig{},
62+
},
63+
}
64+
65+
imageBasedConfigImageTarget = target{
66+
name: "Image-based Installer Config ISO Image",
67+
command: &cobra.Command{
68+
Use: "config-image",
69+
Short: "Generates an ISO containing configuration files only",
70+
Args: cobra.ExactArgs(0),
71+
},
72+
assets: []asset.WritableAsset{
73+
&configimage.ConfigImage{},
74+
&kubeconfig.ImageBasedAdminClient{},
75+
&password.KubeadminPassword{},
76+
},
77+
}
78+
5179
imageBasedTargets = []target{
5280
imageBasedInstallationConfigTemplateTarget,
5381
imageBasedInstallationImageTarget,
82+
imageBasedConfigTemplateTarget,
83+
imageBasedConfigImageTarget,
5484
}
5585
)
5686

@@ -69,30 +99,5 @@ func newImageBasedCreateCmd(ctx context.Context) *cobra.Command {
6999
cmd.AddCommand(t.command)
70100
}
71101

72-
cmd.AddCommand(createConfigTemplateCmd())
73-
cmd.AddCommand(createConfigImageCmd())
74-
75102
return cmd
76103
}
77-
78-
func createConfigTemplateCmd() *cobra.Command {
79-
return &cobra.Command{
80-
Use: "config-template",
81-
Short: "Generates a template of the Image-based Config ISO config manifest used by the Image-based installer",
82-
Args: cobra.ExactArgs(0),
83-
Run: func(_ *cobra.Command, _ []string) {
84-
logrus.Info("Create config template command")
85-
},
86-
}
87-
}
88-
89-
func createConfigImageCmd() *cobra.Command {
90-
return &cobra.Command{
91-
Use: "config-image",
92-
Short: "Generates an ISO containing configuration files only",
93-
Args: cobra.ExactArgs(0),
94-
Run: func(_ *cobra.Command, _ []string) {
95-
logrus.Info("Create config image command")
96-
},
97-
}
98-
}

0 commit comments

Comments
 (0)