Skip to content

Commit

Permalink
fix kubebuilder stuff here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
QcFe committed Apr 10, 2024
1 parent 26ba3fe commit 3fd4cb7
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 165 deletions.
9 changes: 8 additions & 1 deletion operators/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### NOTE: THIS FILE IS CURRENTLY NOT UP TO DATE WITH THE ACTUAL KUBEBUILDER 3 BOILERPLATE

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -59,7 +66,7 @@ generate: controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1
@go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
Expand Down
10 changes: 10 additions & 0 deletions operators/PROJECT
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: crownlabs.polito.it
layout:
- go.kubebuilder.io/v4
projectName: operators
repo: github.com/netgroup-polito/CrownLabs/operators
version: "3"
1 change: 0 additions & 1 deletion operators/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion operators/api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions operators/deploy/crds/crownlabs.polito.it_imagelists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: imagelists.crownlabs.polito.it
spec:
group: crownlabs.polito.it
Expand All @@ -26,14 +25,19 @@ spec:
registry.
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
80 changes: 45 additions & 35 deletions operators/deploy/crds/crownlabs.polito.it_instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: instances.crownlabs.polito.it
spec:
group: crownlabs.polito.it
Expand Down Expand Up @@ -47,14 +46,19 @@ spec:
description: Instance describes the instance of a CrownLabs environment Template.
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 @@ -85,21 +89,22 @@ spec:
type: string
type: object
prettyName:
description: Custom name the user can assign and change at any time
description: |-
Custom name the user can assign and change at any time
in order to more easily identify the instance.
type: string
running:
default: true
description: Whether the current instance is running or not. The meaning
of this flag is different depending on whether the instance refers
to a persistent environment or not. If the first case, it allows
to stop the environment (e.g. the underlying VM) without deleting
the associated disk. Setting the flag to true will restart the environment,
attaching it to the same disk used previously. Differently, if the
environment is not persistent, it only tears down the exposition
objects, making the instance effectively unreachable from outside
the cluster, but allowing the subsequent recreation without data
loss.
description: |-
Whether the current instance is running or not.
The meaning of this flag is different depending on whether the instance
refers to a persistent environment or not. If the first case, it allows to
stop the environment (e.g. the underlying VM) without deleting the associated
disk. Setting the flag to true will restart the environment, attaching it
to the same disk used previously. Differently, if the environment is not
persistent, it only tears down the exposition objects, making the instance
effectively unreachable from outside the cluster, but allowing the
subsequent recreation without data loss.
type: boolean
template.crownlabs.polito.it/TemplateRef:
description: The reference to the Template to be instantiated.
Expand All @@ -108,8 +113,9 @@ spec:
description: The name of the resource to be referenced.
type: string
namespace:
description: The namespace containing the resource to be referenced.
It should be left empty in case of cluster-wide resources.
description: |-
The namespace containing the resource to be referenced. It should be left
empty in case of cluster-wide resources.
type: string
required:
- name
Expand All @@ -121,8 +127,9 @@ spec:
description: The name of the resource to be referenced.
type: string
namespace:
description: The namespace containing the resource to be referenced.
It should be left empty in case of cluster-wide resources.
description: |-
The namespace containing the resource to be referenced. It should be left
empty in case of cluster-wide resources.
type: string
required:
- name
Expand Down Expand Up @@ -154,20 +161,22 @@ spec:
type: string
type: object
initialReadyTime:
description: The amount of time the Instance required to become ready
for the first time upon creation.
description: |-
The amount of time the Instance required to become ready for the first time
upon creation.
type: string
ip:
description: The internal IP address associated with the remote environment,
which can be used to access it through the SSH protocol (leveraging
the SSH bastion in case it is not contacted from another CrownLabs
Instance).
description: |-
The internal IP address associated with the remote environment, which can
be used to access it through the SSH protocol (leveraging the SSH bastion
in case it is not contacted from another CrownLabs Instance).
type: string
phase:
description: The current status Instance, with reference to the associated
environment (e.g. VM). This conveys which resource is being created,
as well as whether the associated VM is being scheduled, is running
or ready to accept incoming connections.
description: |-
The current status Instance, with reference to the associated environment
(e.g. VM). This conveys which resource is being created, as well as
whether the associated VM is being scheduled, is running or ready to
accept incoming connections.
enum:
- ""
- Importing
Expand All @@ -181,8 +190,9 @@ spec:
- CreationLoopBackoff
type: string
url:
description: The URL where it is possible to access the remote desktop
of the instance (in case of graphical environments)
description: |-
The URL where it is possible to access the remote desktop of the instance
(in case of graphical environments)
type: string
type: object
type: object
Expand Down
43 changes: 25 additions & 18 deletions operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: instancesnapshots.crownlabs.polito.it
spec:
group: crownlabs.polito.it
Expand Down Expand Up @@ -33,31 +32,37 @@ spec:
description: InstanceSnapshot is the Schema for the instancesnapshots 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
spec:
description: InstanceSnapshotSpec defines the desired state of InstanceSnapshot.
properties:
environmentRef:
description: Environment represents the reference to the environment
to be snapshotted, in case more are associated with the same Instance.
If not specified, the first available environment is considered.
description: |-
Environment represents the reference to the environment to be snapshotted, in case more are
associated with the same Instance. If not specified, the first available environment is considered.
properties:
name:
description: The name of the resource to be referenced.
type: string
namespace:
description: The namespace containing the resource to be referenced.
It should be left empty in case of cluster-wide resources.
description: |-
The namespace containing the resource to be referenced. It should be left
empty in case of cluster-wide resources.
type: string
required:
- name
Expand All @@ -68,16 +73,18 @@ spec:
minLength: 1
type: string
instanceRef:
description: Instance is the reference to the persistent VM instance
to be snapshotted. The instance should not be running, otherwise
it won't be possible to steal the volume and extract its content.
description: |-
Instance is the reference to the persistent VM instance to be snapshotted.
The instance should not be running, otherwise it won't be possible to
steal the volume and extract its content.
properties:
name:
description: The name of the resource to be referenced.
type: string
namespace:
description: The namespace containing the resource to be referenced.
It should be left empty in case of cluster-wide resources.
description: |-
The namespace containing the resource to be referenced. It should be left
empty in case of cluster-wide resources.
type: string
required:
- name
Expand Down
Loading

0 comments on commit 3fd4cb7

Please sign in to comment.