-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Vest
committed
May 8, 2024
1 parent
2f727f0
commit c92060b
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/linode/linodego" | ||
) | ||
|
||
func main() { | ||
Check failure on line 11 in cmd/test.go GitHub Actions / lint-tidy
|
||
client, err := linodego.NewClientFromEnv(nil) | ||
if err != nil { | ||
fmt.Println(err) | ||
Check failure on line 14 in cmd/test.go GitHub Actions / lint-tidy
|
||
os.Exit(1) | ||
} | ||
|
||
// Create Encrypted VM | ||
encryptedLinode, err := client.CreateInstance(context.TODO(), linodego.InstanceCreateOptions{ | ||
Region: "us-east", | ||
Type: "g6-standard-1", | ||
Label: "encrypted", | ||
// SET_ME_SECURELY | ||
RootPass: "", | ||
Image: "linode/debian12-kube-v1.28.3", | ||
DiskEncryption: &linodego.InstanceDiskEncryptionEnabled, | ||
}) | ||
if err != nil { | ||
fmt.Println(err) | ||
Check failure on line 29 in cmd/test.go GitHub Actions / lint-tidy
|
||
os.Exit(1) | ||
} | ||
|
||
fmt.Printf("%v\n", encryptedLinode) | ||
Check failure on line 33 in cmd/test.go GitHub Actions / lint-tidy
|
||
|
||
unencryptedLinode, err := client.CreateInstance(context.TODO(), linodego.InstanceCreateOptions{ | ||
Region: "us-east", | ||
Type: "g6-standard-1", | ||
Label: "not", | ||
// SET_ME_SECURELY | ||
RootPass: "", | ||
Image: "linode/debian12-kube-v1.28.3", | ||
Tags: []string{"not"}, | ||
DiskEncryption: &linodego.InstanceDiskEncryptionDisabled, | ||
}) | ||
if err != nil { | ||
fmt.Println(err) | ||
Check failure on line 46 in cmd/test.go GitHub Actions / lint-tidy
|
||
os.Exit(1) | ||
} | ||
|
||
fmt.Printf("%v\n", unencryptedLinode) | ||
Check failure on line 50 in cmd/test.go GitHub Actions / lint-tidy
|
||
|
||
c, err := client.CreateLKECluster(context.TODO(), linodego.LKEClusterCreateOptions{ | ||
NodePools: []linodego.LKENodePoolCreateOptions{ | ||
{ | ||
Count: 1, | ||
Type: "g6-standard-1", | ||
Tags: []string{"linodego"}, | ||
DiskEncryption: &linodego.InstanceDiskEncryptionEnabled, | ||
}, | ||
}, | ||
Label: "enabled2", | ||
Region: "us-east", | ||
K8sVersion: "1.28", | ||
Tags: []string{"bingo"}, | ||
}) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
nodePools, err := client.ListLKENodePools(context.TODO(), c.ID, &linodego.ListOptions{}) | ||
if err != nil { | ||
fmt.Println(err) | ||
os.Exit(1) | ||
} | ||
|
||
fmt.Printf("%v", nodePools) | ||
Check failure on line 77 in cmd/test.go GitHub Actions / lint-tidy
|
||
} |