Skip to content

Commit

Permalink
test: don't set the talosconfig owner ref to the machine
Browse files Browse the repository at this point in the history
Now as we have core CAPI controllers running, they will do it
automatically which provides better test coverage.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Sep 30, 2021
1 parent 8c7fec8 commit 442ee41
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
33 changes: 23 additions & 10 deletions config/crd/bases/bootstrap.cluster.x-k8s.io_talosconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: talosconfigs.bootstrap.cluster.x-k8s.io
spec:
Expand All @@ -24,10 +24,14 @@ spec:
description: TalosConfig is the Schema for the talosconfigs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down Expand Up @@ -55,10 +59,12 @@ spec:
description: ErrorReason will be set on non-retryable errors
type: string
ready:
description: Ready indicates the BootstrapData field is ready to be consumed
description: Ready indicates the BootstrapData field is ready to be
consumed
type: boolean
talosConfig:
description: Talos config will be a string containing the config for download
description: Talos config will be a string containing the config for
download
type: string
type: object
type: object
Expand All @@ -72,10 +78,14 @@ spec:
description: TalosConfig is the Schema for the talosconfigs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down Expand Up @@ -109,7 +119,8 @@ spec:
description: TalosConfigStatus defines the observed state of TalosConfig
properties:
dataSecretName:
description: DataSecretName is the name of the secret that stores the bootstrap data script.
description: DataSecretName is the name of the secret that stores
the bootstrap data script.
type: string
failureMessage:
description: FailureMessage will be set on non-retryable errors
Expand All @@ -118,10 +129,12 @@ spec:
description: FailureReason will be set on non-retryable errors
type: string
ready:
description: Ready indicates the BootstrapData field is ready to be consumed
description: Ready indicates the BootstrapData field is ready to be
consumed
type: boolean
talosConfig:
description: Talos config will be a string containing the config for download
description: Talos config will be a string containing the config for
download
type: string
type: object
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: talosconfigtemplates.bootstrap.cluster.x-k8s.io
spec:
Expand All @@ -21,13 +21,18 @@ spec:
- name: v1alpha2
schema:
openAPIV3Schema:
description: TalosConfigTemplate is the Schema for the talosconfigtemplates API
description: TalosConfigTemplate is the Schema for the talosconfigtemplates
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down Expand Up @@ -57,13 +62,18 @@ spec:
- name: v1alpha3
schema:
openAPIV3Schema:
description: TalosConfigTemplate is the Schema for the talosconfigtemplates API
description: TalosConfigTemplate is the Schema for the talosconfigtemplates
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down
2 changes: 0 additions & 2 deletions internal/integration/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ func createMachine(ctx context.Context, t *testing.T, c client.Client, cluster *
},
}

require.NoError(t, controllerutil.SetOwnerReference(cluster, machine, scheme.Scheme))

require.NoError(t, c.Create(ctx, machine))

return machine
Expand Down

0 comments on commit 442ee41

Please sign in to comment.