Skip to content

Commit 5ed9eea

Browse files
authored
Merge pull request crossplane#6200 from negz/package-all-the-things
Introduce new apiVersion and kind style package dependencies
2 parents 5ce2f11 + 93c7d69 commit 5ed9eea

27 files changed

+777
-599
lines changed

apis/pkg/meta/v1/interfaces.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ limitations under the License.
1616

1717
package v1
1818

19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
runtime "k8s.io/apimachinery/pkg/runtime"
22+
)
23+
1924
var (
2025
_ Pkg = &Configuration{}
2126
_ Pkg = &Provider{}
@@ -25,6 +30,9 @@ var (
2530
// Pkg is a description of a Crossplane package.
2631
// +k8s:deepcopy-gen=false
2732
type Pkg interface {
33+
runtime.Object
34+
metav1.Object
35+
2836
GetCrossplaneConstraints() *CrossplaneConstraints
2937
GetDependencies() []Dependency
3038
}

apis/pkg/meta/v1/meta.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,38 @@ type CrossplaneConstraints struct {
3131
Version string `json:"version"`
3232
}
3333

34-
// Dependency is a dependency on another package. One of Provider or Configuration may be supplied.
34+
// Dependency is a dependency on another package. A dependency can be of an
35+
// arbitrary API version and kind, but Crossplane expects package dependencies
36+
// to behave like a Crossplane package. Specifically it expects to be able to
37+
// create the dependency and set its spec.package field to a package OCI
38+
// reference.
3539
type Dependency struct {
40+
// APIVersion of the dependency.
41+
// +optional
42+
APIVersion *string `json:"apiVersion,omitempty"`
43+
44+
// Kind of the dependency.
45+
// +optional
46+
Kind *string `json:"kind,omitempty"`
47+
48+
// Package OCI reference of the dependency. Only used when apiVersion and
49+
// kind are set.
50+
// +optional
51+
Package *string `json:"package,omitempty"`
52+
3653
// Provider is the name of a Provider package image.
54+
// +optional
55+
// Deprecated: Specify an apiVersion and kind instead.
3756
Provider *string `json:"provider,omitempty"`
3857

3958
// Configuration is the name of a Configuration package image.
59+
// +optional
60+
// Deprecated: Specify an apiVersion, kind, and package instead.
4061
Configuration *string `json:"configuration,omitempty"`
4162

4263
// Function is the name of a Function package image.
64+
// +optional
65+
// Deprecated: Specify an apiVersion, kind, and package instead.
4366
Function *string `json:"function,omitempty"`
4467

4568
// Version is the semantic version constraints of the dependency image.

apis/pkg/meta/v1/zz_generated.deepcopy.go

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/pkg/meta/v1alpha1/zz_generated.conversion.go

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

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

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

apis/pkg/meta/v1alpha1/zz_generated.meta.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,38 @@ type CrossplaneConstraints struct {
3333
Version string `json:"version"`
3434
}
3535

36-
// Dependency is a dependency on another package. One of Provider or Configuration may be supplied.
36+
// Dependency is a dependency on another package. A dependency can be of an
37+
// arbitrary API version and kind, but Crossplane expects package dependencies
38+
// to behave like a Crossplane package. Specifically it expects to be able to
39+
// create the dependency and set its spec.package field to a package OCI
40+
// reference.
3741
type Dependency struct {
42+
// APIVersion of the dependency.
43+
// +optional
44+
APIVersion *string `json:"apiVersion,omitempty"`
45+
46+
// Kind of the dependency.
47+
// +optional
48+
Kind *string `json:"kind,omitempty"`
49+
50+
// Package OCI reference of the dependency. Only used when apiVersion and
51+
// kind are set.
52+
// +optional
53+
Package *string `json:"package,omitempty"`
54+
3855
// Provider is the name of a Provider package image.
56+
// +optional
57+
// Deprecated: Specify an apiVersion and kind instead.
3958
Provider *string `json:"provider,omitempty"`
4059

4160
// Configuration is the name of a Configuration package image.
61+
// +optional
62+
// Deprecated: Specify an apiVersion, kind, and package instead.
4263
Configuration *string `json:"configuration,omitempty"`
4364

4465
// Function is the name of a Function package image.
66+
// +optional
67+
// Deprecated: Specify an apiVersion, kind, and package instead.
4568
Function *string `json:"function,omitempty"`
4669

4770
// Version is the semantic version constraints of the dependency image.

apis/pkg/meta/v1beta1/zz_generated.conversion.go

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

apis/pkg/meta/v1beta1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)