Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency resolution added for carvel packages #1484

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions config/config/crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ spec:
capacityRequirementsDescription:
description: 'System requirements needed to install the package. Note: these requirements will not be verified by kapp-controller on installation. (optional; string)'
type: string
dependencies:
description: List of dependencies to be resolved
items:
description: DependencyType contains the list of type of depencies
properties:
package:
description: PackageDependency contains package dependency related info
properties:
refName:
description: The name of the PackageMetadata associated with this dependency Must be a valid PackageMetadata name (see PackageMetadata CR for details) Cannot be empty
type: string
version:
description: Package version; Will be Referenced by PackageInstall; Must be valid semver (required) Cannot be empty
type: string
type: object
type: object
type: array
includedSoftware:
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
items:
Expand Down Expand Up @@ -1511,6 +1528,12 @@ spec:
defaultNamespace:
description: Specifies the default namespace to install the Package resources, by default this is same as the PackageInstall namespace (optional; v0.48.0+)
type: string
dependencies:
description: Dependencies can be controlled through this section
properties:
install:
type: boolean
type: object
noopDelete:
description: When NoopDelete set to true, PackageInstall deletion should delete PackageInstall/App CR but preserve App's associated resources.
type: boolean
Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/packaging/v1alpha1/package_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ type PackageInstallSpec struct {
// same as the PackageInstall namespace (optional; v0.48.0+)
// +optional
DefaultNamespace string `json:"defaultNamespace,omitempty"`
// Dependencies can be controlled through this section
// +optional
Dependencies Dependencies `json:"dependencies,omitempty"`
}

type PackageRef struct {
Expand Down Expand Up @@ -111,3 +114,9 @@ type PackageInstallStatus struct {
// +optional
LastAttemptedVersion string `json:"lastAttemptedVersion,omitempty"`
}

// Dependencies controls whether to install depency packages along with the current package or not
type Dependencies struct {
// +optional
Install bool `json:"install,omitempty"`
}
17 changes: 17 additions & 0 deletions pkg/apis/packaging/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions pkg/apiserver/apis/datapackaging/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ type PackageSpec struct {
// Must be valid semver (required)
// Cannot be empty
Version string `json:"version,omitempty"`
// List of dependencies to be resolved
// +optional
Dependencies []DependencyType `json:"dependencies,omitempty"`
// Description of the licenses that apply to the package software
// (optional; Array of strings)
Licenses []string `json:"licenses,omitempty"`
Expand Down Expand Up @@ -151,3 +154,20 @@ type IncludedSoftware struct {
Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
Description string `json:"description,omitempty" protobuf:"bytes,3,opt,name=description"`
}

// DependencyType contains the list of type of depencies
type DependencyType struct {
Package *PackageDependency `json:"package,omitempty"`
}

// PackageDependency contains package dependency related info
type PackageDependency struct {
// The name of the PackageMetadata associated with this dependency
// Must be a valid PackageMetadata name (see PackageMetadata CR for details)
// Cannot be empty
RefName string `json:"refName,omitempty"`
// Package version; Will be Referenced by PackageInstall;
// Must be valid semver (required)
// Cannot be empty
Version string `json:"version,omitempty"`
}
Loading
Loading