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

chore: remove new cluster conn-credential API #6098

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions apis/apps/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ type ClusterSpec struct {
// +optional
Services []Service `json:"services,omitempty"`

// connectionCredentials defines the credentials used to access a cluster.
// affinity is a group of affinity scheduling rules.
// +optional
Affinity *Affinity `json:"affinity,omitempty"`

// tolerations are attached to tolerate any taint that matches the triple `key,value,effect` using the matching operator `operator`.
// +kubebuilder:pruning:PreserveUnknownFields
// +optional
ConnectionCredentials []ConnectionCredential `json:"connectionCredentials,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// tenancy describes how pods are distributed across node.
// SharedNode means multiple pods may share the same node.
Expand All @@ -87,15 +91,6 @@ type ClusterSpec struct {
// +optional
AvailabilityPolicy AvailabilityPolicyType `json:"availabilityPolicy,omitempty"`

// affinity is a group of affinity scheduling rules.
// +optional
Affinity *Affinity `json:"affinity,omitempty"`

// tolerations are attached to tolerate any taint that matches the triple `key,value,effect` using the matching operator `operator`.
// +kubebuilder:pruning:PreserveUnknownFields
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// replicas specifies the replicas of the first componentSpec, if the replicas of the first componentSpec is specified, this value will be ignored.
// +optional
Replicas *int32 `json:"replicas,omitempty"`
Expand Down
31 changes: 0 additions & 31 deletions apis/apps/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,37 +622,6 @@ type Service struct {
RoleSelector string `json:"roleSelector,omitempty"`
}

type ConnectionCredential struct {
// The name of the ConnectionCredential.
// Cannot be updated.
// +required
Name string `json:"name"`

// ServiceName specifies the name of service to use for accessing.
// Cannot be updated.
// +optional
ServiceName string `json:"serviceName,omitempty"`

// PortName specifies the name of the port to access the service.
// If the service has multiple ports, a specific port must be specified to use here.
// Otherwise, the unique port of the service will be used.
// Cannot be updated.
// +optional
PortName string `json:"portName,omitempty"`

// ComponentName specifies the name of component where the account defined.
// For cluster-level connection credential, this field is required.
// Cannot be updated.
// +optional
ComponentName string `json:"componentName,omitempty"`

// AccountName specifies the name of account used to access the service.
// If specified, the account must be defined in @SystemAccounts.
// Cannot be updated.
// +optional
AccountName string `json:"accountName,omitempty"`
}

// List of all the built-in variables provided by KubeBlocks.
// These variables are automatically available when building environment variables for Pods and Actions, as well as
// rendering templates for config and script. Users can directly use these variables without explicit declaration.
Expand Down
20 changes: 0 additions & 20 deletions apis/apps/v1alpha1/zz_generated.deepcopy.go

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

34 changes: 0 additions & 34 deletions config/crd/bases/apps.kubeblocks.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -898,40 +898,6 @@ spec:
x-kubernetes-validations:
- message: duplicated component
rule: self.all(x, size(self.filter(c, c.name == x.name)) == 1)
connectionCredentials:
description: connectionCredentials defines the credentials used to
access a cluster.
items:
properties:
accountName:
description: AccountName specifies the name of account used
to access the service. If specified, the account must be defined
in @SystemAccounts. Cannot be updated.
type: string
componentName:
description: ComponentName specifies the name of component where
the account defined. For cluster-level connection credential,
this field is required. Cannot be updated.
type: string
name:
description: The name of the ConnectionCredential. Cannot be
updated.
type: string
portName:
description: PortName specifies the name of the port to access
the service. If the service has multiple ports, a specific
port must be specified to use here. Otherwise, the unique
port of the service will be used. Cannot be updated.
type: string
serviceName:
description: ServiceName specifies the name of service to use
for accessing. Cannot be updated.
type: string
required:
- name
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
monitor:
description: monitor specifies the configuration of monitor
properties:
Expand Down
10 changes: 7 additions & 3 deletions config/crd/bases/dataprotection.kubeblocks.io_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ spec:
- Delete
- Retain
default: Delete
description: deletionPolicy determines whether the backup contents
description: 'deletionPolicy determines whether the backup contents
stored in backup repository should be deleted when the backup custom
resource is deleted. Supported values are "Retain" and "Delete".
"Retain" means that the backup can not be deleted and remains in
'Deleting' phase. "Delete" means that the backup content and its
physical snapshot on backup repository are deleted.
''Deleting'' phase. "Delete" means that the backup content and its
physical snapshot on backup repository are deleted. TODO: for the
retain policy, we should support in the future for only deleting
the backup custom objects but retaining the backup contents in backup
repository. The current implementation only prevent accidental deletion
of backup data.'
type: string
parentBackupName:
description: parentBackupName determines the parent backup name for
Expand Down
2 changes: 1 addition & 1 deletion controllers/apps/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
// update cluster components' status
&clusterComponentStatusTransformer{},
// create default cluster connection credential secret object
&clusterCredentialTransformer{},
&clusterConnCredentialTransformer{},
// build backuppolicy and backupschedule from backupPolicyTemplate
&clusterBackupPolicyTransformer{},
// add our finalizer to all objects
Expand Down
7 changes: 0 additions & 7 deletions controllers/apps/cluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ var _ = Describe("Cluster Controller", func() {
})).Should(Succeed())
}

testClusterCredential := func(compName, compDefName string, createObj func(string, string, func(*testapps.MockClusterFactory))) {
}

testClusterAffinityNToleration := func(compName, compDefName string, createObj func(string, string, func(*testapps.MockClusterFactory))) {
const (
clusterTopologyKey = "testClusterTopologyKey"
Expand Down Expand Up @@ -752,10 +749,6 @@ var _ = Describe("Cluster Controller", func() {
testClusterService(consensusCompName, compDefName, createObj)
})

It("with cluster credential set", func() {
testClusterCredential(consensusCompName, compDefName, createObj)
})

It("with cluster affinity and toleration set", func() {
testClusterAffinityNToleration(consensusCompName, compDefName, createObj)
})
Expand Down
Loading