Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ignore status globally #3754

Merged
merged 13 commits into from Jul 3, 2020
13 changes: 12 additions & 1 deletion assets/swagger.json
Expand Up @@ -4247,6 +4247,17 @@
}
}
},
"v1alpha1OverrideIgnoreDiff": {
"type": "object",
"properties": {
"jSONPointers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v1alpha1ProjectRole": {
"type": "object",
"title": "ProjectRole represents a role that has access to a project",
Expand Down Expand Up @@ -4631,7 +4642,7 @@
"type": "string"
},
"ignoreDifferences": {
"type": "string"
"$ref": "#/definitions/v1alpha1OverrideIgnoreDiff"
},
"knownTypeFields": {
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion cmd/argocd-util/commands/settings.go
Expand Up @@ -401,7 +401,7 @@ argocd-util settings resource-overrides ignore-differences ./deploy.yaml --argoc

executeResourceOverrideCommand(cmdCtx, args, func(res unstructured.Unstructured, override v1alpha1.ResourceOverride, overrides map[string]v1alpha1.ResourceOverride) {
gvk := res.GroupVersionKind()
if override.IgnoreDifferences == "" {
if len(override.IgnoreDifferences.JSONPointers) == 0 {
_, _ = fmt.Printf("Ignore differences are not configured for '%s/%s'\n", gvk.Group, gvk.Kind)
return
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/argocd-util/commands/settings_test.go
Expand Up @@ -195,7 +195,7 @@ admissionregistration.k8s.io/MutatingWebhookConfiguration:
jsonPointers:
- /webhooks/0/clientConfig/caBundle`,
},
containsSummary: "1 resource overrides",
containsSummary: "2 resource overrides",
},
}
for name := range testCases {
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/api-rules/violation_exceptions.list
Expand Up @@ -28,6 +28,7 @@ API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/appli
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,GnuPGPublicKeyList,Items
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,JWTTokens,Items
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,Operation,Info
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,OverrideIgnoreDiff,JSONPointers
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ProjectRole,Groups
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ProjectRole,JWTTokens
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ProjectRole,Policies
Expand All @@ -53,6 +54,7 @@ API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/appli
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,TLSClientConfig,CAData
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,TLSClientConfig,CertData
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,TLSClientConfig,KeyData
API rule violation: list_type_missing,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,rawResourceOverride,KnownTypeFields
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ApplicationSourceJsonnet,TLAs
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ClusterCacheInfo,APIsCount
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ConnectionState,ModifiedAt
Expand All @@ -63,5 +65,9 @@ API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,Repository,EnableLFS
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceActionDefinition,ActionLua
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceActions,ActionDiscoveryLua
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceOverride,Actions
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceOverride,HealthLua
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceOverride,IgnoreDifferences
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,ResourceOverride,KnownTypeFields
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,objectMeta,Name
API rule violation: names_match,github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1,rawResourceOverride,HealthLua