fixtures

package
v0.0.0-...-7df4f84 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllStatesNodeGroupUUID        = "b78e8587-785e-430c-a179-6f2c995d2993"
	AllStatesStackUUID            = "ff87db0d-fdfc-4cca-9489-cc1494064349"
	AllStatesStackName            = "kube-all-states-w5axvlfrz5lr"
	AllStatesKubeMinionsStackUUID = "2c6ef157-3d53-46b2-834e-9d1144e7f470"
	AllStatesKubeMinionsStackName = "kube-all-states-dd1a8b074cb6-kube_minions-8e1410ada96e"

	AllStatesMinion0ID         = "43e67ac6-0d22-4161-9727-4d624b3e6649"
	AllStatesMinion0ProviderID = "openstack:///43e67ac6-0d22-4161-9727-4d624b3e6649"
)

Node groups and stack UUIDs.

View Source
const (
	ProjectUUID = "57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2"
	ClusterUUID = "91444514-b8db-4314-849c-650df15e8e83"

	DefaultMasterNodeGroupUUID = "8870ab3e-cae8-4971-8198-3b8e37fb1ab7"
	DefaultMasterStackUUID     = "5d48650b-6707-4565-ad5a-bd9f482093b2"
)

Cluster UUIDs.

View Source
const (
	DefaultWorkerNodeGroupUUID        = "f4ecc247-8732-4614-8265-716ab281c7c7"
	DefaultWorkerStackUUID            = "5d48650b-6707-4565-ad5a-bd9f482093b2"
	DefaultWorkerStackName            = "kube-w5axvlfrz5lr"
	DefaultWorkerKubeMinionsStackUUID = "f692ba59-598a-4c6d-8b69-0b78090114a8"
	DefaultWorkerKubeMinionsStackName = "kube-w5axvlfrz5lr-kube_minions-vv7bsojktpi7"

	DefaultWorkerMinion0ID         = "fa405ca9-4486-4159-9763-0f82fbc2e4ac"
	DefaultWorkerMinion0ProviderID = "openstack:///fa405ca9-4486-4159-9763-0f82fbc2e4ac"
)

Node groups and stack UUIDs.

View Source
const (
	TestNodeGroupUUID                 = "e9927ee4-0ca7-4ac1-ab46-4a7230c76dab"
	TestNodeGroupStackUUID            = "3773d4d9-d6c8-4493-8ea2-2a7215dfc046"
	TestNodeGroupStackName            = "kube-test-ng-j5g7osyr44tb"
	TestNodeGroupKubeMinionsStackUUID = "0c8d8826-7333-4705-bfe9-f73d35477341"
	TestNodeGroupKubeMinionsStackName = "kube-test-ng-j5g7osyr44tb-kube_minions-3vb5diwdaggh"
)

Node groups and stack UUIDs.

Variables

View Source
var AllNodes = []node{

	{0, "888c414b-17e2-41d6-8f3d-c0b4cb296e1f", "CREATE_COMPLETE", ""},
	{1, "31c58d44-ce8d-458d-84b1-b1cdb601df81", "UPDATE_COMPLETE", ""},
	{2, "200ec335-1617-46ac-85c3-68cf083bbd08", "UPDATE_IN_PROGRESS", ""},

	{3, "ca10499b-82c3-499b-b77f-a5a8c07f42db", "INIT_COMPLETE", ""},
	{4, "2ecad77f-a6b7-43b6-a765-9ac9d3bdd24d", "CREATE_IN_PROGRESS", ""},
	{5, "509ec187-7ef4-4753-a1b9-29d236e8d73e", "UPDATE_IN_PROGRESS", ""},
	{6, "kube-minion", "CREATE_IN_PROGRESS", ""},
	{7, "kube-minion", "UPDATE_IN_PROGRESS", ""},

	{8, "1f09a01b-9459-459a-9c4c-cc732704b98a", "DELETE_IN_PROGRESS", ""},
	{9, "65fbfddc-67fd-4fa5-a906-dd1204ea677b", "DELETE_COMPLETE", ""},

	{10, "58ee5f00-991e-4875-bf60-3c3b51773e5c", "CREATE_FAILED", "out of quota"},
	{11, "78ae755f-a649-40d3-889a-ad5196adbed9", "UPDATE_FAILED", "other error"},
	{12, "af4fb9d7-6aa2-4f39-b2be-e20affa87c79", "DELETE_FAILED", "delete error"},
}

