Skip to content

Commit

Permalink
fix: make submodule fetching (and recursion) configurable per App (ar…
Browse files Browse the repository at this point in the history
…goproj#10174)

Signed-off-by: CI <michael@crenshaw.dev>
  • Loading branch information
crenshaw-dev committed Aug 3, 2022
1 parent 4d7ff83 commit e2b50bd
Show file tree
Hide file tree
Showing 19 changed files with 2,596 additions and 532 deletions.
2 changes: 1 addition & 1 deletion applicationset/services/repo_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func checkoutRepo(gitRepoClient git.Client, revision string) error {
if err != nil {
return fmt.Errorf("Error during fetching commitSHA: %w", err)
}
err = gitRepoClient.Checkout(commitSHA, true)
err = gitRepoClient.Checkout(commitSHA, true, true)
if err != nil {
return fmt.Errorf("Error during repo checkout: %w", err)
}
Expand Down
26 changes: 26 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4863,6 +4863,9 @@
"directory": {
"$ref": "#/definitions/v1alpha1ApplicationSourceDirectory"
},
"fetch": {
"$ref": "#/definitions/v1alpha1ApplicationSourceFetch"
},
"helm": {
"$ref": "#/definitions/v1alpha1ApplicationSourceHelm"
},
Expand Down Expand Up @@ -4907,6 +4910,29 @@
}
}
},
"v1alpha1ApplicationSourceFetch": {
"description": "ApplicationSourceFetch contains settings about how git fetches should be performed.",
"type": "object",
"properties": {
"submodule": {
"$ref": "#/definitions/v1alpha1ApplicationSourceFetchSubmodule"
}
}
},
"v1alpha1ApplicationSourceFetchSubmodule": {
"description": "ApplicationSourceFetchSubmodule contains fetch settings for submodules.",
"type": "object",
"properties": {
"enabled": {
"description": "Enabled determines whether submodules will be fetched. If not specified, defaults to true.",
"type": "boolean"
},
"recursive": {
"description": "Recursive determines whether submodules will be fetched recursively. If not specified, defaults to true. This\nvalue is only considered if submodule fetching is also enabled (both at the global and the app level). In other\nwords, setting Recursive to true does not implicitly enable submodule fetching.",
"type": "boolean"
}
}
},
"v1alpha1ApplicationSourceHelm": {
"type": "object",
"title": "ApplicationSourceHelm holds helm specific options",
Expand Down
11 changes: 11 additions & 0 deletions docs/operator-manual/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ spec:
- name: FOO
value: bar

# Settings for git fetch operations.
fetch:
submodule:
# Use this to disable submodule fetching. The default is `true`. ARGOCD_GIT_MODULES_ENABLED=false, if set on the
# repo-server Deployment, overrides this setting.
enabled: true
# Use this to disable recursive submodule fetching (i.e. only fetch submodules directly referenced from the top-
# level repo). This setting only has an effect if submodule fetching is enabled both globally and for this App.
# The default is `true`.
recursive: true

# Destination cluster and namespace to deploy the application
destination:
server: https://kubernetes.default.svc
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ clean_swagger() {
}

echo "If additional types are added, the number of expected collisions may need to be increased"
EXPECTED_COLLISION_COUNT=62
EXPECTED_COLLISION_COUNT=64
collect_swagger server ${EXPECTED_COLLISION_COUNT}
clean_swagger server
clean_swagger reposerver
Expand Down
348 changes: 348 additions & 0 deletions manifests/core-install.yaml

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,27 @@ spec:
recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git fetches
should be performed.
properties:
submodule:
description: Submodule contains fetch settings for submodules.
properties:
enabled:
description: Enabled determines whether submodules
will be fetched. If not specified, defaults to true.
type: boolean
recursive:
description: Recursive determines whether submodules
will be fetched recursively. If not specified, defaults
to true. This value is only considered if submodule
fetching is also enabled (both at the global and
the app level). In other words, setting Recursive
to true does not implicitly enable submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down Expand Up @@ -562,6 +583,27 @@ spec:
recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git fetches should
be performed.
properties:
submodule:
description: Submodule contains fetch settings for submodules.
properties:
enabled:
description: Enabled determines whether submodules will
be fetched. If not specified, defaults to true.
type: boolean
recursive:
description: Recursive determines whether submodules will
be fetched recursively. If not specified, defaults to
true. This value is only considered if submodule fetching
is also enabled (both at the global and the app level).
In other words, setting Recursive to true does not implicitly
enable submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down Expand Up @@ -914,6 +956,29 @@ spec:
recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git fetches
should be performed.
properties:
submodule:
description: Submodule contains fetch settings for submodules.
properties:
enabled:
description: Enabled determines whether submodules
will be fetched. If not specified, defaults to
true.
type: boolean
recursive:
description: Recursive determines whether submodules
will be fetched recursively. If not specified,
defaults to true. This value is only considered
if submodule fetching is also enabled (both at
the global and the app level). In other words,
setting Recursive to true does not implicitly
enable submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down Expand Up @@ -1278,6 +1343,31 @@ spec:
a directory recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git
fetches should be performed.
properties:
submodule:
description: Submodule contains fetch settings
for submodules.
properties:
enabled:
description: Enabled determines whether submodules
will be fetched. If not specified, defaults
to true.
type: boolean
recursive:
description: Recursive determines whether
submodules will be fetched recursively.
If not specified, defaults to true. This
value is only considered if submodule fetching
is also enabled (both at the global and
the app level). In other words, setting
Recursive to true does not implicitly enable
submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down Expand Up @@ -1628,6 +1718,30 @@ spec:
recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git fetches
should be performed.
properties:
submodule:
description: Submodule contains fetch settings for
submodules.
properties:
enabled:
description: Enabled determines whether submodules
will be fetched. If not specified, defaults
to true.
type: boolean
recursive:
description: Recursive determines whether submodules
will be fetched recursively. If not specified,
defaults to true. This value is only considered
if submodule fetching is also enabled (both
at the global and the app level). In other words,
setting Recursive to true does not implicitly
enable submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down Expand Up @@ -1962,6 +2076,30 @@ spec:
recursively for manifests
type: boolean
type: object
fetch:
description: Fetch contains settings about how git fetches
should be performed.
properties:
submodule:
description: Submodule contains fetch settings for
submodules.
properties:
enabled:
description: Enabled determines whether submodules
will be fetched. If not specified, defaults
to true.
type: boolean
recursive:
description: Recursive determines whether submodules
will be fetched recursively. If not specified,
defaults to true. This value is only considered
if submodule fetching is also enabled (both
at the global and the app level). In other words,
setting Recursive to true does not implicitly
enable submodule fetching.
type: boolean
type: object
type: object
helm:
description: Helm holds helm specific options
properties:
Expand Down

0 comments on commit e2b50bd

Please sign in to comment.