Ejemplo n.º 1
0
def test_check_requests_same_limits():
    manifest = yaml.safe_load(dedent("""
    ---
    apiVersion: apps.openshift.io/v1
    kind: DeploymentConfig
    spec:
        template:
            spec:
                containers:
                - name: c1
                  resources:
                    requests:
                        cpu: 100
                        memory: 100
                    limits:
                        cpu: 200
                        memory: 200
                - name: c2
                  resources:
                    requests:
                        cpu: 100
                        memory: 100
                    limits:
                        cpu: 100
                        memory: 100
    """))

    c = CheckBurstable()
    result = c.check_burstable(manifest)
    assert isinstance(result, CheckError)
Ejemplo n.º 2
0
def test_check_requests_no_containers():
    manifest = yaml.safe_load(dedent("""
    ---
    apiVersion: apps.openshift.io/v1
    kind: DeploymentConfig
    spec:
        template:
            spec:
    """))

    c = CheckBurstable()

    result = c.check_burstable(manifest)
    assert isinstance(result, CheckSuccess)