Skip to content

Commit

Permalink
feat: added deep links backend changes (argoproj#11401)
Browse files Browse the repository at this point in the history
* feat: added deep links backend changes

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* fix: add rbac check to list links services

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: removed project param and updated sample config

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* feat: update sample config

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
  • Loading branch information
gdsoumya authored and schakrad committed Mar 14, 2023
1 parent 8757cfa commit 04c4d83
Show file tree
Hide file tree
Showing 15 changed files with 2,230 additions and 287 deletions.
156 changes: 156 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,42 @@
}
}
},
"/api/v1/applications/{name}/links": {
"get": {
"tags": [
"ApplicationService"
],
"summary": "ListLinks returns the list of all application deep links",
"operationId": "ApplicationService_ListLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"name": "namespace",
"in": "query"
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/applications/{name}/logs": {
"get": {
"tags": [
Expand Down Expand Up @@ -1385,6 +1421,67 @@
}
}
},
"/api/v1/applications/{name}/resource/links": {
"get": {
"tags": [
"ApplicationService"
],
"summary": "ListResourceLinks returns the list of all resource deep links",
"operationId": "ApplicationService_ListResourceLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"name": "namespace",
"in": "query"
},
{
"type": "string",
"name": "resourceName",
"in": "query"
},
{
"type": "string",
"name": "version",
"in": "query"
},
{
"type": "string",
"name": "group",
"in": "query"
},
{
"type": "string",
"name": "kind",
"in": "query"
},
{
"type": "string",
"name": "appNamespace",
"in": "query"
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/applications/{name}/revisions/{revision}/metadata": {
"get": {
"tags": [
Expand Down Expand Up @@ -2560,6 +2657,37 @@
}
}
},
"/api/v1/projects/{name}/links": {
"get": {
"tags": [
"ProjectService"
],
"summary": "ListLinks returns all deep links for the particular project",
"operationId": "ProjectService_ListLinks",
"parameters": [
{
"type": "string",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/applicationLinksResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/v1/projects/{name}/syncwindows": {
"get": {
"tags": [
Expand Down Expand Up @@ -3900,6 +4028,34 @@
}
}
},
"applicationLinkInfo": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"iconClass": {
"type": "string"
},
"title": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"applicationLinksResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/applicationLinkInfo"
}
}
}
},
"applicationLogEntry": {
"type": "object",
"properties": {
Expand Down
26 changes: 26 additions & 0 deletions docs/operator-manual/argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,29 @@ data:
# token verification to pass despite the OIDC provider having an invalid certificate. Only set to "true" if you
# understand the risks.
oidc.tls.insecure.skip.verify: "false"

# Add Deep Links to ArgoCD UI
# sample project level links
project.links: |
- url: https://myaudit-system.com?project={{.metadata.name}}
title: Audit
description: system audit logs
icon.class: "fa-book"
# sample application level links
application.links: |
# pkg.go.dev/text/template is used for evaluating url templates
- url: https://mycompany.splunk.com?search={{.spec.destination.namespace}}
title: Splunk
# conditionally show link e.g. for specific project
# github.com/antonmedv/expr is used for evaluation of conditions
- url: https://mycompany.splunk.com?search={{.spec.destination.namespace}}
title: Splunk
if: spec.project == "default"
- url: https://{{.metadata.annotations.splunkhost}}?search={{.spec.destination.namespace}}
title: Splunk
if: metadata.annotations.splunkhost
# sample resource level links
resource.links: |
- url: https://mycompany.splunk.com?search={{.metadata.namespace}}
title: Splunk
if: kind == "Pod" || kind == "Deployment"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ require (

require (
github.com/Masterminds/sprig/v3 v3.2.2
github.com/antonmedv/expr v1.9.0
github.com/gosimple/slug v1.13.1
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/robfig/cron/v3 v3.0.1
Expand Down Expand Up @@ -142,7 +143,6 @@ require (
github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20210112200207-10ab4d695d60 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/antonmedv/expr v1.9.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ clean_swagger() {
}

echo "If additional types are added, the number of expected collisions may need to be increased"
EXPECTED_COLLISION_COUNT=93
EXPECTED_COLLISION_COUNT=95
collect_swagger server ${EXPECTED_COLLISION_COUNT}
clean_swagger server
clean_swagger reposerver
Expand Down
Loading

0 comments on commit 04c4d83

Please sign in to comment.