text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (s *DataStore) GetBackupTargetRO(backupTargetName string) (*longhorn.BackupTarget, error) {
return s.btLister.BackupTargets(s.namespace).Get(backupTargetName)
} | [
-0.19446760416030884,
-0.19389179348945618,
0.4288279116153717,
-0.4508768916130066,
-0.08961701393127441,
-0.9963718056678772,
-0.5532289147377014,
0.32602357864379883,
-0.3431083559989929,
-0.3819580674171448,
-0.0997171550989151,
1.0077522993087769,
-0.6039265990257263,
-0.6883198618888... |
func (s *DataStore) GetBackupTarget(name string) (*longhorn.BackupTarget, error) {
resultRO, err := s.GetBackupTargetRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.5691168308258057,
-0.11962442100048065,
0.6593299508094788,
-0.04251360148191452,
-0.20091409981250763,
-1.2769238948822021,
-0.3025785982608795,
-0.11824123561382294,
0.18929481506347656,
-0.167769193649292,
-0.06446264684200287,
0.9623554348945618,
-0.7174358367919922,
-0.785944759845... |
func (s *DataStore) UpdateBackupTarget(backupTarget *longhorn.BackupTarget) (*longhorn.BackupTarget, error) {
obj, err := s.lhClient.LonghornV1beta2().BackupTargets(s.namespace).Update(context.TODO(), backupTarget, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backupTarget.Name, obj, func... | [
-0.8679289221763611,
-1.3422855138778687,
0.3766044080257416,
-0.6363758444786072,
-0.3185298442840576,
-0.9050350189208984,
-0.33008286356925964,
-0.5379988551139832,
0.15318851172924042,
-0.011058123782277107,
-0.03386519476771355,
1.0575344562530518,
-0.7814849019050598,
-0.501203477382... |
func (s *DataStore) UpdateBackupTargetStatus(backupTarget *longhorn.BackupTarget) (*longhorn.BackupTarget, error) {
obj, err := s.lhClient.LonghornV1beta2().BackupTargets(s.namespace).UpdateStatus(context.TODO(), backupTarget, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backupTarget.Nam... | [
-0.8527194261550903,
-1.3836241960525513,
0.2910443842411041,
-0.6084340214729309,
-0.06485311686992645,
-0.42627227306365967,
-0.4213718771934509,
0.14789733290672302,
0.3725661039352417,
0.2588786482810974,
-0.4075622260570526,
1.2133790254592896,
-0.22717837989330292,
-0.463390618562698... |
func (s *DataStore) DeleteBackupTarget(backupTargetName string) error {
return s.lhClient.LonghornV1beta2().BackupTargets(s.namespace).Delete(context.TODO(), backupTargetName, metav1.DeleteOptions{})
} | [
-0.17477327585220337,
-0.7194505929946899,
0.4736723005771637,
-0.3931213915348053,
0.04323097690939903,
-0.8402016758918762,
-0.2813914716243744,
0.10650880634784698,
0.22295092046260834,
-0.49027472734451294,
0.20159129798412323,
1.0341299772262573,
-0.3803229331970215,
-0.22075371444225... |
func (s *DataStore) CreateBackupVolume(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error) {
ret, err := s.lhClient.LonghornV1beta2().BackupVolumes(s.namespace).Create(context.TODO(), backupVolume, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
}... | [
-0.2735768258571625,
-0.2487877756357193,
0.49195805191993713,
-0.08981051295995712,
0.5948113799095154,
-0.0008336314931511879,
-0.10414860397577286,
-0.7574388384819031,
0.06019039824604988,
-0.37200212478637695,
-0.798233151435852,
0.31068360805511475,
-0.5383687615394592,
0.70517563819... |
func (s *DataStore) ListBackupVolumes() (map[string]*longhorn.BackupVolume, error) {
list, err := s.bvLister.BackupVolumes(s.namespace).List(labels.Everything())
if err != nil {
return nil, err
}
itemMap := map[string]*longhorn.BackupVolume{}
for _, itemRO := range list {
itemMap[itemRO.Name] = itemRO.DeepCop... | [
-0.392100989818573,
-1.2830325365066528,
0.39212656021118164,
-0.31165534257888794,
-0.052835479378700256,
-0.7532906532287598,
-0.8126841187477112,
0.1200549528002739,
0.23169995844364166,
0.44388923048973083,
-1.3373855352401733,
0.3559422194957733,
0.1951729953289032,
0.465282142162323,... |
func (s *DataStore) GetBackupVolumeRO(backupVolumeName string) (*longhorn.BackupVolume, error) {
return s.bvLister.BackupVolumes(s.namespace).Get(backupVolumeName)
} | [
0.2808617949485779,
-0.46860113739967346,
0.30726462602615356,
0.12692609429359436,
-0.31977200508117676,
-0.4101593494415283,
-0.46803519129753113,
0.03769239783287048,
-0.23240432143211365,
-0.06646254658699036,
-0.7487814426422119,
0.5562344193458557,
-0.21656742691993713,
0.53551816940... |
func (s *DataStore) GetBackupVolume(name string) (*longhorn.BackupVolume, error) {
resultRO, err := s.GetBackupVolumeRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.4132179915904999,
0.07450158149003983,
0.5632004141807556,
0.5063158869743347,
-0.48403623700141907,
-0.719849705696106,
-0.22932016849517822,
-0.2853989005088806,
-0.1916920393705368,
-0.028653204441070557,
-1.0093107223510742,
0.5544267892837524,
-0.14039507508277893,
0.37328311800956... |
func (s *DataStore) UpdateBackupVolume(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error) {
obj, err := s.lhClient.LonghornV1beta2().BackupVolumes(s.namespace).Update(context.TODO(), backupVolume, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backupVolume.Name, obj, func... | [
-0.7943814396858215,
-1.1824647188186646,
0.37471267580986023,
-0.27473270893096924,
-0.07574992626905441,
-0.3814511001110077,
-0.3603212535381317,
-0.3374658524990082,
-0.2930028438568115,
0.37032416462898254,
-0.9810537099838257,
0.6340385675430298,
-0.853081464767456,
-0.00462054507806... |
func (s *DataStore) UpdateBackupVolumeStatus(backupVolume *longhorn.BackupVolume) (*longhorn.BackupVolume, error) {
obj, err := s.lhClient.LonghornV1beta2().BackupVolumes(s.namespace).UpdateStatus(context.TODO(), backupVolume, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backupVolume.Nam... | [
-0.5680471658706665,
-1.4831020832061768,
0.3155944347381592,
-0.1649353951215744,
-0.11542872339487076,
-0.0780949741601944,
-0.7083284258842468,
0.010604833252727985,
0.08400292694568634,
0.537630021572113,
-0.9493668079376221,
0.44846537709236145,
-0.4921643137931824,
-0.280638128519058... |
func (s *DataStore) DeleteBackupVolume(backupVolumeName string) error {
return s.lhClient.LonghornV1beta2().BackupVolumes(s.namespace).Delete(context.TODO(), backupVolumeName, metav1.DeleteOptions{})
} | [
-0.19763173162937164,
-0.7498778104782104,
0.49709567427635193,
0.2755471467971802,
0.32805097103118896,
-0.14271987974643707,
-0.14945411682128906,
0.4759022295475006,
-0.3591025471687317,
-0.4180438816547394,
-0.9692845940589905,
0.6986513733863831,
-0.4343200922012329,
0.307475298643112... |
func (s *DataStore) RemoveFinalizerForBackupVolume(backupVolume *longhorn.BackupVolume) error {
if !util.FinalizerExists(longhornFinalizerKey, backupVolume) {
// finalizer already removed
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, backupVolume); err != nil {
return err
}
_, err := s.lh... | [
-0.4671749770641327,
-0.7302100658416748,
0.38462719321250916,
-0.1449616551399231,
-0.3752109408378601,
-1.139581561088562,
-0.3101719617843628,
0.6323487758636475,
-0.22442777454853058,
-0.1542433649301529,
-0.5355791449546814,
-0.8919500112533569,
-0.7386988401412964,
0.527755081653595,... |
func (s *DataStore) CreateBackup(backup *longhorn.Backup, backupVolumeName string) (*longhorn.Backup, error) {
if err := labelBackupVolume(backupVolumeName, backup); err != nil {
return nil, err
}
ret, err := s.lhClient.LonghornV1beta2().Backups(s.namespace).Create(context.TODO(), backup, metav1.CreateOptions{})
... | [
-0.18338537216186523,
0.05493037775158882,
0.7974461913108826,
0.4401380717754364,
0.4019262492656708,
0.0999726876616478,
-0.332610547542572,
-0.8290207386016846,
0.44618624448776245,
0.03148883208632469,
-0.30999672412872314,
-0.18008841574192047,
-0.6708152294158936,
-0.362911581993103,... |
func (s *DataStore) ListBackupsWithBackupVolumeName(backupVolumeName string) (map[string]*longhorn.Backup, error) {
selector, err := getBackupVolumeSelector(backupVolumeName)
if err != nil {
return nil, err
}
list, err := s.bLister.Backups(s.namespace).List(selector)
if err != nil {
return nil, err
}
itemM... | [
0.2651958167552948,
-1.1581406593322754,
0.8076353073120117,
-0.13574852049350739,
-0.24866966903209686,
-0.5442200899124146,
-0.41951170563697815,
-0.25021252036094666,
0.5859789848327637,
0.5757985711097717,
-1.0723347663879395,
-0.2718518078327179,
-0.3252295255661011,
0.338389277458190... |
func (s *DataStore) ListBackupsRO() ([]*longhorn.Backup, error) {
return s.bLister.Backups(s.namespace).List(labels.Everything())
} | [
0.3195831775665283,
0.026757659390568733,
0.37004920840263367,
0.2555569112300873,
0.17009297013282776,
-0.8131128549575806,
-1.0532350540161133,
-0.03901287540793419,
0.2108689397573471,
-0.6481325030326843,
-0.9666039943695068,
-0.3406193256378174,
0.15304265916347504,
0.6186557412147522... |
func (s *DataStore) ListBackups() (map[string]*longhorn.Backup, error) {
list, err := s.bLister.Backups(s.namespace).List(labels.Everything())
if err != nil {
return nil, err
}
itemMap := map[string]*longhorn.Backup{}
for _, itemRO := range list {
itemMap[itemRO.Name] = itemRO.DeepCopy()
}
return itemMap, n... | [
-0.3633161783218384,
-0.738103449344635,
0.5852504968643188,
-0.260926216840744,
-0.3277646601200104,
-0.19336894154548645,
-0.8309078812599182,
-0.2960270047187805,
0.4149904251098633,
0.3608466386795044,
-1.132398247718811,
-0.39761242270469666,
0.46760907769203186,
0.38641053438186646,
... |
func (s *DataStore) GetBackupRO(backupName string) (*longhorn.Backup, error) {
return s.bLister.Backups(s.namespace).Get(backupName)
} | [
0.17259803414344788,
0.8461816310882568,
0.4469105303287506,
0.4986259639263153,
-0.3149624466896057,
-1.0095537900924683,
-0.8489197492599487,
-0.055883798748254776,
-0.08588220179080963,
-0.12372054159641266,
-1.1079521179199219,
-0.33341822028160095,
-0.5964123606681824,
-0.099756188690... |
func (s *DataStore) GetBackup(name string) (*longhorn.Backup, error) {
resultRO, err := s.GetBackupRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.4907391369342804,
0.5679469108581543,
0.6214677095413208,
1.2142348289489746,
-0.4878649413585663,
-0.6214103102684021,
-0.0526905320584774,
-0.306084543466568,
0.4885846972465515,
0.3899743854999542,
-0.7030742764472961,
0.190636545419693,
-0.1767919510602951,
-0.42497825622558594,
0... |
func (s *DataStore) UpdateBackup(backup *longhorn.Backup) (*longhorn.Backup, error) {
obj, err := s.lhClient.LonghornV1beta2().Backups(s.namespace).Update(context.TODO(), backup, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backup.Name, obj, func(name string) (runtime.Object, error) {
... | [
-0.8115568161010742,
-0.43368950486183167,
0.7591534852981567,
0.7102892994880676,
-0.41843539476394653,
-0.36193621158599854,
-0.15643572807312012,
-0.5671775937080383,
0.7189834713935852,
0.0889761820435524,
-0.6944847106933594,
0.12545712292194366,
-0.49102577567100525,
-0.3519844114780... |
func (s *DataStore) UpdateBackupStatus(backup *longhorn.Backup) (*longhorn.Backup, error) {
obj, err := s.lhClient.LonghornV1beta2().Backups(s.namespace).UpdateStatus(context.TODO(), backup, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(backup.Name, obj, func(name string) (runtime.Object,... | [
-0.49770382046699524,
-0.6941879987716675,
0.40420109033584595,
0.29973065853118896,
-0.8058620095252991,
-0.26280054450035095,
-0.498281866312027,
-0.19726409018039703,
0.5378299355506897,
0.1863989681005478,
-1.2183148860931396,
-0.1528940051794052,
-0.29719460010528564,
0.12441719323396... |
func (s *DataStore) DeleteBackup(backupName string) error {
return s.lhClient.LonghornV1beta2().Backups(s.namespace).Delete(context.TODO(), backupName, metav1.DeleteOptions{})
} | [
-0.10481933504343033,
0.4035128355026245,
0.43238162994384766,
0.11370674520730972,
0.14699329435825348,
-0.3743271827697754,
-0.1388874650001526,
-0.03440399467945099,
0.3808440864086151,
-0.4838408827781677,
-0.5215041637420654,
0.0077924299985170364,
-0.09350911527872086,
0.253335863351... |
func (s *DataStore) DeleteAllBackupsForBackupVolume(backupVolumeName string) error {
return s.lhClient.LonghornV1beta2().Backups(s.namespace).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", types.LonghornLabelBackupVolume, backupVolumeName)})
} | [
0.1186319887638092,
-1.1003990173339844,
0.7103193998336792,
0.35551759600639343,
0.3955429494380951,
-0.06250518560409546,
-0.4262849688529968,
0.04232314974069595,
-0.4546709358692169,
-0.20204664766788483,
-0.43874073028564453,
-0.042368561029434204,
-0.4204135239124298,
0.7777245044708... |
func (s *DataStore) RemoveFinalizerForBackup(backup *longhorn.Backup) error {
if !util.FinalizerExists(longhornFinalizerKey, backup) {
// finalizer already removed
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, backup); err != nil {
return err
}
_, err := s.lhClient.LonghornV1beta2().Backu... | [
-0.6571231484413147,
-0.13537323474884033,
0.4308090806007385,
0.28774186968803406,
-0.8534956574440002,
-1.2603373527526855,
-0.04362010955810547,
0.46458500623703003,
0.36407041549682617,
-0.1364603042602539,
-0.7162903547286987,
-1.4728060960769653,
-0.4927659332752228,
0.18611620366573... |
func (s *DataStore) CreateSnapshot(snapshot *longhorn.Snapshot) (*longhorn.Snapshot, error) {
ret, err := s.lhClient.LonghornV1beta2().Snapshots(s.namespace).Create(context.TODO(), snapshot, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
}
obj, err := verifyCre... | [
-0.39324912428855896,
0.41363972425460815,
0.47815659642219543,
0.3160732686519623,
-0.08367721736431122,
0.31576573848724365,
-0.10000114887952805,
-0.6375942826271057,
0.6124044060707092,
-0.8452677726745605,
-0.8179504871368408,
-0.6385560035705566,
0.0849834531545639,
0.474135220050811... |
func (s *DataStore) GetSnapshotRO(snapName string) (*longhorn.Snapshot, error) {
return s.snapLister.Snapshots(s.namespace).Get(snapName)
} | [
-0.16956759989261627,
0.7623593211174011,
0.34771403670310974,
0.3973780870437622,
-1.407653570175171,
-0.6491320133209229,
-0.9047338366508484,
0.2797846794128418,
0.03526385501027107,
-0.9297730922698975,
-1.3526965379714966,
-0.2939522862434387,
0.4081767797470093,
0.29546815156936646,
... |
func (s *DataStore) GetSnapshot(name string) (*longhorn.Snapshot, error) {
resultRO, err := s.GetSnapshotRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.419950008392334,
0.534798800945282,
0.536551296710968,
0.7212793231010437,
-0.9959211945533752,
-0.6720849871635437,
-0.25411248207092285,
-0.05245968699455261,
0.3921597898006439,
-0.3672049641609192,
-0.9731342792510986,
0.019649850204586983,
0.26592347025871277,
-0.0998711884021759,
... |
func (s *DataStore) UpdateSnapshotStatus(snap *longhorn.Snapshot) (*longhorn.Snapshot, error) {
obj, err := s.lhClient.LonghornV1beta2().Snapshots(s.namespace).UpdateStatus(context.TODO(), snap, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(snap.Name, obj, func(name string) (runtime.Objec... | [
-1.171018362045288,
-0.88083815574646,
0.2802290618419647,
-0.17542122304439545,
-1.499221920967102,
0.05190492048859596,
-0.6284888982772827,
0.03939775004982948,
1.1259605884552002,
-0.05438578873872757,
-1.2810481786727905,
0.11981572955846786,
0.5555934309959412,
0.21936993300914764,
... |
func (s *DataStore) RemoveFinalizerForSnapshot(snapshot *longhorn.Snapshot) error {
if !util.FinalizerExists(longhornFinalizerKey, snapshot) {
// finalizer already removed
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, snapshot); err != nil {
return err
}
_, err := s.lhClient.LonghornV1bet... | [
-0.6637542247772217,
-0.06422745436429977,
0.18013179302215576,
-0.2376403957605362,
-1.5075263977050781,
-1.0649056434631348,
-0.24893109500408173,
0.5530511140823364,
0.4513747990131378,
-0.6993341445922852,
-0.9517722129821777,
-1.4407472610473633,
0.03158224746584892,
0.650745809078216... |
func (s *DataStore) DeleteSnapshot(snapshotName string) error {
return s.lhClient.LonghornV1beta2().Snapshots(s.namespace).Delete(context.TODO(), snapshotName, metav1.DeleteOptions{})
} | [
-0.0902843251824379,
0.21056804060935974,
0.1941971778869629,
0.19140371680259705,
-0.7145920991897583,
-0.31946709752082825,
-0.3118956685066223,
0.003268573200330138,
0.7376625537872314,
-1.2464797496795654,
-1.0083521604537964,
-0.299480676651001,
0.7527719140052795,
0.32882609963417053... |
func (s *DataStore) CreateRecurringJob(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error) {
ret, err := s.lhClient.LonghornV1beta2().RecurringJobs(s.namespace).Create(context.TODO(), recurringJob, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
}... | [
0.30297785997390747,
0.3409951627254486,
0.27608370780944824,
0.5597400665283203,
0.006965675391256809,
0.4792541265487671,
-0.38767844438552856,
-0.2734120786190033,
-0.23315827548503876,
-0.412728488445282,
-0.9549540877342224,
0.17061057686805725,
-0.770999550819397,
0.16903401911258698... |
func (s *DataStore) ListRecurringJobs() (map[string]*longhorn.RecurringJob, error) {
itemMap := map[string]*longhorn.RecurringJob{}
list, err := s.rjLister.RecurringJobs(s.namespace).List(labels.Everything())
if err != nil {
return nil, err
}
for _, itemRO := range list {
// Cannot use cached object from lis... | [
-0.645822286605835,
-0.5765002369880676,
0.2740345299243927,
-0.2574169337749481,
-0.5943886637687683,
-0.42480868101119995,
-0.5453740954399109,
0.37640541791915894,
-0.14421893656253815,
-0.08002330362796783,
-1.3335933685302734,
0.21589650213718414,
-0.2550397515296936,
0.17235493659973... |
func (s *DataStore) ListRecurringJobsRO() (map[string]*longhorn.RecurringJob, error) {
itemMap := map[string]*longhorn.RecurringJob{}
list, err := s.rjLister.RecurringJobs(s.namespace).List(labels.Everything())
if err != nil {
return nil, err
}
for _, itemRO := range list {
// Cannot use cached object from l... | [
-0.45065176486968994,
-0.47086888551712036,
0.36049073934555054,
-0.3053319752216339,
-0.44160154461860657,
-0.49737703800201416,
-0.5221966505050659,
0.45247533917427063,
-0.5430689454078674,
-0.3236258625984192,
-1.2185301780700684,
0.2449827343225479,
-0.12283800542354584,
0.36212027072... |
func (s *DataStore) GetRecurringJob(name string) (*longhorn.RecurringJob, error) {
result, err := s.getRecurringJob(name)
if err != nil {
return nil, err
}
return result.DeepCopy(), nil
} | [
0.2069694548845291,
0.6759926676750183,
0.0685843676328659,
0.6604921817779541,
-0.6328350901603699,
-0.35369741916656494,
-0.44533032178878784,
0.19810156524181366,
-0.3906959593296051,
-0.1996319442987442,
-0.5717567205429077,
0.5499653220176697,
-0.6529524922370911,
-0.7002894878387451,... |
func (s *DataStore) UpdateRecurringJob(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error) {
obj, err := s.lhClient.LonghornV1beta2().RecurringJobs(s.namespace).Update(context.TODO(), recurringJob, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(recurringJob.Name, obj, func... | [
-0.03286587819457054,
-0.597937822341919,
-0.16468091309070587,
0.0855121836066246,
-0.43146905303001404,
0.41056060791015625,
-0.4775622487068176,
-0.26580286026000977,
-0.11930534988641739,
0.03505183011293411,
-0.8641087412834167,
0.4751204550266266,
-1.1624246835708618,
-0.215079262852... |
func (s *DataStore) UpdateRecurringJobStatus(recurringJob *longhorn.RecurringJob) (*longhorn.RecurringJob, error) {
obj, err := s.lhClient.LonghornV1beta2().RecurringJobs(s.namespace).UpdateStatus(context.TODO(), recurringJob, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(recurringJob.Nam... | [
-0.15079985558986664,
-0.8139340281486511,
-0.05353271961212158,
-0.364559531211853,
-0.6955764293670654,
0.49850162863731384,
-0.6415603160858154,
0.1296161562204361,
-0.20744620263576508,
0.16978570818901062,
-1.3708611726760864,
0.5469690561294556,
-0.7044023275375366,
-0.00490737380459... |
func (s *DataStore) DeleteRecurringJob(name string) error {
propagation := metav1.DeletePropagationForeground
return s.lhClient.LonghornV1beta2().RecurringJobs(s.namespace).Delete(
context.TODO(),
name,
metav1.DeleteOptions{PropagationPolicy: &propagation},
)
} | [
0.624395489692688,
0.08429133892059326,
0.23706376552581787,
0.14436683058738708,
-0.46694961190223694,
0.04006735607981682,
0.05318249762058258,
0.8989262580871582,
-0.6257867217063904,
-0.48217469453811646,
-0.8768832087516785,
0.6943954825401306,
-0.6231367588043213,
0.20165933668613434... |
func (s *DataStore) CreateOrphan(orphan *longhorn.Orphan) (*longhorn.Orphan, error) {
ret, err := s.lhClient.LonghornV1beta2().Orphans(s.namespace).Create(context.TODO(), orphan, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
}
obj, err := verifyCreation(ret.Na... | [
-0.333969384431839,
-0.3331776261329651,
0.6646925806999207,
-0.38093313574790955,
0.024812001734972,
0.5438634753227234,
-0.0688718929886818,
-0.7685214281082153,
0.2805359959602356,
-0.4176087975502014,
-1.0452568531036377,
0.6327101588249207,
0.10466040670871735,
0.5307117104530334,
1... |
func (s *DataStore) GetOrphanRO(orphanName string) (*longhorn.Orphan, error) {
return s.oLister.Orphans(s.namespace).Get(orphanName)
} | [
0.39457786083221436,
0.2511305510997772,
0.33793047070503235,
-0.44459500908851624,
-0.7558274269104004,
-0.14333046972751617,
-0.49685046076774597,
-0.09918209910392761,
0.09637836366891861,
-0.39726701378822327,
-0.8998744487762451,
1.1872406005859375,
0.5260198712348938,
-0.247583284974... |
func (s *DataStore) GetOrphan(name string) (*longhorn.Orphan, error) {
resultRO, err := s.GetOrphanRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.7102534174919128,
-0.1096964031457901,
0.614527702331543,
0.33522915840148926,
-0.7019035220146179,
-0.21691621840000153,
-0.15607041120529175,
0.07309094816446304,
0.4562609791755676,
-0.33586394786834717,
-1.1483713388442993,
1.3221677541732788,
0.27068719267845154,
-0.231100767850875... |
func (s *DataStore) UpdateOrphan(orphan *longhorn.Orphan) (*longhorn.Orphan, error) {
obj, err := s.lhClient.LonghornV1beta2().Orphans(s.namespace).Update(context.TODO(), orphan, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(orphan.Name, obj, func(name string) (runtime.Object, error) {
... | [
-0.7233699560165405,
-1.3074902296066284,
0.6515406370162964,
-0.6914221048355103,
-0.5815891623497009,
0.21626415848731995,
-0.20362506806850433,
-0.3243156373500824,
0.5146722197532654,
-0.17994990944862366,
-0.9174477458000183,
1.2084813117980957,
-0.26293087005615234,
-0.10756605118513... |
func (s *DataStore) UpdateOrphanStatus(orphan *longhorn.Orphan) (*longhorn.Orphan, error) {
obj, err := s.lhClient.LonghornV1beta2().Orphans(s.namespace).UpdateStatus(context.TODO(), orphan, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(orphan.Name, obj, func(name string) (runtime.Object,... | [
-0.17793864011764526,
-1.1711419820785522,
0.4932047426700592,
-0.7752927541732788,
-1.0235888957977295,
0.6422991752624512,
-0.5616286993026733,
-0.5929327607154846,
0.5005990266799927,
0.283435195684433,
-0.9472390413284302,
1.1151281595230103,
0.09523820132017136,
0.1048886701464653,
... |
func (s *DataStore) RemoveFinalizerForOrphan(orphan *longhorn.Orphan) error {
if !util.FinalizerExists(longhornFinalizerKey, orphan) {
// finalizer already removed
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, orphan); err != nil {
return err
}
_, err := s.lhClient.LonghornV1beta2().Orpha... | [
-0.7023736834526062,
-0.720984935760498,
0.3386632204055786,
-0.5756348967552185,
-0.6428216099739075,
-0.7830162048339844,
-0.12865523993968964,
0.17929565906524658,
-0.02010994590818882,
-0.23302386701107025,
-0.6921681761741638,
-0.5255485773086548,
-0.003209797665476799,
0.511068999767... |
func (s *DataStore) ListOrphans() (map[string]*longhorn.Orphan, error) {
return s.listOrphans(labels.Everything())
} | [
-0.670122504234314,
-0.5945783853530884,
0.24532464146614075,
-1.171747088432312,
-0.3533496856689453,
0.1718725860118866,
-0.7175454497337341,
-0.09255966544151306,
1.0237219333648682,
-0.15998445451259613,
-0.6745223999023438,
0.6608859896659851,
1.013585090637207,
0.6861344575881958,
... |
func (s *DataStore) ListOrphansByNode(name string) (map[string]*longhorn.Orphan, error) {
nodeSelector, err := getNodeSelector(name)
if err != nil {
return nil, err
}
return s.listOrphans(nodeSelector)
} | [
-0.6219606995582581,
-0.0380842499434948,
0.3332383334636688,
-1.1761332750320435,
-0.45771291851997375,
-0.5078182816505432,
0.1591678261756897,
-0.3787316679954529,
0.3315250277519226,
0.6415184736251831,
-0.5665620565414429,
0.49848538637161255,
0.6560840606689453,
0.8405246138572693,
... |
func (s *DataStore) ListOrphansRO() ([]*longhorn.Orphan, error) {
return s.oLister.Orphans(s.namespace).List(labels.Everything())
} | [
-0.043801069259643555,
-0.5678962469100952,
0.25480300188064575,
-0.9335574507713318,
-0.13303789496421814,
0.09947044402360916,
-0.9383580684661865,
-0.11533022671937943,
0.4532262980937958,
0.032312072813510895,
-0.6301934719085693,
0.6701156497001648,
0.2717188000679016,
0.9605815410614... |
func (s *DataStore) ListOrphansByNodeRO(name string) ([]*longhorn.Orphan, error) {
nodeSelector, err := getNodeSelector(name)
if err != nil {
return nil, err
}
return s.oLister.Orphans(s.namespace).List(nodeSelector)
} | [
-0.09688625484704971,
-0.47821035981178284,
0.27027153968811035,
-0.8815950751304626,
-0.12929463386535645,
-0.1551111936569214,
0.19561830163002014,
-0.9202154278755188,
0.38240814208984375,
0.557494044303894,
-0.8532330989837646,
1.0841096639633179,
0.36932480335235596,
0.657803356647491... |
func (s *DataStore) DeleteOrphan(orphanName string) error {
return s.lhClient.LonghornV1beta2().Orphans(s.namespace).Delete(context.TODO(), orphanName, metav1.DeleteOptions{})
} | [
-0.3788093626499176,
-0.7302820086479187,
0.573482096195221,
-0.8394694924354553,
-0.32985517382621765,
0.2605041563510895,
-0.07299072295427322,
0.17280623316764832,
0.2850530445575714,
-0.7464085817337036,
-0.9333594441413879,
0.8560603857040405,
0.5456914901733398,
0.4817141592502594,
... |
func GetOwnerReferencesForSupportBundle(supportBundle *longhorn.SupportBundle) []metav1.OwnerReference {
return []metav1.OwnerReference{
{
APIVersion: longhorn.SchemeGroupVersion.String(),
Kind: types.LonghornKindSupportBundle,
Name: supportBundle.Name,
UID: supportBundle.UID,
},
}
... | [
-0.34795767068862915,
-0.4578004777431488,
0.3959762752056122,
0.5296883583068848,
-0.04663992300629616,
0.258354514837265,
-0.14386944472789764,
0.06822910904884338,
-0.2800798714160919,
-0.033426493406295776,
-0.3172343075275421,
0.34644657373428345,
-0.45271793007850647,
0.2036536484956... |
func (s *DataStore) GetSupportBundleRO(name string) (*longhorn.SupportBundle, error) {
return s.supportBundleLister.SupportBundles(s.namespace).Get(name)
} | [
0.8095709681510925,
0.3109051585197449,
0.29316309094429016,
0.06099173054099083,
-1.1804834604263306,
-0.09376110881567001,
-0.6266733407974243,
1.0162919759750366,
-0.618121325969696,
0.07663267105817795,
-1.3486158847808838,
-0.03582702949643135,
-0.2730453312397003,
0.7980817556381226,... |
func (s *DataStore) GetSupportBundle(name string) (*longhorn.SupportBundle, error) {
resultRO, err := s.GetSupportBundleRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.16871225833892822,
0.38854604959487915,
0.5903430581092834,
0.31201106309890747,
-1.024405837059021,
-0.4282284677028656,
-0.3729512095451355,
0.42937004566192627,
-0.1405314952135086,
0.31519076228141785,
-1.1079999208450317,
0.022502325475215912,
-0.8347144722938538,
0.487975984811782... |
func (s *DataStore) CreateLHVolumeAttachment(va *longhorn.VolumeAttachment) (*longhorn.VolumeAttachment, error) {
ret, err := s.lhClient.LonghornV1beta2().VolumeAttachments(s.namespace).Create(context.TODO(), va, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
}
... | [
0.3148788809776306,
-0.9747484922409058,
0.37812232971191406,
0.2609914541244507,
0.0013462220085784793,
0.49244198203086853,
-0.47566381096839905,
-0.7006499171257019,
0.392865926027298,
-0.5801384449005127,
-0.3810332119464874,
0.40329092741012573,
-0.5969918966293335,
0.8142122030258179... |
func (s *DataStore) GetLHVolumeAttachmentRO(name string) (*longhorn.VolumeAttachment, error) {
return s.lhVALister.VolumeAttachments(s.namespace).Get(name)
} | [
0.41738924384117126,
-1.2673022747039795,
0.3980076014995575,
0.262420654296875,
-0.9971611499786377,
0.10233593732118607,
-0.9750115275382996,
-0.3029091954231262,
-0.11885575205087662,
-0.4226788580417633,
-0.14307749271392822,
0.7998549938201904,
-0.3796486258506775,
0.44298291206359863... |
func (s *DataStore) GetLHVolumeAttachment(name string) (*longhorn.VolumeAttachment, error) {
resultRO, err := s.GetLHVolumeAttachmentRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
0.03922376409173012,
-1.2782702445983887,
0.5817869901657104,
0.5551907420158386,
-1.0008184909820557,
0.15190528333187103,
-0.7220030426979065,
-0.43769869208335876,
0.4650329053401947,
-0.16478362679481506,
-0.22076378762722015,
0.9584311246871948,
-0.6622007489204407,
0.4111416935920715... |
func (s *DataStore) ListSupportBundles() (map[string]*longhorn.SupportBundle, error) {
itemMap := make(map[string]*longhorn.SupportBundle)
list, err := s.ListSupportBundlesRO()
if err != nil {
return nil, err
}
for _, itemRO := range list {
// Cannot use cached object from lister
itemMap[itemRO.Name] = ite... | [
-0.2022501826286316,
-0.3972408175468445,
0.45021069049835205,
0.001562202349305153,
-0.792534351348877,
-0.32751548290252686,
-0.17826929688453674,
0.7522211074829102,
0.22583815455436707,
0.23198743164539337,
-1.1753255128860474,
-0.2829349935054779,
-0.12651114165782928,
0.7207604050636... |
func (s *DataStore) ListSupportBundlesRO() ([]*longhorn.SupportBundle, error) {
return s.supportBundleLister.SupportBundles(s.namespace).List(labels.Everything())
} | [
0.32189857959747314,
0.11084890365600586,
0.4402244985103607,
0.2693782448768616,
-0.20155738294124603,
-0.14604072272777557,
-0.6858113408088684,
0.9295223355293274,
0.0006017503328621387,
-0.10229917615652084,
-0.6828528046607971,
0.17494389414787292,
-0.4276902675628662,
0.3522967100143... |
func (s *DataStore) RemoveFinalizerForSupportBundle(supportBundle *longhorn.SupportBundle) (err error) {
if !util.FinalizerExists(longhornFinalizerKey, supportBundle) {
// finalizer already removed
return nil
}
if err = util.RemoveFinalizer(longhornFinalizerKey, supportBundle); err != nil {
return err
}
su... | [
-0.2944928705692291,
-0.23548640310764313,
0.32409346103668213,
0.1228114515542984,
-1.1375800371170044,
-0.511221706867218,
-0.07717928290367126,
1.176856279373169,
-0.31696343421936035,
0.2279595583677292,
-0.5969489216804504,
-1.239258050918579,
-0.47618886828422546,
0.6670454740524292,... |
func (s *DataStore) UpdateSupportBundleStatus(supportBundle *longhorn.SupportBundle) (*longhorn.SupportBundle, error) {
obj, err := s.lhClient.LonghornV1beta2().SupportBundles(s.namespace).UpdateStatus(context.TODO(), supportBundle, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(supportBun... | [
-0.11797273904085159,
-0.8915418386459351,
0.23223184049129486,
-0.16937518119812012,
-0.7930001020431519,
0.41978809237480164,
-0.2184079885482788,
0.5810357928276062,
-0.01409912109375,
0.5531662106513977,
-0.9757290482521057,
0.06903855502605438,
-0.4226498305797577,
0.02644818462431430... |
func (s *DataStore) CreateSupportBundle(supportBundle *longhorn.SupportBundle) (*longhorn.SupportBundle, error) {
ret, err := s.lhClient.LonghornV1beta2().SupportBundles(s.namespace).Create(context.TODO(), supportBundle, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, ... | [
0.17666040360927582,
-0.02904672361910343,
0.4193654954433441,
0.012696696445345879,
-0.12480772286653519,
0.4219834506511688,
-0.022807437926530838,
-0.16385570168495178,
0.13559697568416595,
0.046513572335243225,
-0.9722930788993835,
-0.25102391839027405,
-1.0269428491592407,
0.632498562... |
func (s *DataStore) DeleteSupportBundle(name string) error {
return s.lhClient.LonghornV1beta2().SupportBundles(s.namespace).Delete(context.TODO(), name, metav1.DeleteOptions{})
} | [
0.2898603081703186,
-0.08251597732305527,
0.6150560975074768,
-0.31012779474258423,
-0.7011898159980774,
0.2081490457057953,
-0.12246961891651154,
0.8129924535751343,
-0.5482385158538818,
0.7817172408103943,
-1.0139621496200562,
-0.2864155173301697,
-0.3963654041290283,
0.7792098522186279,... |
func (s *DataStore) CreateSystemBackup(systemBackup *longhorn.SystemBackup) (*longhorn.SystemBackup, error) {
ret, err := s.lhClient.LonghornV1beta2().SystemBackups(s.namespace).Create(context.TODO(), systemBackup, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret, nil
... | [
-0.2804403603076935,
0.20613126456737518,
0.5105756521224976,
0.9561010599136353,
0.14976489543914795,
0.21858222782611847,
-0.176596000790596,
-0.6667658686637878,
0.5376278162002563,
-0.15247374773025513,
-1.475196123123169,
-0.39072924852371216,
-0.8789509534835815,
0.8494594693183899,
... |
func (s *DataStore) DeleteSystemBackup(name string) error {
return s.lhClient.LonghornV1beta2().SystemBackups(s.namespace).Delete(context.TODO(), name, metav1.DeleteOptions{})
} | [
0.5424160361289978,
0.0673905462026596,
0.5521290898323059,
0.7776444554328918,
-0.11708850413560867,
-0.2392139434814453,
0.09973607212305069,
0.14331457018852234,
-0.045339103788137436,
0.23483557999134064,
-1.3319449424743652,
-0.22389771044254303,
-0.7948408722877502,
0.972982287406921... |
func (s *DataStore) RemoveFinalizerForSystemBackup(obj *longhorn.SystemBackup) error {
if !util.FinalizerExists(longhornFinalizerKey, obj) {
// finalizer already removed
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, obj); err != nil {
return err
}
_, err := s.lhClient.LonghornV1beta2().... | [
-0.17685769498348236,
-0.23426499962806702,
0.3999669551849365,
0.44125044345855713,
-0.9572130441665649,
-0.863044798374176,
0.10046949237585068,
0.47549328207969666,
-0.08040083199739456,
0.29736021161079407,
-1.1940840482711792,
-1.2530310153961182,
-0.8768523931503296,
0.63953739404678... |
func (s *DataStore) UpdateSystemBackup(systemBackup *longhorn.SystemBackup) (*longhorn.SystemBackup, error) {
obj, err := s.lhClient.LonghornV1beta2().SystemBackups(s.namespace).Update(context.TODO(), systemBackup, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(systemBackup.Name, obj, func... | [
-0.6377663016319275,
-0.7546849250793457,
0.4146513044834137,
1.0017967224121094,
-0.7216045260429382,
-0.4211905598640442,
-0.2616924047470093,
-0.4053892195224762,
0.32433587312698364,
0.36643368005752563,
-1.7063004970550537,
0.01303018070757389,
-1.2133089303970337,
0.48773327469825745... |
func (s *DataStore) UpdateSystemBackupStatus(systemBackup *longhorn.SystemBackup) (*longhorn.SystemBackup, error) {
obj, err := s.lhClient.LonghornV1beta2().SystemBackups(s.namespace).UpdateStatus(context.TODO(), systemBackup, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(systemBackup.Na... | [
-0.33224406838417053,
-0.8872017860412598,
0.3480975329875946,
0.7119991779327393,
-0.834122359752655,
-0.2743166387081146,
-0.3173375427722931,
0.05675747990608215,
0.4740348756313324,
0.5561471581459045,
-1.7616071701049805,
-0.1324124038219452,
-0.7699365615844727,
0.605426549911499,
... |
func (s *DataStore) GetSystemBackup(name string) (*longhorn.SystemBackup, error) {
resultRO, err := s.GetSystemBackupRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.2925259470939636,
0.5701485872268677,
0.6427175402641296,
1.3878117799758911,
-0.8395138382911682,
-0.5949801206588745,
-0.12805986404418945,
-0.3025512397289276,
0.31053730845451355,
0.31265610456466675,
-1.5624431371688843,
0.15780693292617798,
-0.7374621033668518,
0.5653541088104248,... |
func (s *DataStore) GetSystemBackupRO(name string) (*longhorn.SystemBackup, error) {
return s.sbLister.SystemBackups(s.namespace).Get(name)
} | [
0.5028293132781982,
0.6068102121353149,
0.4538763165473938,
1.180383324623108,
-0.7844979166984558,
-0.7739850878715515,
-0.5657171010971069,
0.05232832580804825,
-0.28469574451446533,
0.51460200548172,
-1.682891607284546,
-0.13946902751922607,
-0.773829460144043,
0.638702392578125,
0.22... |
func (s *DataStore) ListSystemBackups() (map[string]*longhorn.SystemBackup, error) {
list, err := s.ListSystemBackupsRO()
if err != nil {
return nil, err
}
itemMap := map[string]*longhorn.SystemBackup{}
for _, itemRO := range list {
itemMap[itemRO.Name] = itemRO.DeepCopy()
}
return itemMap, nil
} | [
-0.2781447768211365,
-0.4957697093486786,
0.5812937617301941,
0.6034753918647766,
-0.7464014887809753,
-0.4898901581764221,
-0.3946797847747803,
0.03474969416856766,
0.25930577516555786,
0.4808279275894165,
-1.7197645902633667,
-0.23426219820976257,
-0.03634341061115265,
0.9583949446678162... |
func (s *DataStore) ListSystemBackupsRO() ([]*longhorn.SystemBackup, error) {
return s.sbLister.SystemBackups(s.namespace).List(labels.Everything())
} | [
0.2309589833021164,
-0.037203796207904816,
0.461535781621933,
1.2392160892486572,
-0.021004391834139824,
-0.7889209389686584,
-0.7450692653656006,
0.22218185663223267,
0.1242823451757431,
-0.0959041640162468,
-1.2622050046920776,
-0.055299099534749985,
-0.48440003395080566,
1.0281013250350... |
func (s *DataStore) CreateSystemRestore(systemRestore *longhorn.SystemRestore) (*longhorn.SystemRestore, error) {
ret, err := s.lhClient.LonghornV1beta2().SystemRestores(s.namespace).Create(context.TODO(), systemRestore, metav1.CreateOptions{})
if err != nil {
return nil, err
}
if SkipListerCheck {
return ret,... | [
-0.19365136325359344,
0.13452722132205963,
0.4891667068004608,
0.24013425409793854,
-0.04117094725370407,
-0.16483528912067413,
-0.7640072107315063,
-0.48463451862335205,
0.6039188504219055,
-0.6426385045051575,
-1.079322338104248,
-0.11953754723072052,
-0.9971839189529419,
0.2493281662464... |
func (s *DataStore) DeleteSystemRestore(name string) error {
propagation := metav1.DeletePropagationForeground
return s.lhClient.LonghornV1beta2().SystemRestores(s.namespace).Delete(
context.TODO(),
name,
metav1.DeleteOptions{PropagationPolicy: &propagation},
)
} | [
0.08797203749418259,
-0.12904123961925507,
0.45156219601631165,
-0.45328155159950256,
-0.9665449261665344,
-0.6408538222312927,
-0.25221529603004456,
0.5344968438148499,
0.6487743854522705,
-0.7532628774642944,
-0.3903115391731262,
0.5299776196479797,
-0.44282352924346924,
0.10978706181049... |
func GetOwnerReferencesForSystemRestore(systemRestore *longhorn.SystemRestore) []metav1.OwnerReference {
controller := true
blockOwnerDeletion := true
return []metav1.OwnerReference{
{
APIVersion: longhorn.SchemeGroupVersion.String(),
Kind: types.LonghornKindSystemRestore,
Name: ... | [
0.19382870197296143,
-0.7428299784660339,
0.6028884649276733,
0.4600033164024353,
-0.21330586075782776,
-0.22832274436950684,
-0.37703320384025574,
-0.27628183364868164,
0.6539109945297241,
-0.609606146812439,
-0.16135826706886292,
0.9079515337944031,
-0.5575288534164429,
-0.20978222787380... |
func (s *DataStore) RemoveSystemRestoreLabel(systemRestore *longhorn.SystemRestore) (*longhorn.SystemRestore, error) {
key := types.GetSystemRestoreLabelKey()
if _, exist := systemRestore.Labels[key]; !exist {
return systemRestore, nil
}
delete(systemRestore.Labels, key)
_, err := s.lhClient.LonghornV1beta2().S... | [
-0.34830328822135925,
-0.7865917682647705,
0.2754670977592468,
-0.6796388030052185,
-0.9739781022071838,
0.27919238805770874,
-0.3894483745098114,
0.11217983812093735,
0.26211419701576233,
0.7059983611106873,
-0.32930344343185425,
-0.1613803654909134,
-1.6460928916931152,
-0.68614178895950... |
func (s *DataStore) UpdateSystemRestore(systemRestore *longhorn.SystemRestore) (*longhorn.SystemRestore, error) {
err := labelLonghornSystemRestoreInProgress(systemRestore)
if err != nil {
return nil, err
}
obj, err := s.lhClient.LonghornV1beta2().SystemRestores(s.namespace).Update(context.TODO(), systemRestore,... | [
-0.6061045527458191,
-0.9497562646865845,
0.341203898191452,
-0.29139190912246704,
-0.9755023717880249,
-0.314708411693573,
-0.731643795967102,
-0.1875312626361847,
0.561631441116333,
-0.2405136674642563,
-0.8266831040382385,
-0.06376508623361588,
-1.4757647514343262,
-0.22523359954357147,... |
func (s *DataStore) UpdateSystemRestoreStatus(systemRestore *longhorn.SystemRestore) (*longhorn.SystemRestore, error) {
obj, err := s.lhClient.LonghornV1beta2().SystemRestores(s.namespace).UpdateStatus(context.TODO(), systemRestore, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(systemRes... | [
-0.10708749294281006,
-0.7818336486816406,
0.14732442796230316,
-0.476025253534317,
-0.5451124310493469,
-0.1155674010515213,
-0.7671856880187988,
0.1342269480228424,
0.6942191123962402,
-0.12951506674289703,
-1.245604157447815,
0.5383523106575012,
-0.6694211959838867,
-0.10418207198381424... |
func (s *DataStore) GetSystemRestore(name string) (*longhorn.SystemRestore, error) {
resultRO, err := s.GetSystemRestoreRO(name)
if err != nil {
return nil, err
}
// Cannot use cached object from lister
return resultRO.DeepCopy(), nil
} | [
-0.45761099457740784,
0.5513266324996948,
0.5111382603645325,
0.5458565354347229,
-1.037628412246704,
-1.1397886276245117,
-0.6223405599594116,
0.21143274009227753,
0.5617712736129761,
-0.5920229554176331,
-0.8355886936187744,
0.02849200740456581,
-1.113834023475647,
-0.21360743045806885,
... |
func (s *DataStore) GetSystemRestoreRO(name string) (*longhorn.SystemRestore, error) {
return s.srLister.SystemRestores(s.namespace).Get(name)
} | [
0.3765668272972107,
0.36517333984375,
0.28073224425315857,
0.1479676067829132,
-0.8067283034324646,
-0.7328199744224548,
-0.6352605223655701,
0.27814269065856934,
0.3821958899497986,
-0.49262604117393494,
-1.293720006942749,
0.5236428380012512,
-0.8635014891624451,
0.18125960230827332,
-... |
func (s *DataStore) GetSystemRestoreInProgress(name string) (systemRestore *longhorn.SystemRestore, err error) {
systemRestores, err := s.ListSystemRestoresInProgress()
if err != nil {
return nil, err
}
systemRestoreCount := len(systemRestores)
if systemRestoreCount == 0 {
return nil, errors.Errorf("cannot fi... | [
-0.009230900555849075,
-0.6378005743026733,
0.6332160234451294,
-0.1613653302192688,
-1.0483007431030273,
-0.5262238383293152,
-0.5271901488304138,
-0.27717143297195435,
0.30356279015541077,
-0.40210723876953125,
0.2600056529045105,
0.13023774325847626,
-1.7332773208618164,
0.0238557662814... |
func (s *DataStore) ListSystemRestoresInProgress() (map[string]*longhorn.SystemRestore, error) {
selector, err := s.getSystemRestoreInProgressSelector()
if err != nil {
return nil, err
}
return s.listSystemRestores(selector)
} | [
0.16058239340782166,
-0.24184180796146393,
0.312610000371933,
-0.0001976433995878324,
-0.4897717237472534,
-0.5495429039001465,
-0.2382088601589203,
0.22515970468521118,
0.08585745841264725,
-0.3163556158542633,
-0.2735428214073181,
-0.06979116797447205,
-0.6825342774391174,
0.553476154804... |
func (s *DataStore) ListSystemRestores() (map[string]*longhorn.SystemRestore, error) {
return s.listSystemRestores(labels.Everything())
} | [
0.04879534989595413,
0.011729152873158455,
0.2755044996738434,
-0.17511525750160217,
-0.0907704085111618,
-0.7712377309799194,
-0.9092711210250854,
0.5884613990783691,
0.5275558233261108,
-0.3916545808315277,
-0.8723465800285339,
0.4188835024833679,
-0.19207966327667236,
0.4736455380916595... |
func (s *DataStore) UpdateLHVolumeAttachment(va *longhorn.VolumeAttachment) (*longhorn.VolumeAttachment, error) {
obj, err := s.lhClient.LonghornV1beta2().VolumeAttachments(s.namespace).Update(context.TODO(), va, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(va.Name, obj, func(name string... | [
0.1171794980764389,
-2.2644975185394287,
0.34969067573547363,
0.004662054590880871,
-0.7636263966560364,
0.32882827520370483,
-0.6574625968933105,
-0.36618542671203613,
0.029468530789017677,
0.1946471631526947,
-0.3723633289337158,
0.7892587780952454,
-0.6474446654319763,
0.292249709367752... |
func (s *DataStore) UpdateLHVolumeAttachmentStatus(va *longhorn.VolumeAttachment) (*longhorn.VolumeAttachment, error) {
obj, err := s.lhClient.LonghornV1beta2().VolumeAttachments(s.namespace).UpdateStatus(context.TODO(), va, metav1.UpdateOptions{})
if err != nil {
return nil, err
}
verifyUpdate(va.Name, obj, func... | [
0.017660468816757202,
-2.3333704471588135,
0.2504938542842865,
-0.1530546396970749,
-0.77542644739151,
0.5949757099151611,
-0.9332223534584045,
0.11531661450862885,
0.32691630721092224,
0.22564555704593658,
-0.6502147316932678,
0.9318236708641052,
-0.18199260532855988,
0.3917320668697357,
... |
func (s *DataStore) ListLonghornVolumeAttachmentByVolumeRO(name string) ([]*longhorn.VolumeAttachment, error) {
volumeSelector, err := getVolumeSelector(name)
if err != nil {
return nil, err
}
return s.lhVALister.VolumeAttachments(s.namespace).List(volumeSelector)
} | [
0.10211107134819031,
-2.0346872806549072,
0.5092211961746216,
0.4234815537929535,
-0.5546990036964417,
-0.09775442630052567,
-0.5031125545501709,
-0.26007142663002014,
0.3407785892486572,
0.4417160153388977,
-0.37995895743370056,
0.5836416482925415,
-0.2896217107772827,
1.1495951414108276,... |
func (s *DataStore) RemoveFinalizerForLHVolumeAttachment(va *longhorn.VolumeAttachment) error {
if !util.FinalizerExists(longhornFinalizerKey, va) {
return nil
}
if err := util.RemoveFinalizer(longhornFinalizerKey, va); err != nil {
return err
}
_, err := s.lhClient.LonghornV1beta2().VolumeAttachments(s.namesp... | [
-0.21455293893814087,
-1.590712308883667,
0.33161866664886475,
-0.25379571318626404,
-1.2229597568511963,
-0.23147065937519073,
0.012632403522729874,
0.4669594466686249,
0.12807391583919525,
-0.1465381532907486,
-0.31246012449264526,
-0.7059398293495178,
-0.46090835332870483,
0.64069074392... |
func (s *DataStore) DeleteLHVolumeAttachment(vaName string) error {
return s.lhClient.LonghornV1beta2().VolumeAttachments(s.namespace).Delete(context.TODO(), vaName, metav1.DeleteOptions{})
} | [
0.1219722181558609,
-1.849398136138916,
0.42766374349594116,
0.025602126494050026,
-0.7598060369491577,
0.5087631940841675,
-0.3187393546104431,
-0.008693919517099857,
0.47187545895576477,
-0.17372505366802216,
-0.37187397480010986,
0.7213686108589172,
-0.5468398332595825,
0.36875745654106... |
func RegisterRoutes(r weave.Registry, auth x.Authenticator) {
blogs := NewBlogBucket()
r.Handle(PathCreateBlogMsg, CreateBlogMsgHandler{auth, blogs})
r.Handle(PathCreatePostMsg, CreatePostMsgHandler{auth, NewPostBucket(), blogs})
r.Handle(PathRenameBlogMsg, RenameBlogMsgHandler{auth, blogs})
r.Handle(PathChangeBlo... | [
-0.13718503713607788,
0.9448588490486145,
0.35961467027664185,
0.34019893407821655,
1.2705087661743164,
0.492431640625,
0.7034794092178345,
-0.283751517534256,
-0.3530353009700775,
-0.5089100003242493,
-0.7536507844924927,
0.40477150678634644,
-0.26106515526771545,
1.2591391801834106,
0.... |
func RegisterQuery(qr weave.QueryRouter) {
NewBlogBucket().Register("blogs", qr)
NewPostBucket().Register("posts", qr)
NewProfileBucket().Register("profiles", qr)
} | [
0.03505776822566986,
0.5759552717208862,
0.3554917871952057,
0.21817485988140106,
1.5704853534698486,
0.430626779794693,
-0.6836196184158325,
-0.37657806277275085,
0.2550150156021118,
-0.5917127132415771,
-0.8025807738304138,
0.2837417423725128,
0.4501945674419403,
0.9461086392402649,
-1... |
func (h CreateBlogMsgHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*CreateBlogMsg, error) {
// Retrieve tx main signer in this context
sender := x.MainSigner(ctx, h.auth)
if sender == nil {
return nil, errors.Wrapf(errors.ErrUnauthorized, unauthorisedBlogAuthorFmt, nil)
}
msg, err := tx.G... | [
0.033483464270830154,
0.7584331631660461,
0.5074582099914551,
0.2471495270729065,
0.5150887966156006,
0.39217236638069153,
0.36788541078567505,
-0.37868839502334595,
-0.6626327037811279,
0.6001299619674683,
0.10168101638555527,
0.3590996265411377,
-1.192872166633606,
0.8347958326339722,
... |
func (h CreatePostMsgHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*CreatePostMsg, *Blog, error) {
msg, err := tx.GetMsg()
if err != nil {
return nil, nil, err
}
createPostMsg, ok := msg.(*CreatePostMsg)
if !ok {
return nil, nil, errors.WithType(errors.ErrMsg, msg)
}
// Check the aut... | [
0.4900335669517517,
0.43248915672302246,
0.598731279373169,
0.38426312804222107,
0.074439138174057,
0.6631245613098145,
-0.05211061239242554,
-0.12832318246364594,
-0.6575208306312561,
0.39221659302711487,
0.15950915217399597,
-0.0009310716995969415,
-0.9850953221321106,
1.0967392921447754... |
func (h RenameBlogMsgHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*RenameBlogMsg, *Blog, error) {
// Retrieve tx main signer in this context
sender := x.MainSigner(ctx, h.auth)
if sender == nil {
return nil, nil, errors.Wrapf(errors.ErrUnauthorized, unauthorisedBlogAuthorFmt, nil)
}
msg,... | [
0.07973258942365646,
-0.11218622326850891,
0.7048903703689575,
0.6470114588737488,
-0.41092023253440857,
0.12235557287931442,
0.347808837890625,
0.36749935150146484,
-0.5792681574821472,
0.7444553375244141,
0.08060041069984436,
0.6205392479896545,
-1.0623273849487305,
1.0241531133651733,
... |
func (h ChangeBlogAuthorsMsgHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*ChangeBlogAuthorsMsg, *Blog, error) {
// Retrieve tx main signer in this context
sender := x.MainSigner(ctx, h.auth)
if sender == nil {
return nil, nil, errors.Wrapf(errors.ErrUnauthorized, unauthorisedBlogAuthorFmt, ... | [
-0.09676995873451233,
0.06255354732275009,
0.8092231750488281,
0.3641369342803955,
0.21307414770126343,
-0.39281582832336426,
0.6628974080085754,
0.38200169801712036,
-0.2779392600059509,
1.1006054878234863,
0.08084475249052048,
0.7383864521980286,
-1.0271763801574707,
1.0227888822555542,
... |
func (h SetProfileMsgHandler) validate(ctx weave.Context, db weave.KVStore, tx weave.Tx) (*SetProfileMsg, *Profile, error) {
// Retrieve tx main signer in this context
sender := x.MainSigner(ctx, h.auth)
if sender == nil {
return nil, nil, errors.Wrapf(errors.ErrUnauthorized, unauthorisedBlogAuthorFmt, nil)
}
m... | [
0.07708562910556793,
0.2819836139678955,
0.7948285937309265,
0.19878336787223816,
0.275292307138443,
-0.10780171304941177,
0.011010644026100636,
-0.6262065768241882,
0.08104763925075531,
1.064461588859558,
-0.15539920330047607,
-0.14243707060813904,
-0.8679279088973999,
0.8109448552131653,... |
func NewCertificate(ctx *pulumi.Context,
name string, args *CertificateArgs, opts ...pulumi.ResourceOption) (*Certificate, error) {
if args == nil {
args = &CertificateArgs{}
}
var resource Certificate
err := ctx.RegisterResource("digitalocean:index/certificate:Certificate", name, args, &resource, opts...)
if e... | [
-0.35503143072128296,
1.1436697244644165,
0.38932305574417114,
0.35884034633636475,
0.5616033673286438,
-0.045813076198101044,
-0.24752900004386902,
-0.016268786042928696,
0.21946866810321808,
0.06328047066926956,
-0.005092911422252655,
-0.1623796820640564,
-0.4512983560562134,
-0.15373021... |
func GetCertificate(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CertificateState, opts ...pulumi.ResourceOption) (*Certificate, error) {
var resource Certificate
err := ctx.ReadResource("digitalocean:index/certificate:Certificate", name, id, state, &resource, opts...)
if err != nil {
return nil, e... | [
0.3017553985118866,
0.7187116146087646,
0.25658896565437317,
0.28958240151405334,
0.47293856739997864,
-0.5076730847358704,
-0.4814682602882385,
-0.31917333602905273,
1.0327194929122925,
-0.25564607977867126,
0.5110096335411072,
0.5503981113433838,
-0.089253731071949,
-1.2184823751449585,
... |
func (rb RankBased[T]) Select(pop *evolve.Population[T], natural bool, n int, rng *rand.Rand) []T {
ranked := evolve.NewPopulation[T](pop.Len())
for i := range pop.Candidates {
ranked.Candidates[i] = pop.Candidates[i]
// use candidate 1-based index
ranked.Fitness[i] = rb.Map(i+1, pop.Len())
}
return rb.Select... | [
-1.1638096570968628,
-0.4938613772392273,
0.36826708912849426,
0.7114002704620361,
0.13048864901065826,
-0.18305587768554688,
-0.0696023628115654,
-0.37695103883743286,
-0.2564384341239929,
1.1300863027572632,
-0.3765302002429962,
0.4817327558994293,
0.170865997672081,
-0.08221609145402908... |
func MapRankToScore(rank, size int) float64 { return float64(size - rank) } | [
-0.3117371201515198,
-0.9874594211578369,
0.538219153881073,
-0.5775062441825867,
-0.18292948603630066,
-0.39525315165519714,
-0.7350775599479675,
-0.5927853584289551,
0.415999174118042,
0.7750242948532104,
0.48708876967430115,
0.20387452840805054,
-0.41482049226760864,
-0.4145052433013916... |
func Rank[T any]() RankBased[T] {
return RankBased[T]{
Selector: SUS[T]{},
Map: MapRankToScore,
}
} | [
-0.4196256697177887,
-0.33214908838272095,
0.29327934980392456,
0.49638596177101135,
0.08207517117261887,
-0.21957819163799286,
-0.005857828073203564,
-0.06143834814429283,
0.6384236812591553,
-0.38563698530197144,
-0.3493257462978363,
0.8451999425888062,
1.0928646326065063,
-0.00906316097... |
func GetCollection(name string) *mgo.Collection {
return DB.C(name)
} | [
0.6986228227615356,
0.2918560802936554,
0.34841984510421753,
-0.07071266323328018,
-0.06667322665452957,
-0.3733518123626709,
-0.2761248052120209,
-0.6920341849327087,
-0.7656484246253967,
0.1691460907459259,
-0.7421628832817078,
0.23242947459220886,
0.39484646916389465,
0.5661622285842896... |
func importMessage(msg ledgertools.Message) (*importer.Parsed, error) {
if !strings.Contains(msg.From, fromMatcher) {
return nil, nil
}
if !strings.HasPrefix(msg.Subject, subjectPrefix) {
return nil, nil
}
date, err := time.Parse(time.RFC1123Z, msg.Date)
if err != nil {
return nil, errors.Wrapf(err, "Parsi... | [
0.9934518337249756,
-0.5341768264770508,
0.9549406170845032,
-0.09919890761375427,
0.026071442291140556,
-0.6082159876823425,
0.2285698801279068,
-0.1326024979352951,
0.3247027099132538,
-0.36381784081459045,
0.45048826932907104,
-0.23248134553432465,
-0.697870135307312,
0.4793576896190643... |
func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error {
for _, nft := range collection.NFTs {
if err := k.MintNFT(ctx,
collection.Denom,
nft.GetID(),
nft.GetTokenURI(),
nft.GetOwner(),
); err != nil {
return err
}
}
return nil
} | [
-0.7933087944984436,
-0.057266976684331894,
0.3063209056854248,
0.6930400133132935,
0.6904287338256836,
0.0047871386632323265,
-0.581944465637207,
-0.5547544360160828,
-0.4525364339351654,
0.10052730143070221,
-0.026384012773633003,
0.2748441696166992,
0.16236571967601776,
1.76117682456970... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.