Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
refactor: template/catalog/connector/connectorbinding reconciling
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed Apr 23, 2024
1 parent 9ffb2ee commit b17c709
Show file tree
Hide file tree
Showing 92 changed files with 4,990 additions and 2,959 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/walrus/v1/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
//
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],subResources=["status"]
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cat"],subResources=["status"]
type Catalog walruscore.Catalog

var _ runtime.Object = (*Catalog)(nil)
Expand Down
42 changes: 42 additions & 0 deletions pkg/apis/walrus/v1/connector.config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package v1

import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"

walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1"
)

// ConnectorConfig is the subresource of the Connector resource for extract configuration.
//
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"]
type ConnectorConfig struct {
meta.TypeMeta `json:",inline"`
meta.ObjectMeta `json:"metadata,omitempty"`

Status ConnectorConfigStatus `json:"status"`
}

var _ runtime.Object = (*ConnectorConfig)(nil)

// ConnectorConfigStatus defines the observed state of ConnectorConfig.
type ConnectorConfigStatus struct {
// ApplicableEnvironmentType is the environment type that the connector is applicable to.
ApplicableEnvironmentType walruscore.EnvironmentType `json:"applicableEnvironmentType"`

// Category is the category of the connector.
Category walruscore.ConnectorCategory `json:"category"`

// Type is the type of the connector.
Type string `json:"type"`

// Version is the version of the configuration.
Version string `json:"version"`

// Data is the configuration of the connector.
Data map[string][]byte `json:"data"`

// ConditionSummary is the summary of the conditions.
walruscore.ConditionSummary `json:",inline"`
}
1 change: 1 addition & 0 deletions pkg/apis/walrus/v1/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
// Connector is the schema for the connectors API.
//
// +genclient
// +genclient:method=GetConfig,verb=get,subresource=config,result=ConnectorConfig
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["conn"],subResources=["status"]
type Connector walruscore.Connector
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/walrus/v1/connector_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
//
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cb"],subResources=["status"]
// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["connbd"]
type ConnectorBinding walruscore.ConnectorBinding

var _ runtime.Object = (*ConnectorBinding)(nil)
Expand Down
Loading

0 comments on commit b17c709

Please sign in to comment.