Skip to content

Commit

Permalink
Remove migration code
Browse files Browse the repository at this point in the history
Old Cluster and Console would not be migrated to flux based version. In future
thouse custom resources would use the same reconciler as Redpanda does.
  • Loading branch information
RafalKorepta committed Sep 17, 2024
1 parent 7ac4262 commit 4aaea5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 376 deletions.
55 changes: 3 additions & 52 deletions src/go/k8s/api/redpanda/v1alpha2/redpanda_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ type RedpandaSpec struct {
ChartRef ChartRef `json:"chartRef,omitempty"`
// Defines the Helm values to use to deploy the cluster.
ClusterSpec *RedpandaClusterSpec `json:"clusterSpec,omitempty"`
// Deprecated: Old Cluster and Console would not be migrated to flux based version.
// In future old Cluster and Console custom resource would use the same reconciler as Redpanda does.
//
// Migration flag that adjust Kubernetes core resources with annotation and labels, so
// flux controller can import resources.
// Doc: https://docs.redpanda.com/current/upgrade/migrate/kubernetes/operator/
Expand Down Expand Up @@ -242,55 +245,3 @@ func (in *Redpanda) OwnerShipRefObj() metav1.OwnerReference {
Controller: ptr.To(true),
}
}

// GetMigrationConsoleName returns Console custom resource namespace which will be taken out from
// old reconciler, so that underlying resources could be migrated.
func (in *Redpanda) GetMigrationConsoleName() string {
if in.Spec.Migration == nil {
return ""
}
name := in.Spec.Migration.ConsoleRef.Name
if name == "" {
name = in.Name
}
return name
}

// GetMigrationConsoleNamespace returns Console custom resource name which will be taken out from
// old reconciler, so that underlying resources could be migrated.
func (in *Redpanda) GetMigrationConsoleNamespace() string {
if in.Spec.Migration == nil {
return ""
}
namespace := in.Spec.Migration.ConsoleRef.Namespace
if namespace == "" {
namespace = in.Namespace
}
return namespace
}

// GetMigrationClusterName returns Cluster custom resource namespace which will be taken out from
// old reconciler, so that underlying resources could be migrated.
func (in *Redpanda) GetMigrationClusterName() string {
if in.Spec.Migration == nil {
return ""
}
name := in.Spec.Migration.ClusterRef.Name
if name == "" {
name = in.Name
}
return name
}

// GetMigrationClusterNamespace returns Cluster custom resource name which will be taken out from
// old reconciler, so that underlying resources could be migrated.
func (in *Redpanda) GetMigrationClusterNamespace() string {
if in.Spec.Migration == nil {
return ""
}
namespace := in.Spec.Migration.ClusterRef.Namespace
if namespace == "" {
namespace = in.Namespace
}
return namespace
}
Loading

0 comments on commit 4aaea5e

Please sign in to comment.