AllNodes is a list of indices, IDs and statuses of the nodes in this node group. There is a node in every distinct state.

ExpectedInstances are the instances that should be returned for a node group with nodes defined by AllNodes.

View Source
var GetAllStatesKubeMinionsResourceResponse = fmt.Sprintf(`
{
  "resource":{
    "resource_name":"kube_minions",
    "description":"",
    "links":[],
    "logical_resource_id":"kube_minions",
    "creation_time":"2020-04-20T09:55:59Z",
    "resource_status_reason":"state changed",
    "updated_time":"2020-04-21T09:42:18Z",
    "required_by":[],
    "resource_status":"UPDATE_IN_PROGRESS",
    "attributes":{
      "attributes":null,
      "refs":null,
      "refs_map":null,
      "removed_rsrc_list":[]
    },
    "resource_type":"OS::Heat::ResourceGroup",
    "physical_resource_id":"%s"
  }
}`, AllStatesKubeMinionsStackUUID)

GetAllStatesKubeMinionsResourceResponse is a response for a Get request for the node group kube_minions resource.

View Source
var GetAllStatesKubeMinionsStackResponse string

GetAllStatesKubeMinionsStackResponse is a response for a Get request for the kube_minions stack.

View Source
var GetAllStatesNodeGroupResponse = fmt.Sprintf(`
{
  "links":[],
  "labels":{},
  "updated_at":"2020-04-21T09:42:29+00:00",
  "cluster_id":"91444514-b8db-4314-849c-650df15e8e83",
  "min_node_count":1,
  "id":11835,
  "version":null,
  "role":"worker",
  "node_count":1,
  "project_id":"57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2",
  "status":"UPDATE_IN_PROGRESS",
  "docker_volume_size":null,
  "max_node_count":10,
  "is_default":true,
  "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
  "node_addresses":[],
  "status_reason":"Stack UPDATE completed successfully",
  "name":"default-worker",
  "created_at":"2020-04-20T09:55:47+00:00",
  "flavor_id":"m2.medium",
  "uuid":"%s",
  "stack_id":"%s"
}
`, AllStatesNodeGroupUUID, AllStatesStackUUID)

GetAllStatesNodeGroupResponse is a response for a Get request for the node group.

View Source
var GetAllStatesStackResponse = fmt.Sprintf(`
{
  "stack":{
    "parent":null,
    "disable_rollback":true,
    "description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n",
    "parameters":{},
    "deletion_time":null,
    "stack_user_project_id":"e602edb34b394d34b6a0f50c1ac46370",
    "stack_status_reason":"Stack UPDATE completed successfully",
    "creation_time":"2020-04-20T09:55:59Z",
    "links":[],
    "capabilities":[],
    "notification_topics":[],
    "tags":null,
    "timeout_mins":60,
    "stack_status":"UPDATE_IN_PROGRESS",
    "stack_owner":null,
    "updated_time":"2020-04-21T09:42:10Z",
    "outputs":[],
    "template_description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n",
    "id":"%s",
    "stack_name":"%s"
  }
}
`, AllStatesStackUUID, AllStatesStackName)

GetAllStatesStackResponse is a response for a Get request for the node group stack.

