diff --git a/src/components/pebble_component.py b/src/components/pebble_component.py index 672ccc7..0237629 100644 --- a/src/components/pebble_component.py +++ b/src/components/pebble_component.py @@ -45,6 +45,11 @@ def get_layer(self) -> Layer: "MINIO_PROMETHEUS_AUTH_TYPE": "public", "MINIO_ROOT_USER": inputs.MINIO_ROOT_USER, "MINIO_ROOT_PASSWORD": inputs.MINIO_ROOT_PASSWORD, + # Needed to ensure the Pod won't accidentally assume + # other IAM credentials (relevant for gateway mode on EKS only) + # https://github.com/canonical/kfp-operators/issues/785 + "AWS_ACCESS_KEY_ID": inputs.MINIO_ROOT_USER, + "AWS_SECRET_ACCESS_KEY": inputs.MINIO_ROOT_PASSWORD, }, } }, diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index c30173f..09f48b3 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -199,6 +199,8 @@ def test_server_minio_args(harness, mock_kubernetes_service_patched): assert environment["MINIO_ROOT_USER"] == "minio" assert environment["MINIO_ROOT_PASSWORD"] == "test-key" assert environment["MINIO_PROMETHEUS_AUTH_TYPE"] == "public" + assert environment["AWS_ACCESS_KEY_ID"] == "minio" + assert environment["AWS_SECRET_ACCESS_KEY"] == "test-key" # Assert the command includes the console address with the specified port expected_args = [