Skip to content

Commit

Permalink
Fix for displaying hooks in app diff view. Fixes argoproj#2215 (argop…
Browse files Browse the repository at this point in the history
…roj#2218)

* Duct tape fix for displaying hooks in app diff view. Fixes argoproj#2215

* ""operationId": "ListMixin7"," to swagger.json

* "for _, item := range items {" to app.go
  • Loading branch information
alexec authored Aug 26, 2019
1 parent 81aa3fb commit 94b0a79
Show file tree
Hide file tree
Showing 10 changed files with 444 additions and 379 deletions.
38 changes: 21 additions & 17 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"ApplicationService"
],
"summary": "List returns list of applications",
"operationId": "ListMixin6",
"operationId": "ListMixin7",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -89,7 +89,7 @@
"ApplicationService"
],
"summary": "Create creates an application",
"operationId": "CreateMixin6",
"operationId": "CreateMixin7",
"parameters": [
{
"name": "body",
Expand All @@ -116,7 +116,7 @@
"ApplicationService"
],
"summary": "Update updates an application",
"operationId": "UpdateMixin6",
"operationId": "UpdateMixin7",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -197,7 +197,7 @@
"ApplicationService"
],
"summary": "Get returns an application by name",
"operationId": "GetMixin6",
"operationId": "GetMixin7",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -238,7 +238,7 @@
"ApplicationService"
],
"summary": "Delete deletes an application",
"operationId": "DeleteMixin6",
"operationId": "DeleteMixin7",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -934,7 +934,7 @@
"ClusterService"
],
"summary": "Get returns a cluster by server address",
"operationId": "GetMixin1",
"operationId": "GetMixin2",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1007,7 +1007,7 @@
"ProjectService"
],
"summary": "List returns list of projects",
"operationId": "ListMixin4",
"operationId": "ListMixin5",
"parameters": [
{
"type": "string",
Expand All @@ -1029,7 +1029,7 @@
"ProjectService"
],
"summary": "Create a new project.",
"operationId": "CreateMixin4",
"operationId": "CreateMixin5",
"parameters": [
{
"name": "body",
Expand All @@ -1056,7 +1056,7 @@
"ProjectService"
],
"summary": "Get returns a project by name",
"operationId": "GetMixin4",
"operationId": "GetMixin5",
"parameters": [
{
"type": "string",
Expand All @@ -1079,7 +1079,7 @@
"ProjectService"
],
"summary": "Delete deletes a project",
"operationId": "DeleteMixin4",
"operationId": "DeleteMixin5",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1129,7 +1129,7 @@
"ProjectService"
],
"summary": "Update updates a project",
"operationId": "UpdateMixin4",
"operationId": "UpdateMixin5",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1239,7 +1239,7 @@
"RepositoryService"
],
"summary": "List returns list of repos",
"operationId": "ListMixin2",
"operationId": "ListMixin3",
"parameters": [
{
"type": "string",
Expand All @@ -1261,7 +1261,7 @@
"RepositoryService"
],
"summary": "Create creates a repo",
"operationId": "CreateMixin2",
"operationId": "CreateMixin3",
"parameters": [
{
"name": "body",
Expand All @@ -1288,7 +1288,7 @@
"RepositoryService"
],
"summary": "Update updates a repo",
"operationId": "UpdateMixin2",
"operationId": "UpdateMixin3",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1321,7 +1321,7 @@
"RepositoryService"
],
"summary": "Delete deletes a repo",
"operationId": "DeleteMixin2",
"operationId": "DeleteMixin3",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -1458,7 +1458,7 @@
"SessionService"
],
"summary": "Create a new JWT for authentication and set a cookie if using HTTP.",
"operationId": "CreateMixin8",
"operationId": "CreateMixin9",
"parameters": [
{
"name": "body",
Expand All @@ -1483,7 +1483,7 @@
"SessionService"
],
"summary": "Delete an existing JWT cookie if using HTTP.",
"operationId": "DeleteMixin8",
"operationId": "DeleteMixin9",
"responses": {
"200": {
"description": "(empty)",
Expand Down Expand Up @@ -3456,6 +3456,10 @@
"group": {
"type": "string"
},
"hook": {
"type": "boolean",
"format": "boolean"
},
"kind": {
"type": "string"
},
Expand Down
6 changes: 4 additions & 2 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,10 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
}

foundDiffs := false
for i := range items {
item := items[i]
for _, item := range items {
if item.target != nil && hook.IsHook(item.target) || item.live != nil && hook.IsHook(item.live) {
continue
}
overrides := make(map[string]argoappv1.ResourceOverride)
for k := range argoSettings.ResourceOverrides {
val := argoSettings.ResourceOverrides[k]
Expand Down
1 change: 1 addition & 0 deletions controller/appcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ func (ctrl *ApplicationController) managedResources(comparisonResult *comparison
Name: res.Name,
Group: res.Group,
Kind: res.Kind,
Hook: res.Hook,
}

target := res.Target
Expand Down
Loading

0 comments on commit 94b0a79

Please sign in to comment.