示例#1
0
def test_subchart_service_account_global_name(subchart_template: HelmTemplate, capsys):
    with pytest.raises(subprocess.CalledProcessError):
        global_service_account_name = "global-service-account-name"
        service_account_values = DagsterHelmValues.construct(
            global_=Global.construct(serviceAccountName=global_service_account_name),
        )

        subchart_template.render(service_account_values)

        _, err = capsys.readouterr()

        assert "Error: could not find template" in err
示例#2
0
def test_service_account_global_name(template: HelmTemplate):
    global_service_account_name = "global-service-account-name"
    service_account_values = DagsterHelmValues.construct(
        global_=Global.construct(
            serviceAccountName=global_service_account_name), )

    service_account_templates = template.render(service_account_values)

    assert len(service_account_templates) == 1

    service_account_template = service_account_templates[0]

    assert service_account_template.metadata.name == global_service_account_name
示例#3
0
def test_subchart_postgres_password_global_override(subchart_template: HelmTemplate):
    deployment_values = DagsterUserDeploymentsHelmValues.construct(
        postgresqlSecretName="postgresql-secret",
        global_=Global.construct(
            postgresqlSecretName="global-postgresql-secret",
        ),
    )

    deployment_templates = subchart_template.render(deployment_values)

    assert len(deployment_templates) == 1

    deployment_template = deployment_templates[0]
    pod_spec = deployment_template.spec.template.spec
    container = pod_spec.containers[0]

    assert container.env[1].name == "DAGSTER_PG_PASSWORD"
    assert container.env[1].value_from.secret_key_ref.name == "global-postgresql-secret"