Skip to content

Commit ba2f7b9

Browse files
authored
v1.1.0 (#601)
* Initial version * Adding debug info * v1.0.1 Renaming variable * v1.1.0: Adding document on LOG_LEVEL and fault to error Adding return parameters * Remove env_vars_to_export, file created for testing * Enumerate sync status * simplify query * updating version to reduce vuln * updating base image * increasing requests version to 2.31.0 to solve CVSS 6.1 --------- Signed-off-by: Laurent Rochette <[email protected]>
1 parent f471605 commit ba2f7b9

File tree

6 files changed

+43
-157
lines changed

6 files changed

+43
-157
lines changed

incubating/argocd-app-status/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.11.2-slim-buster
1+
FROM python:3.11.3-slim-buster
22
WORKDIR /app
33
COPY requirements.txt requirements.txt
44
RUN pip3 install -r requirements.txt

incubating/argocd-app-status/argocd_app_status.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_runtime_ns():
5757

5858
def get_link_to_apps_dashboard():
5959
runtime_ns= get_runtime_ns()
60-
url_to_app = CF_URL+'/2.0/applications-dashboard/'+RUNTIME+'/'+runtime_ns+'/'+APPLICATION+'/timeline'
60+
url_to_app = CF_URL+'/2.0/applications-dashboard/'+ runtime_ns +'/'+ RUNTIME +'/'+APPLICATION+'/timeline'
6161
return url_to_app
6262

6363
def get_app_status():

incubating/argocd-app-status/env_vars_to_export

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
fragment ApplicationShortOperationStateFragment on ApplicationOperationState {
2-
message
3-
phase
4-
type
5-
syncResult {
6-
revision
7-
source {
8-
repoURL
9-
targetRevision
10-
path
11-
chart
12-
__typename
13-
}
14-
resources {
15-
status
16-
hookPhase
17-
__typename
18-
}
19-
__typename
20-
}
21-
__typename
22-
}
23-
241
query ApplicationsStatusesQuery(
252
$runtime: String!
263
$name: String!
@@ -30,132 +7,12 @@ query ApplicationsStatusesQuery(
307
metadata {
318
runtime
329
name
33-
runtime
3410
namespace
35-
created
36-
uid
37-
labels {
38-
key
39-
value
40-
__typename
41-
}
4211
cluster
4312
__typename
4413
}
4514
healthStatus
4615
syncStatus
4716
syncPolicy
48-
isHelmApp
49-
repoURL
50-
revision
51-
updatedAt
52-
size
53-
desiredManifest
54-
appsRelations {
55-
referencedBy {
56-
kind
57-
__typename
58-
}
59-
__typename
60-
}
61-
specSource {
62-
repoURL
63-
targetRevision
64-
path
65-
chart
66-
__typename
67-
}
68-
destination {
69-
name
70-
server
71-
namespace
72-
__typename
73-
}
74-
status {
75-
minHistoryId
76-
__typename
77-
}
78-
source {
79-
gitManifest
80-
path
81-
revision
82-
gitSource {
83-
metadata {
84-
name
85-
__typename
86-
}
87-
self {
88-
repoURL
89-
revision
90-
path
91-
__typename
92-
}
93-
permissions {
94-
read
95-
write
96-
user {
97-
id
98-
__typename
99-
}
100-
__typename
101-
}
102-
__typename
103-
}
104-
__typename
105-
}
106-
errors {
107-
__typename
108-
object {
109-
metadata {
110-
kind
111-
name
112-
namespace
113-
runtime
114-
group
115-
version
116-
__typename
117-
}
118-
__typename
119-
}
120-
level
121-
title
122-
message
123-
lastSeen
124-
... on SyncError {
125-
code
126-
context {
127-
repoURL
128-
revision
129-
path
130-
fileUrl
131-
commitAuthor
132-
commitUrl
133-
commitMessage
134-
commitDate
135-
__typename
136-
}
137-
__typename
138-
}
139-
}
140-
operationState {
141-
...ApplicationShortOperationStateFragment
142-
__typename
143-
}
144-
sync {
145-
status
146-
revision
147-
comparedTo {
148-
source {
149-
repoURL
150-
targetRevision
151-
path
152-
chart
153-
__typename
154-
}
155-
__typename
156-
}
157-
__typename
158-
}
159-
__typename
16017
}
16118
}
+11-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
backoff==2.2.1
2+
certifi==2023.5.7
3+
charset-normalizer==3.1.0
4+
docopt==0.6.2
15
gql==3.4.0
26
graphql-core==3.2.3
3-
requests==2.28.2
4-
requests-toolbelt==0.10.1
5-
urllib3==1.26.15
7+
idna==3.4
68
multidict==6.0.4
9+
pipreqs==0.4.13
10+
requests==2.31.0
11+
requests-toolbelt==0.10.1
12+
urllib3==1.26.16
13+
yarg==0.1.9
14+
yarl==1.9.2

incubating/argocd-app-status/step.yaml

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
kind: step-type
22
metadata:
33
name: argocd-app-status
4-
version: 1.0.1
4+
version: 1.1.1
55
isPublic: true
6-
description: Get Argo CD App status and return SYNC_STATUS and HEALTH_STATUS
6+
description: Get Argo CD App status and return its sybc and health status
77
sources:
88
- 'https://github.com/codefresh-io/steps/tree/master/incubating/argocd-app-status'
99
stage: incubating
@@ -49,18 +49,45 @@ spec:
4949
"type": "string",
5050
"description": "The name of the Argo CD Application to be checked"
5151
},
52+
"LOG_LEVEL": {
53+
"type": "string",
54+
"description": "set the log level, e.g. 'debug', 'info', 'warn', 'error', 'critical' (default 'error')",
55+
"default": "error"
56+
},
5257
"IMAGE_NAME": {
5358
"type": "string",
5459
"default": "quay.io/codefreshplugins/argocd-app-status",
5560
"description": "OPTIONAL - To overwrite the image name to use"
5661
},
5762
"IMAGE_TAG": {
5863
"type": "string",
59-
"default": "1.0.1",
64+
"default": "1.1.1",
6065
"description": "OPTIONAL - To overwrite the tag to use"
6166
}
6267
}
6368
}
69+
returns: |-
70+
{
71+
"definitions": {},
72+
"$schema": "http://json-schema.org/draft-07/schema#",
73+
"type": "object",
74+
"additionalProperties": true,
75+
"patterns": [],
76+
"required": [
77+
"HEALTH_STATUS",
78+
"SYNC_STATUS"
79+
],
80+
"properties": {
81+
"HEALTH_STATUS": {
82+
"type": "string",
83+
"description": "The heatlh status of the application: HEALTHY, PROGRESSING, DEGRADED or SUSPENDED"
84+
},
85+
"SYNC_STATUS": {
86+
"type": "string",
87+
"description": "The synchronization status of the application: SYNCED, OUTOFSYNC, UNKNOWN."
88+
}
89+
}
90+
}
6491
stepsTemplate: |-
6592
argocd_app_status:
6693
image: '[[.Arguments.IMAGE_NAME]]:[[.Arguments.IMAGE_TAG]]'

0 commit comments

Comments
 (0)