knuu icon indicating copy to clipboard operation
knuu copied to clipboard

Verify if cloning performs deep cloning

Open smuu opened this issue 2 years ago • 2 comments

Check if cloning performs deep cloning and does not use the same reference

https://github.com/celestiaorg/knuu/blob/db168444fc447779f039ce8b254ef906835c21dc/pkg/knuu/instance_helper.go#L325

smuu avatar Nov 27 '23 15:11 smuu

it seems like some of the pointers in the instance are not cloned. The same case goes for slices and maps. So we need a proper method to deeply clone everything.

type Instance struct {
	kubernetesService    *v1.Service
	builderFactory       *container.BuilderFactory
	kubernetesReplicaSet *appv1.ReplicaSet
	portsTCP             []int
	portsUDP             []int
	command              []string
	args                 []string
	env                  map[string]string
	volumes              []*k8s.Volume
	policyRules          []rbacv1.PolicyRule
	livenessProbe        *v1.Probe
	readinessProbe       *v1.Probe
	startupProbe         *v1.Probe
	obsyConfig           *ObsyConfig
}

mojtaba-esk avatar Apr 23 '24 10:04 mojtaba-esk

@mojtaba-esk checks this

smuu avatar Jul 04 '24 14:07 smuu