def test_containerized_group_default_fields(instance_group, kube_credential):
    ig = InstanceGroup(name="test_policy_field_defaults")
    ig.policy_instance_list = [1]
    ig.policy_instance_minimum = 5
    ig.policy_instance_percentage = 5
    ig.save()
    assert ig.policy_instance_list == [1]
    assert ig.policy_instance_minimum == 5
    assert ig.policy_instance_percentage == 5
    ig.credential = kube_credential
    ig.save()
    assert ig.policy_instance_list == []
    assert ig.policy_instance_minimum == 0
    assert ig.policy_instance_percentage == 0
Beispiel #2
0
def containerized_instance_group(instance_group, kube_credential):
    ig = InstanceGroup(name="container")
    ig.credential = kube_credential
    ig.is_container_group = True
    ig.save()
    return ig