View Source
var GetDefaultWorkerKubeMinionsResourceResponse = fmt.Sprintf(`
{
  "resource":{
    "resource_name":"kube_minions",
    "description":"",
    "links":[],
    "logical_resource_id":"kube_minions",
    "creation_time":"2020-04-20T09:55:59Z",
    "resource_status_reason":"state changed",
    "updated_time":"2020-04-21T09:42:18Z",
    "required_by":[],
    "resource_status":"UPDATE_COMPLETE",
    "physical_resource_id":"f692ba59-598a-4c6d-8b69-0b78090114a8",
    "attributes":{
      "attributes":null,
      "refs":null,
      "refs_map":null,
      "removed_rsrc_list":[]
    },
    "resource_type":"OS::Heat::ResourceGroup"
  }
}`)

GetDefaultWorkerKubeMinionsResourceResponse is a response for a Get request for the kube_minions resource of the node group stack.

View Source
var GetDefaultWorkerKubeMinionsStackResponse = fmt.Sprintf(`
{
  "stack":{
    "parent":"5d48650b-6707-4565-ad5a-bd9f482093b2",
    "disable_rollback":true,
    "description":"No description",
    "parameters":{
      "OS::project_id":"57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2",
      "OS::stack_id":"f692ba59-598a-4c6d-8b69-0b78090114a8",
      "OS::stack_name":"kube-w5axvlfrz5lr-kube_minions-vv7bsojktpi7"
    },
    "deletion_time":null,
    "stack_name":"kube-w5axvlfrz5lr-kube_minions-vv7bsojktpi7",
    "stack_user_project_id":"e602edb34b394d34b6a0f50c1ac46370",
    "stack_status_reason":"Stack UPDATE completed successfully",
    "creation_time":"2020-04-20T09:58:56Z",
    "links":[],
    "capabilities":[],
    "notification_topics":[],
    "tags":null,
    "timeout_mins":60,
    "stack_status":"UPDATE_COMPLETE",
    "stack_owner":null,
    "updated_time":"2020-04-21T09:42:18Z",
    "id":"f692ba59-598a-4c6d-8b69-0b78090114a8",
    "outputs":[
      {
        "output_value":[
          "10.100.100.101"
        ],
        "output_key":"kube_minion_external_ip",
        "description":"No description given"
      },
      {
        "output_value":{
          "0":"%s"
        },
        "output_key":"refs_map",
        "description":"No description given"
      },
      {
        "output_value":[
          "10.100.100.101"
        ],
        "output_key":"kube_minion_ip",
        "description":"No description given"
      }
    ],
    "template_description":"No description"
  }
}`, DefaultWorkerMinion0ID)

GetDefaultWorkerKubeMinionsStackResponse is a response for a Get request for the kube_minions stack.

View Source
var GetDefaultWorkerNodeGroupResponse = fmt.Sprintf(`
{
  "links":[],
  "labels":{},
  "updated_at":"2020-04-21T09:42:29+00:00",
  "cluster_id":"91444514-b8db-4314-849c-650df15e8e83",
  "min_node_count":1,
  "id":11831,
  "version":null,
  "role":"worker",
  "node_count":1,
  "project_id":"57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2",
  "status":"UPDATE_COMPLETE",
  "docker_volume_size":null,
  "max_node_count":4,
  "is_default":true,
  "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
  "node_addresses":[
    ""
  ],
  "status_reason":"Stack UPDATE completed successfully",
  "name":"default-worker",
  "stack_id":"5d48650b-6707-4565-ad5a-bd9f482093b2",
  "created_at":"2020-04-20T09:55:47+00:00",
  "flavor_id":"m2.medium",
  "uuid":"%s"
}
`, DefaultWorkerNodeGroupUUID)

GetDefaultWorkerNodeGroupResponse is a response for a Get request for this node group.

