-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start building out shim layer for Tinkerbell
- Loading branch information
Showing
11 changed files
with
657 additions
and
157 deletions.
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
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,14 @@ | ||
/* | ||
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 |
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,14 @@ | ||
/* | ||
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 v1alpha1 |
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,33 @@ | ||
/* | ||
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 v1alpha1 contains API Schema definitions for the Tinkerbell v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=tinkerbell.org | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "tinkerbell.org", Version: "v1alpha1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
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 @@ | ||
/* | ||
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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// HardwareIDAnnotation is used by the controller to store the | ||
// ID assigned to the workflow by Tinkerbell. | ||
const HardwareIDAnnotation = "hardware.tinkerbell.org/id" | ||
|
||
// HardwareSpec defines the desired state of Hardware. | ||
type HardwareSpec struct { | ||
} | ||
|
||
// HardwareStatus defines the observed state of Hardware. | ||
type HardwareStatus struct { | ||
} | ||
|
||
// +kubebuilder:subresource:status | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=hardware,scope=Cluster,categories=tinkerbell | ||
// +kubebuilder:storageversion | ||
|
||
// Hardware is the Schema for the Hardware API. | ||
type Hardware struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec HardwareSpec `json:"spec,omitempty"` | ||
Status HardwareStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// HardwareList contains a list of Hardware. | ||
type HardwareList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Hardware `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Hardware{}, &HardwareList{}) | ||
} |
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,65 @@ | ||
/* | ||
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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// TemplateIDAnnotation is used by the controller to store the | ||
// ID assigned to the workflow by Tinkerbell. | ||
TemplateIDAnnotation = "template.tinkerbell.org/id" | ||
|
||
TemplateFinalizer = "template.tinkerbell.org" | ||
) | ||
|
||
// TemplateSpec defines the desired state of Template. | ||
type TemplateSpec struct { | ||
Data string `json:"data,omitempty"` | ||
} | ||
|
||
// TemplateStatus defines the observed state of Template. | ||
type TemplateStatus struct { | ||
} | ||
|
||
// +kubebuilder:subresource:status | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=templates,scope=Cluster,categories=tinkerbell | ||
// +kubebuilder:storageversion | ||
|
||
// Template is the Schema for the Templates API. | ||
type Template struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec TemplateSpec `json:"spec,omitempty"` | ||
Status TemplateStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// TemplateList contains a list of Templates. | ||
type TemplateList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Template `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Template{}, &TemplateList{}) | ||
} |
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,70 @@ | ||
/* | ||
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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// WorkflowIDAnnotation is used by the controller to store the | ||
// ID assigned to the workflow by Tinkerbell. | ||
const WorkflowIDAnnotation = "workflow.tinkerbell.org/id" | ||
|
||
// WorkflowSpec defines the desired state of Workflow. | ||
type WorkflowSpec struct { | ||
// Name of the Template associated with this Workflow. | ||
Template string `json:"template,omitempty"` | ||
|
||
// Name of the Hardware associated with this workflow. | ||
Hardware string `json:"hardware,omitempty"` | ||
} | ||
|
||
// WorkflowStatus defines the observed state of Workflow. | ||
type WorkflowStatus struct { | ||
// State is the state of the workflow in Tinkerbell. | ||
State string `json:"state,omitempty"` | ||
|
||
// Data is the populated Workflow Data in Tinkerbell. | ||
Data string `json:"data,omitempty"` | ||
} | ||
|
||
// +kubebuilder:subresource:status | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=workflows,scope=Cluster,categories=tinkerbell | ||
// +kubebuilder:storageversion | ||
|
||
// Workflow is the Schema for the Workflows API. | ||
type Workflow struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec WorkflowSpec `json:"spec,omitempty"` | ||
Status WorkflowStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// WorkflowList contains a list of Workflows. | ||
type WorkflowList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Workflow `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Workflow{}, &WorkflowList{}) | ||
} |
Oops, something went wrong.