Skip to content

Commit d60abe3

Browse files
committed
change type of userDataFlag
1 parent a2feccf commit d60abe3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/stackit_beta_server_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ stackit beta server create [flags]
3838
$ stackit beta server create --machine-type t1.1 --name server1 --boot-volume-source-id xxx --boot-volume-source-type image --boot-volume-size 64 --volumes yyy
3939
4040
Create a server with user data (cloud-init)
41-
$ stackit beta server create --machine-type t1.1 --name server1 --boot-volume-source-id xxx --boot-volume-source-type image --boot-volume-size 64 --user-data file("${path.module}/cloud-init.yaml")
41+
$ stackit beta server create --machine-type t1.1 --name server1 --boot-volume-source-id xxx --boot-volume-source-type image --boot-volume-size 64 --user-data @path/to/file.yaml")
4242
```
4343

4444
### Options

internal/cmd/beta/server/create/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func configureFlags(cmd *cobra.Command) {
211211
cmd.Flags().StringSlice(networkInterfaceIdsFlag, []string{}, "List of network interface IDs for the initial networking setup for the server creation")
212212
cmd.Flags().StringSlice(securityGroupsFlag, []string{}, "The initial security groups for the server creation")
213213
cmd.Flags().StringSlice(serviceAccountEmailsFlag, []string{}, "List of the service account mails")
214-
cmd.Flags().String(userDataFlag, "", "User data that is passed via cloud-init to the server")
214+
cmd.Flags().Var(flags.ReadFromFileFlag(), userDataFlag, "User data that is passed via cloud-init to the server")
215215
cmd.Flags().StringSlice(volumesFlag, []string{}, "The list of volumes attached to the server")
216216

217217
err := flags.MarkFlagsRequired(cmd, nameFlag, machineTypeFlag)

0 commit comments

Comments
 (0)