Skip to content

Commit 61e5225

Browse files
committed
remove devfile v2 project.sparseCheckoutDir
Signed-off-by: Stephanie <[email protected]>
1 parent 3ac0baa commit 61e5225

27 files changed

+0
-249
lines changed

Diff for: crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -7012,12 +7012,6 @@ spec:
70127012
- Git
70137013
- Zip
70147014
type: string
7015-
sparseCheckoutDirs:
7016-
description: Populate the project sparsely with selected
7017-
directories.
7018-
items:
7019-
type: string
7020-
type: array
70217015
zip:
70227016
description: Project's Zip source
70237017
properties:
@@ -7203,12 +7197,6 @@ spec:
72037197
- Zip
72047198
- Custom
72057199
type: string
7206-
sparseCheckoutDirs:
7207-
description: Populate the project sparsely with selected
7208-
directories.
7209-
items:
7210-
type: string
7211-
type: array
72127200
zip:
72137201
description: Project's Zip source
72147202
properties:

Diff for: crds/workspace.devfile.io_devworkspaces.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -7017,12 +7017,6 @@ spec:
70177017
- Git
70187018
- Zip
70197019
type: string
7020-
sparseCheckoutDirs:
7021-
description: Populate the project sparsely with selected
7022-
directories.
7023-
items:
7024-
type: string
7025-
type: array
70267020
zip:
70277021
description: Project's Zip source
70287022
properties:
@@ -7208,12 +7202,6 @@ spec:
72087202
- Zip
72097203
- Custom
72107204
type: string
7211-
sparseCheckoutDirs:
7212-
description: Populate the project sparsely with selected
7213-
directories.
7214-
items:
7215-
type: string
7216-
type: array
72177205
zip:
72187206
description: Project's Zip source
72197207
properties:

Diff for: crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

-11
Original file line numberDiff line numberDiff line change
@@ -6679,12 +6679,6 @@ spec:
66796679
- Git
66806680
- Zip
66816681
type: string
6682-
sparseCheckoutDirs:
6683-
description: Populate the project sparsely with selected
6684-
directories.
6685-
items:
6686-
type: string
6687-
type: array
66886682
zip:
66896683
description: Project's Zip source
66906684
properties:
@@ -6865,11 +6859,6 @@ spec:
68656859
- Zip
68666860
- Custom
68676861
type: string
6868-
sparseCheckoutDirs:
6869-
description: Populate the project sparsely with selected directories.
6870-
items:
6871-
type: string
6872-
type: array
68736862
zip:
68746863
description: Project's Zip source
68756864
properties:

Diff for: crds/workspace.devfile.io_devworkspacetemplates.yaml

-11
Original file line numberDiff line numberDiff line change
@@ -6684,12 +6684,6 @@ spec:
66846684
- Git
66856685
- Zip
66866686
type: string
6687-
sparseCheckoutDirs:
6688-
description: Populate the project sparsely with selected
6689-
directories.
6690-
items:
6691-
type: string
6692-
type: array
66936687
zip:
66946688
description: Project's Zip source
66956689
properties:
@@ -6870,11 +6864,6 @@ spec:
68706864
- Zip
68716865
- Custom
68726866
type: string
6873-
sparseCheckoutDirs:
6874-
description: Populate the project sparsely with selected directories.
6875-
items:
6876-
type: string
6877-
type: array
68786867
zip:
68796868
description: Project's Zip source
68806869
properties:

Diff for: pkg/apis/workspaces/v1alpha1/projects_conversion.go

-25
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ func convertProjectTo_v1alpha2(src *Project, dest *v1alpha2.Project) error {
3232
return err
3333
}
3434

