Skip to content

Commit

Permalink
rename view to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
free6om committed Oct 15, 2024
1 parent 0862ba8 commit 30e7bba
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Package v1 contains API Schema definitions for the view v1 API group
// Package v1 contains API Schema definitions for the trace v1 API group
// +kubebuilder:object:generate=true
// +groupName=view.kubeblocks.io
// +groupName=trace.kubeblocks.io
package v1

import (
Expand All @@ -29,7 +29,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "view.kubeblocks.io", Version: "v1"}
GroupVersion = schema.GroupVersion{Group: "trace.kubeblocks.io", Version: "v1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand All @@ -38,4 +38,4 @@ var (
AddToScheme = SchemeBuilder.AddToScheme
)

const Kind = "ReconciliationView"
const Kind = "ReconciliationTrace"
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ReconciliationViewSpec defines the desired state of ReconciliationView
type ReconciliationViewSpec struct {
// ReconciliationTraceSpec defines the desired state of ReconciliationTrace
type ReconciliationTraceSpec struct {
// TargetObject specifies the target Cluster object.
// Default is the Cluster object with same namespace and name as this ReconciliationView object.
// Default is the Cluster object with same namespace and name as this ReconciliationTrace object.
//
// +optional
TargetObject *ObjectReference `json:"targetObject,omitempty"`

// DryRun tells the Controller to simulate the reconciliation process with a new desired spec of the TargetObject.
// And a reconciliation plan will be generated and described in the ReconciliationViewStatus.
// And a reconciliation plan will be generated and described in the ReconciliationTraceStatus.
// The plan generation process will not impact the state of the TargetObject.
//
// +optional
Expand All @@ -57,14 +57,14 @@ type ReconciliationViewSpec struct {
// +optional
Depth *int32 `json:"depth,omitempty"`

// Locale specifies the locale to use when localizing the reconciliation view.
// Locale specifies the locale to use when localizing the reconciliation trace.
//
// +optional
Locale *string `json:"locale,omitempty"`
}

// ReconciliationViewStatus defines the observed state of ReconciliationView
type ReconciliationViewStatus struct {
// ReconciliationTraceStatus defines the observed state of ReconciliationTrace
type ReconciliationTraceStatus struct {
// DryRunResult specifies the dry-run result.
//
// +optional
Expand All @@ -88,13 +88,13 @@ type ReconciliationViewStatus struct {
// ObjectReference defines a reference to an object.
type ObjectReference struct {
// Namespace of the referent.
// Default is same as the ReconciliationView object.
// Default is same as the ReconciliationTrace object.
//
// +optional
Namespace string `json:"namespace,omitempty"`

// Name of the referent.
// Default is same as the ReconciliationView object.
// Default is same as the ReconciliationTrace object.
//
// +optional
Name string `json:"name,omitempty"`
Expand Down Expand Up @@ -287,7 +287,7 @@ type ObjectChange struct {
//
Revision int64 `json:"revision"`

// Timestamp is a timestamp representing the ReconciliationView Controller time when this change occurred.
// Timestamp is a timestamp representing the ReconciliationTrace Controller time when this change occurred.
// It is not guaranteed to be set in happens-before order across separate changes.
// It is represented in RFC3339 form and is in UTC.
//
Expand Down Expand Up @@ -354,7 +354,7 @@ type ObjectTreeDiffSummary struct {
// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories={kubeblocks,all},shortName=view
// +kubebuilder:resource:categories={kubeblocks,all},shortName=trace
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="TARGET_NS",type="string",JSONPath=".spec.targetObject.namespace",description="Target Object Namespace"
// +kubebuilder:printcolumn:name="TARGET_NAME",type="string",JSONPath=".spec.targetObject.name",description="Target Object Name"
Expand All @@ -364,24 +364,24 @@ type ObjectTreeDiffSummary struct {
// +kubebuilder:printcolumn:name="NAME",type="string",JSONPath=".status.currentState.changes[-1].objectReference.name",description="Latest Changed Object Name"
// +kubebuilder:printcolumn:name="CHANGE",type="string",JSONPath=".status.currentState.changes[-1].description",description="Latest Change Description"

// ReconciliationView is the Schema for the reconciliationviews API
type ReconciliationView struct {
// ReconciliationTrace is the Schema for the reconciliationtraces API
type ReconciliationTrace struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ReconciliationViewSpec `json:"spec,omitempty"`
Status ReconciliationViewStatus `json:"status,omitempty"`
Spec ReconciliationTraceSpec `json:"spec,omitempty"`
Status ReconciliationTraceStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// ReconciliationViewList contains a list of ReconciliationView
type ReconciliationViewList struct {
// ReconciliationTraceList contains a list of ReconciliationTrace
type ReconciliationTraceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ReconciliationView `json:"items"`
Items []ReconciliationTrace `json:"items"`
}

func init() {
SchemeBuilder.Register(&ReconciliationView{}, &ReconciliationViewList{})
SchemeBuilder.Register(&ReconciliationTrace{}, &ReconciliationTraceList{})
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ options: {

// required, k8s api resource content
content: {
apiVersion: "view.kubeblocks.io/v1"
kind: "ReconciliationView"
apiVersion: "trace.kubeblocks.io/v1"
kind: "ReconciliationTrace"
metadata: {
name: options.name
namespace: options.namespace
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import (
"github.com/apecloud/kbcli/pkg/cmd/playground"
"github.com/apecloud/kbcli/pkg/cmd/plugin"
"github.com/apecloud/kbcli/pkg/cmd/report"
"github.com/apecloud/kbcli/pkg/cmd/trace"
"github.com/apecloud/kbcli/pkg/cmd/version"
"github.com/apecloud/kbcli/pkg/cmd/view"
"github.com/apecloud/kbcli/pkg/types"
"github.com/apecloud/kbcli/pkg/util"
)
Expand Down Expand Up @@ -177,7 +177,7 @@ A Command Line Interface for KubeBlocks`,
report.NewReportCmd(f, ioStreams),
backuprepo.NewBackupRepoCmd(f, ioStreams),
dataprotection.NewDataProtectionCmd(f, ioStreams),
view.NewViewCmd(f, ioStreams),
trace.NewTraceCmd(f, ioStreams),
)

filters := []string{"options"}
Expand Down
Loading

0 comments on commit 30e7bba

Please sign in to comment.