https://pulumi.com logo
Title
g

gorgeous-minister-41131

02/21/2023, 11:57 PM
Anyone know what would be analogous to
$.Release.Revision
from helm, in Pulumi?
b

billowy-army-68599

02/22/2023, 12:12 AM
is that a helm variable?
g

gorgeous-minister-41131

02/22/2023, 12:30 AM
yeah - it's just a tracking variable that increments for each Release that goes out that isn't a rollback.
I wasn't sure if Pulumi had some deterministic way of assigning an invocation/release/unique ID or if I should just write my own for the scope of the entire run..
(for scope, I'm porting a native Helm chart that is utilizing this for generating the name of a
Job
resource, so I need an alternative that can provide me with a unique-yet-consistent value for each run) I think I would be able to just use a random generated slug just fine, just wasn't sure..
def random_id(length: int = 4) -> str:
    """
    Generates a random n-length character hexidecimal ID that can be used for
    naming, annotating, labeling or tagging a deployment, namespace etc.
    """

    charsets: str = string.ascii_lowercase + string.digits
    return "".join(random.choice(charsets) for _ in range(length))
so I made this