35-
var sparseCheckoutDir string
36-
switch {
37-
case src.Git != nil:
38-
sparseCheckoutDir = src.Git.SparseCheckoutDir
39-
case src.Zip != nil:
40-
sparseCheckoutDir = src.Zip.SparseCheckoutDir
41-
}
42-
if sparseCheckoutDir != "" {
43-
dest.SparseCheckoutDirs = []string{sparseCheckoutDir}
44-
}
45-
4635
// Make sure we didn't modify underlying src struct
4736
if src.Github != nil {
4837
src.Git = nil
@@ -60,20 +49,6 @@ func convertProjectFrom_v1alpha2(src *v1alpha2.Project, dest *Project) error {
6049
if err != nil {
6150
return err
6251
}
63-
// **Note**: These aren't technically compatible:
64-
// - v1alpha2 allows us to specify multiple sparse checkout dirs; v1alpha1 only supports one
65-
// -> we ignore all but the first sparseCheckoutDir
66-
// - v1alpha2 doesn't forbid sparse checkout dir for a custom project source
67-
// -> we ignore all sparseCheckoutDirs when project source is Custom
68-
if len(src.SparseCheckoutDirs) > 0 {
69-
sparseCheckoutDir := src.SparseCheckoutDirs[0]
70-
switch {
71-
case src.Git != nil:
72-
dest.Git.SparseCheckoutDir = sparseCheckoutDir
73-
case src.Zip != nil:
74-
dest.Zip.SparseCheckoutDir = sparseCheckoutDir
75-
}
76-
}
7752

7853
// Check if a Git-type project was originally a Github-type project in v1alpha1
7954
if src.Git != nil && src.Attributes != nil {

Diff for: pkg/apis/workspaces/v1alpha2/projects.go

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ type Project struct {
1919
// +optional
2020
ClonePath string `json:"clonePath,omitempty"`
2121

22-
// Populate the project sparsely with selected directories.
23-
// +optional
24-
SparseCheckoutDirs []string `json:"sparseCheckoutDirs,omitempty"`
25-
2622
ProjectSource `json:",inline"`
2723
}
2824

Diff for: pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pkg/validation/variables/test-fixtures/all/devfile-bad-output.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ variables:
33
projects:
44
- name: project1
55
clonePath: "{{path}}"
6-
sparseCheckoutDirs:
7-
- xyz
8-
- "{{dir}}"
96
git:
107
checkoutFrom:
118
revision: "{{tag}}"

Diff for: pkg/validation/variables/test-fixtures/projects/project-output.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: project1
22
clonePath: "/FOO"
3-
sparseCheckoutDirs:
4-
- /FOO
5-
- "/BAR"
63
git:
74
checkoutFrom:
85
revision: "FOO"

Diff for: pkg/validation/variables/test-fixtures/projects/project.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Variables are defined in test-fixtures/variables/variables-referenced.yaml
22
name: project1
33
clonePath: "/{{foo}}"
4-
sparseCheckoutDirs:
5-
- /FOO
6-
- "/{{bar}}"
74
git:
85
checkoutFrom:
96
revision: "{{foo}}"

Diff for: schemas/latest/dev-workspace-template-spec.json

-14
Original file line numberDiff line numberDiff line change
@@ -2594,13 +2594,6 @@
25942594
"maxLength": 63,
25952595
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
25962596
},
2597-
"sparseCheckoutDirs": {
2598-
"description": "Populate the project sparsely with selected directories.",
2599-
"type": "array",
2600-
"items": {
2601-
"type": "string"
2602-
}
2603-
},
26042597
"zip": {
26052598
"description": "Project's Zip source",
26062599
"type": "object",
@@ -2809,13 +2802,6 @@
28092802
"maxLength": 63,
28102803
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
28112804
},
2812-
"sparseCheckoutDirs": {
2813-
"description": "Populate the project sparsely with selected directories.",
2814-
"type": "array",
2815-
"items": {
2816-
"type": "string"
2817-
}
2818-
},
28192805
"zip": {
28202806
"description": "Project's Zip source",
28212807
"type": "object",

Diff for: schemas/latest/dev-workspace-template.json

-14
Original file line numberDiff line numberDiff line change
@@ -2759,13 +2759,6 @@
27592759
"maxLength": 63,
27602760
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
27612761
},
2762-
"sparseCheckoutDirs": {
2763-
"description": "Populate the project sparsely with selected directories.",
2764-
"type": "array",
2765-
"items": {
2766-
"type": "string"
2767-
}
2768-
},
27692762
"zip": {
27702763
"description": "Project's Zip source",
27712764
"type": "object",
@@ -2974,13 +2967,6 @@
29742967
"maxLength": 63,
29752968
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
29762969
},
2977-
"sparseCheckoutDirs": {
2978-
"description": "Populate the project sparsely with selected directories.",
2979-
"type": "array",
2980-
"items": {
2981-
"type": "string"
2982-
}
2983-
},
29842970
"zip": {
29852971
"description": "Project's Zip source",
29862972
"type": "object",

Diff for: schemas/latest/dev-workspace.json

-14
Original file line numberDiff line numberDiff line change
@@ -2772,13 +2772,6 @@
27722772
"maxLength": 63,
27732773
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
27742774
},
2775-
"sparseCheckoutDirs": {
2776-
"description": "Populate the project sparsely with selected directories.",
2777-
"type": "array",
2778-
"items": {
2779-
"type": "string"
2780-
}
2781-
},
27822775
"zip": {
27832776
"description": "Project's Zip source",
27842777
"type": "object",
@@ -2987,13 +2980,6 @@
29872980
"maxLength": 63,
29882981
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
29892982
},
2990-
"sparseCheckoutDirs": {
2991-
"description": "Populate the project sparsely with selected directories.",
2992-
"type": "array",
2993-
"items": {
2994-
"type": "string"
2995-
}
2996-
},
29972983
"zip": {
29982984
"description": "Project's Zip source",
29992985
"type": "object",

Diff for: schemas/latest/devfile.json

-14
Original file line numberDiff line numberDiff line change
@@ -1354,13 +1354,6 @@
13541354
"maxLength": 63,
13551355
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
13561356
},
1357-
"sparseCheckoutDirs": {
1358-
"description": "Populate the project sparsely with selected directories.",
1359-
"type": "array",
1360-
"items": {
1361-
"type": "string"
1362-
}
1363-
},
13641357
"zip": {
13651358
"description": "Project's Zip source",
13661359
"type": "object",
@@ -1546,13 +1539,6 @@
15461539
"maxLength": 63,
15471540
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
15481541
},
1549-
"sparseCheckoutDirs": {
1550-
"description": "Populate the project sparsely with selected directories.",
1551-
"type": "array",
1552-
"items": {
1553-
"type": "string"
1554-
}
1555-
},
15561542
"zip": {
15571543
"description": "Project's Zip source",
15581544
"type": "object",

Diff for: schemas/latest/ide-targeted/dev-workspace-template-spec.json

-16
Original file line numberDiff line numberDiff line change
@@ -2880,14 +2880,6 @@
28802880
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
28812881
"markdownDescription": "Project name"
28822882
},
2883-
"sparseCheckoutDirs": {
2884-
"description": "Populate the project sparsely with selected directories.",
2885-
"type": "array",
2886-
"items": {
2887-
"type": "string"
2888-
},
2889-
"markdownDescription": "Populate the project sparsely with selected directories."
2890-
},
28912883
"zip": {
28922884
"description": "Project's Zip source",
28932885
"type": "object",
@@ -3124,14 +3116,6 @@
31243116
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
31253117
"markdownDescription": "Project name"
31263118
},
3127-
"sparseCheckoutDirs": {
3128-
"description": "Populate the project sparsely with selected directories.",
3129-
"type": "array",
3130-
"items": {
3131-
"type": "string"
3132-
},
3133-
"markdownDescription": "Populate the project sparsely with selected directories."
3134-
},
31353119
"zip": {
31363120
"description": "Project's Zip source",
31373121
"type": "object",

Diff for: schemas/latest/ide-targeted/dev-workspace-template.json

-16
Original file line numberDiff line numberDiff line change
@@ -3078,14 +3078,6 @@
30783078
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
30793079
"markdownDescription": "Project name"
30803080
},
3081-
"sparseCheckoutDirs": {
3082-
"description": "Populate the project sparsely with selected directories.",
3083-
"type": "array",
3084-
"items": {
3085-
"type": "string"
3086-
},
3087-
"markdownDescription": "Populate the project sparsely with selected directories."
3088-
},
30893081
"zip": {
30903082
"description": "Project's Zip source",
30913083
"type": "object",
@@ -3322,14 +3314,6 @@
33223314
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
33233315
"markdownDescription": "Project name"
33243316
},
3325-
"sparseCheckoutDirs": {
3326-
"description": "Populate the project sparsely with selected directories.",
3327-
"type": "array",
3328-
"items": {
3329-
"type": "string"
3330-
},
3331-
"markdownDescription": "Populate the project sparsely with selected directories."
3332-
},
33333317
"zip": {
33343318
"description": "Project's Zip source",
33353319
"type": "object",

0 commit comments

Comments
 (0)