MCPcopy
hub / github.com/kubernetes/kops / TestVMScaleSetModelBuilder_Build

Function TestVMScaleSetModelBuilder_Build

pkg/model/azuremodel/vmscaleset_test.go:34–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestVMScaleSetModelBuilder_Build(t *testing.T) {
35 b := VMScaleSetModelBuilder{
36 AzureModelContext: newTestAzureModelContext(),
37 BootstrapScriptBuilder: &model.BootstrapScriptBuilder{
38 Lifecycle: fi.LifecycleSync,
39 KopsModelContext: &model.KopsModelContext{
40 IAMModelContext: iam.IAMModelContext{
41 Cluster: &kops.Cluster{
42 Spec: kops.ClusterSpec{
43 Networking: kops.NetworkingSpec{},
44 },
45 },
46 },
47 },
48 },
49 }
50 c := &fi.CloudupModelBuilderContext{
51 Tasks: make(map[string]fi.CloudupTask),
52 }
53
54 caTask := &fitasks.Keypair{
55 Name: fi.PtrTo(fi.CertificateIDCA),
56 Subject: "cn=kubernetes",
57 Type: "ca",
58 }
59 c.AddTask(caTask)
60 etcdCaTask := &fitasks.Keypair{
61 Name: fi.PtrTo("etcd-clients-ca"),
62 Subject: "cn=etcd-clients-ca",
63 Type: "ca",
64 }
65 c.AddTask(etcdCaTask)
66 for _, cert := range []string{
67 "kubelet",
68 "kube-proxy",
69 } {
70 c.AddTask(&fitasks.Keypair{
71 Name: fi.PtrTo(cert),
72 Subject: "cn=" + cert,
73 Signer: caTask,
74 Type: "client",
75 })
76 }
77
78 err := b.Build(c)
79 if err != nil {
80 t.Errorf("unexpected error %s", err)
81 }
82}
83
84func TestGetCapacity(t *testing.T) {
85 testCases := []struct {

Callers

nothing calls this directly

Calls 4

BuildMethod · 0.95
PtrToFunction · 0.92
newTestAzureModelContextFunction · 0.85
AddTaskMethod · 0.80

Tested by

no test coverage detected