Skip to content

Commit

Permalink
Merge branch 'feature-operator-refactor' into feature-branch-push
Browse files Browse the repository at this point in the history
  • Loading branch information
CFSNM committed Nov 28, 2024
2 parents af28224 + 8e9be7b commit 8926be6
Show file tree
Hide file tree
Showing 19 changed files with 604 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/feature-branch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
BUNDLE_IMG: quay.io/${{ secrets.QUAY_ORG }}/opendatahub-operator-bundle:${{ github.head_ref }}
CATALOG_IMG: quay.io/${{ secrets.QUAY_ORG }}/opendatahub-operator-catalog:${{ github.head_ref }}
on:
pull_request_target:
pull_request:
branches:
- 'feature-**'
workflow_dispatch:
Expand Down
39 changes: 27 additions & 12 deletions apis/components/v1/codeflare_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// CodeFlareSpec defines the desired state of CodeFlare
type CodeFlareSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of CodeFlare. Edit codeflare_types.go to remove/update
Foo string `json:"foo,omitempty"`
}
const (
CodeFlareComponentName = "codeflare"
// value should match whats set in the XValidation below
CodeFlareInstanceName = "default-codeflare"
CodeFlareKind = "CodeFlare"
)

// CodeFlareStatus defines the observed state of CodeFlare
type CodeFlareStatus struct {
Expand All @@ -41,6 +36,9 @@ type CodeFlareStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`,description="Ready"
// +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`,description="Reason"
// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default-codeflare'",message="CodeFlare name must be default-codeflare"

// CodeFlare is the Schema for the codeflares API
type CodeFlare struct {
Expand All @@ -51,14 +49,26 @@ type CodeFlare struct {
Status CodeFlareStatus `json:"status,omitempty"`
}

type CodeFlareSpec struct {
CodeFlareCommonSpec `json:",inline"`
}

type CodeFlareCommonSpec struct {
components.DevFlagsSpec `json:",inline"`
}

func (c *CodeFlare) GetDevFlags() *components.DevFlags {
return nil
return c.Spec.DevFlags
}

func (c *CodeFlare) GetStatus() *components.Status {
return &c.Status.Status
}

func init() {
SchemeBuilder.Register(&CodeFlare{}, &CodeFlareList{})
}

// +kubebuilder:object:root=true

// CodeFlareList contains a list of CodeFlare
Expand All @@ -71,3 +81,8 @@ type CodeFlareList struct {
func init() {
SchemeBuilder.Register(&CodeFlare{}, &CodeFlareList{})
}

type DSCCodeFlare struct {
components.ManagementSpec `json:",inline"`
CodeFlareCommonSpec `json:",inline"`
}
36 changes: 35 additions & 1 deletion apis/components/v1/zz_generated.deepcopy.go

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

3 changes: 1 addition & 2 deletions apis/datasciencecluster/v1/datasciencecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (

componentsv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/components/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/components"
"github.com/opendatahub-io/opendatahub-operator/v2/components/codeflare"
"github.com/opendatahub-io/opendatahub-operator/v2/components/kserve"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelmeshserving"
"github.com/opendatahub-io/opendatahub-operator/v2/components/workbenches"
Expand Down Expand Up @@ -65,7 +64,7 @@ type Components struct {

// CodeFlare component configuration.
// If CodeFlare Operator has been installed in the cluster, it should be uninstalled first before enabled component.
CodeFlare codeflare.CodeFlare `json:"codeflare,omitempty"`
CodeFlare componentsv1.DSCCodeFlare `json:"codeflare,omitempty"`

// Ray component configuration.
Ray componentsv1.DSCRay `json:"ray,omitempty"`
Expand Down
140 changes: 0 additions & 140 deletions components/codeflare/codeflare.go

This file was deleted.

39 changes: 0 additions & 39 deletions components/codeflare/zz_generated.deepcopy.go

This file was deleted.

Loading

0 comments on commit 8926be6

Please sign in to comment.