// AddObject adds a client.Object to the state.
AddObject adds a client.Object to the state.
// AddObject adds a client . Object to the state .
func (s *State) AddObject(object client.Object) {
	switch o := object.(type) {
	case *lssv1alpha1.LandscaperDeployment:
		s.Deployments[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	case *lssv1alpha1.Instance:
		s.Instances[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	case *lssv1alpha1.ServiceTargetConfig:
		s.Configs[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	case *corev1.Secret:
		if o.Data == nil {
			o.Data = make(map[string][]byte)
		}
		for key, data := range o.StringData {
			o.Data[key] = []byte(data)
		}
		s.Secrets[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	case *lsv1alpha1.Installation:
		s.Installations[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	case *lsv1alpha1.Target:
		s.Targets[types.NamespacedName{Name: o.Name, Namespace: o.Namespace}.String()] = o.DeepCopy()
	}
}
func ( s * State ) AddObject ( object client . Object ) { switch o := object . ( type ) { case * lssv1alpha1 . LandscaperDeployment : s . Deployments [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) case * lssv1alpha1 . Instance : s . Instances [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) case * lssv1alpha1 . ServiceTargetConfig : s . Configs [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) case * corev1 . Secret : if o . Data == nil { o . Data = make ( map [ string ] [ ] byte ) } for key , data := range o . StringData { o . Data [ key ] = [ ] byte ( data ) } s . Secrets [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) case * lsv1alpha1 . Installation : s . Installations [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) case * lsv1alpha1 . Target : s . Targets [ types . NamespacedName { Name : o . Name , Namespace : o . Namespace } . String ( ) ] = o . DeepCopy ( ) } }
AddObject adds a client.Object to the state.
AddObject adds a client . Object to the state .