-
Notifications
You must be signed in to change notification settings - Fork 36
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
[WIP] Start building out shim layer for Tinkerbell #8
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5e04d71
Start building out shim layer for Tinkerbell
detiber cfb3e70
updates to templates
detiber 24842b1
Start building out template controller
detiber c9ae7d6
review feedback
detiber 38dd4d7
Continue building out Tink types and controllers
detiber 651ee32
Refactor the shim a bit
detiber 4bffdc1
current state
detiber fe98699
latest changes
detiber dab620e
Start wiring up controllers and event handlers
detiber 303da8c
update generated code
detiber 1746f69
Add tests for tink informers, update statuses
detiber a40f06d
fixes
detiber 9126feb
fixes/cleanup
detiber 923ef04
force requeueafter when workflow state is not success
detiber c7fa75d
de-lint
detiber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
# editor and IDE paraphernalia | ||
.idea | ||
.vscode | ||
*.swp | ||
*.swo | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
Copyright 2020 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1alpha3 contains API Schema definitions for the infrastructure v1alpha3 API group. | ||
package v1alpha3 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.4.1 | ||
creationTimestamp: null | ||
name: hardware.tinkerbell.org | ||
spec: | ||
group: tinkerbell.org | ||
names: | ||
categories: | ||
- tinkerbell | ||
kind: Hardware | ||
listKind: HardwareList | ||
plural: hardware | ||
singular: hardware | ||
scope: Cluster | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Hardware is the Schema for the Hardware 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' | ||
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' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: HardwareSpec defines the desired state of Hardware. | ||
properties: | ||
id: | ||
description: ID is the ID of the hardware in Tinkerbell | ||
minLength: 1 | ||
type: string | ||
required: | ||
- id | ||
type: object | ||
status: | ||
description: HardwareStatus defines the observed state of Hardware. | ||
properties: | ||
state: | ||
type: string | ||
tinkInterfaces: | ||
items: | ||
properties: | ||
dhcp: | ||
properties: | ||
arch: | ||
type: string | ||
hostname: | ||
type: string | ||
iface_name: | ||
type: string | ||
ip: | ||
properties: | ||
address: | ||
type: string | ||
family: | ||
format: int64 | ||
type: integer | ||
gateway: | ||
type: string | ||
netmask: | ||
type: string | ||
type: object | ||
lease_time: | ||
format: int64 | ||
type: integer | ||
mac: | ||
type: string | ||
name_servers: | ||
items: | ||
type: string | ||
type: array | ||
time_servers: | ||
items: | ||
type: string | ||
type: array | ||
uefi: | ||
type: boolean | ||
type: object | ||
netboot: | ||
properties: | ||
allowPXE: | ||
type: boolean | ||
allowWorkflow: | ||
type: boolean | ||
ipxe: | ||
properties: | ||
contents: | ||
type: string | ||
url: | ||
type: string | ||
type: object | ||
osie: | ||
properties: | ||
baseURL: | ||
type: string | ||
initrd: | ||
type: string | ||
kernel: | ||
type: string | ||
type: object | ||
type: object | ||
type: object | ||
type: array | ||
tinkMetadata: | ||
type: string | ||
tinkVersion: | ||
format: int64 | ||
type: integer | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.4.1 | ||
creationTimestamp: null | ||
name: templates.tinkerbell.org | ||
spec: | ||
group: tinkerbell.org | ||
names: | ||
categories: | ||
- tinkerbell | ||
kind: Template | ||
listKind: TemplateList | ||
plural: templates | ||
singular: template | ||
scope: Cluster | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Template is the Schema for the Templates 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' | ||
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' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: TemplateSpec defines the desired state of Template. | ||
properties: | ||
data: | ||
type: string | ||
type: object | ||
status: | ||
description: TemplateStatus defines the observed state of Template. | ||
properties: | ||
state: | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.4.1 | ||
creationTimestamp: null | ||
name: workflows.tinkerbell.org | ||
spec: | ||
group: tinkerbell.org | ||
names: | ||
categories: | ||
- tinkerbell | ||
kind: Workflow | ||
listKind: WorkflowList | ||
plural: workflows | ||
singular: workflow | ||
scope: Cluster | ||
versions: | ||
- name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: Workflow is the Schema for the Workflows 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' | ||
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' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: WorkflowSpec defines the desired state of Workflow. | ||
properties: | ||
hardwareRef: | ||
description: Name of the Hardware associated with this workflow. | ||
type: string | ||
templateRef: | ||
description: Name of the Template associated with this workflow. | ||
type: string | ||
type: object | ||
status: | ||
description: WorkflowStatus defines the observed state of Workflow. | ||
properties: | ||
actions: | ||
description: Actions are the actions for this Workflow. | ||
items: | ||
properties: | ||
command: | ||
items: | ||
type: string | ||
type: array | ||
environment: | ||
items: | ||
type: string | ||
type: array | ||
image: | ||
type: string | ||
name: | ||
type: string | ||
on_failure: | ||
items: | ||
type: string | ||
type: array | ||
on_timeout: | ||
items: | ||
type: string | ||
type: array | ||
task_name: | ||
type: string | ||
timeout: | ||
format: int64 | ||
type: integer | ||
volumes: | ||
items: | ||
type: string | ||
type: array | ||
worker_id: | ||
type: string | ||
type: object | ||
type: array | ||
data: | ||
description: Data is the populated Workflow Data in Tinkerbell. | ||
type: string | ||
events: | ||
description: Events are events for this Workflow. | ||
items: | ||
properties: | ||
action_name: | ||
type: string | ||
action_status: | ||
type: string | ||
created_at: | ||
format: date-time | ||
type: string | ||
message: | ||
type: string | ||
seconds: | ||
format: int64 | ||
type: integer | ||
task_name: | ||
type: string | ||
worker_id: | ||
type: string | ||
type: object | ||
type: array | ||
metadata: | ||
description: Metadata is the metadata stored in Tinkerbell. | ||
type: string | ||
state: | ||
description: State is the state of the workflow in Tinkerbell. | ||
type: string | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this mainly for completeness