From 4f2ac95d06afbf0210cc9ae5e151066467a14de8 Mon Sep 17 00:00:00 2001 From: "Olve S. Hansen" Date: Thu, 5 Dec 2024 10:40:28 +0100 Subject: [PATCH] Changed all v1alpha1 references to v1beta1 Signed-off-by: Olve S. Hansen --- example/environmentConfigs.yaml | 2 +- example/kubecon-2024/environmentConfigs.yaml | 4 +- fn.go | 4 +- fn_test.go | 64 ++++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/example/environmentConfigs.yaml b/example/environmentConfigs.yaml index 3482343..daa570b 100644 --- a/example/environmentConfigs.yaml +++ b/example/environmentConfigs.yaml @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.crossplane.io/v1alpha1 +apiVersion: apiextensions.crossplane.io/v1beta1 kind: EnvironmentConfig metadata: name: example-config diff --git a/example/kubecon-2024/environmentConfigs.yaml b/example/kubecon-2024/environmentConfigs.yaml index 340bdad..5403bd0 100644 --- a/example/kubecon-2024/environmentConfigs.yaml +++ b/example/kubecon-2024/environmentConfigs.yaml @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.crossplane.io/v1alpha1 +apiVersion: apiextensions.crossplane.io/v1beta1 kind: EnvironmentConfig metadata: name: example-config @@ -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 diff --git a/fn.go b/fn.go index 551c94c..d40c4ed 100644 --- a/fn.go +++ b/fn.go @@ -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, @@ -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}, diff --git a/fn_test.go b/fn_test.go index 071d5a7..fbaf8c6 100644 --- a/fn_test.go +++ b/fn_test.go @@ -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" } }, @@ -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{ @@ -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{ @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" } }, @@ -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{ @@ -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{ @@ -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", @@ -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" } } @@ -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" @@ -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" @@ -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",