View Source
var GetDefaultWorkerStackResponse = fmt.Sprintf(`
{
  "stack":{
    "parent":null,
    "disable_rollback":true,
    "description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n",
    "parameters":{},
    "deletion_time":null,
    "stack_name":"kube-w5axvlfrz5lr",
    "stack_user_project_id":"e602edb34b394d34b6a0f50c1ac46370",
    "stack_status_reason":"Stack UPDATE completed successfully",
    "creation_time":"2020-04-20T09:55:59Z",
    "links":[],
    "capabilities":[],
    "notification_topics":[],
    "tags":null,
    "timeout_mins":60,
    "stack_status":"UPDATE_COMPLETE",
    "stack_owner":null,
    "updated_time":"2020-04-21T09:42:10Z",
    "id":"5d48650b-6707-4565-ad5a-bd9f482093b2",
    "outputs":[
      {
        "output_value":[
          "10.100.100.100"
        ],
        "output_key":"kube_masters_private",
        "description":"This is a list of the \"private\" IP addresses of all the Kubernetes masters.\n"
      },
      {
        "output_value":[
          "10.100.100.100"
        ],
        "output_key":"kube_masters",
        "description":"This is a list of the \"public\" IP addresses of all the Kubernetes masters. Use these IP addresses to log in to the Kubernetes masters via ssh.\n"
      },
      {
        "output_value":"10.100.100.100",
        "output_key":"api_address",
        "description":"This is the API endpoint of the Kubernetes cluster. Use this to access the Kubernetes API.\n"
      },
      {
        "output_value":[
          "10.100.100.101"
        ],
        "output_key":"kube_minions_private",
        "description":"This is a list of the \"private\" IP addresses of all the Kubernetes minions.\n"
      },
      {
        "output_value":[
          "10.100.100.101"
        ],
        "output_key":"kube_minions",
        "description":"This is a list of the \"public\" IP addresses of all the Kubernetes minions. Use these IP addresses to log in to the Kubernetes minions via ssh."
      },
      {
        "output_value":"localhost:5000",
        "output_key":"registry_address",
        "description":"This is the url of docker registry server where you can store docker images."
      }
    ],
    "template_description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n"
  }
}
`)

GetDefaultWorkerStackResponse is a response for a Get request for the node group stack.

View Source
var GetTestNGKubeMinionsResourceResponse = fmt.Sprintf(`
{
  "resource":{
    "resource_name":"kube_minions",
    "description":"",
    "links":[],
    "logical_resource_id":"kube_minions",
    "creation_time":"2020-04-20T10:20:24Z",
    "resource_status_reason":"state changed",
    "updated_time":"2020-05-05T14:30:18Z",
    "required_by":[],
    "resource_status":"UPDATE_COMPLETE",
    "attributes":{
      "attributes":null,
      "refs":null,
      "refs_map":null,
      "removed_rsrc_list":[]
    },
    "resource_type":"OS::Heat::ResourceGroup",
    "physical_resource_id":"%s"
  }
}
`, TestNodeGroupKubeMinionsStackUUID)

GetTestNGKubeMinionsResourceResponse is a response for a Get request for the kube_minions resource of the node group stack.

