fix: resolve ruff lint errors (unused imports and variable)
This commit is contained in:
+2
-4
@@ -1,3 +1,4 @@
|
|||||||
|
import re
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
k8s-version-tracker: Weekly Kubernetes image version checker and Mattermost notifier.
|
k8s-version-tracker: Weekly Kubernetes image version checker and Mattermost notifier.
|
||||||
@@ -8,8 +9,6 @@ notification with the weekly report.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
@@ -17,7 +16,7 @@ from typing import Optional
|
|||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from kubernetes import client, config
|
from kubernetes import config
|
||||||
from packaging.version import Version, InvalidVersion
|
from packaging.version import Version, InvalidVersion
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
||||||
@@ -121,7 +120,6 @@ def parse_image_ref(image: str) -> ImageInfo:
|
|||||||
def _semver_tags(tags: list[str], current_tag: str) -> Optional[str]:
|
def _semver_tags(tags: list[str], current_tag: str) -> Optional[str]:
|
||||||
"""From a list of tags, return the latest stable semver tag comparable to current."""
|
"""From a list of tags, return the latest stable semver tag comparable to current."""
|
||||||
norm = current_tag.lstrip("v")
|
norm = current_tag.lstrip("v")
|
||||||
has_v_prefix = current_tag.startswith("v")
|
|
||||||
|
|
||||||
# Detect suffix pattern (e.g. '-alpine', '-amd64')
|
# Detect suffix pattern (e.g. '-alpine', '-amd64')
|
||||||
suffix_match = re.search(r"(-[a-zA-Z][a-zA-Z0-9._-]*)$", norm)
|
suffix_match = re.search(r"(-[a-zA-Z][a-zA-Z0-9._-]*)$", norm)
|
||||||
|
|||||||
Reference in New Issue
Block a user