• Alexey igrychev's avatar
    Implement before-hook-creation delete policy · 1d4883bf
    Alexey igrychev authored
    Existing helm.sh/hook-delete-policy annotation variables (hook-failed, hook-succeeded) do not allow to leave failed jobs for debugging without blocking the next job launching: every failed job must be deleted manually before the next related release is launching (installing, updating or rolling back).
    
    New policy, before-hook-creation, removes the hook from previous release if there is one before the new hook is launched and can be used with another variable.
    1d4883bf
SelectState.cpp 1.10 KiB
#include "SelectState.h"
#include "../../../workdir/config.h"
SelectState::SelectState(IStateManager& state_manager,
                         const sf::VideoMode& video_mode,
                         const std::string& window_title) :
        IState(state_manager), IWindowKeeper(video_mode, window_title), m_menu(state_manager) {}
void SelectState::event_handling() {
    sf::Event event;
    while (m_window.pollEvent(event)) {
        if (event.type == sf::Event::Closed) {
            m_state_manager.set_next_state(std::make_unique<ExitState>(m_state_manager));
            break;
void SelectState::update() {
    const sf::Vector2f pos = m_window.mapPixelToCoords(sf::Mouse::getPosition(m_window));
    if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) {
        m_menu.process_mouse(pos, true);
        return;
    m_menu.process_mouse(pos, false);
void SelectState::render() {
    m_window.clear(config::SELECT_LEVEL_BACKGROUND_COLOR);
    m_menu.draw_into(m_window);
    m_window.display();
bool SelectState::do_step() {
    event_handling();
    update();
    render();
    return true;