View Source
var GetTestNGKubeMinionsStackResponse = fmt.Sprintf(`
{
  "stack":{
    "parent":"3773d4d9-d6c8-4493-8ea2-2a7215dfc046",
    "disable_rollback":true,
    "description":"No description",
    "parameters":{
      "OS::project_id":"57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2",
      "OS::stack_id":"0c8d8826-7333-4705-bfe9-f73d35477341",
      "OS::stack_name":"kube-test-ng-j5g7osyr44tb-kube_minions-3vb5diwdaggh"
    },
    "deletion_time":null,
    "stack_name":"kube-test-ng-j5g7osyr44tb-kube_minions-3vb5diwdaggh",
    "stack_user_project_id":"bd2594b6b0a44ff0a14e13c04a1ed031",
    "stack_status_reason":"Stack UPDATE completed successfully",
    "creation_time":"2020-04-20T10:20:24Z",
    "links":[],
    "capabilities":[],
    "notification_topics":[],
    "tags":null,
    "timeout_mins":60,
    "stack_status":"UPDATE_COMPLETE",
    "stack_owner":null,
    "updated_time":"2020-05-05T14:30:18Z",
    "id":"0c8d8826-7333-4705-bfe9-f73d35477341",
    "outputs":[
      {
        "output_value":[
		  "10.100.100.102",
		  "10.100.100.103"
        ],
        "output_key":"kube_minion_external_ip",
        "description":"No description given"
      },
      {
        "output_value":{
          "0":"fee26145-994a-4776-bcb6-3b04c332c0f5",
          "1":"d28f8e0f-da6e-434d-99aa-aa8baf2b328f"
        },
        "output_key":"refs_map",
        "description":"No description given"
      },
      {
        "output_value":[
		  "10.100.100.102",
		  "10.100.100.103"
        ],
        "output_key":"kube_minion_ip",
        "description":"No description given"
      }
    ],
    "template_description":"No description"
  }
}
`)

GetTestNGKubeMinionsStackResponse is a response for a Get request for the kube_minions stack.

View Source
var GetTestNGNodeGroupResponse = fmt.Sprintf(`
{
  "links":[],
  "labels":{},
  "updated_at":"2020-05-05T14:33:19+00:00",
  "cluster_id":"91444514-b8db-4314-849c-650df15e8e83",
  "min_node_count":1,
  "id":11836,
  "version":null,
  "role":"autoscaling",
  "node_count":2,
  "project_id":"57bf1ed0-52b8-4236-b1a7-dc58eceb8ff2",
  "status":"UPDATE_COMPLETE",
  "docker_volume_size":null,
  "max_node_count":4,
  "is_default":false,
  "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
  "node_addresses":[
    "10.100.100.102",
    "10.100.100.103"
  ],
  "status_reason":"Stack UPDATE completed successfully",
  "name":"test-ng",
  "stack_id":"3773d4d9-d6c8-4493-8ea2-2a7215dfc046",
  "created_at":"2020-04-20T10:20:18+00:00",
  "flavor_id":"m2.medium",
  "uuid":"%s"
}
`, TestNodeGroupUUID)

GetTestNGNodeGroupResponse is a response for a Get request for this node group.

View Source
var GetTestNGStackResponse = fmt.Sprintf(`
{
  "stack":{
    "parent":null,
    "disable_rollback":true,
    "description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n",
    "parameters":{},
    "deletion_time":null,
    "stack_user_project_id":"bd2594b6b0a44ff0a14e13c04a1ed031",
    "stack_status_reason":"Stack UPDATE completed successfully",
    "creation_time":"2020-04-20T10:20:23Z",
    "links":[],
    "capabilities":[],
    "notification_topics":[],
    "tags":null,
    "timeout_mins":60,
    "stack_status":"UPDATE_COMPLETE",
    "stack_owner":null,
    "updated_time":"2020-05-05T14:30:18Z",
    "outputs":[
      {
        "output_value":null,
        "output_key":"kube_masters_private",
        "description":"This is a list of the \"private\" IP addresses of all the Kubernetes masters.\n"
      },
      {
        "output_value":null,
        "output_key":"kube_masters",
        "description":"This is a list of the \"public\" IP addresses of all the Kubernetes masters. Use these IP addresses to log in to the Kubernetes masters via ssh.\n"
      },
      {
        "output_value":null,
        "output_key":"api_address",
        "description":"This is the API endpoint of the Kubernetes cluster. Use this to access the Kubernetes API.\n"
      },
      {
        "output_value":[
		  "10.100.100.102",
		  "10.100.100.103"
        ],
        "output_key":"kube_minions_private",
        "description":"This is a list of the \"private\" IP addresses of all the Kubernetes minions.\n"
      },
      {
        "output_value":[
		  "10.100.100.102",
		  "10.100.100.103"
        ],
        "output_key":"kube_minions",
        "description":"This is a list of the \"public\" IP addresses of all the Kubernetes minions. Use these IP addresses to log in to the Kubernetes minions via ssh."
      },
      {
        "output_value":null,
        "output_key":"registry_address",
        "description":"This is the url of docker registry server where you can store docker images."
      }
    ],
    "template_description":"This template will boot a Kubernetes cluster with one or more minions (as specified by the number_of_minions parameter, which defaults to 1).\n",
    "id":"%s",
    "stack_name":"%s"
  }
}`, TestNodeGroupStackUUID, TestNodeGroupStackName)

