Skip to content

Commit 07df1b5

Browse files
committed
Remove GitHub-type projects from v1alpha2 spec
Signed-off-by: Angel Misevski <[email protected]>
1 parent 2312ff6 commit 07df1b5

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

pkg/apis/workspaces/v1alpha1/conversion_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,21 @@ var parentCommandFuzzFunc = func(command *Command, c fuzz.Continue) {
148148
var parentProjectFuzzFunc = func(project *Project, c fuzz.Continue) {
149149
// Custom projects are not supported in v1alpha2 parent
150150
project.Name = c.RandString()
151-
switch c.Intn(3) {
151+
switch c.Intn(2) {
152152
case 0:
153153
c.Fuzz(&project.Git)
154154
case 1:
155-
c.Fuzz(&project.Github)
156-
case 2:
157155
c.Fuzz(&project.Zip)
158156
}
159157
}
160158

161159
var projectFuzzFunc = func(project *Project, c fuzz.Continue) {
162-
switch c.Intn(4) {
160+
switch c.Intn(3) {
163161
case 0:
164162
c.Fuzz(&project.Git)
165163
case 1:
166-
c.Fuzz(&project.Github)
167-
case 2:
168164
c.Fuzz(&project.Zip)
169-
case 3:
165+
case 2:
170166
c.Fuzz(&project.Custom)
171167
}
172168
}

pkg/apis/workspaces/v1alpha1/projects_conversion.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ func convertProjectTo_v1alpha2(src *Project, dest *v1alpha2.Project) error {
1919
switch {
2020
case src.Git != nil:
2121
sparseCheckoutDir = src.Git.SparseCheckoutDir
22-
case src.Github != nil:
23-
sparseCheckoutDir = src.Github.SparseCheckoutDir
2422
case src.Zip != nil:
2523
sparseCheckoutDir = src.Zip.SparseCheckoutDir
2624
}
@@ -49,8 +47,6 @@ func convertProjectFrom_v1alpha2(src *v1alpha2.Project, dest *Project) error {
4947
switch {
5048
case src.Git != nil:
5149
dest.Git.SparseCheckoutDir = sparseCheckoutDir
52-
case src.Github != nil:
53-
dest.Github.SparseCheckoutDir = sparseCheckoutDir
5450
case src.Zip != nil:
5551
dest.Zip.SparseCheckoutDir = sparseCheckoutDir
5652
}
@@ -74,8 +70,6 @@ func convertStarterProjectTo_v1alpha2(src *StarterProject, dest *v1alpha2.Starte
7470
switch {
7571
case src.Git != nil:
7672
dest.SubDir = src.Git.SparseCheckoutDir
77-
case src.Github != nil:
78-
dest.SubDir = src.Github.SparseCheckoutDir
7973
case src.Zip != nil:
8074
dest.SubDir = src.Zip.SparseCheckoutDir
8175
}
@@ -97,8 +91,6 @@ func convertStarterProjectFrom_v1alpha2(src *v1alpha2.StarterProject, dest *Star
9791
switch {
9892
case src.Git != nil:
9993
dest.Git.SparseCheckoutDir = src.SubDir
100-
case src.Github != nil:
101-
dest.Github.SparseCheckoutDir = src.SubDir
10294
case src.Zip != nil:
10395
dest.Zip.SparseCheckoutDir = src.SubDir
10496
}

pkg/apis/workspaces/v1alpha2/projects.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ type StarterProject struct {
5151
// Only one of the following project sources may be specified.
5252
// If none of the following policies is specified, the default one
5353
// is AllowConcurrent.
54-
// +kubebuilder:validation:Enum=Git;Github;Zip;Custom
54+
// +kubebuilder:validation:Enum=Git;Zip;Custom
5555
type ProjectSourceType string
5656

5757
const (
5858
GitProjectSourceType ProjectSourceType = "Git"
59-
GitHubProjectSourceType ProjectSourceType = "Github"
6059
ZipProjectSourceType ProjectSourceType = "Zip"
6160
CustomProjectSourceType ProjectSourceType = "Custom"
6261
)
@@ -73,10 +72,6 @@ type ProjectSource struct {
7372
// +optional
7473
Git *GitProjectSource `json:"git,omitempty"`
7574

76-
// Project's GitHub source. Deprecated, use `Git` instead
77-
// +optional
78-
Github *GithubProjectSource `json:"github,omitempty"`
79-
8075
// Project's Zip source
8176
// +optional
8277
Zip *ZipProjectSource `json:"zip,omitempty"`
@@ -129,7 +124,3 @@ type CheckoutFrom struct {
129124
type GitProjectSource struct {
130125
GitLikeProjectSource `json:",inline"`
131126
}
132-
133-
type GithubProjectSource struct {
134-
GitLikeProjectSource `json:",inline"`
135-
}

0 commit comments

Comments
 (0)