Class HelmRegistryLogin

  • All Implemented Interfaces:
    io.github.build.extensions.oss.gradle.plugins.helm.command.ConfigurableGlobalHelmOptions , io.github.build.extensions.oss.gradle.plugins.helm.command.ConfigurableHelmOptions , io.github.build.extensions.oss.gradle.plugins.helm.command.GlobalHelmOptions , io.github.build.extensions.oss.gradle.plugins.helm.command.HelmOptions , kotlin.Comparable , org.gradle.api.Named , org.gradle.api.Task , org.gradle.api.internal.DynamicObjectAware , org.gradle.api.internal.TaskInternal , org.gradle.api.plugins.ExtensionAware , org.gradle.util.Configurable

    @DisableCachingByDefault(because = "Login task should not be cached") 
    public abstract class HelmRegistryLogin
    extends AbstractHelmCommandTask
                        

    Logs in to an OCI registry. Corresponds to the helm registry login CLI command.

    For chart dependencies, prefer declaring the registry in helm.registries: the dependency tasks then log in themselves, and only when they actually run. Use this task for anything else that needs a login, and wire it with dependsOn - it is not connected to any other task automatically:

    val helmRegistryLogin by tasks.registering(HelmRegistryLogin::class) {
        registry.set("registry.example.com")
        username.set(providers.environmentVariable("REGISTRY_USER"))
        password.set(providers.environmentVariable("REGISTRY_PASSWORD"))
    }

    The login is stored below the plugin's xdgConfigHome, which is where the other Helm tasks of the build look for it - a login done in a shell outside of Gradle is not visible to them. The password is passed on the standard input (--password-stdin), never on the command line.

    The task declares no outputs, so it is never up-to-date: a login leaves nothing that could be checked, and credentials may have expired since the last build.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Property<String> getRegistry() The registry host, optionally with a port, e.g.
      final Property<String> getUsername() Username to access the registry.
      final Property<String> getPassword() Password or identity token to access the registry.
      final RegularFileProperty getCaFile() A CA bundle used to verify certificates of HTTPS-enabled registries.
      final RegularFileProperty getCertificateFile() Path to a certificate file for client SSL authentication.
      final RegularFileProperty getKeyFile() Path to a certificate private key file for client SSL authentication.
      final Unit login()
      • Methods inherited from class io.github.build.extensions.oss.gradle.plugins.helm.command.tasks.AbstractHelmCommandTask

        getDebug, getExecutable, getExtraArgs, getXdgCacheHome, getXdgConfigHome, getXdgDataHome
      • Methods inherited from class org.gradle.api.DefaultTask

        getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, setActions, setDescription, setDidWork, setEnabled, setEnabled, setGroup
      • Methods inherited from class org.gradle.api.internal.AbstractTask

        getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getLoggingManager, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getReasonsNotToTrackState, getRequiredServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, setImpliesSubProjects
      • Methods inherited from class org.gradle.api.Task

        configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, doNotTrackState, finalizedBy, hasProperty, mustRunAfter, notCompatibleWithConfigurationCache, onlyIf, onlyIf, onlyIf, property, setDependsOn, setFinalizedBy, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
      • Methods inherited from class kotlin.Comparable

        compareTo
      • Methods inherited from class org.gradle.api.internal.TaskInternal

        acceptServiceReferences, appendParallelSafeAction, doNotTrackStateIf, hasTaskActions, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HelmRegistryLogin

        HelmRegistryLogin()
    • Method Detail

      • getRegistry

        @Input() final Property<String> getRegistry()

        The registry host, optionally with a port, e.g. registry.example.com:5000.

      • getUsername

        @Input()@Optional() final Property<String> getUsername()

        Username to access the registry.

        Corresponds to the --username CLI parameter.

      • getPassword

        @Input()@Optional() final Property<String> getPassword()

        Password or identity token to access the registry.

        Passed to Helm on the standard input, using the --password-stdin CLI parameter.

      • getCaFile

        @InputFile()@Optional() final RegularFileProperty getCaFile()

        A CA bundle used to verify certificates of HTTPS-enabled registries.

        Corresponds to the --ca-file CLI parameter.

      • getCertificateFile

        @InputFile()@Optional() final RegularFileProperty getCertificateFile()

        Path to a certificate file for client SSL authentication.

        Corresponds to the --cert-file CLI parameter.

      • getKeyFile

        @InputFile()@Optional() final RegularFileProperty getKeyFile()

        Path to a certificate private key file for client SSL authentication.

        Corresponds to the --key-file CLI parameter.