GetTestNGStackResponse is a response for a Get request for the node group stack.

View Source
var ListAllStatesKubeMinionsResources string

ListAllStatesKubeMinionsResources is a response for listing the resources belonging to the kube_minions stack.

View Source
var ListDefaultWorkerKubeMinionsResources = `` /* 556-byte string literal not displayed */

ListDefaultWorkerKubeMinionsResources is a response for listing the resources belonging to the kube_minions stack.

View Source
var ListNodeGroupsResponse = fmt.Sprintf(`
{
  "nodegroups":[
    {
      "status":"UPDATE_COMPLETE",
      "is_default":true,
      "uuid":"%s",
      "max_node_count":null,
      "stack_id":"%s",
      "min_node_count":1,
      "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
      "role":"master",
      "flavor_id":"m2.medium",
      "node_count":1,
      "name":"default-master"
    },
    {
      "status":"UPDATE_COMPLETE",
      "is_default":true,
      "uuid":"%s",
      "max_node_count":null,
      "stack_id":"%s",
      "min_node_count":1,
      "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
      "role":"worker",
      "flavor_id":"m2.medium",
      "node_count":1,
      "name":"default-worker"
    },
    {
      "status":"UPDATE_COMPLETE",
      "is_default":false,
      "uuid":"%s",
      "max_node_count":null,
      "stack_id":"%s",
      "min_node_count":1,
      "image_id":"5b338766-0fbf-47fa-9d9a-8f9543be9729",
      "role":"autoscaling",
      "flavor_id":"m2.medium",
      "node_count":2,
      "name":"test-ng"
    }
  ]
}
`, DefaultMasterNodeGroupUUID, DefaultMasterStackUUID,
	DefaultWorkerNodeGroupUUID, DefaultWorkerStackUUID,
	TestNodeGroupUUID, TestNodeGroupStackUUID)

ListNodeGroupsResponse is a response for listing the node groups belonging to this cluster.

View Source
var ResizeDefaultWorkerNodeGroupError = `` /* 340-byte string literal not displayed */

ResizeDefaultWorkerNodeGroupError is a response for resizing a node group where the requested number of nodes did not fit the min/max constraints.

View Source
var ResizeDefaultWorkerNodeGroupResponse = `{"uuid": "add2739b-7af1-4d8c-a293-dad16c6fe789"}`

ResizeDefaultWorkerNodeGroupResponse is a response for resizing a node group.

Functions

func BuildAllStatesKubeMinionPhysicalResources

func BuildAllStatesKubeMinionPhysicalResources(index int) string

BuildAllStatesKubeMinionPhysicalResources should only be called for minions 2 and 5 which are UPDATE_IN_PROGRESS, to determine if they are still being created or not.

func BuildTemplatedNodeGroupsGetResponse

func BuildTemplatedNodeGroupsGetResponse(ng *nodegroups.NodeGroup) string

BuildTemplatedNodeGroupsGetResponse builds a node group Get JSON response for a node group that is passed in.

func BuildTemplatedNodeGroupsListResponse

func BuildTemplatedNodeGroupsListResponse(ngs []*nodegroups.NodeGroup) string

BuildTemplatedNodeGroupsListResponse builds a node groups list JSON response for the list of node groups that is passed in.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL