Skip to content

Commit d213958

Browse files
authored
Removed old subpackage fragments (#968)
* Removed old subpackage fragments Signed-off-by: liamfallon <liam.fallon@est.tech> * Removed subpackage from v1alpha1 API Signed-off-by: liamfallon <liam.fallon@est.tech> --------- Signed-off-by: liamfallon <liam.fallon@est.tech>
1 parent 77040f2 commit d213958

12 files changed

Lines changed: 3 additions & 70 deletions

File tree

api/generated/openapi/zz_generated.openapi.go

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/porch/types.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ type RenderStatus struct {
198198

199199
// PackageInitTaskSpec defines the package initialization task.
200200
type PackageInitTaskSpec struct {
201-
// `Subpackage` is a directory path to a subpackage to initialize. If unspecified, the main package will be initialized.
202-
Subpackage string `json:"subpackage,omitempty"`
203201
// `Description` is a short description of the package.
204202
Description string `json:"description,omitempty"`
205203
// `Keywords` is a list of keywords describing the package.
@@ -209,9 +207,6 @@ type PackageInitTaskSpec struct {
209207
}
210208

211209
type PackageCloneTaskSpec struct {
212-
// // `Subpackage` is a path to a directory where to clone the upstream package.
213-
// Subpackage string `json:"subpackage,omitempty"`
214-
215210
// `Upstream` is the reference to the upstream package to clone.
216211
Upstream UpstreamPackage `json:"upstreamRef,omitempty"`
217212
}
@@ -410,10 +405,6 @@ type Result struct {
410405
// If user provides an executable file with commands, ExecPath should
411406
// contain the entire input string.
412407
ExecPath string `json:"exec,omitempty"`
413-
// TODO(droot): This is required for making structured results subpackage aware.
414-
// Enable this once test harness supports filepath based assertions.
415-
// Pkg is OS specific Absolute path to the package.
416-
// Pkg string `yaml:"pkg,omitempty"`
417408
// Stderr is the content in function stderr
418409
Stderr string `json:"stderr,omitempty"`
419410
// ExitCode is the exit code from running the function

api/porch/v1alpha1/types.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ type RenderStatus struct {
198198

199199
// PackageInitTaskSpec defines the package initialization task.
200200
type PackageInitTaskSpec struct {
201-
// `Subpackage` is a directory path to a subpackage to initialize. If unspecified, the main package will be initialized.
202-
Subpackage string `json:"subpackage,omitempty"`
203201
// `Description` is a short description of the package.
204202
Description string `json:"description,omitempty"`
205203
// `Keywords` is a list of keywords describing the package.
@@ -209,9 +207,6 @@ type PackageInitTaskSpec struct {
209207
}
210208

211209
type PackageCloneTaskSpec struct {
212-
// // `Subpackage` is a path to a directory where to clone the upstream package.
213-
// Subpackage string `json:"subpackage,omitempty"`
214-
215210
// `Upstream` is the reference to the upstream package to clone.
216211
Upstream UpstreamPackage `json:"upstreamRef,omitempty"`
217212
}
@@ -408,10 +403,6 @@ type Result struct {
408403
// If user provides an executable file with commands, ExecPath should
409404
// contain the entire input string.
410405
ExecPath string `json:"exec,omitempty"`
411-
// TODO(droot): This is required for making structured results subpackage aware.
412-
// Enable this once test harness supports filepath based assertions.
413-
// Pkg is OS specific Absolute path to the package.
414-
// Pkg string `yaml:"pkg,omitempty"`
415406
// Stderr is the content in function stderr
416407
Stderr string `json:"stderr,omitempty"`
417408
// ExitCode is the exit code from running the function

api/porch/v1alpha1/zz_generated.conversion.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/porch/v1alpha2/porch.kpt.dev_packagerevisions.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ spec:
202202
description: Site is a link to page with information about
203203
the package.
204204
type: string
205-
subpackage:
206-
description: |-
207-
Subpackage is a directory path to a subpackage to initialize.
208-
If unspecified, the main package will be initialized.
209-
type: string
210205
type: object
211206
upgrade:
212207
description: Upgrade merges changes from a new upstream version

api/porch/v1alpha2/source_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ package v1alpha2
2222
// PackageInitSpec defines the package initialization parameters.
2323
// Used when creating a brand new package from scratch.
2424
type PackageInitSpec struct {
25-
// Subpackage is a directory path to a subpackage to initialize.
26-
// If unspecified, the main package will be initialized.
27-
Subpackage string `json:"subpackage,omitempty"`
2825
// Description is a short description of the package.
2926
Description string `json:"description,omitempty"`
3027
// Keywords is a list of keywords describing the package.

controllers/config/crd/bases/config.porch.kpt.dev_packagevariants.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,8 @@ spec:
544544
type: object
545545
type: array
546546
stderr:
547-
description: |-
548-
Enable this once test harness supports filepath based assertions.
549-
Pkg is OS specific Absolute path to the package.
550-
Pkg string `yaml:"pkg,omitempty"`
551-
Stderr is the content in function stderr
547+
description: Stderr is the content in function
548+
stderr
552549
type: string
553550
required:
554551
- exitCode

controllers/packagerevisions/pkg/controllers/packagerevision/source.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ func initPackage(ctx context.Context, pkgName string, spec *porchv1alpha2.Packag
6767
fs := filesys.MakeFsInMemory()
6868
pkgPath := "/"
6969

70-
if spec.Subpackage != "" {
71-
pkgPath = "/" + spec.Subpackage
72-
}
7370
if err := fs.Mkdir(pkgPath); err != nil {
7471
return nil, err
7572
}

controllers/packagerevisions/pkg/controllers/packagerevision/source_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,6 @@ func TestApplySourceInit(t *testing.T) {
5252
assert.Contains(t, resources["Kptfile"], "a test package")
5353
}
5454

55-
func TestApplySourceInitWithSubpackage(t *testing.T) {
56-
r := &PackageRevisionReconciler{}
57-
pr := &porchv1alpha2.PackageRevision{
58-
Spec: porchv1alpha2.PackageRevisionSpec{
59-
PackageName: "test-pkg",
60-
Source: &porchv1alpha2.PackageSource{
61-
Init: &porchv1alpha2.PackageInitSpec{
62-
Subpackage: "sub/dir",
63-
Description: "subpkg",
64-
},
65-
},
66-
},
67-
}
68-
69-
resources, source, err := r.applySource(context.Background(), pr)
70-
require.NoError(t, err)
71-
assert.Equal(t, "init", source)
72-
assert.Contains(t, resources, "sub/dir/Kptfile")
73-
}
74-
7555
func TestApplySourceSkipsWhenAlreadyCreated(t *testing.T) {
7656
r := &PackageRevisionReconciler{}
7757
pr := &porchv1alpha2.PackageRevision{
@@ -639,7 +619,6 @@ func TestApplySourceCloneIdempotent(t *testing.T) {
639619
assert.Empty(t, source)
640620
}
641621

642-
643622
func TestApplySourceUpgrade(t *testing.T) {
644623
ctx := context.Background()
645624

docs/content/en/docs/7_cli_api/api-ref.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ _Appears in:_
192192

193193
| Field | Description | Default | Validation |
194194
| --- | --- | --- | --- |
195-
| `subpackage` _string_ | `Subpackage` is a directory path to a subpackage to initialize. If unspecified, the main package will be initialized. | | |
196195
| `description` _string_ | `Description` is a short description of the package. | | |
197196
| `keywords` _string array_ | `Keywords` is a list of keywords describing the package. | | |
198197
| `site` _string_ | `Site` is a link to page with information about the package. | | |

0 commit comments

Comments
 (0)