Skip to content

Commit

Permalink
ci: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
harshilgajera-crest committed Aug 9, 2024
1 parent a8a1a68 commit e4e5c40
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions splunk_matrix_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def get_token():


def get_images_list(token):
# headers = {"Authorization": f"Bearer {token}"}
# splunk_image_list_url = "https://registry.hub.docker.com/v2/splunk/splunk/tags/list"
# response = requests.get(splunk_image_list_url, headers=headers)
# response.raise_for_status()
# response_json = json.loads(response.text)
headers = {"Authorization": f"Bearer {token}"}
splunk_image_list_url = "https://registry.hub.docker.com/v2/splunk/splunk/tags/list"
response = requests.get(splunk_image_list_url, headers=headers)
response.raise_for_status()
response_json = json.loads(response.text)
all_details = (
"https://hub.docker.com/v2/repositories/splunk/splunk/tags?page_size=100"
)
response = requests.get(all_details)
all_details = json.loads(response.content)
return all_details["results"]
return response_json["tags"], all_details["results"]


def get_latest_image(stanza, images):
Expand Down Expand Up @@ -56,7 +56,7 @@ def filter_image_list(images_list):


def get_build_number_1(token, latest_image_digest):
image_lists = get_images_list(token)
_, image_lists = get_images_list(token)
match_and_return_name = next(
(
d["name"]
Expand Down Expand Up @@ -109,9 +109,9 @@ def update_splunk_version(token):
config.optionxform = str
config.read("config/splunk_matrix.conf")
update_file = False
all_images = get_images_list(token)
images_list, all_images = get_images_list(token)
# filter_images = filter_image_list(images_list)
images_list = [d["name"] for d in all_images]
# images_list = [d["name"] for d in all_images]
for stanza in config.sections():
if stanza != "GENERAL":
print(images_list)
Expand Down

0 comments on commit e4e5c40

Please sign in to comment.