Skip to content

Commit

Permalink
fix(): add requeueOnFailure and enableAutoEviction field in cluster t…
Browse files Browse the repository at this point in the history
…ypes (#237)

* fix(): add enableAutoEviction flag in cluster spec

Signed-off-by: RohanKumarMainali <rohan.manali@aveshasystems.com>

* fix(): typo of omitempty in project apis

Signed-off-by: RohanKumarMainali <rohan.manali@aveshasystems.com>

* fix(): add requeueOnFailure field

Signed-off-by: RohanKumarMainali <rohan.manali@aveshasystems.com>

---------

Signed-off-by: RohanKumarMainali <rohan.manali@aveshasystems.com>
  • Loading branch information
RohanKumarMainali authored Jan 10, 2025
1 parent 386fcd5 commit 16bbf5b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
38 changes: 20 additions & 18 deletions apis/controller/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,64 +55,66 @@ type ClusterSpec struct {
NodeIPs []string `json:"nodeIPs,omitempty"`
// NetworkInterface is the network interface attached with the cluster.
NetworkInterface string `json:"networkInterface,omitempty"`
//put in an object
ClusterProperty ClusterProperty `json:"clusterProperty,omitempty"`
// put in an object
ClusterProperty ClusterProperty `json:"clusterProperty,omitempty"`
EnableAutoEviction bool `json:"enableAutoEviction,omitempty"`
RequeueOnFailure bool `json:"requeueOnFailure,omitempty"`
}

type ClusterProperty struct {
//Telemetry contains Telemetry information
// Telemetry contains Telemetry information
Telemetry Telemetry `json:"telemetry,omitempty"`
//GeoLocation contains information regarding Geographical Location of the Cluster
// GeoLocation contains information regarding Geographical Location of the Cluster
GeoLocation GeoLocation `json:"geoLocation,omitempty"`
//Monitoring contains the Kubernetes Monitoring Dashboard
// Monitoring contains the Kubernetes Monitoring Dashboard
Monitoring Monitoring `json:"monitoring,omitempty"`
}

// Telemetry defines the field of ClusterSpec
type Telemetry struct {
//Enabled is the enable status of the Telemetry
// Enabled is the enable status of the Telemetry
Enabled bool `json:"enabled,omitempty"`
//TelemetryProvider is the Telemetry Provider information
// TelemetryProvider is the Telemetry Provider information
TelemetryProvider string `json:"telemetryProvider,omitempty"`
//Endpoint is the Telemetry Endpoint
// Endpoint is the Telemetry Endpoint
Endpoint string `json:"endpoint,omitempty"`
}

// GeoLocation defines the field of ClusterSpec
type GeoLocation struct {
//CloudProvider is the cloud service provider
// CloudProvider is the cloud service provider
CloudProvider string `json:"cloudProvider,omitempty"`
//CloudRegion is the region of the cloud
// CloudRegion is the region of the cloud
CloudRegion string `json:"cloudRegion,omitempty"`
//Latitude is the latitude of the cluster
// Latitude is the latitude of the cluster
Latitude string `json:"latitude,omitempty"`
//Longitude is the longitude of the cluster
// Longitude is the longitude of the cluster
Longitude string `json:"longitude,omitempty"`
}

// Monitoring defines the field of ClusterSpec
type Monitoring struct {
//KubernetesDashboard contains the information regarding Kubernetes Monitoring Dashboard
// KubernetesDashboard contains the information regarding Kubernetes Monitoring Dashboard
KubernetesDashboard KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
}

// KubernetesDashboard defines the field of ClusterSpec
type KubernetesDashboard struct {
//Enabled is the enable status of the KubernetesDashboard
// Enabled is the enable status of the KubernetesDashboard
Enabled bool `json:"enabled,omitempty"`
//AccessToken is the Access Token to access the KubernetesDashboard
// AccessToken is the Access Token to access the KubernetesDashboard
AccessToken string `json:"accessToken,omitempty"`
//IngressPrefix is the prefix of ingress gateway for KubernetesDashboard
// IngressPrefix is the prefix of ingress gateway for KubernetesDashboard
IngressPrefix string `json:"ingressPrefix,omitempty"`
//Endpoint is the base endpoint to access the kubernetes dashboard
// Endpoint is the base endpoint to access the kubernetes dashboard
Endpoint string `json:"endpoint,omitempty"`
}

// ClusterStatus defines the observed state of Cluster
type ClusterStatus struct {
// SecretName is the name of the secret for the worker cluster.
SecretName string `json:"secretName,omitempty"`
//CniSubnet is the podip and service ip subnet of CNI
// CniSubnet is the podip and service ip subnet of CNI
CniSubnet []string `json:"cniSubnet,omitempty"`
// Namespaces present in cluster
Namespaces []NamespacesConfig `json:"namespaces,omitempty"`
Expand Down
3 changes: 1 addition & 2 deletions apis/controller/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ type ProjectSpec struct {
// ServiceAccount is a field of Project. Edit project_types.go to remove/update
ServiceAccount ServiceAccount `json:"serviceAccount,omitempty"`
// If defaultSliceCreation is true, then the default slice will be created
//+kubebuilder:validation:Optional
DefaultSliceCreation bool `json:"defaultSliceCreation,omitemtpy"`
DefaultSliceCreation bool `json:"defaultSliceCreation,omitempty"`
}

// ServiceAccount defines the field of ProjectSpec
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/controller.kubeslice.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ spec:
type: string
type: object
type: object
enableAutoEviction:
type: boolean
networkInterface:
description: NetworkInterface is the network interface attached with
the cluster.
Expand All @@ -109,6 +111,8 @@ spec:
items:
type: string
type: array
requeueOnFailure:
type: boolean
type: object
status:
description: ClusterStatus defines the observed state of Cluster
Expand Down

0 comments on commit 16bbf5b

Please sign in to comment.