public boolean writeRack() {

        Map<String, String> nodeLabels = client.nodes().withName(config.getNodeName()).get().getMetadata().getLabels();
        LOGGER.info("NodeLabels = {}", nodeLabels);
        String rackId = nodeLabels.get(config.getRackTopologyKey());
        LOGGER.info("Rack: {} = {}", config.getRackTopologyKey(), rackId);

        if (rackId == null) {
            LOGGER.error("Node {} doesn't have the label {} for getting the rackid",
                    config.getNodeName(), config.getRackTopologyKey());
            return false;
        }

        return write(FILE_RACK_ID, rackId);
    }
@Test
    public void testWriteRackFailWithMissingKubernetesZoneLabel() {

        // the cluster node will not have the requested label
        Map<String, String> labels = new HashMap<>(LABELS);
        labels.remove("failure-domain.beta.kubernetes.io/zone");

        InitWriterConfig config = InitWriterConfig.fromMap(ENV_VARS);

        KubernetesClient client = mockKubernetesClient(config.getNodeName(), labels, List.of());

        InitWriter writer = new InitWriter(client, config);
        assertThat(writer.writeRack(), is(false));
    }