Class DisplaySecretReconciler

java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.manager.DisplaySecretReconciler
All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager

public class DisplaySecretReconciler extends Component
The properties of the display secret do not only depend on the VM definition, but also on events that occur during runtime.

The reconciler for the display secret is therefore a separate component.

The reconciler supports the following configuration properties:

  • passwordValidity: the validity of the random password in seconds. Used to calculate the password expiry time in the generated secret.
  • Field Details

  • Constructor Details

    • DisplaySecretReconciler

      public DisplaySecretReconciler(Channel componentChannel)
      Instantiates a new display secret reconciler.
      Parameters:
      componentChannel - the component channel
  • Method Details

    • onConfigurationUpdate

      On configuration update.
      Parameters:
      event - the event
    • reconcile

      public void reconcile(VmDefChanged event, Map<String,Object> model, VmChannel channel) throws IOException, TemplateException, io.kubernetes.client.openapi.ApiException
      Reconcile.

      If the configuration prevents generating a secret or the secret already exists, do nothing. Else generate a new secret with a random password and immediate expiration, thus preventing access to the display.

      Parameters:
      event - the event
      model - the model
      channel - the channel
      Throws:
      IOException - Signals that an I/O exception has occurred.
      TemplateException - the template exception
      io.kubernetes.client.openapi.ApiException - the api exception
    • onPrepareConsole

      @Handler public void onPrepareConsole(PrepareConsole event, VmChannel channel) throws io.kubernetes.client.openapi.ApiException
      Prepares access to the console for the user from the event.

      Generates a new password and sends it to the runner. Requests the VM (via the runner) to login the user if specified in the event.

      Parameters:
      event - the event
      channel - the channel
      Throws:
      io.kubernetes.client.openapi.ApiException - the api exception
    • onVmDefChanged

      @Handler public void onVmDefChanged(VmDefChanged event, Channel channel)
      On vm def changed.
      Parameters:
      event - the event
      channel - the channel