From 5fb2b16f2343c3335e56096681a867fc70a7be3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Wawrzyk?= Date: Mon, 17 Jun 2024 15:28:29 +0200 Subject: [PATCH] Use rctx.os.environ for compatibility --- oci/private/authn.bzl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/oci/private/authn.bzl b/oci/private/authn.bzl index 6fcde626..8dd3ba91 100644 --- a/oci/private/authn.bzl +++ b/oci/private/authn.bzl @@ -2,7 +2,6 @@ load("@aspect_bazel_lib//lib:base64.bzl", "base64") load("@aspect_bazel_lib//lib:repo_utils.bzl", "repo_utils") -load("@bazel_skylib//lib:versions.bzl", "versions") load(":util.bzl", "util") @@ -285,12 +284,8 @@ def _get_token(rctx, state, registry, repository): auth = None if pattern["login"] == "": - if versions.is_at_least("7.0.0", versions.get() or "0.0.0"): - if not rctx.getenv("OCI_ENABLE_OAUTH2_SUPPORT"): - fail(IDENTITY_TOKEN_WARNING) - else: - if not rctx.os.environ.get("OCI_ENABLE_OAUTH2_SUPPORT"): - fail(IDENTITY_TOKEN_WARNING) + if not rctx.os.environ.get("OCI_ENABLE_OAUTH2_SUPPORT"): + fail(IDENTITY_TOKEN_WARNING) response = _oauth2( rctx = rctx, @@ -369,5 +364,6 @@ authn = struct( "REGISTRY_AUTH_FILE", "XDG_RUNTIME_DIR", "HOME", + "OCI_ENABLE_OAUTH2_SUPPORT", ] ) \ No newline at end of file