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

Added Kubernetes API types #542

Merged
merged 2 commits into from
Nov 24, 2021
Merged
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: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: "1.14.6"
- name: Generate
run: make generate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the idea there that we just validate that the generate works? Will we need this to run below so that this is available in crosscompile? maybe I just don't understand how github actions work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we want to make sure that our generation tooling works, and the checked-in generated code is up-to-date. It runs before ci-checks.md, so that any differences in generated code are marked as a CI failure.

- name: go test
run: go test -coverprofile=coverage.txt ./...
- name: upload codecov
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ certs/
cmd/tink-cli/tink-cli
cmd/tink-server/tink-server
cmd/tink-worker/tink-worker
doc/
.idea
.vscode

Expand All @@ -17,3 +18,6 @@ envrc
.env
deploy/state
out/

.*.swp
hack/tools
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ issues:
linters:
- noctx

# kubebuilder needs the stdlib invalid `inline` json struct tag
- path: pkg/apis/.*
text: "struct-tag"

- path: main\.go
linters:
- noctx
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ all: cli server worker ## Build all binaries for host OS and CPU

-include rules.mk
-include lint.mk
-include kube.mk

crosscompile: $(crossbinaries) ## Build all binaries for Linux and all supported CPU arches
images: tink-cli-image tink-server-image tink-worker-image ## Build all docker images
Expand Down
347 changes: 347 additions & 0 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: hardware.tinkerbell.org
spec:
group: tinkerbell.org
names:
categories:
- tinkerbell
kind: Hardware
listKind: HardwareList
plural: hardware
shortNames:
- hw
singular: hardware
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.state
name: State
type: string
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:
disks:
items:
description: Disk represents a disk device for Tinkerbell Hardware.
properties:
device:
type: string
type: object
type: array
interfaces:
items:
description:
Interface represents a network interface configuration
for Hardware.
properties:
dhcp:
description: DHCP configuration.
properties:
arch:
type: string
hostname:
type: string
iface_name:
type: string
ip:
description: IP configuration.
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:
description: Netboot configuration.
properties:
allowPXE:
type: boolean
allowWorkflow:
type: boolean
ipxe:
description: IPXE configuration.
properties:
contents:
type: string
url:
type: string
type: object
osie:
description: OSIE configuration.
properties:
baseURL:
type: string
initrd:
type: string
kernel:
type: string
type: object
type: object
type: object
type: array
metadata:
properties:
bonding_mode:
format: int64
type: integer
custom:
properties:
preinstalled_operating_system_version:
properties:
distro:
type: string
image_tag:
type: string
os_slug:
type: string
slug:
type: string
version:
type: string
type: object
private_subnets:
items:
type: string
type: array
type: object
facility:
properties:
facility_code:
type: string
plan_slug:
type: string
plan_version_slug:
type: string
type: object
instance:
properties:
allow_pxe:
type: boolean
always_pxe:
type: boolean
crypted_root_password:
type: string
hostname:
type: string
id:
type: string
ips:
items:
properties:
address:
type: string
family:
format: int64
type: integer
gateway:
type: string
management:
type: boolean
netmask:
type: string
public:
type: boolean
type: object
type: array
ipxe_script_url:
type: string
network_ready:
type: boolean
operating_system:
properties:
distro:
type: string
image_tag:
type: string
os_slug:
type: string
slug:
type: string
version:
type: string
type: object
rescue:
type: boolean
ssh_keys:
items:
type: string
type: array
state:
type: string
storage:
properties:
disks:
items:
properties:
device:
type: string
partitions:
items:
properties:
label:
type: string
number:
format: int64
type: integer
size:
format: int64
type: integer
start:
format: int64
type: integer
type_guid:
type: string
type: object
type: array
wipe_table:
type: boolean
type: object
type: array
filesystems:
items:
properties:
mount:
properties:
create:
properties:
force:
type: boolean
options:
items:
type: string
type: array
type: object
device:
type: string
files:
items:
properties:
contents:
type: string
gid:
format: int64
type: integer
mode:
format: int64
type: integer
path:
type: string
uid:
format: int64
type: integer
type: object
type: array
format:
type: string
point:
type: string
type: object
type: object
type: array
raid:
items:
properties:
devices:
items:
type: string
type: array
level:
type: string
name:
type: string
spare:
format: int64
type: integer
type: object
type: array
type: object
tags:
items:
type: string
type: array
userdata:
type: string
type: object
manufacturer:
properties:
id:
type: string
slug:
type: string
type: object
state:
type: string
type: object
tinkVersion:
format: int64
type: integer
userData:
description:
UserData is the user data to configure in the hardware's
metadata
type: string
type: object
status:
description: HardwareStatus defines the observed state of Hardware.
properties:
state:
description: HardwareState represents the hardware state.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading