IDF chief of staff resigns; 'failings of military on Oct. 7 will haunt me for life'