| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 
 | "sigs.k8s.io/controller-runtime/pkg/client"
 
 type Inodes struct {
 client.Client
 }
 
 
 inodesListExpect = xxxx
 
 
 
 inodes := &irov1.IaasNodes{}
 err = c.Get(context.TODO(), types.NamespacedName{Name: inodesExpect.Name, Namespace: inodesExpect.Namespace}, inodes)
 
 
 if err = c.Create(context.TODO(), &inodesExpect); err != nil {
 klog.ErrorS(err, "Create iaasnodes err", "iaasnodes", iNodeKey)
 return err
 }
 
 
 inodesExpect.SetResourceVersion(inodes.GetResourceVersion())
 if err = c.Update(context.TODO(), &inodesExpect); err != nil {
 klog.ErrorS(err, "Update iaasnodes err", "iaasnodes", iNodeKey)
 return err
 }
 
 
 
 |