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

Changed all v1alpha1 references to v1beta1 #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion example/environmentConfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apiextensions.crossplane.io/v1alpha1
apiVersion: apiextensions.crossplane.io/v1beta1
kind: EnvironmentConfig
metadata:
name: example-config
Expand Down
4 changes: 2 additions & 2 deletions example/kubecon-2024/environmentConfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: apiextensions.crossplane.io/v1alpha1
apiVersion: apiextensions.crossplane.io/v1beta1
kind: EnvironmentConfig
metadata:
name: example-config
Expand All @@ -10,7 +10,7 @@ data:
d: e
f: "1"
---
apiVersion: apiextensions.crossplane.io/v1alpha1
apiVersion: apiextensions.crossplane.io/v1beta1
kind: EnvironmentConfig
metadata:
name: example-config-by-label
Expand Down
4 changes: 2 additions & 2 deletions fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func buildRequirements(in *v1beta1.Input, xr *resource.Composite) (*fnv1.Require
switch config.Type {
case v1beta1.EnvironmentSourceTypeReference, "":
extraResources[extraResName] = &fnv1.ResourceSelector{
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: config.Ref.Name,
Expand Down Expand Up @@ -292,7 +292,7 @@ func buildRequirements(in *v1beta1.Input, xr *resource.Composite) (*fnv1.Require
continue
}
extraResources[extraResName] = &fnv1.ResourceSelector{
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchLabels{
MatchLabels: &fnv1.MatchLabels{Labels: matchLabels},
Expand Down
64 changes: 32 additions & 32 deletions fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ func TestRunFunction(t *testing.T) {
"kind": "Input",
"spec": {
"environmentConfigs": [
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-env-config"
}
},
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-second-env-config"
}
},
Expand Down Expand Up @@ -123,21 +123,21 @@ func TestRunFunction(t *testing.T) {
Requirements: &fnv1.Requirements{
ExtraResources: map[string]*fnv1.ResourceSelector{
"environment-config-0": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-env-config",
},
},
"environment-config-1": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-second-env-config",
},
},
"environment-config-2": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchLabels{
MatchLabels: &fnv1.MatchLabels{
Expand All @@ -149,7 +149,7 @@ func TestRunFunction(t *testing.T) {
},
// environment-config-3 is not requested because it was optional
"environment-config-4": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchLabels{
MatchLabels: &fnv1.MatchLabels{
Expand Down Expand Up @@ -188,7 +188,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-env-config"
Expand All @@ -205,7 +205,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-second-env-config"
Expand All @@ -222,7 +222,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-third-env-config-b"
Expand All @@ -234,7 +234,7 @@ func TestRunFunction(t *testing.T) {
},
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-third-env-config-a"
Expand All @@ -250,7 +250,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-third-env-config"
Expand All @@ -266,7 +266,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-fourth-env-config"
Expand All @@ -284,15 +284,15 @@ func TestRunFunction(t *testing.T) {
"kind": "Input",
"spec": {
"environmentConfigs": [
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-env-config"
}
},
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-second-env-config"
}
},
Expand Down Expand Up @@ -347,21 +347,21 @@ func TestRunFunction(t *testing.T) {
Requirements: &fnv1.Requirements{
ExtraResources: map[string]*fnv1.ResourceSelector{
"environment-config-0": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-env-config",
},
},
"environment-config-1": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-second-env-config",
},
},
"environment-config-2": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchLabels{
MatchLabels: &fnv1.MatchLabels{
Expand All @@ -373,7 +373,7 @@ func TestRunFunction(t *testing.T) {
},
// environment-config-3 is not requested because it was optional
"environment-config-4": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchLabels{
MatchLabels: &fnv1.MatchLabels{
Expand Down Expand Up @@ -451,7 +451,7 @@ func TestRunFunction(t *testing.T) {
Requirements: &fnv1.Requirements{
ExtraResources: map[string]*fnv1.ResourceSelector{
"environment-config-0": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-env-config",
Expand Down Expand Up @@ -485,17 +485,17 @@ func TestRunFunction(t *testing.T) {
"b": "only-from-default",
"e": "overridden-from-input",
"f": "overridden-from-env-config-2"
},
},
"environmentConfigs": [
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-env-config"
}
},
{
{
"type": "Reference",
"ref": {
"ref": {
"name": "my-second-env-config"
}
}
Expand All @@ -507,7 +507,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-env-config"
Expand All @@ -525,7 +525,7 @@ func TestRunFunction(t *testing.T) {
Items: []*fnv1.Resource{
{
Resource: resource.MustStructJSON(`{
"apiVersion": "apiextensions.crossplane.io/v1alpha1",
"apiVersion": "apiextensions.crossplane.io/v1beta1",
"kind": "EnvironmentConfig",
"metadata": {
"name": "my-second-env-config"
Expand All @@ -549,14 +549,14 @@ func TestRunFunction(t *testing.T) {
Requirements: &fnv1.Requirements{
ExtraResources: map[string]*fnv1.ResourceSelector{
"environment-config-0": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-env-config",
},
},
"environment-config-1": {
ApiVersion: "apiextensions.crossplane.io/v1alpha1",
ApiVersion: "apiextensions.crossplane.io/v1beta1",
Kind: "EnvironmentConfig",
Match: &fnv1.ResourceSelector_MatchName{
MatchName: "my-second-env-config",
Expand Down