Skip to content
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
73 changes: 0 additions & 73 deletions apis/installer/v1alpha1/capi_cluster_presets_types.go

This file was deleted.

95 changes: 95 additions & 0 deletions apis/installer/v1alpha1/cluster_presets_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md

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 (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindClusterPresets = "ClusterPresets"
ResourceClusterPresets = "clusterpresets"
ResourceClusterPresetss = "clusterpresetss"
)

// ClusterPresets defines the schama for ClusterPresets operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=clusterpresetss,singular=clusterpresets,categories={kubeops,appscode}
type ClusterPresets struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterPresetsSpec `json:"spec,omitempty"`
}

// ClusterPresetsSpec is the schema for Identity Server values file
type ClusterPresetsSpec struct {
//+optional
NameOverride string `json:"nameOverride"`
//+optional
FullnameOverride string `json:"fullnameOverride"`
//+optional
RegistryFQDN string `json:"registryFQDN"`
ReplicaCount int32 `json:"replicaCount"`
Image ImageReference `json:"image"`
//+optional
ImagePullSecrets []string `json:"imagePullSecrets"`
//+optional
PodAnnotations map[string]string `json:"podAnnotations"`
//+optional
PodLabels map[string]string `json:"podLabels"`
// PodSecurityContext holds pod-level security attributes and common container settings.
// Optional: Defaults to empty. See type description for default values of each field.
// +optional
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
//+optional
SecurityContext *core.SecurityContext `json:"securityContext"`
//+optional
Resources core.ResourceRequirements `json:"resources"`
//+optional
NodeSelector map[string]string `json:"nodeSelector"`
// If specified, the pod's tolerations.
// +optional
Tolerations []core.Toleration `json:"tolerations"`
// If specified, the pod's scheduling constraints
// +optional
Affinity *core.Affinity `json:"affinity"`
// +optional
LivenessProbe *core.Probe `json:"livenessProbe"`
// +optional
ReadinessProbe *core.Probe `json:"readinessProbe"`
Service AceServiceSpec `json:"service"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
Volumes []core.Volume `json:"volumes"`
VolumeMounts []core.VolumeMount `json:"volumeMounts"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterPresetsList is a list of ClusterPresetss
type ClusterPresetsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of ClusterPresets CRD objects
Items []ClusterPresets `json:"items,omitempty"`
}
10 changes: 10 additions & 0 deletions apis/installer/v1alpha1/opscenter_features_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ type CapiMetadata struct {
Namespace string `json:"namespace"`
}

// +kubebuilder:validation:Enum=capa;capg;capz
type CAPIProvider string

const (
CAPIProviderDisabled CAPIProvider = ""
CAPIProviderCAPA CAPIProvider = "capa"
CAPIProviderCAPG CAPIProvider = "capg"
CAPIProviderCAPZ CAPIProvider = "capz"
)

type OpscenterHelmSpec struct {
CreateNamespace bool `json:"createNamespace"`
Repositories map[string]*shared.HelmRepository `json:"repositories"`
Expand Down
4 changes: 2 additions & 2 deletions apis/installer/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&BillingList{},
&BillingUi{},
&BillingUiList{},
&CapiClusterPresets{},
&CapiClusterPresetsList{},
&CatalogManager{},
&CatalogManagerList{},
&CertManagerWebhookAce{},
&CertManagerWebhookAceList{},
&ClusterImporter{},
&ClusterImporterList{},
&ClusterPresets{},
&ClusterPresetsList{},
&ClusterUi{},
&ClusterUiList{},
&DeployUi{},
Expand Down
2 changes: 1 addition & 1 deletion apis/installer/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ func TestDefaultValues(t *testing.T) {
sc.TestCase{Obj: v1alpha1.AceSpec{}},
sc.TestCase{Obj: v1alpha1.BillingSpec{}},
sc.TestCase{Obj: v1alpha1.BillingUiSpec{}},
sc.TestCase{Obj: v1alpha1.CapiClusterPresetsSpec{}},
sc.TestCase{Obj: v1alpha1.CatalogManagerSpec{}},
sc.TestCase{Obj: v1alpha1.CertManagerWebhookAceSpec{}},
sc.TestCase{Obj: v1alpha1.ClusterImporterSpec{}},
sc.TestCase{Obj: v1alpha1.ClusterPresetsSpec{}},
sc.TestCase{Obj: v1alpha1.ClusterUiSpec{}},
sc.TestCase{Obj: v1alpha1.DeployUiSpec{}},
sc.TestCase{Obj: v1alpha1.DnsProxySpec{}},
Expand Down
Loading