MCPcopy Create free account
hub / github.com/crc-org/crc-cloud / fillCreateRequest

Function fillCreateRequest

pkg/provider/openstack/create-instance.go:30–60  ·  view source on GitHub ↗
(projectName, bootingPrivateKeyFilePath, ocpPullSecretFilePath string,
	args map[string]string)

Source from the content-addressed store, hash-verified

28}
29
30func fillCreateRequest(projectName, bootingPrivateKeyFilePath, ocpPullSecretFilePath string,
31 args map[string]string) (*createRequest, error) {
32 imageIDValue, ok := args[imageID]
33 if !ok {
34 return nil, fmt.Errorf("imageID not found")
35 }
36 networkNameValue, ok := args[networkName]
37 if !ok {
38 return nil, fmt.Errorf("openstack-network-name not found")
39 }
40 it := ocpInstanceType
41 if customInstanceType, ok := args[instanceType]; ok {
42 it = customInstanceType
43 }
44 ds := ocpDefaultRootBlockDeviceSize
45 if customDiskSizeAsString, ok := args[diskSize]; ok {
46 customDiskSize, err := strconv.Atoi(customDiskSizeAsString)
47 if err != nil {
48 return nil, fmt.Errorf("error creating request for cluster machine: %v", err)
49 }
50 ds = customDiskSize
51 }
52 return &createRequest{
53 projectName: projectName,
54 imageID: imageIDValue,
55 instanceType: it,
56 diskSize: ds,
57 bootingPrivateKeyFilePath: bootingPrivateKeyFilePath,
58 ocpPullSecretFilePath: ocpPullSecretFilePath,
59 networkName: networkNameValue}, nil
60}
61
62func (r createRequest) runFunc(ctx *pulumi.Context) error {
63 privateKey, err := crctls.CreateKey(ctx)

Callers 1

CreateRunFuncMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected