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

Introduce services.opendatahub.io api group #1389

36 changes: 8 additions & 28 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# 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: opendatahub.io
layout:
- go.kubebuilder.io/v3
Expand All @@ -14,7 +10,6 @@ repo: github.com/opendatahub-io/opendatahub-operator
resources:
- api:
crdVersion: v1
namespaced: false
controller: true
domain: opendatahub.io
group: dscinitialization
Expand All @@ -26,7 +21,6 @@ resources:
webhookVersion: v1
- api:
crdVersion: v1
namespaced: false
controller: true
domain: opendatahub.io
group: datasciencecluster
Expand All @@ -45,8 +39,6 @@ resources:
kind: Dashboard
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -55,8 +47,6 @@ resources:
kind: Workbenches
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -65,8 +55,6 @@ resources:
kind: ModelMeshServing
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -75,8 +63,6 @@ resources:
kind: DataSciencePipelines
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -85,8 +71,6 @@ resources:
kind: Kserve
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -95,8 +79,6 @@ resources:
kind: Kueue
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -105,8 +87,6 @@ resources:
kind: CodeFlare
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -115,8 +95,6 @@ resources:
kind: Ray
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -125,8 +103,6 @@ resources:
kind: TrustyAI
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -135,8 +111,6 @@ resources:
kind: ModelRegistry
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
Expand All @@ -145,6 +119,12 @@ resources:
kind: TrainingOperator
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1
version: v1
webhooks:
validation: false
- api:
crdVersion: v1
controller: true
domain: opendatahub.io
group: services
kind: Monitoring
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/services/v1
version: v1
version: "3"
80 changes: 80 additions & 0 deletions apis/common/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package common

import (
operatorv1 "github.com/openshift/api/operator/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)

// ManagementSpec struct defines the component's management configuration.
// +kubebuilder:object:generate=true
type ManagementSpec struct {
// Set to one of the following values:
//
// - "Managed" : the operator is actively managing the component and trying to keep it active.
// It will only upgrade the component if it is safe to do so
//
// - "Removed" : the operator is actively managing the component and will not install it,
// or if it is installed, the operator will try to remove it
//
// +kubebuilder:validation:Enum=Managed;Removed
ManagementState operatorv1.ManagementState `json:"managementState,omitempty"`
}

// DevFlags defines list of fields that can be used by developers to test customizations. This is not recommended
// to be used in production environment.
// +kubebuilder:object:generate=true
type DevFlags struct {
// List of custom manifests for the given component
// +optional
Manifests []ManifestsConfig `json:"manifests,omitempty"`
}

// DevFlagsSpec struct defines the component's dev flags configuration.
// +kubebuilder:object:generate=true
type DevFlagsSpec struct {
// Add developer fields
// +optional
DevFlags *DevFlags `json:"devFlags,omitempty"`
}

type ManifestsConfig struct {
// uri is the URI point to a git repo with tag/branch. e.g. https://github.com/org/repo/tarball/<tag/branch>
// +optional
// +kubebuilder:default:=""
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
URI string `json:"uri,omitempty"`

// contextDir is the relative path to the folder containing manifests in a repository, default value "manifests"
// +optional
// +kubebuilder:default:="manifests"
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
ContextDir string `json:"contextDir,omitempty"`

// sourcePath is the subpath within contextDir where kustomize builds start. Examples include any sub-folder or path: `base`, `overlays/dev`, `default`, `odh` etc.
// +optional
// +kubebuilder:default:=""
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
SourcePath string `json:"sourcePath,omitempty"`
}

// +kubebuilder:object:generate=true
type Status struct {
Phase string `json:"phase,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

type WithStatus interface {
GetStatus() *Status
}

type WithDevFlags interface {
GetDevFlags() *DevFlags
}

type BaseObject interface {
client.Object
WithStatus
WithDevFlags
}
102 changes: 102 additions & 0 deletions apis/common/zz_generated.deepcopy.go

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

Loading
Loading