updateOrInsertContext(login) {
    const context = findOrCreateContext(this.contexts, login);
    // add context if newly created
    if (!this.contexts.find(c => c.name === context.name)) {
      this.contexts.push(context);
      if (Array.isArray(this.server_contexts)) {
        this.server_contexts.push(context);
      }
    }
    // update context with login form information
    if (isNotEmpty(login.token)) {
      if (!context.user) context.user = {};
      context.user.token = login.token;
    } else {
      if (!context.user) context.user = {};
      context.user.username = login.username;
      context.user.password = login.password;
    }
    this.current_context = context;

    if (os.platform() === 'browser') {
      writeKubeConfigInLocalStore(this);
    }
  }
This will create a new Context from the login form and set it as the current context.
If the created context already exists it will be updated instead of creating a new one.
@param {*} login the login form