Skip to content

Commit c7f8eeb

Browse files
committed
Dependency resolution added for carvel packages
Signed-off-by: rcmadhankumar <[email protected]>
1 parent 87059e5 commit c7f8eeb

File tree

13 files changed

+1145
-90
lines changed

13 files changed

+1145
-90
lines changed

config/config/crds.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,23 @@ spec:
9595
capacityRequirementsDescription:
9696
description: 'System requirements needed to install the package. Note: these requirements will not be verified by kapp-controller on installation. (optional; string)'
9797
type: string
98+
dependencies:
99+
description: List of dependencies to be resolved
100+
items:
101+
description: DependencyType contains the list of type of depencies
102+
properties:
103+
package:
104+
description: PackageDependency contains package dependency related info
105+
properties:
106+
refName:
107+
description: The name of the PackageMetadata associated with this dependency Must be a valid PackageMetadata name (see PackageMetadata CR for details) Cannot be empty
108+
type: string
109+
version:
110+
description: Package version; Will be Referenced by PackageInstall; Must be valid semver (required) Cannot be empty
111+
type: string
112+
type: object
113+
type: object
114+
type: array
98115
includedSoftware:
99116
description: IncludedSoftware can be used to show the software contents of a Package. This is especially useful if the underlying versions do not match the Package version
100117
items:
@@ -1511,6 +1528,13 @@ spec:
15111528
defaultNamespace:
15121529
description: Specifies the default namespace to install the Package resources, by default this is same as the PackageInstall namespace (optional; v0.48.0+)
15131530
type: string
1531+
dependencies:
1532+
description: Dependencies can be controlled through this section
1533+
properties:
1534+
install:
1535+
description: Indicates whether to install depencies along with or not
1536+
type: boolean
1537+
type: object
15141538
noopDelete:
15151539
description: When NoopDelete set to true, PackageInstall deletion should delete PackageInstall/App CR but preserve App's associated resources.
15161540
type: boolean

pkg/apis/packaging/v1alpha1/package_install.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ type PackageInstallSpec struct {
7979
// same as the PackageInstall namespace (optional; v0.48.0+)
8080
// +optional
8181
DefaultNamespace string `json:"defaultNamespace,omitempty"`
82+
// Dependencies can be controlled through this section
83+
// +optional
84+
Dependencies Dependencies `json:"dependencies,omitempty"`
8285
}
8386

8487
type PackageRef struct {
@@ -111,3 +114,9 @@ type PackageInstallStatus struct {
111114
// +optional
112115
LastAttemptedVersion string `json:"lastAttemptedVersion,omitempty"`
113116
}
117+
118+
type Dependencies struct {
119+
// Indicates whether to install depencies along with or not
120+
// +optional
121+
Install bool `json:"install,omitempty"`
122+
}

pkg/apis/packaging/v1alpha1/zz_generated.deepcopy.go

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

pkg/apiserver/apis/datapackaging/types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ type PackageSpec struct {
7070
// Must be valid semver (required)
7171
// Cannot be empty
7272
Version string `json:"version,omitempty"`
73+
// List of dependencies to be resolved
74+
// +optional
75+
Dependencies []DependencyType `json:"dependencies,omitempty"`
7376
// Description of the licenses that apply to the package software
7477
// (optional; Array of strings)
7578
Licenses []string `json:"licenses,omitempty"`
@@ -151,3 +154,20 @@ type IncludedSoftware struct {
151154
Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
152155
Description string `json:"description,omitempty" protobuf:"bytes,3,opt,name=description"`
153156
}
157+
158+
// DependencyType contains the list of type of depencies
159+
type DependencyType struct {
160+
Package *PackageDependency `json:"package,omitempty"`
161+
}
162+
163+
// PackageDependency contains package dependency related info
164+
type PackageDependency struct {
165+
// The name of the PackageMetadata associated with this dependency
166+
// Must be a valid PackageMetadata name (see PackageMetadata CR for details)
167+
// Cannot be empty
168+
RefName string `json:"refName,omitempty"`
169+
// Package version; Will be Referenced by PackageInstall;
170+
// Must be valid semver (required)
171+
// Cannot be empty
172+
Version string `json:"version,omitempty"`
173+
}

0 commit comments

Comments
 (0)