-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abdul Hameed <[email protected]>
- Loading branch information
1 parent
eb42450
commit e2ddf09
Showing
32 changed files
with
1,197 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
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 ( | ||
"github.com/opendatahub-io/opendatahub-operator/v2/apis/common" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// FeastOperatorName is the name of the new component | ||
FeastOperatorComponentName = "feastoperator" | ||
|
||
// FeastOperatorInstanceName is the singleton name for the FeastOperator instance | ||
// Value must match the validation rule defined below | ||
FeastOperatorInstanceName = "default-" + FeastOperatorComponentName | ||
|
||
// FeastOperatorKind represents the Kubernetes kind for FeastOperator | ||
FeastOperatorKind = "FeastOperator" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'default-feastoperator'",message="FeastOperator name must be 'default-feastoperator'" | ||
// +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" | ||
|
||
// FeastOperator is the Schema for the FeastOperator API | ||
type FeastOperator struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec FeastOperatorSpec `json:"spec,omitempty"` | ||
Status FeastOperatorStatus `json:"status,omitempty"` | ||
} | ||
|
||
// FeastOperatorCommonSpec defines the common spec shared across APIs for FeastOperator | ||
type FeastOperatorCommonSpec struct { | ||
// Spec fields exposed to the DSC API | ||
common.DevFlagsSpec `json:",inline"` | ||
} | ||
|
||
// FeastOperatorCommonStatus defines the shared observed state of FeastOperator | ||
type FeastOperatorCommonStatus struct { | ||
} | ||
|
||
// FeastOperatorSpec defines the desired state of FeastOperator | ||
type FeastOperatorSpec struct { | ||
FeastOperatorCommonSpec `json:",inline"` | ||
} | ||
|
||
// FeastOperatorStatus defines the observed state of FeastOperator | ||
type FeastOperatorStatus struct { | ||
common.Status `json:",inline"` | ||
FeastOperatorCommonStatus `json:",inline"` | ||
} | ||
|
||
// GetDevFlags retrieves the development flags from the spec | ||
func (c *FeastOperator) GetDevFlags() *common.DevFlags { | ||
return c.Spec.DevFlags | ||
} | ||
|
||
// GetStatus retrieves the status of the FeastOperator component | ||
func (c *FeastOperator) GetStatus() *common.Status { | ||
return &c.Status.Status | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// FeastOperatorList contains a list of FeastOperator objects | ||
type FeastOperatorList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []FeastOperator `json:"items"` | ||
} | ||
|
||
// DSCFeastOperator defines the configuration exposed in the DSC instance for FeastOperator | ||
type DSCFeastOperator struct { | ||
// Fields common across components | ||
common.ManagementSpec `json:",inline"` | ||
|
||
// FeastOperator-specific fields | ||
FeastOperatorCommonSpec `json:",inline"` | ||
} | ||
|
||
// DSCFeastOperatorStatus struct holds the status for the FeastOperator component exposed in the DSC | ||
type DSCFeastOperatorStatus struct { | ||
common.ManagementSpec `json:",inline"` | ||
*FeastOperatorCommonStatus `json:",inline"` | ||
} | ||
|
||
func init() { | ||
// Register the schema with the scheme builder | ||
SchemeBuilder.Register(&FeastOperator{}, &FeastOperatorList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.