From e19c7f239c4ad8b7170ecd896fe10f1e6e8ecaba Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 2 Jan 2023 16:36:57 +0100 Subject: [PATCH 01/20] WIP Remove burst counts and raw capacity --- pkg/apis/hobbyfarm.io/v1/types.go | 14 -- .../hobbyfarm.io/v1/zz_generated.deepcopy.go | 28 --- .../dynamicbindcontroller.go | 62 ++--- .../scheduledeventcontroller.go | 212 ++++++------------ .../tfpcontroller/tfpcontroller.go | 4 - pkg/environmentserver/environmentserver.go | 52 ----- pkg/util/labels.go | 1 + pkg/util/util.go | 155 ++----------- pkg/vmtemplateserver/vmtemplateserver.go | 25 --- 9 files changed, 112 insertions(+), 441 deletions(-) diff --git a/pkg/apis/hobbyfarm.io/v1/types.go b/pkg/apis/hobbyfarm.io/v1/types.go index 59cf04a9..fc934c81 100644 --- a/pkg/apis/hobbyfarm.io/v1/types.go +++ b/pkg/apis/hobbyfarm.io/v1/types.go @@ -124,7 +124,6 @@ type VirtualMachineTemplateSpec struct { Id string `json:"id"` Name string `json:"name"` // 2x4, etc. Image string `json:"image"` // ubuntu-18.04 - Resources CMSStruct `json:"resources"` ConfigMap map[string]string `json:"config_map"` } @@ -157,25 +156,13 @@ type EnvironmentSpec struct { EnvironmentSpecifics map[string]string `json:"environment_specifics"` IPTranslationMap map[string]string `json:"ip_translation_map"` WsEndpoint string `json:"ws_endpoint"` - CapacityMode CapacityMode `json:"capacity_mode"` - BurstCapable bool `json:"burst_capable"` CountCapacity map[string]int `json:"count_capacity"` - Capacity CMSStruct `json:"capacity"` - BurstCountCapacity map[string]int `json:"burst_count_capacity"` - BurstCapacity CMSStruct `json:"burst_capacity"` } type EnvironmentStatus struct { - Used CMSStruct `json:"used"` AvailableCount map[string]int `json:"available_count"` } -type CMSStruct struct { - CPU int `json:"cpu"` // cores - Memory int `json:"memory"` // in MB - Storage int `json:"storage"` // in GB -} - // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -485,7 +472,6 @@ type DynamicBindConfigurationSpec struct { RestrictedBind bool `json:"restricted_bind"` RestrictedBindValue string `json:"restricted_bind_value"` BurstCountCapacity map[string]int `json:"burst_count_capacity"` - BurstCapacity CMSStruct `json:"burst_capacity"` } // +genclient diff --git a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go index eac19047..3af49feb 100644 --- a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go @@ -111,22 +111,6 @@ func (in *AccessCodeSpec) DeepCopy() *AccessCodeSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CMSStruct) DeepCopyInto(out *CMSStruct) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CMSStruct. -func (in *CMSStruct) DeepCopy() *CMSStruct { - if in == nil { - return nil - } - out := new(CMSStruct) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Course) DeepCopyInto(out *Course) { *out = *in @@ -296,7 +280,6 @@ func (in *DynamicBindConfigurationSpec) DeepCopyInto(out *DynamicBindConfigurati (*out)[key] = val } } - out.BurstCapacity = in.BurstCapacity return } @@ -512,15 +495,6 @@ func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) { (*out)[key] = val } } - out.Capacity = in.Capacity - if in.BurstCountCapacity != nil { - in, out := &in.BurstCountCapacity, &out.BurstCountCapacity - *out = make(map[string]int, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.BurstCapacity = in.BurstCapacity return } @@ -537,7 +511,6 @@ func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvironmentStatus) DeepCopyInto(out *EnvironmentStatus) { *out = *in - out.Used = in.Used if in.AvailableCount != nil { in, out := &in.AvailableCount, &out.AvailableCount *out = make(map[string]int, len(*in)) @@ -1472,7 +1445,6 @@ func (in *VirtualMachineTemplateList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineTemplateSpec) DeepCopyInto(out *VirtualMachineTemplateSpec) { *out = *in - out.Resources = in.Resources if in.ConfigMap != nil { in, out := &in.ConfigMap, &out.ConfigMap *out = make(map[string]string, len(*in)) diff --git a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go b/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go index 040b2d1c..62f8969c 100644 --- a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go +++ b/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go @@ -186,11 +186,6 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * return err } - if !environment.Spec.BurstCapable { - glog.V(8).Infof("Environment %s is not burst capable. Ignoring.", environment.Name) - continue - } - suitable := true needed := make(map[string]int) @@ -205,52 +200,35 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * } } - if environment.Spec.CapacityMode == hfv1.CapacityModeRaw { + for vmTemplate, vmsNeeded := range needed { + // first, let's see if the environment itself has capacity currentVMs, err := d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,environment=%s", environment.Name), + LabelSelector: fmt.Sprintf("dynamic=true,%s=%s,template=%s", util.EnvironmentLabel, environment.Name, vmTemplate), }) if err != nil { glog.V(4).Infof("error retrieving current vm list, assuming environment empty") } + availableVMCount := environment.Spec.CountCapacity[vmTemplate] - len(currentVMs.Items) - availableCapacity := util.AvailableRawCapacity(d.hfClientSet, environment.Spec.BurstCapacity, currentVMs.Items, d.ctx) - availableVMCount := util.MaxVMCountsRaw(d.hfClientSet, needed, *availableCapacity, d.ctx) - - if availableVMCount <= 0 { + if availableVMCount < vmsNeeded { + // this environment does not suit us. move on. suitable = false + break } - } else { - for vmTemplate, vmsNeeded := range needed { - // first, let's see if the environment itself has capacity - - currentVMs, err := d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,environment=%s,template=%s", environment.Name, vmTemplate), - }) - if err != nil { - glog.V(4).Infof("error retrieving current vm list, assuming environment empty") - } - availableVMCount := environment.Spec.BurstCountCapacity[vmTemplate] - len(currentVMs.Items) - - if availableVMCount < vmsNeeded { - // this environment does not suit us. move on. - suitable = false - break - } - - currentVMs, err = d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,dynamicbindconfig=%s,environment=%s,template=%s", dynamicBindConfiguration.Spec.Id, environment.Name, vmTemplate), - }) - if err != nil { - glog.V(4).Infof("error retrieving current vm list, assuming environment empty") - } - availableVMCount = dynamicBindConfiguration.Spec.BurstCountCapacity[vmTemplate] - len(currentVMs.Items) + // next check if the dynamicbindconfiguration has capacity + currentVMs, err = d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ + LabelSelector: fmt.Sprintf("dynamic=true,dynamicbindconfig=%s,template=%s", dynamicBindConfiguration.Spec.Id, vmTemplate), + }) + if err != nil { + glog.V(4).Infof("error retrieving current vm list, assuming no machines") + } + availableVMCount = dynamicBindConfiguration.Spec.BurstCountCapacity[vmTemplate] - len(currentVMs.Items) - if availableVMCount < vmsNeeded { - // this DBC has no more provisioning capacity - suitable = false - break - } + if availableVMCount < vmsNeeded { + // this DBC has no more provisioning capacity + suitable = false + break } } @@ -283,7 +261,7 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * "dynamicbindrequest": dynamicBindRequest.Name, "dynamicbindconfiguration": chosenDynamicBindConfiguration.Spec.Id, "template": vmX.Template, - "environment": chosenDynamicBindConfiguration.Spec.Environment, + util.EnvironmentLabel: chosenDynamicBindConfiguration.Spec.Environment, "bound": "true", "ready": "false", util.ScheduledEventLabel: chosenDynamicBindConfiguration.ObjectMeta.Labels[util.ScheduledEventLabel], diff --git a/pkg/controllers/scheduledevent/scheduledeventcontroller.go b/pkg/controllers/scheduledevent/scheduledeventcontroller.go index a9c62200..46d7e254 100644 --- a/pkg/controllers/scheduledevent/scheduledeventcontroller.go +++ b/pkg/controllers/scheduledevent/scheduledeventcontroller.go @@ -271,126 +271,82 @@ func (s ScheduledEventController) provisionScheduledEvent(templates *hfv1.Virtua glog.Errorf("error retreiving environment %s", err.Error()) return err } - // get all vmsets that are being provisioned into this environment (label selector) - vmsList, err := s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).List(s.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("environment=%s", envName), - }) - if err != nil { - glog.Errorf("error while retrieving virtual machine sets %v", err) - } - - _, usedCapacity := calculateUsedCapacity(env, vmsList, templates) - - if env.Spec.CapacityMode == hfv1.CapacityModeRaw { - neededCapacity := calculateNeededCapacity(env, vmtMap, templates) - if env.Spec.Capacity.CPU < (usedCapacity.CPU + neededCapacity.CPU) { - glog.Errorf("we are overprovisioning this environment %s by CPU, capacity is %d but need %d", envName, env.Spec.Capacity.CPU, usedCapacity.CPU+neededCapacity.CPU) - } - if env.Spec.Capacity.Memory < (usedCapacity.Memory + neededCapacity.Memory) { - glog.Errorf("we are overprovisioning this environment %s by Memory, capacity is %d but need %d", envName, env.Spec.Capacity.Memory, usedCapacity.Memory+neededCapacity.Memory) - } - if env.Spec.Capacity.Storage < (usedCapacity.Storage + neededCapacity.Storage) { - glog.Errorf("we are overprovisioning this environment %s by Storage, capacity is %d but need %d", envName, env.Spec.Capacity.Storage, usedCapacity.Storage+neededCapacity.Storage) - } - } else if env.Spec.CapacityMode == hfv1.CapacityModeCount { - // TODO: actually check for capacity usage - - // vmtMap has all the neededCapacity for this environment. - // used capacity is calculated by calculateUsedCapacity() - } - - // create the virtualmachinesets now - - for templateName, count := range vmtMap { - if count > 0 && !se.Spec.OnDemand { // only setup vmsets if >0 VMs are requested, and they aren't ondemand - - //1. Find existing VMset that match this SE and the current environment - existingVMSets, err := s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).List(s.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s=%s,environment=%s,virtualmachinetemplate.hobbyfarm.io/%s=true", util.ScheduledEventLabel, se.Name, envName, templateName), - }) - - if err != nil || len(existingVMSets.Items) == 0 { // create new vmset if no existing one was found - vmsRand := fmt.Sprintf("%s-%08x", baseNameScheduledPrefix, rand.Uint32()) - vmsName := strings.Join([]string{"se", se.Name, "vms", vmsRand}, "-") - vmSets = append(vmSets, vmsName) - vms := &hfv1.VirtualMachineSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: vmsName, - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "hobbyfarm.io/v1", - Kind: "ScheduledEvent", - Name: se.Name, - UID: se.UID, + // TODO: actually check for capacity usage + + // create virtualmachinesets if not on demand + if !se.Spec.OnDemand { + for templateName, count := range vmtMap { + if count > 0 { // only setup vmsets if >0 VMs are requested, and they aren't ondemand + //1. Find existing VMset that match this SE and the current environment + existingVMSets, err := s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).List(s.ctx, metav1.ListOptions{ + LabelSelector: fmt.Sprintf("%s=%s,%s=%s,virtualmachinetemplate.hobbyfarm.io/%s=true", util.ScheduledEventLabel, se.Name, util.EnvironmentLabel, envName, templateName), + }) + + if err != nil || len(existingVMSets.Items) == 0 { // create new vmset if no existing one was found + vmsRand := fmt.Sprintf("%s-%08x", baseNameScheduledPrefix, rand.Uint32()) + vmsName := strings.Join([]string{"se", se.Name, "vms", vmsRand}, "-") + vmSets = append(vmSets, vmsName) + vms := &hfv1.VirtualMachineSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: vmsName, + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "hobbyfarm.io/v1", + Kind: "ScheduledEvent", + Name: se.Name, + UID: se.UID, + }, + }, + Labels: map[string]string{ + util.EnvironmentLabel: env.Name, + util.ScheduledEventLabel: se.Name, + fmt.Sprintf("virtualmachinetemplate.hobbyfarm.io/%s", templateName): "true", }, }, - Labels: map[string]string{ - "environment": env.Name, - util.ScheduledEventLabel: se.Name, - fmt.Sprintf("virtualmachinetemplate.hobbyfarm.io/%s", templateName): "true", + Spec: hfv1.VirtualMachineSetSpec{ + Count: count, + Environment: envName, + VMTemplate: templateName, + BaseName: vmsRand, }, - }, - Spec: hfv1.VirtualMachineSetSpec{ - Count: count, - Environment: envName, - VMTemplate: templateName, - BaseName: vmsRand, - }, - } - if se.Spec.RestrictedBind { - vms.Spec.RestrictedBind = true - vms.Spec.RestrictedBindValue = se.Spec.RestrictedBindValue - } else { - vms.Spec.RestrictedBind = false - } - _, err = s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).Create(s.ctx, vms, metav1.CreateOptions{}) - if err != nil { - glog.Error(err) - return err - } - } else { // update existing vmset - existingVMSet := existingVMSets.Items[0] - vmSets = append(vmSets, existingVMSet.Name) - - existingVMSet.Labels["environment"] = env.Name - existingVMSet.Spec.Count = count - if se.Spec.RestrictedBind { - existingVMSet.Spec.RestrictedBind = true - - } else { - existingVMSet.Spec.RestrictedBind = false - } - _, err = s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).Update(s.ctx, &existingVMSet, metav1.UpdateOptions{}) - if err != nil { - glog.Errorf("error updating vmset config %s", err.Error()) - return err + } + if se.Spec.RestrictedBind { + vms.Spec.RestrictedBind = true + vms.Spec.RestrictedBindValue = se.Spec.RestrictedBindValue + } else { + vms.Spec.RestrictedBind = false + } + _, err = s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).Create(s.ctx, vms, metav1.CreateOptions{}) + if err != nil { + glog.Error(err) + return err + } + } else { // update existing vmset + // Todo support multiple VM Sets + existingVMSet := existingVMSets.Items[0] + vmSets = append(vmSets, existingVMSet.Name) + + existingVMSet.Labels[util.EnvironmentLabel] = env.Name + existingVMSet.Spec.Count = count + if se.Spec.RestrictedBind { + existingVMSet.Spec.RestrictedBind = true + } else { + existingVMSet.Spec.RestrictedBind = false + } + _, err = s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).Update(s.ctx, &existingVMSet, metav1.UpdateOptions{}) + if err != nil { + glog.Errorf("error updating vmset config %s", err.Error()) + return err + } } } - } } - + // create the dynamic bind configurations dbcRand := fmt.Sprintf("%s-%08x", baseNameDynamicPrefix, rand.Uint32()) dbcName := strings.Join([]string{"se", se.Name, "dbc", dbcRand}, "-") - emptyCap := hfv1.CMSStruct{ - CPU: 0, - Memory: 0, - Storage: 0, - } - - bcc := map[string]int{} - - for t, c := range vmtMap { - if se.Spec.OnDemand { - bcc[t] = c - } else if c == 0 || c == -1 { - bcc[t] = 10 - } else { - bcc[t] = c - } - } dbc := &hfv1.DynamicBindConfiguration{ ObjectMeta: metav1.ObjectMeta{ @@ -404,7 +360,7 @@ func (s ScheduledEventController) provisionScheduledEvent(templates *hfv1.Virtua }, }, Labels: map[string]string{ - "environment": env.Name, + util.EnvironmentLabel: env.Name, util.ScheduledEventLabel: se.Name, }, }, @@ -412,8 +368,7 @@ func (s ScheduledEventController) provisionScheduledEvent(templates *hfv1.Virtua Id: dbcName, Environment: envName, BaseName: dbcRand, - BurstCountCapacity: bcc, - BurstCapacity: emptyCap, + BurstCountCapacity: vmtMap, }, } @@ -460,7 +415,6 @@ func (s ScheduledEventController) provisionScheduledEvent(templates *hfv1.Virtua } return nil - } func (s ScheduledEventController) createAccessCode(se *hfv1.ScheduledEvent) error { @@ -634,38 +588,14 @@ func (s *ScheduledEventController) reconcileScheduledEvent(seName string) error return nil } -func calculateUsedCapacity(env *hfv1.Environment, vmsList *hfv1.VirtualMachineSetList, templates *hfv1.VirtualMachineTemplateList) (map[string]int, hfv1.CMSStruct) { - used := hfv1.CMSStruct{} +func calculateUsedCapacity(env *hfv1.Environment, vmsList *hfv1.VirtualMachineSetList, templates *hfv1.VirtualMachineTemplateList) (map[string]int) { usedCount := map[string]int{} for _, vms := range vmsList.Items { for _, t := range templates.Items { if t.Name == vms.Spec.VMTemplate { - if env.Spec.CapacityMode == hfv1.CapacityModeRaw { - used.CPU = used.CPU + (t.Spec.Resources.CPU * vms.Spec.Count) - used.Memory = used.Memory + (t.Spec.Resources.Memory * vms.Spec.Count) - used.Storage = used.Storage + (t.Spec.Resources.Storage * vms.Spec.Count) - } else if env.Spec.CapacityMode == hfv1.CapacityModeCount { - usedCount[t.Name] = usedCount[t.Name] + vms.Spec.Count - } + usedCount[t.Name] = usedCount[t.Name] + vms.Spec.Count } } } - - return usedCount, used -} - -func calculateNeededCapacity(env *hfv1.Environment, vmtMap map[string]int, templates *hfv1.VirtualMachineTemplateList) hfv1.CMSStruct { - needed := hfv1.CMSStruct{} - - for templateName, count := range vmtMap { - for _, t := range templates.Items { - if t.Name == templateName { - needed.CPU = needed.CPU + (t.Spec.Resources.CPU * count) - needed.Memory = needed.Memory + (t.Spec.Resources.Memory * count) - needed.Storage = needed.Storage + (t.Spec.Resources.Storage * count) - } - } - } - - return needed -} + return usedCount +} \ No newline at end of file diff --git a/pkg/controllers/tfpcontroller/tfpcontroller.go b/pkg/controllers/tfpcontroller/tfpcontroller.go index 2f32b4ce..04febab0 100644 --- a/pkg/controllers/tfpcontroller/tfpcontroller.go +++ b/pkg/controllers/tfpcontroller/tfpcontroller.go @@ -6,7 +6,6 @@ import ( "fmt" "math/rand" "reflect" - "strconv" "strings" "time" @@ -229,9 +228,6 @@ func (t *TerraformProvisionerController) handleProvision(vm *hfv1.VirtualMachine config["name"] = vm.Name config["public_key"] = pubKey - config["cpu"] = strconv.Itoa(vmt.Spec.Resources.CPU) - config["memory"] = strconv.Itoa(vmt.Spec.Resources.Memory) - config["disk"] = strconv.Itoa(vmt.Spec.Resources.Storage) image, exists := config["image"] if !exists || image == "" { diff --git a/pkg/environmentserver/environmentserver.go b/pkg/environmentserver/environmentserver.go index 9feb4a32..7bba765d 100644 --- a/pkg/environmentserver/environmentserver.go +++ b/pkg/environmentserver/environmentserver.go @@ -16,7 +16,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" "net/http" - "strconv" "strings" "time" ) @@ -195,27 +194,6 @@ func (e EnvironmentServer) CreateFunc(w http.ResponseWriter, r *http.Request) { return } - capacityMode := r.PostFormValue("capacity_mode") - if capacityMode == "" { - util.ReturnHTTPMessage(w, r, 400, "badrequest", "no capacity_mode passed in") - return - } else if capacityMode != "raw" && capacityMode != "count" { - // invalid capacity mode passed in - util.ReturnHTTPMessage(w, r, 400, "badrequest", "invalid capacity_mode passed in") - return - } - - burstCapable := r.PostFormValue("burst_capable") - if burstCapable == "" { - util.ReturnHTTPMessage(w, r, 400, "badrequest", "no burst_capable passed in") - return - } - burstCapableBool, err := strconv.ParseBool(burstCapable) - if err != nil { - util.ReturnHTTPMessage(w, r, 400, "badrequest", "invalid burst_capacity passed in") - return - } - templateMappingUnmarshaled := map[string]map[string]string{} // lol err = json.Unmarshal([]byte(templateMapping), &templateMappingUnmarshaled) if err != nil { @@ -254,14 +232,6 @@ func (e EnvironmentServer) CreateFunc(w http.ResponseWriter, r *http.Request) { environment.Spec.IPTranslationMap = ipTranslationUnmarshaled environment.Spec.WsEndpoint = wsEndpoint - if capacityMode == "raw" { - environment.Spec.CapacityMode = hfv1.CapacityModeRaw - } else { - // not validating "count" here as we already validated input var above - environment.Spec.CapacityMode = hfv1.CapacityModeCount - } - - environment.Spec.BurstCapable = burstCapableBool environment, err = e.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Create(e.ctx, environment, metav1.CreateOptions{}) if err != nil { @@ -304,8 +274,6 @@ func (e EnvironmentServer) UpdateFunc(w http.ResponseWriter, r *http.Request) { environmentSpecifics := r.PostFormValue("environment_specifics") ipTranslationMap := r.PostFormValue("ip_translation_map") wsEndpoint := r.PostFormValue("ws_endpoint") - capacityMode := r.PostFormValue("capacity_mode") - burstCapable := r.PostFormValue("burst_capable") if len(displayName) > 0 { environment.Spec.DisplayName = displayName @@ -356,26 +324,6 @@ func (e EnvironmentServer) UpdateFunc(w http.ResponseWriter, r *http.Request) { environment.Spec.WsEndpoint = wsEndpoint } - if len(capacityMode) > 0 { - if capacityMode == "raw" { - environment.Spec.CapacityMode = hfv1.CapacityModeRaw - } else if capacityMode == "count" { - environment.Spec.CapacityMode = hfv1.CapacityModeCount - } else { - util.ReturnHTTPMessage(w, r, 400, "badrequest", "invalid capacity_mode passed in") - return fmt.Errorf("bad") - } - } - - if len(burstCapable) > 0 { - burstCapableBool, err := strconv.ParseBool(burstCapable) - if err != nil { - util.ReturnHTTPMessage(w, r, 400, "badrequest", "invalid burst_capable passed in") - return fmt.Errorf("bad") - } - environment.Spec.BurstCapable = burstCapableBool - } - _, updateErr := e.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Update(e.ctx, &environment, metav1.UpdateOptions{}) return updateErr }) diff --git a/pkg/util/labels.go b/pkg/util/labels.go index 9021f71d..6ee68d97 100644 --- a/pkg/util/labels.go +++ b/pkg/util/labels.go @@ -6,4 +6,5 @@ const ( SessionLabel = "hobbyfarm.io/sessionlabel" UserLabel = "hobbyfarm.io/user" RBACManagedLabel = "rbac.hobbyfarm.io/managed" + EnvironmentLabel = "hobbyfarm.io/environment" ) \ No newline at end of file diff --git a/pkg/util/util.go b/pkg/util/util.go index b662f55d..39fc581c 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -319,71 +319,10 @@ func EnsureVMNotReady(hfClientset hfClientset.Interface, vmLister hfListers.Virt return nil } -func AvailableRawCapacity(hfClientset hfClientset.Interface, capacity hfv1.CMSStruct, virtualMachines []hfv1.VirtualMachine, ctx context.Context) *hfv1.CMSStruct { - vmTemplates, err := hfClientset.HobbyfarmV1().VirtualMachineTemplates(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) - if err != nil { - glog.Errorf("unable to list virtual machine templates, got error %v", err) - return nil - } - - currentUsage := hfv1.CMSStruct{} - for _, vm := range virtualMachines { - for _, vmTemplate := range vmTemplates.Items { - if vmTemplate.Spec.Id == vm.Spec.VirtualMachineTemplateId { - currentUsage.CPU = currentUsage.CPU + vmTemplate.Spec.Resources.CPU - currentUsage.Memory = currentUsage.Memory + vmTemplate.Spec.Resources.Memory - currentUsage.Storage = currentUsage.Storage + vmTemplate.Spec.Resources.Storage - } - } - } - - availableCapacity := hfv1.CMSStruct{} - - availableCapacity.CPU = capacity.CPU - currentUsage.CPU - availableCapacity.Memory = capacity.Memory - currentUsage.Memory - availableCapacity.Storage = capacity.Storage - currentUsage.Storage - - return &availableCapacity -} - -func MaxVMCountsRaw(hfClientset hfClientset.Interface, vmTemplates map[string]int, available hfv1.CMSStruct, ctx context.Context) int { - vmTemplatesFromK8s, err := hfClientset.HobbyfarmV1().VirtualMachineTemplates(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) - if err != nil { - glog.Errorf("unable to list virtual machine templates, got error %v", err) - return 0 - } - - maxCount := 0 - - var neededResources hfv1.CMSStruct - - for _, vmTemplate := range vmTemplatesFromK8s.Items { - if vmtCount, ok := vmTemplates[vmTemplate.Name]; ok { - neededResources.CPU = neededResources.CPU + vmTemplate.Spec.Resources.CPU*vmtCount - neededResources.Memory = neededResources.Memory + vmTemplate.Spec.Resources.Memory*vmtCount - neededResources.Storage = neededResources.Storage + vmTemplate.Spec.Resources.Storage*vmtCount - } - } - - maxCount = available.CPU / neededResources.CPU - - if available.Memory/neededResources.Memory > maxCount { - maxCount = available.Memory / neededResources.Memory - } - - if available.Storage/neededResources.Storage > maxCount { - maxCount = available.Storage / neededResources.Storage - } - - return maxCount - -} // pending rename... type Maximus struct { - CapacityMode hfv1.CapacityMode `json:"capacity_mode"` AvailableCount map[string]int `json:"available_count"` - AvailableCapacity hfv1.CMSStruct `json:"available_capacity"` } func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { @@ -412,25 +351,12 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str return Maximus{}, fmt.Errorf("error retrieving environment %v", err) } - vmTemplatesFromK8s, err := hfClientset.HobbyfarmV1().VirtualMachineTemplates(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) - - if err != nil { - return Maximus{}, fmt.Errorf("error retrieving virtual machine templates %v", err) - } - - vmTemplateResources := map[string]hfv1.CMSStruct{} - - for _, vmTemplateInfo := range vmTemplatesFromK8s.Items { - vmTemplateResources[vmTemplateInfo.Name] = vmTemplateInfo.Spec.Resources - } - scheduledEvents, err := hfClientset.HobbyfarmV1().ScheduledEvents(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) if err != nil { return Maximus{}, fmt.Errorf("error retrieving scheduled events %v", err) } - maxRaws := make([]hfv1.CMSStruct, 1) maxCounts := map[string]int{} maxCounts = make(map[string]int) // maxCount will be the largest number of virtual machines allocated from the environment @@ -439,7 +365,6 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str }*/ for i := start; i.Before(end) || i.Equal(end); i = i.Add(duration) { glog.V(8).Infof("Checking time at %s", i.Format(time.UnixDate)) - maxRaw := hfv1.CMSStruct{} currentMaxCount := map[string]int{} for _, se := range scheduledEvents.Items { glog.V(4).Infof("Checking scheduled event %s", se.Spec.Name) @@ -457,77 +382,37 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str // and if i is before or equal to the end of the scheduled event if i.Equal(seStart) || i.Equal(seEnd) || (i.Before(seEnd) && i.After(seStart)) { glog.V(4).Infof("Scheduled Event %s was within the time period", se.Name) - if environmentFromK8s.Spec.CapacityMode == hfv1.CapacityModeRaw { - for vmTemplateName, vmTemplateCount := range vmMapping { - if vmTemplateR, ok := vmTemplateResources[vmTemplateName]; ok { - maxRaw.CPU = vmTemplateR.CPU * vmTemplateCount - maxRaw.Memory = vmTemplateR.Memory * vmTemplateCount - maxRaw.Storage = vmTemplateR.Storage * vmTemplateCount - } else { - return Maximus{}, fmt.Errorf("error retrieving vm template %s resources %v", vmTemplateName, err) - } - } - } else if environmentFromK8s.Spec.CapacityMode == hfv1.CapacityModeCount { - for vmTemplateName, vmTemplateCount := range vmMapping { - glog.V(4).Infof("SE VM Template %s Count was %d", vmTemplateName, vmTemplateCount) - currentMaxCount[vmTemplateName] = currentMaxCount[vmTemplateName] + vmTemplateCount - } - } else { - return Maximus{}, fmt.Errorf("environment %s had unexpected capacity mode %s", environment, environmentFromK8s.Spec.CapacityMode) + for vmTemplateName, vmTemplateCount := range vmMapping { + glog.V(4).Infof("SE VM Template %s Count was %d", vmTemplateName, vmTemplateCount) + currentMaxCount[vmTemplateName] = currentMaxCount[vmTemplateName] + vmTemplateCount } } } } - maxRaws = append(maxRaws, maxRaw) - if environmentFromK8s.Spec.CapacityMode == hfv1.CapacityModeCount { - for vmt, currentCount := range currentMaxCount { - glog.V(4).Infof("currentCount for vmt %s is %d", vmt, currentCount) - if maxCount, ok := maxCounts[vmt]; ok { - glog.V(4).Infof("Current max count for vmt %s is %d", vmt, maxCount) - if maxCount < currentCount { - maxCounts[vmt] = currentCount - } - } else { + for vmt, currentCount := range currentMaxCount { + glog.V(4).Infof("currentCount for vmt %s is %d", vmt, currentCount) + if maxCount, ok := maxCounts[vmt]; ok { + glog.V(4).Infof("Current max count for vmt %s is %d", vmt, maxCount) + if maxCount < currentCount { maxCounts[vmt] = currentCount } + } else { + maxCounts[vmt] = currentCount } } } max := Maximus{} - max.CapacityMode = environmentFromK8s.Spec.CapacityMode - if environmentFromK8s.Spec.CapacityMode == hfv1.CapacityModeRaw { - maxCPU := 0 - maxMem := 0 - maxStorage := 0 - for _, raw := range maxRaws { - if maxCPU < raw.CPU { - maxCPU = raw.CPU - } - if maxMem < raw.Memory { - maxMem = raw.Memory - } - if maxStorage < raw.Storage { - maxStorage = raw.Storage - } - } - max.AvailableCapacity.CPU = environmentFromK8s.Spec.Capacity.CPU - maxCPU - max.AvailableCapacity.Memory = environmentFromK8s.Spec.Capacity.Memory - maxMem - max.AvailableCapacity.Storage = environmentFromK8s.Spec.Capacity.Storage - maxStorage - } else if environmentFromK8s.Spec.CapacityMode == hfv1.CapacityModeCount { - max.AvailableCount = make(map[string]int) - for k, v := range environmentFromK8s.Spec.CountCapacity { - max.AvailableCount[k] = v - } - for vmt, count := range maxCounts { - if vmtCap, ok := environmentFromK8s.Spec.CountCapacity[vmt]; ok { - max.AvailableCount[vmt] = vmtCap - count - } else { - glog.Errorf("Error looking for maximum count capacity of virtual machine template %s", vmt) - max.AvailableCount[vmt] = 0 - } + max.AvailableCount = make(map[string]int) + for k, v := range environmentFromK8s.Spec.CountCapacity { + max.AvailableCount[k] = v + } + for vmt, count := range maxCounts { + if vmtCap, ok := environmentFromK8s.Spec.CountCapacity[vmt]; ok { + max.AvailableCount[vmt] = vmtCap - count + } else { + glog.Errorf("Error looking for maximum count capacity of virtual machine template %s", vmt) + max.AvailableCount[vmt] = 0 } - } else { - return Maximus{}, fmt.Errorf("environment %s had unexpected capacity mode %s", environment, environmentFromK8s.Spec.CapacityMode) } return max, nil } diff --git a/pkg/vmtemplateserver/vmtemplateserver.go b/pkg/vmtemplateserver/vmtemplateserver.go index 8ae939a3..ea88fc45 100644 --- a/pkg/vmtemplateserver/vmtemplateserver.go +++ b/pkg/vmtemplateserver/vmtemplateserver.go @@ -161,25 +161,11 @@ func (v VirtualMachineTemplateServer) CreateFunc(w http.ResponseWriter, r *http. return } - resourcesRaw := r.PostFormValue("resources") // no validation, resources not required configMapRaw := r.PostFormValue("config_map") // no validation, config_map not required vmTemplate := &hfv1.VirtualMachineTemplate{Spec: hfv1.VirtualMachineTemplateSpec{}} - resources := hfv1.CMSStruct{} configMap := map[string]string{} - if resourcesRaw != "" { - // attempt to decode if resources passed in - err := json.Unmarshal([]byte(resourcesRaw), &resources) - if err != nil { - glog.Errorf("error while unmarshalling resources: %v", err) - util.ReturnHTTPMessage(w, r, 500, "internalerror", "error parsing resources") - return - } - // no error, assign to vmtemplate - vmTemplate.Spec.Resources = resources - } - if configMapRaw != "" { // attempt to decode if config_map passed in err := json.Unmarshal([]byte(configMapRaw), &configMap) @@ -240,7 +226,6 @@ func (v VirtualMachineTemplateServer) UpdateFunc(w http.ResponseWriter, r *http. name := r.PostFormValue("name") image := r.PostFormValue("image") - resourcesRaw := r.PostFormValue("resources") configMapRaw := r.PostFormValue("config_map") if name != "" { @@ -251,16 +236,6 @@ func (v VirtualMachineTemplateServer) UpdateFunc(w http.ResponseWriter, r *http. vmTemplate.Spec.Image = image } - if resourcesRaw != "" { - cms := hfv1.CMSStruct{} - err := json.Unmarshal([]byte(resourcesRaw), &cms) - if err != nil { - glog.Error(err) - return fmt.Errorf("bad") - } - vmTemplate.Spec.Resources = cms - } - if configMapRaw != "" { configMap := map[string]string{} err := json.Unmarshal([]byte(configMapRaw), &configMap) From f73b542291979335936397786fd5b31a3333c5d3 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 2 Jan 2023 17:09:02 +0100 Subject: [PATCH 02/20] Remove legacy id and change it to name --- pkg/apis/hobbyfarm.io/v1/types.go | 12 ---- pkg/apis/hobbyfarm.io/v2/types.go | 1 - pkg/authserver/authserver.go | 9 ++- .../dynamicbindcontroller.go | 15 +++-- .../scheduledeventcontroller.go | 4 +- pkg/controllers/session/sessioncontroller.go | 6 +- .../vmclaimcontroller/vmclaimcontroller.go | 5 +- .../vmsetcontroller/vmsetcontroller.go | 5 +- pkg/courseserver/courseserver.go | 5 +- pkg/progressserver/progressserver.go | 6 +- pkg/scenarioserver/scenarioserver.go | 4 +- pkg/scheduledeventserver/scheduledevent.go | 7 +-- pkg/sessionserver/sessionserver.go | 55 +++++++++---------- pkg/shell/shell.go | 8 +-- pkg/vmclaimserver/vmclaimserver.go | 6 +- pkg/vmserver/vmserver.go | 8 +-- pkg/vmsetserver/vmsetserver.go | 2 +- pkg/vmtemplateserver/vmtemplateserver.go | 1 - 18 files changed, 67 insertions(+), 92 deletions(-) diff --git a/pkg/apis/hobbyfarm.io/v1/types.go b/pkg/apis/hobbyfarm.io/v1/types.go index fc934c81..f6e61c83 100644 --- a/pkg/apis/hobbyfarm.io/v1/types.go +++ b/pkg/apis/hobbyfarm.io/v1/types.go @@ -5,15 +5,12 @@ import ( ) type VmStatus string -type CapacityMode string const ( VmStatusRFP VmStatus = "readyforprovisioning" VmStatusProvisioned VmStatus = "provisioned" VmStatusRunning VmStatus = "running" VmStatusTerminating VmStatus = "terminating" - CapacityModeRaw CapacityMode = "raw" - CapacityModeCount CapacityMode = "count" ) // +genclient @@ -35,7 +32,6 @@ type VirtualMachineList struct { } type VirtualMachineSpec struct { - Id string `json:"id"` VirtualMachineTemplateId string `json:"vm_template_id"` SshUsername string `json:"ssh_username"` Protocol string `json:"protocol"` @@ -77,7 +73,6 @@ type VirtualMachineClaimList struct { } type VirtualMachineClaimSpec struct { - Id string `json:"id"` UserId string `json:"user"` RestrictedBind bool `json:"restricted_bind"` RestrictedBindValue string `json:"restricted_bind_value"` @@ -121,7 +116,6 @@ type VirtualMachineTemplateList struct { // VM type is a genercized collection of information about a VM. this includes things like // cpu, ram, disk, etc. type VirtualMachineTemplateSpec struct { - Id string `json:"id"` Name string `json:"name"` // 2x4, etc. Image string `json:"image"` // ubuntu-18.04 ConfigMap map[string]string `json:"config_map"` @@ -221,7 +215,6 @@ type CourseList struct { } type CourseSpec struct { - Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Scenarios []string `json:"scenarios"` @@ -252,7 +245,6 @@ type ScenarioList struct { } type ScenarioSpec struct { - Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Steps []ScenarioStep `json:"steps"` @@ -288,7 +280,6 @@ type SessionList struct { } type SessionSpec struct { - Id string `json:"id"` ScenarioId string `json:"scenario"` CourseId string `json:"course"` KeepCourseVM bool `json:"keep_course_vm"` @@ -325,7 +316,6 @@ type ProgressList struct { } type ProgressSpec struct { - Id string `json:"id"` CurrentStep int `json:"current_step"` MaxStep int `json:"max_step"` TotalStep int `json:"total_step"` @@ -466,7 +456,6 @@ type DynamicBindConfigurationList struct { // that there is adequate vm capacity, it will always choose the environment with the highest capacity before creating a dynamic VM. type DynamicBindConfigurationSpec struct { - Id string `json:"id"` Environment string `json:"environment"` BaseName string `json:"base_name"` RestrictedBind bool `json:"restricted_bind"` @@ -493,7 +482,6 @@ type DynamicBindRequestList struct { } type DynamicBindRequestSpec struct { - Id string `json:"id"` VirtualMachineClaim string `json:"vm_claim"` Attempts int `json:"attempts"` } diff --git a/pkg/apis/hobbyfarm.io/v2/types.go b/pkg/apis/hobbyfarm.io/v2/types.go index 781f033a..74885854 100644 --- a/pkg/apis/hobbyfarm.io/v2/types.go +++ b/pkg/apis/hobbyfarm.io/v2/types.go @@ -21,7 +21,6 @@ type UserList struct { } type UserSpec struct { - Id string `json:"id"` Email string `json:"email"` Password string `json:"password"` AccessCodes []string `json:"access_codes"` diff --git a/pkg/authserver/authserver.go b/pkg/authserver/authserver.go index 2801ccd3..dd4d5b67 100644 --- a/pkg/authserver/authserver.go +++ b/pkg/authserver/authserver.go @@ -111,7 +111,6 @@ func (a AuthServer) NewUser(email string, password string) (string, error) { sha := base32.StdEncoding.WithPadding(-1).EncodeToString(hasher.Sum(nil))[:10] id := "u-" + strings.ToLower(sha) newUser.Name = id - newUser.Spec.Id = id newUser.Spec.Email = email settings := make(map[string]string) @@ -147,7 +146,7 @@ func (a AuthServer) ChangePasswordFunc(w http.ResponseWriter, r *http.Request) { oldPassword := r.PostFormValue("old_password") newPassword := r.PostFormValue("new_password") - err = a.ChangePassword(user.Spec.Id, oldPassword, newPassword) + err = a.ChangePassword(user.Name, oldPassword, newPassword) if err != nil { util.ReturnHTTPMessage(w, r, 500, "error", fmt.Sprintf("error changing password for user %s", user.Name)) @@ -173,7 +172,7 @@ func (a AuthServer) UpdateSettingsFunc(w http.ResponseWriter, r *http.Request) { newSettings[key] = r.FormValue(key) //Ignore when multiple values were set for one argument. Just take the first one } - err = a.UpdateSettings(user.Spec.Id, newSettings) + err = a.UpdateSettings(user.Name, newSettings) if err != nil { util.ReturnHTTPMessage(w, r, 500, "error", fmt.Sprintf("error updating settings for user %s", user.Name)) @@ -264,7 +263,7 @@ func (a AuthServer) AddAccessCodeFunc(w http.ResponseWriter, r *http.Request) { accessCode := strings.ToLower(r.PostFormValue("access_code")) - err = a.AddAccessCode(user.Spec.Id, accessCode) + err = a.AddAccessCode(user.Name, accessCode) if err != nil { glog.Error(err) @@ -288,7 +287,7 @@ func (a AuthServer) RemoveAccessCodeFunc(w http.ResponseWriter, r *http.Request) accessCode := strings.ToLower(vars["access_code"]) - err = a.RemoveAccessCode(user.Spec.Id, accessCode) + err = a.RemoveAccessCode(user.Name, accessCode) if err != nil { glog.Error(err) diff --git a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go b/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go index 62f8969c..068b8924 100644 --- a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go +++ b/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go @@ -140,12 +140,12 @@ func (d *DynamicBindController) processNextDynamicBindRequest() bool { func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest *hfv1.DynamicBindRequest) error { - d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts+1, false, false, "", make(map[string]string), dynamicBindRequest.Spec.Id) + d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts+1, false, false, "", make(map[string]string), dynamicBindRequest.Name) vmClaim, err := d.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Get(d.ctx, dynamicBindRequest.Spec.VirtualMachineClaim, metav1.GetOptions{}) if err != nil { - glog.Errorf("error retrieving corresponding virtual machine claim %s for dynamic bind request %s", dynamicBindRequest.Spec.VirtualMachineClaim, dynamicBindRequest.Spec.Id) + glog.Errorf("error retrieving corresponding virtual machine claim %s for dynamic bind request %s", dynamicBindRequest.Spec.VirtualMachineClaim, dynamicBindRequest.Name) return err } @@ -218,7 +218,7 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * // next check if the dynamicbindconfiguration has capacity currentVMs, err = d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,dynamicbindconfig=%s,template=%s", dynamicBindConfiguration.Spec.Id, vmTemplate), + LabelSelector: fmt.Sprintf("dynamic=true,dynamicbindconfig=%s,template=%s", dynamicBindConfiguration.Name, vmTemplate), }) if err != nil { glog.V(4).Infof("error retrieving current vm list, assuming no machines") @@ -259,7 +259,7 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * Labels: map[string]string{ "dynamic": "true", "dynamicbindrequest": dynamicBindRequest.Name, - "dynamicbindconfiguration": chosenDynamicBindConfiguration.Spec.Id, + "dynamicbindconfiguration": chosenDynamicBindConfiguration.Name, "template": vmX.Template, util.EnvironmentLabel: chosenDynamicBindConfiguration.Spec.Environment, "bound": "true", @@ -268,7 +268,6 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * }, }, Spec: hfv1.VirtualMachineSpec{ - Id: vmName, VirtualMachineTemplateId: vmX.Template, SecretName: "", Protocol: "ssh", //default protocol is ssh @@ -338,14 +337,14 @@ func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest * virtualMachines[vmClaimVMName] = newVm.Name } - d.updateDynamicBindRequestStatus(dynamicBindRequest.Spec.Attempts, false, true, chosenDynamicBindConfiguration.Spec.Id, virtualMachines, dynamicBindRequest.Spec.Id) + d.updateDynamicBindRequestStatus(dynamicBindRequest.Spec.Attempts, false, true, chosenDynamicBindConfiguration.Name, virtualMachines, dynamicBindRequest.Name) } else { // check to see if we're above our attempt threshold if dynamicBindRequest.Status.CurrentAttempts > dynamicBindRequest.Spec.Attempts { - d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts, true, false, "", make(map[string]string), dynamicBindRequest.Spec.Id) + d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts, true, false, "", make(map[string]string), dynamicBindRequest.Name) } else { - return fmt.Errorf("did not bind dynamic vms for dynamic bind request %s", dynamicBindRequest.Spec.Id) + return fmt.Errorf("did not bind dynamic vms for dynamic bind request %s", dynamicBindRequest.Name) } } diff --git a/pkg/controllers/scheduledevent/scheduledeventcontroller.go b/pkg/controllers/scheduledevent/scheduledeventcontroller.go index 46d7e254..f79a4d0b 100644 --- a/pkg/controllers/scheduledevent/scheduledeventcontroller.go +++ b/pkg/controllers/scheduledevent/scheduledeventcontroller.go @@ -228,9 +228,9 @@ func (s ScheduledEventController) finishSessionsFromScheduledEvent(se *hfv1.Sche for _, session := range sessionList.Items { retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - result, getErr := s.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).Get(s.ctx, session.Spec.Id, metav1.GetOptions{}) + result, getErr := s.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).Get(s.ctx, session.Name, metav1.GetOptions{}) if getErr != nil { - return fmt.Errorf("error retrieving latest version of session %s: %v", session.Spec.Id, getErr) + return fmt.Errorf("error retrieving latest version of session %s: %v", session.Name, getErr) } result.Status.ExpirationTime = now diff --git a/pkg/controllers/session/sessioncontroller.go b/pkg/controllers/session/sessioncontroller.go index 9b97fd0f..57fd89a3 100644 --- a/pkg/controllers/session/sessioncontroller.go +++ b/pkg/controllers/session/sessioncontroller.go @@ -180,11 +180,11 @@ func (s *SessionController) reconcileSession(ssName string) error { } if pausedExpiration.After(now) { - glog.V(4).Infof("Session %s was paused, and the pause expiration is after now, skipping clean up.", ss.Spec.Id) + glog.V(4).Infof("Session %s was paused, and the pause expiration is after now, skipping clean up.", ss.Name) return nil } - glog.V(4).Infof("Session %s was paused, but the pause expiration was before now, so cleaning up.", ss.Spec.Id) + glog.V(4).Infof("Session %s was paused, but the pause expiration was before now, so cleaning up.", ss.Name) } for _, vmc := range ss.Spec.VmClaimSet { vmcObj, err := s.vmcLister.VirtualMachineClaims(util.GetReleaseNamespace()).Get(vmc) @@ -323,7 +323,7 @@ func (s *SessionController) FinishProgress(sessionId string, userId string) { p.Spec.Finished = "true" _, updateErr := s.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).Update(s.ctx, &p, metav1.UpdateOptions{}) - glog.V(4).Infof("updated progress with ID %s", p.Spec.Id) + glog.V(4).Infof("updated progress with ID %s", p.Name) return updateErr }) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index 991b341a..2ae13809 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -330,7 +330,6 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) }, }, Spec: hfv1.VirtualMachineSpec{ - Id: genName, VirtualMachineTemplateId: vmDetails.Template, SecretName: "", Protocol: "ssh", //default protocol is ssh @@ -499,7 +498,7 @@ func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) ( for name, vmStruct := range vmc.Spec.VirtualMachines { if vmStruct.VirtualMachineId == "" { glog.Info("assigning a vm") - vmID, err := v.assignNextFreeVM(vmc.Spec.Id, vmc.Spec.UserId, vmStruct.Template, env, vmc.Spec.RestrictedBind, vmc.Spec.RestrictedBindValue) + vmID, err := v.assignNextFreeVM(vmc.Name, vmc.Spec.UserId, vmStruct.Template, env, vmc.Spec.RestrictedBind, vmc.Spec.RestrictedBindValue) if err != nil { return err } @@ -587,7 +586,7 @@ func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, temp if !vm.Status.Allocated && !vm.Status.Tainted { // we can assign this vm assigned = true - vmId = vm.Spec.Id + vmId = vm.Name // Prefer running machines if( vm.Status.Status == hfv1.VmStatusRunning){ diff --git a/pkg/controllers/vmsetcontroller/vmsetcontroller.go b/pkg/controllers/vmsetcontroller/vmsetcontroller.go index ebf64337..8c3c6991 100644 --- a/pkg/controllers/vmsetcontroller/vmsetcontroller.go +++ b/pkg/controllers/vmsetcontroller/vmsetcontroller.go @@ -289,7 +289,7 @@ func (v *VirtualMachineSetController) reconcileVirtualMachineSet(vmset *hfv1.Vir Labels: map[string]string{ "dynamic": "false", "vmset": vmset.Name, - "template": vmt.Spec.Id, + "template": vmt.Name, "environment": env.Name, "bound": "false", "ready": "false", @@ -297,8 +297,7 @@ func (v *VirtualMachineSetController) reconcileVirtualMachineSet(vmset *hfv1.Vir }, }, Spec: hfv1.VirtualMachineSpec{ - Id: vmName, - VirtualMachineTemplateId: vmt.Spec.Id, + VirtualMachineTemplateId: vmt.Name, SecretName: "", Protocol: "ssh", VirtualMachineClaimId: "", diff --git a/pkg/courseserver/courseserver.go b/pkg/courseserver/courseserver.go index b95c08ab..921172bf 100644 --- a/pkg/courseserver/courseserver.go +++ b/pkg/courseserver/courseserver.go @@ -215,7 +215,6 @@ func (c CourseServer) CreateFunc(w http.ResponseWriter, r *http.Request) { generatedName := util.GenerateResourceName("c", name, 10) course.Name = generatedName - course.Spec.Id = generatedName course.Spec.Name = name course.Spec.Description = description @@ -550,7 +549,7 @@ func (c CourseServer) AppendDynamicScenariosByCategories(scenariosList []string, continue } for _, scenario := range scenarios.Items { - scenariosList = append(scenariosList, scenario.Spec.Id) + scenariosList = append(scenariosList, scenario.Name) } } @@ -615,5 +614,5 @@ func idIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{course.Spec.Id}, nil + return []string{course.Name}, nil } diff --git a/pkg/progressserver/progressserver.go b/pkg/progressserver/progressserver.go index 452dc15e..2b699405 100644 --- a/pkg/progressserver/progressserver.go +++ b/pkg/progressserver/progressserver.go @@ -98,7 +98,7 @@ func (s ProgressServer) ListForUserFunc(w http.ResponseWriter, r *http.Request) return } - s.ListByLabel(w, r, util.UserLabel, user.Spec.Id, true) + s.ListByLabel(w, r, util.UserLabel, user.Name, true) } /* @@ -223,7 +223,7 @@ func (s ProgressServer) Update(w http.ResponseWriter, r *http.Request) { } progress, err := s.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).List(s.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s=%s,%s=%s,finished=false", util.SessionLabel, id, util.UserLabel, user.Spec.Id)}) + LabelSelector: fmt.Sprintf("%s=%s,%s=%s,finished=false", util.SessionLabel, id, util.UserLabel, user.Name)}) if err != nil { glog.Errorf("error while retrieving progress %v", err) @@ -256,7 +256,7 @@ func (s ProgressServer) Update(w http.ResponseWriter, r *http.Request) { }) if retryErr != nil { - glog.Errorf("error updating progress %s: %v", p.Spec.Id, err) + glog.Errorf("error updating progress %s: %v", p.Name, err) util.ReturnHTTPMessage(w, r, 500, "error", "progress could not be updated") return } diff --git a/pkg/scenarioserver/scenarioserver.go b/pkg/scenarioserver/scenarioserver.go index c384eab5..abf2b975 100644 --- a/pkg/scenarioserver/scenarioserver.go +++ b/pkg/scenarioserver/scenarioserver.go @@ -98,7 +98,6 @@ func (s ScenarioServer) prepareScenario(scenario hfv1.Scenario, printable bool) ps := PreparedScenario{} ps.Name = scenario.Spec.Name - ps.Id = scenario.Spec.Id ps.Description = scenario.Spec.Description ps.VirtualMachines = scenario.Spec.VirtualMachines ps.Pauseable = scenario.Spec.Pauseable @@ -633,7 +632,6 @@ func (s ScenarioServer) CreateFunc(w http.ResponseWriter, r *http.Request) { hasher.Write([]byte(name)) sha := base32.StdEncoding.WithPadding(-1).EncodeToString(hasher.Sum(nil))[:10] scenario.Name = "s-" + strings.ToLower(sha) - scenario.Spec.Id = "s-" + strings.ToLower(sha) // LEGACY!!!! scenario.Spec.Name = name scenario.Spec.Description = description @@ -820,5 +818,5 @@ func idIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{scenario.Spec.Id}, nil + return []string{scenario.Name}, nil } diff --git a/pkg/scheduledeventserver/scheduledevent.go b/pkg/scheduledeventserver/scheduledevent.go index 7af2ae3b..5d29b316 100644 --- a/pkg/scheduledeventserver/scheduledevent.go +++ b/pkg/scheduledeventserver/scheduledevent.go @@ -255,13 +255,12 @@ func (s ScheduledEventServer) CreateFunc(w http.ResponseWriter, r *http.Request) scheduledEvent.Spec.Name = name scheduledEvent.Spec.Description = description - scheduledEvent.Spec.Creator = user.Spec.Id + scheduledEvent.Spec.Creator = user.Name scheduledEvent.Spec.StartTime = startTime scheduledEvent.Spec.EndTime = endTime scheduledEvent.Spec.OnDemand = onDemand scheduledEvent.Spec.Printable = printable scheduledEvent.Spec.RequiredVirtualMachines = requiredVMUnmarshaled - scheduledEvent.Spec.AccessCode = accessCode if scenariosRaw != "" { scheduledEvent.Spec.Scenarios = scenarios @@ -576,9 +575,9 @@ func (s ScheduledEventServer) finishSessions(se *hfv1.ScheduledEvent) error { for _, session := range sessionList.Items { retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - result, getErr := s.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).Get(s.ctx, session.Spec.Id, metav1.GetOptions{}) + result, getErr := s.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).Get(s.ctx, session.Name, metav1.GetOptions{}) if getErr != nil { - return fmt.Errorf("error retrieving latest version of session %s: %v", session.Spec.Id, getErr) + return fmt.Errorf("error retrieving latest version of session %s: %v", session.Name, getErr) } result.Status.ExpirationTime = now diff --git a/pkg/sessionserver/sessionserver.go b/pkg/sessionserver/sessionserver.go index b2503c86..c471a031 100644 --- a/pkg/sessionserver/sessionserver.go +++ b/pkg/sessionserver/sessionserver.go @@ -91,7 +91,7 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) restrictedBindVal := "" if accessCode == "" { - accessCode, err = sss.accessCodeClient.GetClosestAccessCode(user.Spec.Id, id) + accessCode, err = sss.accessCodeClient.GetClosestAccessCode(user.Name, id) if err != nil { glog.Error(err) util.ReturnHTTPMessage(w, r, 500, "error", "error retrieving access code applicable to course/scenario") @@ -139,7 +139,7 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) // now we should check for existing sessions for the user sessions, err := sss.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).List(sss.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s=%s", util.UserLabel, user.Spec.Id), + LabelSelector: fmt.Sprintf("%s=%s", util.UserLabel, user.Name), }) if err != nil { @@ -153,8 +153,8 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) if err != nil { continue } - if v.Spec.UserId == user.Spec.Id && - (v.Spec.CourseId == course.Spec.Id || v.Spec.ScenarioId == scenario.Spec.Id) && + if v.Spec.UserId == user.Name && + (v.Spec.CourseId == course.Name || v.Spec.ScenarioId == scenario.Name) && !v.Status.Finished && v.Status.Active && expires.After(now) { // we should just return this session... @@ -176,8 +176,8 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) glog.V(4).Infof("updated session for new scenario") //finish old progress & create new progress for the new scenario - sss.FinishProgress(result.Spec.Id, user.Spec.Id) - sss.CreateProgress(result.Spec.Id, accessCodeObj.Labels[util.ScheduledEventLabel], scenario.Spec.Id, course.Spec.Id, user.Spec.Id, len(scenario.Spec.Steps)) + sss.FinishProgress(result.Name, user.Name) + sss.CreateProgress(result.Name, accessCodeObj.Labels[util.ScheduledEventLabel], scenario.Name, course.Name, user.Name, len(scenario.Spec.Steps)) return updateErr }) @@ -204,14 +204,13 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) session := hfv1.Session{} session.Name = sessionName - session.Spec.Id = sessionName - session.Spec.CourseId = course.Spec.Id - session.Spec.ScenarioId = scenario.Spec.Id - session.Spec.UserId = user.Spec.Id + session.Spec.CourseId = course.Name + session.Spec.ScenarioId = scenario.Name + session.Spec.UserId = user.Name session.Spec.KeepCourseVM = course.Spec.KeepVM labels := make(map[string]string) labels[util.AccessCodeLabel] = accessCode // map accesscode to session - labels[util.UserLabel] = user.Spec.Id // map user to session + labels[util.UserLabel] = user.Name // map user to session session.Labels = labels var vms []map[string]string if course.Spec.VirtualMachines != nil { @@ -259,11 +258,10 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) vmcId := util.GenerateResourceName(baseName, util.RandStringRunes(10), 10) labels := make(map[string]string) labels[util.SessionLabel] = session.Name // map vmc to session - labels[util.UserLabel] = user.Spec.Id // map session to user in a way that is searchable + labels[util.UserLabel] = user.Name // map session to user in a way that is searchable labels[util.AccessCodeLabel] = session.Labels[util.AccessCodeLabel] labels[util.ScheduledEventLabel] = schedEvent.Name virtualMachineClaim.Labels = labels - virtualMachineClaim.Spec.Id = vmcId virtualMachineClaim.Spec.BaseName = vmcId virtualMachineClaim.Name = vmcId virtualMachineClaim.Spec.VirtualMachines = make(map[string]hfv1.VirtualMachineClaimVM) @@ -272,7 +270,7 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) // also label this vmc so we can query against it later labels[fmt.Sprintf("virtualmachinetemplate.hobbyfarm.io/%s", vmTemplateName)] = "true" } - virtualMachineClaim.Spec.UserId = user.Spec.Id + virtualMachineClaim.Spec.UserId = user.Name virtualMachineClaim.Spec.DynamicCapable = true @@ -301,7 +299,7 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) return } - session.Spec.VmClaimSet[index] = createdVmClaim.Spec.Id + session.Spec.VmClaimSet[index] = createdVmClaim.Name } var ssTimeout string @@ -337,9 +335,9 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) return } - glog.V(2).Infof("created session ID %s", createdSession.Spec.Id) + glog.V(2).Infof("created session ID %s", createdSession.Name) - sss.CreateProgress(createdSession.Spec.Id, accessCodeObj.Labels[util.ScheduledEventLabel], scenario.Spec.Id, course.Spec.Id, user.Spec.Id, len(scenario.Spec.Steps)) + sss.CreateProgress(createdSession.Name, accessCodeObj.Labels[util.ScheduledEventLabel], scenario.Name, course.Name, user.Name, len(scenario.Spec.Steps)) encodedSS, err := json.Marshal(createdSession.Spec) if err != nil { @@ -357,7 +355,6 @@ func (sss SessionServer) CreateProgress(sessionId string, scheduledEventId strin progress := hfv1.Progress{} progress.Name = progressName - progress.Spec.Id = progressName progress.Spec.Course = courseId progress.Spec.Scenario = scenarioId progress.Spec.UserId = userId @@ -387,7 +384,7 @@ func (sss SessionServer) CreateProgress(sessionId string, scheduledEventId strin return } - glog.V(2).Infof("created progress with ID %s", createdProgress.Spec.Id) + glog.V(2).Infof("created progress with ID %s", createdProgress.Name) } func (sss SessionServer) FinishProgress(sessionId string, userId string) { @@ -408,7 +405,7 @@ func (sss SessionServer) FinishProgress(sessionId string, userId string) { p.Spec.Finished = "true" _, updateErr := sss.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).Update(sss.ctx, &p, metav1.UpdateOptions{}) - glog.V(4).Infof("updated progress with ID %s", p.Spec.Id) + glog.V(4).Infof("updated progress with ID %s", p.Name) return updateErr }) @@ -434,7 +431,7 @@ func (sss SessionServer) FinishedSessionFunc(w http.ResponseWriter, r *http.Requ } ss, err := sss.GetSessionById(sessionId) - if ss.Spec.UserId != user.Spec.Id { + if ss.Spec.UserId != user.Name { // check if the user has access to write sessions _, err := sss.auth.AuthGrant(rbacclient.RbacRequest().HobbyfarmPermission(resourcePlural, rbacclient.VerbUpdate), w, r) if err != nil { @@ -486,7 +483,7 @@ func (sss SessionServer) KeepAliveSessionFunc(w http.ResponseWriter, r *http.Req } ss, err := sss.GetSessionById(sessionId) - if ss.Spec.UserId != user.Spec.Id { + if ss.Spec.UserId != user.Name { util.ReturnHTTPMessage(w, r, 403, "forbidden", "no session found that matches this user") return } @@ -497,7 +494,7 @@ func (sss SessionServer) KeepAliveSessionFunc(w http.ResponseWriter, r *http.Req } if ss.Status.Paused { - glog.V(4).Infof("session %s was paused, returning paused", ss.Spec.Id) + glog.V(4).Infof("session %s was paused, returning paused", ss.Name) now := time.Now() pauseExpiration, err := time.Parse(time.UnixDate, ss.Status.PausedTime) @@ -588,7 +585,7 @@ func (sss SessionServer) PauseSessionFunc(w http.ResponseWriter, r *http.Request } ss, err := sss.GetSessionById(sessionId) - if ss.Spec.UserId != user.Spec.Id { + if ss.Spec.UserId != user.Name { util.ReturnHTTPMessage(w, r, 403, "forbidden", "no session found that matches this user") return } @@ -614,7 +611,7 @@ func (sss SessionServer) PauseSessionFunc(w http.ResponseWriter, r *http.Request } if !course.Spec.Pauseable && !scenario.Spec.Pauseable { - glog.Errorf("session is not pauseable %s", course.Spec.Id) + glog.Errorf("session is not pauseable %s", course.Name) util.ReturnHTTPMessage(w, r, 500, "error", "not pauseable") return } @@ -674,7 +671,7 @@ func (sss SessionServer) ResumeSessionFunc(w http.ResponseWriter, r *http.Reques } ss, err := sss.GetSessionById(sessionId) - if ss.Spec.UserId != user.Spec.Id { + if ss.Spec.UserId != user.Name { util.ReturnHTTPMessage(w, r, 403, "forbidden", "no session found that matches this user") return } @@ -763,7 +760,7 @@ func (sss SessionServer) GetSessionFunc(w http.ResponseWriter, r *http.Request) return } - if ss.Spec.UserId != user.Spec.Id { + if ss.Spec.UserId != user.Name { _, err := sss.auth.AuthGrant(rbacclient.RbacRequest().HobbyfarmPermission("sessions", rbacclient.VerbGet), w, r) if err != nil { util.ReturnHTTPMessage(w, r, 403, "forbidden", "no session found that matches for this user") @@ -777,7 +774,7 @@ func (sss SessionServer) GetSessionFunc(w http.ResponseWriter, r *http.Request) } util.ReturnHTTPContent(w, r, 200, "success", encodedSS) - glog.V(2).Infof("retrieved session %s", ss.Spec.Id) + glog.V(2).Infof("retrieved session %s", ss.Name) } func ssIdIndexer(obj interface{}) ([]string, error) { @@ -785,7 +782,7 @@ func ssIdIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{ss.Spec.Id}, nil + return []string{ss.Name}, nil } func (sss SessionServer) GetSessionById(id string) (hfv1.Session, error) { diff --git a/pkg/shell/shell.go b/pkg/shell/shell.go index 0f1a510e..87612f5b 100644 --- a/pkg/shell/shell.go +++ b/pkg/shell/shell.go @@ -103,12 +103,12 @@ func (sp ShellProxy) ConnectGuacFunc(w http.ResponseWriter, r *http.Request) { return } - if vm.Spec.UserId != user.Spec.Id { + if vm.Spec.UserId != user.Name { util.ReturnHTTPMessage(w, r, 403, "forbidden", "you do not have access to shell") return } - glog.Infof("Going to upgrade guac connection now... %s", vm.Spec.Id) + glog.Infof("Going to upgrade guac connection now... %s", vm.Name) // ok first get the secret for the vm secret, err := sp.kubeClient.CoreV1().Secrets(util.GetReleaseNamespace()).Get(sp.ctx, vm.Spec.SecretName, v1.GetOptions{}) // idk? @@ -278,7 +278,7 @@ func (sp ShellProxy) ConnectSSHFunc(w http.ResponseWriter, r *http.Request) { return } - if vm.Spec.UserId != user.Spec.Id { + if vm.Spec.UserId != user.Name { // check if the user has access to access user sessions // TODO: add permission like 'virtualmachine/shell' similar to 'pod/exec' _, err := sp.auth.AuthGrantWS( @@ -294,7 +294,7 @@ func (sp ShellProxy) ConnectSSHFunc(w http.ResponseWriter, r *http.Request) { } } - glog.Infof("Going to upgrade connection now... %s", vm.Spec.Id) + glog.Infof("Going to upgrade connection now... %s", vm.Name) // ok first get the secret for the vm secret, err := sp.kubeClient.CoreV1().Secrets(util.GetReleaseNamespace()).Get(sp.ctx, vm.Spec.SecretName, v1.GetOptions{}) // idk? diff --git a/pkg/vmclaimserver/vmclaimserver.go b/pkg/vmclaimserver/vmclaimserver.go index 50b7a178..edd15d01 100644 --- a/pkg/vmclaimserver/vmclaimserver.go +++ b/pkg/vmclaimserver/vmclaimserver.go @@ -102,7 +102,7 @@ func (vmcs VMClaimServer) GetVMClaimFunc(w http.ResponseWriter, r *http.Request) return } - if vmc.Spec.UserId != user.Spec.Id { + if vmc.Spec.UserId != user.Name { _, err := vmcs.auth.AuthGrant(rbacclient.RbacRequest().HobbyfarmPermission(resourcePlural, rbacclient.VerbGet), w, r) if err != nil { util.ReturnHTTPMessage(w, r, 403, "forbidden", "access denied to get vmclaim") @@ -118,7 +118,7 @@ func (vmcs VMClaimServer) GetVMClaimFunc(w http.ResponseWriter, r *http.Request) } util.ReturnHTTPContent(w, r, 200, "success", encodedVMC) - glog.V(2).Infof("retrieved vmc %s", vmc.Spec.Id) + glog.V(2).Infof("retrieved vmc %s", vmc.Name) } func vmcIdIndexer(obj interface{}) ([]string, error) { @@ -126,5 +126,5 @@ func vmcIdIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{vmc.Spec.Id}, nil + return []string{vmc.Name}, nil } diff --git a/pkg/vmserver/vmserver.go b/pkg/vmserver/vmserver.go index a4f54cec..d2dd2dc1 100644 --- a/pkg/vmserver/vmserver.go +++ b/pkg/vmserver/vmserver.go @@ -109,10 +109,10 @@ func (vms VMServer) GetVMFunc(w http.ResponseWriter, r *http.Request) { return } - if vm.Spec.UserId != user.Spec.Id { + if vm.Spec.UserId != user.Name { _, err := vms.auth.AuthGrant(rbacclient.RbacRequest().HobbyfarmPermission(resourcePlural, rbacclient.VerbGet), w, r) if err != nil { - glog.Errorf("user forbidden from accessing vm id %s", vm.Spec.Id) + glog.Errorf("user forbidden from accessing vm id %s", vm.Name) util.ReturnHTTPMessage(w, r, 403, "forbidden", "no access to get vm") return } @@ -126,7 +126,7 @@ func (vms VMServer) GetVMFunc(w http.ResponseWriter, r *http.Request) { } util.ReturnHTTPContent(w, r, 200, "success", encodedVM) - glog.V(2).Infof("retrieved vm %s", vm.Spec.Id) + glog.V(2).Infof("retrieved vm %s", vm.Name) } func (vms VMServer) GetVMListFunc(w http.ResponseWriter, r *http.Request, listOptions metav1.ListOptions) { @@ -212,5 +212,5 @@ func vmIdIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{vm.Spec.Id}, nil + return []string{vm.Name}, nil } diff --git a/pkg/vmsetserver/vmsetserver.go b/pkg/vmsetserver/vmsetserver.go index a454b111..808ce2b0 100644 --- a/pkg/vmsetserver/vmsetserver.go +++ b/pkg/vmsetserver/vmsetserver.go @@ -109,5 +109,5 @@ func vmIdIndexer(obj interface{}) ([]string, error) { if !ok { return []string{}, nil } - return []string{vm.Spec.Id}, nil + return []string{vm.Name}, nil } diff --git a/pkg/vmtemplateserver/vmtemplateserver.go b/pkg/vmtemplateserver/vmtemplateserver.go index ea88fc45..73ba04ac 100644 --- a/pkg/vmtemplateserver/vmtemplateserver.go +++ b/pkg/vmtemplateserver/vmtemplateserver.go @@ -182,7 +182,6 @@ func (v VirtualMachineTemplateServer) CreateFunc(w http.ResponseWriter, r *http. hasher.Write([]byte(name)) sha := base32.StdEncoding.WithPadding(-1).EncodeToString(hasher.Sum(nil))[:10] vmTemplate.Name = "vmt-" + strings.ToLower(sha) - vmTemplate.Spec.Id = vmTemplate.Name vmTemplate.Spec.Name = name vmTemplate.Spec.Image = image From 6aa66a37820eee96648edf36b3a32af786555d76 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Wed, 4 Jan 2023 17:13:50 +0100 Subject: [PATCH 03/20] WIP generate clients --- go.mod | 1 - go.sum | 115 +----------------- .../v1/zz_generated.deepcopy.go | 2 +- pkg/client/clientset/versioned/clientset.go | 54 +++++--- .../hobbyfarm.io/v1/hobbyfarm.io_client.go | 53 +++++--- .../hobbyfarm.io/v2/hobbyfarm.io_client.go | 27 +++- .../terraformcontroller.cattle.io_client.go | 31 ++++- .../scheduledeventcontroller.go | 1 - 8 files changed, 124 insertions(+), 160 deletions(-) diff --git a/go.mod b/go.mod index 969b0487..3e73c34c 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,6 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.2.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect diff --git a/go.sum b/go.sum index c7eb56ba..4c55a5b0 100644 --- a/go.sum +++ b/go.sum @@ -25,25 +25,15 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -53,7 +43,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= @@ -83,7 +72,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -115,12 +103,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= @@ -154,7 +137,6 @@ github.com/ebauman/crder v0.0.17 h1:YoYZZCQzbgGL6tVnzzoHts8ZumKGTZE+eAfVYP6AFx0= github.com/ebauman/crder v0.0.17/go.mod h1:hBFgWb3ywEx5eq2rpI0GDIqU+xEsLXShKtfesQW2Yjk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= @@ -166,8 +148,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= @@ -202,12 +182,10 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= @@ -277,7 +255,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= -github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= @@ -294,7 +271,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -327,21 +303,15 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA= github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -415,9 +385,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -516,13 +485,11 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -597,7 +564,6 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -605,9 +571,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -630,21 +594,14 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/pkg/v3 v3.5.4/go.mod h1:OI+TtO+Aa3nhQSppMbwE4ld3uF1/fqqwbpfndbbrEe0= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/raft/v3 v3.5.4/go.mod h1:SCuunjYvZFC0fBX0vxMSPjuZmpcSk+XaAcMrD6Do03w= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.etcd.io/etcd/server/v3 v3.5.4/go.mod h1:S5/YTU15KxymM5l3T6b09sNOHPXqGYIZStpuuGbb65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -686,7 +643,6 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -785,11 +741,7 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -811,10 +763,6 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -828,7 +776,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -905,24 +852,14 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1020,9 +957,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1052,18 +986,7 @@ google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNe google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1114,7 +1037,6 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1130,31 +1052,8 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1181,12 +1080,6 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1210,7 +1103,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -1263,7 +1155,6 @@ k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= -k8s.io/apiserver v0.25.2/go.mod h1:30r7xyQTREWCkG2uSjgjhQcKVvAAlqoD+YyrqR6Cn+I= k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI= k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= @@ -1274,7 +1165,6 @@ k8s.io/code-generator v0.25.2 h1:qEHux0+E1c+j1MhsWn9+4Z6av8zrZBixOTPW064rSiY= k8s.io/code-generator v0.25.2/go.mod h1:f61OcU2VqVQcjt/6TrU0sta1TA5hHkOO6ZZPwkL9Eys= k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= -k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1285,7 +1175,6 @@ k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHz k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -1318,7 +1207,6 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/cli-utils v0.27.0/go.mod h1:8ll2fyx+bzjbwmwUnKBQU+2LDbMDsxy44DiDZ+drALg= sigs.k8s.io/controller-runtime v0.10.1/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= @@ -1329,7 +1217,6 @@ sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqw sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= -sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65 h1:xJNnO2qzHtgVCSPoGkkltSpyEX7D7IJw1TmbE3G/7lY= sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go b/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go index 590d21a8..65c8c576 100644 --- a/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go @@ -17,7 +17,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by C:\Users\Jgoebel.SVA\go\bin\deepcopy-gen.exe. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 721c9a8c..204bda43 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -27,6 +27,7 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" + "net/http" ) type Interface interface { @@ -69,33 +70,56 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { } // NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, +// If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } + var cs Clientset var err error - cs.hobbyfarmV1, err = hobbyfarmv1.NewForConfig(&configShallowCopy) - if err != nil { + cs.hobbyfarmV1, err =hobbyfarmv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err!=nil { return nil, err } - cs.hobbyfarmV2, err = hobbyfarmv2.NewForConfig(&configShallowCopy) - if err != nil { + cs.hobbyfarmV2, err =hobbyfarmv2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err!=nil { return nil, err } - cs.terraformcontrollerV1, err = terraformcontrollerv1.NewForConfig(&configShallowCopy) - if err != nil { + cs.terraformcontrollerV1, err =terraformcontrollerv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err!=nil { return nil, err } - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err!=nil { return nil, err } return &cs, nil @@ -104,13 +128,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // NewForConfigOrDie creates a new Clientset for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.hobbyfarmV1 = hobbyfarmv1.NewForConfigOrDie(c) - cs.hobbyfarmV2 = hobbyfarmv2.NewForConfigOrDie(c) - cs.terraformcontrollerV1 = terraformcontrollerv1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs + cs, err := NewForConfig(c) + if err!=nil { + panic(err) + } + return cs } // New creates a new Clientset for the given RESTClient. diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go index 16316341..49bbb42c 100644 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go +++ b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go @@ -22,24 +22,27 @@ import ( v1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" + "net/http" ) + type HobbyfarmV1Interface interface { - RESTClient() rest.Interface - AccessCodesGetter - CoursesGetter - DynamicBindConfigurationsGetter - DynamicBindRequestsGetter - EnvironmentsGetter - ProgressesGetter - ScenariosGetter - ScheduledEventsGetter - SessionsGetter - UsersGetter - VirtualMachinesGetter - VirtualMachineClaimsGetter - VirtualMachineSetsGetter - VirtualMachineTemplatesGetter + RESTClient() rest.Interface + AccessCodesGetter + CoursesGetter + DynamicBindConfigurationsGetter + DynamicBindRequestsGetter + EnvironmentsGetter + ProgressesGetter + ScenariosGetter + ScheduledEventsGetter + SessionsGetter + UsersGetter + VirtualMachinesGetter + VirtualMachineClaimsGetter + VirtualMachineSetsGetter + VirtualMachineTemplatesGetter + } // HobbyfarmV1Client is used to interact with features provided by the hobbyfarm.io group. @@ -104,12 +107,28 @@ func (c *HobbyfarmV1Client) VirtualMachineTemplates(namespace string) VirtualMac } // NewForConfig creates a new HobbyfarmV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*HobbyfarmV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } - client, err := rest.RESTClientFor(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new HobbyfarmV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*HobbyfarmV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } @@ -133,7 +152,7 @@ func New(c rest.Interface) *HobbyfarmV1Client { func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion - config.GroupVersion = &gv + config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v2/hobbyfarm.io_client.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v2/hobbyfarm.io_client.go index 90ff44af..c4736953 100644 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v2/hobbyfarm.io_client.go +++ b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v2/hobbyfarm.io_client.go @@ -22,11 +22,14 @@ import ( v2 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v2" "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" + "net/http" ) + type HobbyfarmV2Interface interface { - RESTClient() rest.Interface - UsersGetter + RESTClient() rest.Interface + UsersGetter + } // HobbyfarmV2Client is used to interact with features provided by the hobbyfarm.io group. @@ -39,12 +42,28 @@ func (c *HobbyfarmV2Client) Users(namespace string) UserInterface { } // NewForConfig creates a new HobbyfarmV2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*HobbyfarmV2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } - client, err := rest.RESTClientFor(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new HobbyfarmV2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*HobbyfarmV2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } @@ -68,7 +87,7 @@ func New(c rest.Interface) *HobbyfarmV2Client { func setConfigDefaults(config *rest.Config) error { gv := v2.SchemeGroupVersion - config.GroupVersion = &gv + config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/client/clientset/versioned/typed/terraformcontroller.cattle.io/v1/terraformcontroller.cattle.io_client.go b/pkg/client/clientset/versioned/typed/terraformcontroller.cattle.io/v1/terraformcontroller.cattle.io_client.go index d950e778..136ca70b 100644 --- a/pkg/client/clientset/versioned/typed/terraformcontroller.cattle.io/v1/terraformcontroller.cattle.io_client.go +++ b/pkg/client/clientset/versioned/typed/terraformcontroller.cattle.io/v1/terraformcontroller.cattle.io_client.go @@ -22,13 +22,16 @@ import ( v1 "github.com/hobbyfarm/gargantua/pkg/apis/terraformcontroller.cattle.io/v1" "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" + "net/http" ) + type TerraformcontrollerV1Interface interface { - RESTClient() rest.Interface - ExecutionsGetter - ModulesGetter - StatesGetter + RESTClient() rest.Interface + ExecutionsGetter + ModulesGetter + StatesGetter + } // TerraformcontrollerV1Client is used to interact with features provided by the terraformcontroller.cattle.io group. @@ -49,12 +52,28 @@ func (c *TerraformcontrollerV1Client) States(namespace string) StateInterface { } // NewForConfig creates a new TerraformcontrollerV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*TerraformcontrollerV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } - client, err := rest.RESTClientFor(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new TerraformcontrollerV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*TerraformcontrollerV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } @@ -78,7 +97,7 @@ func New(c rest.Interface) *TerraformcontrollerV1Client { func setConfigDefaults(config *rest.Config) error { gv := v1.SchemeGroupVersion - config.GroupVersion = &gv + config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/controllers/scheduledevent/scheduledeventcontroller.go b/pkg/controllers/scheduledevent/scheduledeventcontroller.go index f79a4d0b..b35a9fc9 100644 --- a/pkg/controllers/scheduledevent/scheduledeventcontroller.go +++ b/pkg/controllers/scheduledevent/scheduledeventcontroller.go @@ -365,7 +365,6 @@ func (s ScheduledEventController) provisionScheduledEvent(templates *hfv1.Virtua }, }, Spec: hfv1.DynamicBindConfigurationSpec{ - Id: dbcName, Environment: envName, BaseName: dbcRand, BurstCountCapacity: vmtMap, From 852e41ec8909bf56448e2493340d800f1198d305 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 5 Jan 2023 13:45:08 +0100 Subject: [PATCH 04/20] Fix CRD columns, remove environment status --- pkg/crd/crd.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/crd/crd.go b/pkg/crd/crd.go index 21474bc4..1e312f47 100644 --- a/pkg/crd/crd.go +++ b/pkg/crd/crd.go @@ -41,9 +41,7 @@ func GenerateCRDs(caBundle string, reference apiextv1.ServiceReference) []crder. hobbyfarmCRD(&v1.Environment{}, func(c *crder.CRD) { c. IsNamespaced(true). - AddVersion("v1", &v1.Environment{}, func(cv *crder.Version) { - cv.WithStatus() - }) + AddVersion("v1", &v1.Environment{}, nil) }), hobbyfarmCRD(&v1.VirtualMachineSet{}, func(c *crder.CRD) { c. @@ -74,7 +72,7 @@ func GenerateCRDs(caBundle string, reference apiextv1.ServiceReference) []crder. WithColumn("Active", ".status.active"). WithColumn("Finished", ".status.finished"). WithColumn("StartTime", ".status.start_time"). - WithColumn("ExpirationTime", ".status.expiration_time"). + WithColumn("ExpirationTime", ".status.end_time"). WithStatus() }) }), From 3290497230ece2d1fe1a686c0bd26c51160f4ba7 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 5 Jan 2023 13:47:12 +0100 Subject: [PATCH 05/20] Remove environment status in types --- pkg/apis/hobbyfarm.io/v1/types.go | 5 ----- .../v1/zz_generated.deepcopy.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/apis/hobbyfarm.io/v1/types.go b/pkg/apis/hobbyfarm.io/v1/types.go index f6e61c83..4216164e 100644 --- a/pkg/apis/hobbyfarm.io/v1/types.go +++ b/pkg/apis/hobbyfarm.io/v1/types.go @@ -128,7 +128,6 @@ type Environment struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec EnvironmentSpec `json:"spec"` - Status EnvironmentStatus `json:"status"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -153,10 +152,6 @@ type EnvironmentSpec struct { CountCapacity map[string]int `json:"count_capacity"` } -type EnvironmentStatus struct { - AvailableCount map[string]int `json:"available_count"` -} - // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go b/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go index 65c8c576..590d21a8 100644 --- a/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/terraformcontroller.cattle.io/v1/zz_generated.deepcopy.go @@ -17,7 +17,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by C:\Users\Jgoebel.SVA\go\bin\deepcopy-gen.exe. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1 From 53d0e083ec16fc58b8d44291a1494f8802d00b4c Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 5 Jan 2023 14:10:05 +0100 Subject: [PATCH 06/20] Remove environment status in types --- go.mod | 27 ----- go.sum | 113 ++++++++++++++++++ .../hobbyfarm.io/v1/zz_generated.deepcopy.go | 24 ---- pkg/environmentserver/environmentserver.go | 3 +- 4 files changed, 114 insertions(+), 53 deletions(-) diff --git a/go.mod b/go.mod index 3e73c34c..17a51035 100644 --- a/go.mod +++ b/go.mod @@ -24,47 +24,20 @@ require ( ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08 // indirect github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect - golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect - k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220928191237-829ce0c27909 // indirect k8s.io/utils v0.0.0-20220922133306-665eaaec4324 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 4c55a5b0..ed4e4ebc 100644 --- a/go.sum +++ b/go.sum @@ -25,15 +25,25 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -43,6 +53,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= @@ -72,6 +83,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -103,7 +115,12 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= @@ -137,6 +154,7 @@ github.com/ebauman/crder v0.0.17 h1:YoYZZCQzbgGL6tVnzzoHts8ZumKGTZE+eAfVYP6AFx0= github.com/ebauman/crder v0.0.17/go.mod h1:hBFgWb3ywEx5eq2rpI0GDIqU+xEsLXShKtfesQW2Yjk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= @@ -148,6 +166,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= @@ -182,10 +202,12 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= +github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= @@ -255,6 +277,7 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= +github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= @@ -271,6 +294,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -303,15 +327,21 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA= github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -387,6 +417,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -485,11 +516,13 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -564,6 +597,7 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -571,7 +605,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -594,14 +630,21 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= +go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/pkg/v3 v3.5.4/go.mod h1:OI+TtO+Aa3nhQSppMbwE4ld3uF1/fqqwbpfndbbrEe0= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/raft/v3 v3.5.4/go.mod h1:SCuunjYvZFC0fBX0vxMSPjuZmpcSk+XaAcMrD6Do03w= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= +go.etcd.io/etcd/server/v3 v3.5.4/go.mod h1:S5/YTU15KxymM5l3T6b09sNOHPXqGYIZStpuuGbb65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -643,6 +686,7 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -741,7 +785,11 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -763,6 +811,10 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -776,6 +828,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -852,14 +905,24 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -957,6 +1020,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -986,7 +1052,18 @@ google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNe google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1037,6 +1114,7 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1052,8 +1130,31 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1080,6 +1181,12 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1103,6 +1210,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -1155,6 +1263,7 @@ k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= +k8s.io/apiserver v0.25.2/go.mod h1:30r7xyQTREWCkG2uSjgjhQcKVvAAlqoD+YyrqR6Cn+I= k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI= k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= @@ -1165,6 +1274,7 @@ k8s.io/code-generator v0.25.2 h1:qEHux0+E1c+j1MhsWn9+4Z6av8zrZBixOTPW064rSiY= k8s.io/code-generator v0.25.2/go.mod h1:f61OcU2VqVQcjt/6TrU0sta1TA5hHkOO6ZZPwkL9Eys= k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= +k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1175,6 +1285,7 @@ k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHz k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -1207,6 +1318,7 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/cli-utils v0.27.0/go.mod h1:8ll2fyx+bzjbwmwUnKBQU+2LDbMDsxy44DiDZ+drALg= sigs.k8s.io/controller-runtime v0.10.1/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= @@ -1217,6 +1329,7 @@ sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqw sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= +sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65 h1:xJNnO2qzHtgVCSPoGkkltSpyEX7D7IJw1TmbE3G/7lY= sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go index 3af49feb..0a2753c3 100644 --- a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go @@ -399,7 +399,6 @@ func (in *Environment) DeepCopyInto(out *Environment) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) return } @@ -508,29 +507,6 @@ func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EnvironmentStatus) DeepCopyInto(out *EnvironmentStatus) { - *out = *in - if in.AvailableCount != nil { - in, out := &in.AvailableCount, &out.AvailableCount - *out = make(map[string]int, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentStatus. -func (in *EnvironmentStatus) DeepCopy() *EnvironmentStatus { - if in == nil { - return nil - } - out := new(EnvironmentStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Progress) DeepCopyInto(out *Progress) { *out = *in diff --git a/pkg/environmentserver/environmentserver.go b/pkg/environmentserver/environmentserver.go index 7bba765d..582313c7 100644 --- a/pkg/environmentserver/environmentserver.go +++ b/pkg/environmentserver/environmentserver.go @@ -69,7 +69,6 @@ func (e EnvironmentServer) SetupRoutes(r *mux.Router) { type PreparedEnvironment struct { Name string `json:"name"` hfv1.EnvironmentSpec - hfv1.EnvironmentStatus } type PreparedListEnvironment struct { @@ -103,7 +102,7 @@ func (e EnvironmentServer) GetFunc(w http.ResponseWriter, r *http.Request) { return } - preparedEnvironment := PreparedEnvironment{environment.Name, environment.Spec, environment.Status} + preparedEnvironment := PreparedEnvironment{environment.Name, environment.Spec} encodedEnvironment, err := json.Marshal(preparedEnvironment) if err != nil { From b5a5e9c905008ce23f7c63f1504ead39fb35d8d4 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 5 Jan 2023 14:13:26 +0100 Subject: [PATCH 07/20] Fix go.mod --- go.mod | 27 ++++++++++++++ go.sum | 113 --------------------------------------------------------- 2 files changed, 27 insertions(+), 113 deletions(-) diff --git a/go.mod b/go.mod index 17a51035..3e73c34c 100644 --- a/go.mod +++ b/go.mod @@ -24,20 +24,47 @@ require ( ) require ( + github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.22.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.6.9 // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08 // indirect github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect + golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect + golang.org/x/tools v0.1.12 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect + k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220928191237-829ce0c27909 // indirect k8s.io/utils v0.0.0-20220922133306-665eaaec4324 // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index ed4e4ebc..4c55a5b0 100644 --- a/go.sum +++ b/go.sum @@ -25,25 +25,15 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -53,7 +43,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= @@ -83,7 +72,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -115,12 +103,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= @@ -154,7 +137,6 @@ github.com/ebauman/crder v0.0.17 h1:YoYZZCQzbgGL6tVnzzoHts8ZumKGTZE+eAfVYP6AFx0= github.com/ebauman/crder v0.0.17/go.mod h1:hBFgWb3ywEx5eq2rpI0GDIqU+xEsLXShKtfesQW2Yjk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= @@ -166,8 +148,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= @@ -202,12 +182,10 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= @@ -277,7 +255,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= -github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= @@ -294,7 +271,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -327,21 +303,15 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA= github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -417,7 +387,6 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -516,13 +485,11 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -597,7 +564,6 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -605,9 +571,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -630,21 +594,14 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/pkg/v3 v3.5.4/go.mod h1:OI+TtO+Aa3nhQSppMbwE4ld3uF1/fqqwbpfndbbrEe0= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/raft/v3 v3.5.4/go.mod h1:SCuunjYvZFC0fBX0vxMSPjuZmpcSk+XaAcMrD6Do03w= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.etcd.io/etcd/server/v3 v3.5.4/go.mod h1:S5/YTU15KxymM5l3T6b09sNOHPXqGYIZStpuuGbb65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -686,7 +643,6 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -785,11 +741,7 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -811,10 +763,6 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -828,7 +776,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -905,24 +852,14 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1020,9 +957,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1052,18 +986,7 @@ google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNe google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1114,7 +1037,6 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1130,31 +1052,8 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1181,12 +1080,6 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1210,7 +1103,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -1263,7 +1155,6 @@ k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= -k8s.io/apiserver v0.25.2/go.mod h1:30r7xyQTREWCkG2uSjgjhQcKVvAAlqoD+YyrqR6Cn+I= k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI= k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= @@ -1274,7 +1165,6 @@ k8s.io/code-generator v0.25.2 h1:qEHux0+E1c+j1MhsWn9+4Z6av8zrZBixOTPW064rSiY= k8s.io/code-generator v0.25.2/go.mod h1:f61OcU2VqVQcjt/6TrU0sta1TA5hHkOO6ZZPwkL9Eys= k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= -k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1285,7 +1175,6 @@ k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHz k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= @@ -1318,7 +1207,6 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/cli-utils v0.27.0/go.mod h1:8ll2fyx+bzjbwmwUnKBQU+2LDbMDsxy44DiDZ+drALg= sigs.k8s.io/controller-runtime v0.10.1/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= @@ -1329,7 +1217,6 @@ sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqw sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= -sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65 h1:xJNnO2qzHtgVCSPoGkkltSpyEX7D7IJw1TmbE3G/7lY= sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= From 10c5189cfe8f630c532e0c23570ec10a44b08720 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Wed, 11 Jan 2023 15:47:51 +0100 Subject: [PATCH 08/20] Better calculation of available VM counts for a given period --- pkg/scenarioserver/scenarioserver.go | 1 + pkg/util/util.go | 129 +++++++++++++++++---------- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/pkg/scenarioserver/scenarioserver.go b/pkg/scenarioserver/scenarioserver.go index abf2b975..5ade9b9a 100644 --- a/pkg/scenarioserver/scenarioserver.go +++ b/pkg/scenarioserver/scenarioserver.go @@ -97,6 +97,7 @@ func (s ScenarioServer) SetupRoutes(r *mux.Router) { func (s ScenarioServer) prepareScenario(scenario hfv1.Scenario, printable bool) (PreparedScenario, error) { ps := PreparedScenario{} + ps.Id = scenario.Name ps.Name = scenario.Spec.Name ps.Description = scenario.Spec.Description ps.VirtualMachines = scenario.Spec.VirtualMachines diff --git a/pkg/util/util.go b/pkg/util/util.go index 39fc581c..69d0b7cb 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -26,6 +26,7 @@ import ( "strconv" "strings" "time" + "sort" hfClientset "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned" ) @@ -325,88 +326,120 @@ type Maximus struct { AvailableCount map[string]int `json:"available_count"` } -func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { +// Range with reserved virtual machine amounts for given time range +type Range struct { + Start time.Time + End time.Time + VMMapping map[string]int +} +// These functions are used to sort arrays of time.Time +type ByTime []time.Time +func (t ByTime) Len() int { return len(t) } +func (t ByTime) Swap(i, j int) { t[i], t[j] = t[j], t[i] } +func (t ByTime) Less(i, j int) bool { return t[i].Before(t[j]) } +func sortTime(timeArray []time.Time) { + sort.Sort(ByTime(timeArray)) +} - duration, _ := time.ParseDuration("30m") +func Max(x, y int) int { + if x < y { + return y + } + return x +} +func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { start, err := time.Parse(time.UnixDate, startString) - if err != nil { return Maximus{}, fmt.Errorf("error parsing start time %v", err) } - start = start.Round(duration) + // We only want to calculate for the future. Otherwise old ( even finished ) events will be considered too. + if(start.Before(time.Now())){ + start = time.Now(); + } end, err := time.Parse(time.UnixDate, endString) - if err != nil { return Maximus{}, fmt.Errorf("error parsing end time %v", err) } - end = end.Round(duration) - environmentFromK8s, err := hfClientset.HobbyfarmV1().Environments(GetReleaseNamespace()).Get(ctx, environment, metav1.GetOptions{}) - if err != nil { return Maximus{}, fmt.Errorf("error retrieving environment %v", err) } scheduledEvents, err := hfClientset.HobbyfarmV1().ScheduledEvents(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) - if err != nil { return Maximus{}, fmt.Errorf("error retrieving scheduled events %v", err) } - maxCounts := map[string]int{} - maxCounts = make(map[string]int) - // maxCount will be the largest number of virtual machines allocated from the environment - /*for t, c := range environmentFromK8s.Spec.CountCapacity { - maxCounts[t] = c - }*/ - for i := start; i.Before(end) || i.Equal(end); i = i.Add(duration) { - glog.V(8).Infof("Checking time at %s", i.Format(time.UnixDate)) - currentMaxCount := map[string]int{} - for _, se := range scheduledEvents.Items { - glog.V(4).Infof("Checking scheduled event %s", se.Spec.Name) - if vmMapping, ok := se.Spec.RequiredVirtualMachines[environment]; ok { - seStart, err := time.Parse(time.UnixDate, se.Spec.StartTime) - if err != nil { - return Maximus{}, fmt.Errorf("error parsing scheduled event start %v", err) - } - seEnd, err := time.Parse(time.UnixDate, se.Spec.EndTime) - if err != nil { - return Maximus{}, fmt.Errorf("error parsing scheduled event end %v", err) - } - // i is the checking time - // if the time to be checked is after or equal to the start time of the scheduled event - // and if i is before or equal to the end of the scheduled event - if i.Equal(seStart) || i.Equal(seEnd) || (i.Before(seEnd) && i.After(seStart)) { - glog.V(4).Infof("Scheduled Event %s was within the time period", se.Name) - for vmTemplateName, vmTemplateCount := range vmMapping { - glog.V(4).Infof("SE VM Template %s Count was %d", vmTemplateName, vmTemplateCount) - currentMaxCount[vmTemplateName] = currentMaxCount[vmTemplateName] + vmTemplateCount - } - } + var timeRange []Range + var changingTimestamps []time.Time // All timestamps where number of virtualmachines changes (Begin or End of Scheduled Event) + virtualMachineCount := make(map[time.Time]map[string]int) // Count of virtualmachines per VMTemplate for any given timestamp where a change happened + maximumVirtualMachineCount := make(map[string]int) // Maximum VirtualMachine Count per VirtualMachineTemplate over all timestamps + + for _, se := range scheduledEvents.Items { + // Scheduled Event uses the environment we are checking + if vmMapping, ok := se.Spec.RequiredVirtualMachines[environment]; ok { + seStart, err := time.Parse(time.UnixDate, se.Spec.StartTime) + if err != nil { + return Maximus{}, fmt.Errorf("error parsing scheduled event start %v", err) + } + seEnd, err := time.Parse(time.UnixDate, se.Spec.EndTime) + if err != nil { + return Maximus{}, fmt.Errorf("error parsing scheduled event end %v", err) + } + // Scheduled Event is withing our timerange. We consider it by adding it to our Ranges + if start.Equal(seStart) || end.Equal(seEnd) || (start.Before(seEnd) && end.After(seStart)) { + timeRange = append(timeRange, Range{Start: seStart, End: seEnd, VMMapping: vmMapping}) + changingTimestamps = append(changingTimestamps, seStart) + changingTimestamps = append(changingTimestamps, seEnd) + virtualMachineCount[seStart] = make(map[string]int) + virtualMachineCount[seEnd] = make(map[string]int) + glog.V(4).Infof("Scheduled Event %s was within the time period", se.Name) } } - for vmt, currentCount := range currentMaxCount { - glog.V(4).Infof("currentCount for vmt %s is %d", vmt, currentCount) - if maxCount, ok := maxCounts[vmt]; ok { - glog.V(4).Infof("Current max count for vmt %s is %d", vmt, maxCount) - if maxCount < currentCount { - maxCounts[vmt] = currentCount + } + + // Sort timestamps + sortTime(changingTimestamps) + + for _, eventRange := range timeRange { + // For any given Scheduled Event check if the timestamp is during the duration of our event. Add required Virtualmachine Counts to this timestamp. + for _, timestamp := range changingTimestamps { + if(eventRange.Start.After(timestamp)){ + continue + } + if(eventRange.End.Before(timestamp)){ + break + } + + // When we are here the timestamp is in the duration of this event. + for vmTemplateName, vmTemplateCount := range eventRange.VMMapping { + // VM Capacity for this timestamp + if currentVMCapacity, ok := virtualMachineCount[timestamp][vmTemplateName]; ok { + virtualMachineCount[timestamp][vmTemplateName] = currentVMCapacity + vmTemplateCount + } else { + virtualMachineCount[timestamp][vmTemplateName] = vmTemplateCount + } + // Highest VM Capacity over all timestamps + if maximumVMCapacity, ok := maximumVirtualMachineCount[vmTemplateName]; ok { + maximumVirtualMachineCount[vmTemplateName] = Max(maximumVMCapacity, virtualMachineCount[timestamp][vmTemplateName]) + } else { + maximumVirtualMachineCount[vmTemplateName] = vmTemplateCount } - } else { - maxCounts[vmt] = currentCount } + } } + max := Maximus{} max.AvailableCount = make(map[string]int) for k, v := range environmentFromK8s.Spec.CountCapacity { max.AvailableCount[k] = v } - for vmt, count := range maxCounts { + for vmt, count := range maximumVirtualMachineCount { if vmtCap, ok := environmentFromK8s.Spec.CountCapacity[vmt]; ok { max.AvailableCount[vmt] = vmtCap - count } else { From 02d803d56dc819161c8e4a760a6ac58b1ab0699a Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Wed, 11 Jan 2023 16:47:42 +0100 Subject: [PATCH 09/20] Clean up --- pkg/scheduledeventserver/scheduledevent.go | 1 + pkg/util/util.go | 35 +++++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/pkg/scheduledeventserver/scheduledevent.go b/pkg/scheduledeventserver/scheduledevent.go index 5d29b316..5306e1f2 100644 --- a/pkg/scheduledeventserver/scheduledevent.go +++ b/pkg/scheduledeventserver/scheduledevent.go @@ -261,6 +261,7 @@ func (s ScheduledEventServer) CreateFunc(w http.ResponseWriter, r *http.Request) scheduledEvent.Spec.OnDemand = onDemand scheduledEvent.Spec.Printable = printable scheduledEvent.Spec.RequiredVirtualMachines = requiredVMUnmarshaled + scheduledEvent.Spec.AccessCode = accessCode if scenariosRaw != "" { scheduledEvent.Spec.Scenarios = scenarios diff --git a/pkg/util/util.go b/pkg/util/util.go index 69d0b7cb..7469d697 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -348,10 +348,12 @@ func Max(x, y int) int { return x } -func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { +// Calculates available virtualMachineTemplates for a given period (startString, endString) and environment +// Returns a map with timestamps and corresponding availability of virtualmachines. Also returns the maximum available count of virtualmachinetemplates over the whole duration. +func VirtualMachinesUsedDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context)(map[time.Time]map[string]int, map[string]int, error){ start, err := time.Parse(time.UnixDate, startString) if err != nil { - return Maximus{}, fmt.Errorf("error parsing start time %v", err) + return map[time.Time]map[string]int{}, map[string]int{}, fmt.Errorf("error parsing start time %v", err) } // We only want to calculate for the future. Otherwise old ( even finished ) events will be considered too. @@ -361,17 +363,12 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str end, err := time.Parse(time.UnixDate, endString) if err != nil { - return Maximus{}, fmt.Errorf("error parsing end time %v", err) - } - - environmentFromK8s, err := hfClientset.HobbyfarmV1().Environments(GetReleaseNamespace()).Get(ctx, environment, metav1.GetOptions{}) - if err != nil { - return Maximus{}, fmt.Errorf("error retrieving environment %v", err) + return map[time.Time]map[string]int{}, map[string]int{}, fmt.Errorf("error parsing end time %v", err) } scheduledEvents, err := hfClientset.HobbyfarmV1().ScheduledEvents(GetReleaseNamespace()).List(ctx, metav1.ListOptions{}) if err != nil { - return Maximus{}, fmt.Errorf("error retrieving scheduled events %v", err) + return map[time.Time]map[string]int{}, map[string]int{}, fmt.Errorf("error retrieving scheduled events %v", err) } var timeRange []Range @@ -384,11 +381,11 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str if vmMapping, ok := se.Spec.RequiredVirtualMachines[environment]; ok { seStart, err := time.Parse(time.UnixDate, se.Spec.StartTime) if err != nil { - return Maximus{}, fmt.Errorf("error parsing scheduled event start %v", err) + return map[time.Time]map[string]int{}, map[string]int{}, fmt.Errorf("error parsing scheduled event start %v", err) } seEnd, err := time.Parse(time.UnixDate, se.Spec.EndTime) if err != nil { - return Maximus{}, fmt.Errorf("error parsing scheduled event end %v", err) + return map[time.Time]map[string]int{}, map[string]int{}, fmt.Errorf("error parsing scheduled event end %v", err) } // Scheduled Event is withing our timerange. We consider it by adding it to our Ranges if start.Equal(seStart) || end.Equal(seEnd) || (start.Before(seEnd) && end.After(seStart)) { @@ -434,6 +431,22 @@ func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment str } } + return virtualMachineCount, maximumVirtualMachineCount, nil +} + +func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { + _, maximumVirtualMachineCount, err := VirtualMachinesUsedDuringPeriod(hfClientset, environment, startString, endString, ctx); + + if(err != nil) { + return Maximus{}, err + } + + environmentFromK8s, err := hfClientset.HobbyfarmV1().Environments(GetReleaseNamespace()).Get(ctx, environment, metav1.GetOptions{}) + if err != nil { + return Maximus{}, fmt.Errorf("error retrieving environment %v", err) + } + + max := Maximus{} max.AvailableCount = make(map[string]int) for k, v := range environmentFromK8s.Spec.CountCapacity { From edc0bfa02a39d9af071a2934b0eae457b658e21a Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Wed, 11 Jan 2023 17:43:42 +0100 Subject: [PATCH 10/20] Fix errors where frontend relies on ID --- pkg/progressserver/progressserver.go | 3 ++- pkg/sessionserver/sessionserver.go | 11 +++++++++-- pkg/vmclaimserver/vmclaimserver.go | 3 ++- pkg/vmserver/vmserver.go | 5 +++-- pkg/vmtemplateserver/vmtemplateserver.go | 3 ++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pkg/progressserver/progressserver.go b/pkg/progressserver/progressserver.go index 2b699405..f8d2f2cc 100644 --- a/pkg/progressserver/progressserver.go +++ b/pkg/progressserver/progressserver.go @@ -30,6 +30,7 @@ type ProgressServer struct { } type AdminPreparedProgress struct { + ID string `json:"id"` Session string `json:"session"` hfv1.ProgressSpec } @@ -175,7 +176,7 @@ func (s ProgressServer) ListByLabel(w http.ResponseWriter, r *http.Request, labe preparedProgress := []AdminPreparedProgress{} for _, p := range progress.Items { - pProgress := AdminPreparedProgress{p.Labels[util.SessionLabel], p.Spec} + pProgress := AdminPreparedProgress{p.Name, p.Labels[util.SessionLabel], p.Spec} preparedProgress = append(preparedProgress, pProgress) } diff --git a/pkg/sessionserver/sessionserver.go b/pkg/sessionserver/sessionserver.go index c471a031..a295f22b 100644 --- a/pkg/sessionserver/sessionserver.go +++ b/pkg/sessionserver/sessionserver.go @@ -42,6 +42,11 @@ type SessionServer struct { ctx context.Context } +type preparedSession struct { + ID string `json:"id"` + hfv1.SessionSpec +} + func NewSessionServer(authClient *authclient.AuthClient, accessCodeClient *accesscode.AccessCodeClient, scenarioClient *scenarioclient.ScenarioClient, courseClient *courseclient.CourseClient, hfClientSet hfClientset.Interface, hfInformerFactory hfInformers.SharedInformerFactory, ctx context.Context) (*SessionServer, error) { a := SessionServer{} a.hfClientSet = hfClientSet @@ -339,7 +344,8 @@ func (sss SessionServer) NewSessionFunc(w http.ResponseWriter, r *http.Request) sss.CreateProgress(createdSession.Name, accessCodeObj.Labels[util.ScheduledEventLabel], scenario.Name, course.Name, user.Name, len(scenario.Spec.Steps)) - encodedSS, err := json.Marshal(createdSession.Spec) + preparedSession := preparedSession{createdSession.Name, createdSession.Spec} + encodedSS, err := json.Marshal(preparedSession) if err != nil { glog.Error(err) } @@ -768,7 +774,8 @@ func (sss SessionServer) GetSessionFunc(w http.ResponseWriter, r *http.Request) } } - encodedSS, err := json.Marshal(ss.Spec) + preparedSession := preparedSession{ss.Name, ss.Spec} + encodedSS, err := json.Marshal(preparedSession) if err != nil { glog.Error(err) } diff --git a/pkg/vmclaimserver/vmclaimserver.go b/pkg/vmclaimserver/vmclaimserver.go index edd15d01..d247e2ba 100644 --- a/pkg/vmclaimserver/vmclaimserver.go +++ b/pkg/vmclaimserver/vmclaimserver.go @@ -74,6 +74,7 @@ func (vmcs VMClaimServer) SetupRoutes(r *mux.Router) { } type PreparedVirtualMachineClaim struct { + ID string `json:"id"` hfv1.VirtualMachineClaimSpec hfv1.VirtualMachineClaimStatus } @@ -110,7 +111,7 @@ func (vmcs VMClaimServer) GetVMClaimFunc(w http.ResponseWriter, r *http.Request) } } - preparedVMC := PreparedVirtualMachineClaim{vmc.Spec, vmc.Status} + preparedVMC := PreparedVirtualMachineClaim{vmc.Name, vmc.Spec, vmc.Status} encodedVMC, err := json.Marshal(preparedVMC) if err != nil { diff --git a/pkg/vmserver/vmserver.go b/pkg/vmserver/vmserver.go index d2dd2dc1..703d50a8 100644 --- a/pkg/vmserver/vmserver.go +++ b/pkg/vmserver/vmserver.go @@ -31,6 +31,7 @@ type VMServer struct { } type PreparedVirtualMachine struct { + ID string `json:"id"` hfv1.VirtualMachineSpec hfv1.VirtualMachineStatus } @@ -118,7 +119,7 @@ func (vms VMServer) GetVMFunc(w http.ResponseWriter, r *http.Request) { } } - preparedVM := PreparedVirtualMachine{vm.Spec, vm.Status} + preparedVM := PreparedVirtualMachine{vm.Name, vm.Spec, vm.Status} encodedVM, err := json.Marshal(preparedVM) if err != nil { @@ -146,7 +147,7 @@ func (vms VMServer) GetVMListFunc(w http.ResponseWriter, r *http.Request, listOp preparedVMs := []PreparedVirtualMachine{} for _, vm := range vmList.Items { - pVM := PreparedVirtualMachine{vm.Spec, vm.Status} + pVM := PreparedVirtualMachine{vm.Name, vm.Spec, vm.Status} preparedVMs = append(preparedVMs, pVM) } diff --git a/pkg/vmtemplateserver/vmtemplateserver.go b/pkg/vmtemplateserver/vmtemplateserver.go index 73ba04ac..35839f98 100644 --- a/pkg/vmtemplateserver/vmtemplateserver.go +++ b/pkg/vmtemplateserver/vmtemplateserver.go @@ -68,6 +68,7 @@ func (v VirtualMachineTemplateServer) SetupRoutes(r *mux.Router) { } type PreparedVMTemplate struct { + ID string `json:"id"` hfv1.VirtualMachineTemplateSpec } @@ -101,7 +102,7 @@ func (v VirtualMachineTemplateServer) GetFunc(w http.ResponseWriter, r *http.Req return } - preparedEnvironment := PreparedVMTemplate{vmt.Spec} + preparedEnvironment := PreparedVMTemplate{vmt.Name, vmt.Spec} encodedEnvironment, err := json.Marshal(preparedEnvironment) if err != nil { From 7a30d86043c2c6a049ae3c5d165f805d2e9cdf4d Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 12 Jan 2023 12:14:58 +0100 Subject: [PATCH 11/20] Keep progress when event is finished - delete when event deleted --- .../scheduledeventcontroller.go | 17 ----------------- pkg/scheduledeventserver/scheduledevent.go | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/pkg/controllers/scheduledevent/scheduledeventcontroller.go b/pkg/controllers/scheduledevent/scheduledeventcontroller.go index b35a9fc9..e8aacf42 100644 --- a/pkg/controllers/scheduledevent/scheduledeventcontroller.go +++ b/pkg/controllers/scheduledevent/scheduledeventcontroller.go @@ -163,12 +163,6 @@ func (s ScheduledEventController) completeScheduledEvent(se *hfv1.ScheduledEvent return err } - err = s.deleteProgressFromScheduledEvent(se) - - if err != nil { - return err - } - // update the scheduled event and set the various flags accordingly (provisioned, ready, finished) retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { seToUpdate, err := s.hfClientSet.HobbyfarmV1().ScheduledEvents(util.GetReleaseNamespace()).Get(s.ctx, se.Name, metav1.GetOptions{}) @@ -206,17 +200,6 @@ func (s ScheduledEventController) deleteVMSetsFromScheduledEvent(se *hfv1.Schedu return nil } -func (s ScheduledEventController) deleteProgressFromScheduledEvent(se *hfv1.ScheduledEvent) error { - // for each vmset that belongs to this to-be-stopped scheduled event, delete that vmset - err := s.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).DeleteCollection(s.ctx, metav1.DeleteOptions{}, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s=%s", util.ScheduledEventLabel, se.Name), - }) - if err != nil { - return err - } - - return nil -} func (s ScheduledEventController) finishSessionsFromScheduledEvent(se *hfv1.ScheduledEvent) error { // get a list of sessions for the user diff --git a/pkg/scheduledeventserver/scheduledevent.go b/pkg/scheduledeventserver/scheduledevent.go index 5306e1f2..72ed3b86 100644 --- a/pkg/scheduledeventserver/scheduledevent.go +++ b/pkg/scheduledeventserver/scheduledevent.go @@ -514,6 +514,13 @@ func (s ScheduledEventServer) DeleteFunc(w http.ResponseWriter, r *http.Request) return } + err = s.deleteProgressFromScheduledEvent(scheduledEvent) + + if err != nil { + util.ReturnHTTPMessage(w, r, 500, "internalerror", err.Error()) + return + } + err = s.deleteScheduledEventConfig(scheduledEvent) if err != nil { util.ReturnHTTPMessage(w, r, 500, "internalerror", "error deleting scheduled event's access code(s) and DBC(s)") @@ -554,6 +561,18 @@ func (s ScheduledEventServer) deleteScheduledEventConfig(se *hfv1.ScheduledEvent return nil // break (return) here because we're done with this SE. } +func (s ScheduledEventServer) deleteProgressFromScheduledEvent(se *hfv1.ScheduledEvent) error { + // for each vmset that belongs to this to-be-stopped scheduled event, delete that vmset + err := s.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).DeleteCollection(s.ctx, metav1.DeleteOptions{}, metav1.ListOptions{ + LabelSelector: fmt.Sprintf("%s=%s", util.ScheduledEventLabel, se.Name), + }) + if err != nil { + return err + } + + return nil +} + func (s ScheduledEventServer) deleteVMSetsFromScheduledEvent(se *hfv1.ScheduledEvent) error { // delete all vmsets corresponding to this scheduled event err := s.hfClientSet.HobbyfarmV1().VirtualMachineSets(util.GetReleaseNamespace()).DeleteCollection(s.ctx, metav1.DeleteOptions{}, metav1.ListOptions{ From 959177998c5ec6379a92d7305399791d75f64814 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Thu, 12 Jan 2023 14:25:49 +0100 Subject: [PATCH 12/20] Changing count capacity on environments works --- pkg/environmentserver/environmentserver.go | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pkg/environmentserver/environmentserver.go b/pkg/environmentserver/environmentserver.go index 582313c7..65b607b2 100644 --- a/pkg/environmentserver/environmentserver.go +++ b/pkg/environmentserver/environmentserver.go @@ -181,6 +181,12 @@ func (e EnvironmentServer) CreateFunc(w http.ResponseWriter, r *http.Request) { return } + countCapacity := r.PostFormValue("count_capacity") + if environmentSpecifics == "" { + util.ReturnHTTPMessage(w, r, 400, "badrequest", "no count_capacity passed in") + return + } + ipTranslationMap := r.PostFormValue("ip_translation_map") if ipTranslationMap == "" { util.ReturnHTTPMessage(w, r, 400, "badrequest", "no ip_translation_map passed in") @@ -201,6 +207,14 @@ func (e EnvironmentServer) CreateFunc(w http.ResponseWriter, r *http.Request) { return } + countCapacityUnmarshaled := map[string]int{} + err = json.Unmarshal([]byte(countCapacity), &countCapacityUnmarshaled) + if err != nil { + glog.Errorf("error while unmarshaling count_capacity (create environment) %v", err) + util.ReturnHTTPMessage(w, r, 500, "internalerror", "error parsing") + return + } + environmentSpecificsUnmarshaled := map[string]string{} err = json.Unmarshal([]byte(environmentSpecifics), &environmentSpecificsUnmarshaled) if err != nil { @@ -230,6 +244,7 @@ func (e EnvironmentServer) CreateFunc(w http.ResponseWriter, r *http.Request) { environment.Spec.EnvironmentSpecifics = environmentSpecificsUnmarshaled environment.Spec.IPTranslationMap = ipTranslationUnmarshaled environment.Spec.WsEndpoint = wsEndpoint + environment.Spec.CountCapacity = countCapacityUnmarshaled environment, err = e.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Create(e.ctx, environment, metav1.CreateOptions{}) @@ -273,6 +288,7 @@ func (e EnvironmentServer) UpdateFunc(w http.ResponseWriter, r *http.Request) { environmentSpecifics := r.PostFormValue("environment_specifics") ipTranslationMap := r.PostFormValue("ip_translation_map") wsEndpoint := r.PostFormValue("ws_endpoint") + countCapacity := r.PostFormValue("count_capacity") if len(displayName) > 0 { environment.Spec.DisplayName = displayName @@ -308,11 +324,22 @@ func (e EnvironmentServer) UpdateFunc(w http.ResponseWriter, r *http.Request) { environment.Spec.EnvironmentSpecifics = environmentSpecificsUnmarshaled } + if(len(countCapacity) > 0){ + countCapacityUnmarshaled := map[string]int{} + err = json.Unmarshal([]byte(countCapacity), &countCapacityUnmarshaled) + if err != nil { + glog.Errorf("error while unmarshaling count_capacity (update environment) %v", err) + util.ReturnHTTPMessage(w, r, 500, "internalerror", "error parsing") + return fmt.Errorf("bad") + } + environment.Spec.CountCapacity = countCapacityUnmarshaled + } + if len(ipTranslationMap) > 0 { ipTranslationUnmarshaled := map[string]string{} err = json.Unmarshal([]byte(ipTranslationMap), &ipTranslationUnmarshaled) if err != nil { - glog.Errorf("error while unmarshaling ip_translation_map (create environment) %v", err) + glog.Errorf("error while unmarshaling ip_translation_map (update environment) %v", err) util.ReturnHTTPMessage(w, r, 500, "internalerror", "error parsing") return fmt.Errorf("bad") } From dc257ea65053b760d985c950ca65d3d63cec63c1 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Fri, 13 Jan 2023 17:22:10 +0100 Subject: [PATCH 13/20] Remove DynamicBindRequest, Strictly respect limits --- main.go | 9 - pkg/apis/hobbyfarm.io/v1/register.go | 2 - pkg/apis/hobbyfarm.io/v1/types.go | 32 -- .../hobbyfarm.io/v1/zz_generated.deepcopy.go | 100 ----- .../hobbyfarm.io/v1/dynamicbindrequest.go | 195 --------- .../v1/fake/fake_dynamicbindrequest.go | 142 ------- .../v1/fake/fake_hobbyfarm.io_client.go | 4 - .../hobbyfarm.io/v1/generated_expansion.go | 2 - .../hobbyfarm.io/v1/hobbyfarm.io_client.go | 5 - .../informers/externalversions/generic.go | 2 - .../hobbyfarm.io/v1/dynamicbindrequest.go | 90 ----- .../hobbyfarm.io/v1/interface.go | 7 - .../hobbyfarm.io/v1/dynamicbindrequest.go | 99 ----- .../hobbyfarm.io/v1/expansion_generated.go | 8 - .../dynamicbindcontroller.go | 379 ------------------ .../vmclaimcontroller/vmclaimcontroller.go | 128 ++++-- pkg/crd/crd.go | 11 - pkg/util/util.go | 11 + 18 files changed, 104 insertions(+), 1122 deletions(-) delete mode 100644 pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/dynamicbindrequest.go delete mode 100644 pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_dynamicbindrequest.go delete mode 100644 pkg/client/informers/externalversions/hobbyfarm.io/v1/dynamicbindrequest.go delete mode 100644 pkg/client/listers/hobbyfarm.io/v1/dynamicbindrequest.go delete mode 100644 pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go diff --git a/main.go b/main.go index 5f6c23e8..ab513fde 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,6 @@ import ( "github.com/hobbyfarm/gargantua/pkg/authserver" hfClientset "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned" hfInformers "github.com/hobbyfarm/gargantua/pkg/client/informers/externalversions" - "github.com/hobbyfarm/gargantua/pkg/controllers/dynamicbindcontroller" "github.com/hobbyfarm/gargantua/pkg/controllers/scheduledevent" "github.com/hobbyfarm/gargantua/pkg/controllers/session" "github.com/hobbyfarm/gargantua/pkg/controllers/tfpcontroller" @@ -420,10 +419,6 @@ func bootStrapControllers(kubeClient *kubernetes.Clientset, hfClient *hfClientse if err != nil { return err } - dynamicBindController, err := dynamicbindcontroller.NewDynamicBindController(hfClient, hfInformerFactory, gctx) - if err != nil { - return err - } g.Go(func() error { return sessionController.Run(stopCh) @@ -445,10 +440,6 @@ func bootStrapControllers(kubeClient *kubernetes.Clientset, hfClient *hfClientse return vmSetController.Run(stopCh) }) - g.Go(func() error { - return dynamicBindController.Run(stopCh) - }) - g.Go(func() error { return rbacControllerFactory.Start(ctx, 1) }) diff --git a/pkg/apis/hobbyfarm.io/v1/register.go b/pkg/apis/hobbyfarm.io/v1/register.go index a717cc9c..6c3ac249 100644 --- a/pkg/apis/hobbyfarm.io/v1/register.go +++ b/pkg/apis/hobbyfarm.io/v1/register.go @@ -51,8 +51,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ScheduledEventList{}, &DynamicBindConfiguration{}, &DynamicBindConfigurationList{}, - &DynamicBindRequest{}, - &DynamicBindRequestList{}, &Progress{}, &ProgressList{}, ) diff --git a/pkg/apis/hobbyfarm.io/v1/types.go b/pkg/apis/hobbyfarm.io/v1/types.go index 4216164e..4df59221 100644 --- a/pkg/apis/hobbyfarm.io/v1/types.go +++ b/pkg/apis/hobbyfarm.io/v1/types.go @@ -84,7 +84,6 @@ type VirtualMachineClaimSpec struct { type VirtualMachineClaimStatus struct { BindMode string `json:"bind_mode"` StaticBindAttempts int `json:"static_bind_attempts"` - DynamicBindRequestId string `json:"dynamic_bind_request_id"` Bound bool `json:"bound"` Ready bool `json:"ready"` Tainted bool `json:"tainted"` // If tainted, we should delete the VM's underneath then delete ourself... @@ -457,34 +456,3 @@ type DynamicBindConfigurationSpec struct { RestrictedBindValue string `json:"restricted_bind_value"` BurstCountCapacity map[string]int `json:"burst_count_capacity"` } - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type DynamicBindRequest struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec DynamicBindRequestSpec `json:"spec"` - Status DynamicBindRequestStatus `json:"status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type DynamicBindRequestList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - Items []DynamicBindRequest `json:"items"` -} - -type DynamicBindRequestSpec struct { - VirtualMachineClaim string `json:"vm_claim"` - Attempts int `json:"attempts"` -} - -type DynamicBindRequestStatus struct { - CurrentAttempts int `json:"current_attempts"` - Expired bool `json:"expired"` - Fulfilled bool `json:"fulfilled"` - DynamicBindConfigurationId string `json:"dynamic_bind_configuration_id"` - VirtualMachineIds map[string]string `json:"virtual_machines_id"` -} diff --git a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go index 0a2753c3..250e1fbf 100644 --- a/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/hobbyfarm.io/v1/zz_generated.deepcopy.go @@ -293,106 +293,6 @@ func (in *DynamicBindConfigurationSpec) DeepCopy() *DynamicBindConfigurationSpec return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicBindRequest) DeepCopyInto(out *DynamicBindRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicBindRequest. -func (in *DynamicBindRequest) DeepCopy() *DynamicBindRequest { - if in == nil { - return nil - } - out := new(DynamicBindRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicBindRequest) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicBindRequestList) DeepCopyInto(out *DynamicBindRequestList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DynamicBindRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicBindRequestList. -func (in *DynamicBindRequestList) DeepCopy() *DynamicBindRequestList { - if in == nil { - return nil - } - out := new(DynamicBindRequestList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DynamicBindRequestList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicBindRequestSpec) DeepCopyInto(out *DynamicBindRequestSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicBindRequestSpec. -func (in *DynamicBindRequestSpec) DeepCopy() *DynamicBindRequestSpec { - if in == nil { - return nil - } - out := new(DynamicBindRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DynamicBindRequestStatus) DeepCopyInto(out *DynamicBindRequestStatus) { - *out = *in - if in.VirtualMachineIds != nil { - in, out := &in.VirtualMachineIds, &out.VirtualMachineIds - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicBindRequestStatus. -func (in *DynamicBindRequestStatus) DeepCopy() *DynamicBindRequestStatus { - if in == nil { - return nil - } - out := new(DynamicBindRequestStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Environment) DeepCopyInto(out *Environment) { *out = *in diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/dynamicbindrequest.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/dynamicbindrequest.go deleted file mode 100644 index 4fd48647..00000000 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/dynamicbindrequest.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" - scheme "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// DynamicBindRequestsGetter has a method to return a DynamicBindRequestInterface. -// A group's client should implement this interface. -type DynamicBindRequestsGetter interface { - DynamicBindRequests(namespace string) DynamicBindRequestInterface -} - -// DynamicBindRequestInterface has methods to work with DynamicBindRequest resources. -type DynamicBindRequestInterface interface { - Create(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.CreateOptions) (*v1.DynamicBindRequest, error) - Update(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.UpdateOptions) (*v1.DynamicBindRequest, error) - UpdateStatus(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.UpdateOptions) (*v1.DynamicBindRequest, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DynamicBindRequest, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.DynamicBindRequestList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DynamicBindRequest, err error) - DynamicBindRequestExpansion -} - -// dynamicBindRequests implements DynamicBindRequestInterface -type dynamicBindRequests struct { - client rest.Interface - ns string -} - -// newDynamicBindRequests returns a DynamicBindRequests -func newDynamicBindRequests(c *HobbyfarmV1Client, namespace string) *dynamicBindRequests { - return &dynamicBindRequests{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the dynamicBindRequest, and returns the corresponding dynamicBindRequest object, and an error if there is any. -func (c *dynamicBindRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DynamicBindRequest, err error) { - result = &v1.DynamicBindRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DynamicBindRequests that match those selectors. -func (c *dynamicBindRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DynamicBindRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DynamicBindRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested dynamicBindRequests. -func (c *dynamicBindRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a dynamicBindRequest and creates it. Returns the server's representation of the dynamicBindRequest, and an error, if there is any. -func (c *dynamicBindRequests) Create(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.CreateOptions) (result *v1.DynamicBindRequest, err error) { - result = &v1.DynamicBindRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dynamicBindRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a dynamicBindRequest and updates it. Returns the server's representation of the dynamicBindRequest, and an error, if there is any. -func (c *dynamicBindRequests) Update(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.UpdateOptions) (result *v1.DynamicBindRequest, err error) { - result = &v1.DynamicBindRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - Name(dynamicBindRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dynamicBindRequest). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *dynamicBindRequests) UpdateStatus(ctx context.Context, dynamicBindRequest *v1.DynamicBindRequest, opts metav1.UpdateOptions) (result *v1.DynamicBindRequest, err error) { - result = &v1.DynamicBindRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - Name(dynamicBindRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(dynamicBindRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the dynamicBindRequest and deletes it. Returns an error if one occurs. -func (c *dynamicBindRequests) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *dynamicBindRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("dynamicbindrequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched dynamicBindRequest. -func (c *dynamicBindRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DynamicBindRequest, err error) { - result = &v1.DynamicBindRequest{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("dynamicbindrequests"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_dynamicbindrequest.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_dynamicbindrequest.go deleted file mode 100644 index 08637377..00000000 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_dynamicbindrequest.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - hobbyfarmiov1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeDynamicBindRequests implements DynamicBindRequestInterface -type FakeDynamicBindRequests struct { - Fake *FakeHobbyfarmV1 - ns string -} - -var dynamicbindrequestsResource = schema.GroupVersionResource{Group: "hobbyfarm.io", Version: "v1", Resource: "dynamicbindrequests"} - -var dynamicbindrequestsKind = schema.GroupVersionKind{Group: "hobbyfarm.io", Version: "v1", Kind: "DynamicBindRequest"} - -// Get takes name of the dynamicBindRequest, and returns the corresponding dynamicBindRequest object, and an error if there is any. -func (c *FakeDynamicBindRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *hobbyfarmiov1.DynamicBindRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(dynamicbindrequestsResource, c.ns, name), &hobbyfarmiov1.DynamicBindRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*hobbyfarmiov1.DynamicBindRequest), err -} - -// List takes label and field selectors, and returns the list of DynamicBindRequests that match those selectors. -func (c *FakeDynamicBindRequests) List(ctx context.Context, opts v1.ListOptions) (result *hobbyfarmiov1.DynamicBindRequestList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(dynamicbindrequestsResource, dynamicbindrequestsKind, c.ns, opts), &hobbyfarmiov1.DynamicBindRequestList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &hobbyfarmiov1.DynamicBindRequestList{ListMeta: obj.(*hobbyfarmiov1.DynamicBindRequestList).ListMeta} - for _, item := range obj.(*hobbyfarmiov1.DynamicBindRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested dynamicBindRequests. -func (c *FakeDynamicBindRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(dynamicbindrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a dynamicBindRequest and creates it. Returns the server's representation of the dynamicBindRequest, and an error, if there is any. -func (c *FakeDynamicBindRequests) Create(ctx context.Context, dynamicBindRequest *hobbyfarmiov1.DynamicBindRequest, opts v1.CreateOptions) (result *hobbyfarmiov1.DynamicBindRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(dynamicbindrequestsResource, c.ns, dynamicBindRequest), &hobbyfarmiov1.DynamicBindRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*hobbyfarmiov1.DynamicBindRequest), err -} - -// Update takes the representation of a dynamicBindRequest and updates it. Returns the server's representation of the dynamicBindRequest, and an error, if there is any. -func (c *FakeDynamicBindRequests) Update(ctx context.Context, dynamicBindRequest *hobbyfarmiov1.DynamicBindRequest, opts v1.UpdateOptions) (result *hobbyfarmiov1.DynamicBindRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(dynamicbindrequestsResource, c.ns, dynamicBindRequest), &hobbyfarmiov1.DynamicBindRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*hobbyfarmiov1.DynamicBindRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDynamicBindRequests) UpdateStatus(ctx context.Context, dynamicBindRequest *hobbyfarmiov1.DynamicBindRequest, opts v1.UpdateOptions) (*hobbyfarmiov1.DynamicBindRequest, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(dynamicbindrequestsResource, "status", c.ns, dynamicBindRequest), &hobbyfarmiov1.DynamicBindRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*hobbyfarmiov1.DynamicBindRequest), err -} - -// Delete takes name of the dynamicBindRequest and deletes it. Returns an error if one occurs. -func (c *FakeDynamicBindRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(dynamicbindrequestsResource, c.ns, name), &hobbyfarmiov1.DynamicBindRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDynamicBindRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(dynamicbindrequestsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &hobbyfarmiov1.DynamicBindRequestList{}) - return err -} - -// Patch applies the patch and returns the patched dynamicBindRequest. -func (c *FakeDynamicBindRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *hobbyfarmiov1.DynamicBindRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(dynamicbindrequestsResource, c.ns, name, pt, data, subresources...), &hobbyfarmiov1.DynamicBindRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*hobbyfarmiov1.DynamicBindRequest), err -} diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_hobbyfarm.io_client.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_hobbyfarm.io_client.go index daaf5640..158c342b 100644 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_hobbyfarm.io_client.go +++ b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/fake/fake_hobbyfarm.io_client.go @@ -40,10 +40,6 @@ func (c *FakeHobbyfarmV1) DynamicBindConfigurations(namespace string) v1.Dynamic return &FakeDynamicBindConfigurations{c, namespace} } -func (c *FakeHobbyfarmV1) DynamicBindRequests(namespace string) v1.DynamicBindRequestInterface { - return &FakeDynamicBindRequests{c, namespace} -} - func (c *FakeHobbyfarmV1) Environments(namespace string) v1.EnvironmentInterface { return &FakeEnvironments{c, namespace} } diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/generated_expansion.go index f89882c3..48aa7bfd 100644 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/generated_expansion.go @@ -24,8 +24,6 @@ type CourseExpansion interface{} type DynamicBindConfigurationExpansion interface{} -type DynamicBindRequestExpansion interface{} - type EnvironmentExpansion interface{} type ProgressExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go index 49bbb42c..9902bc5c 100644 --- a/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go +++ b/pkg/client/clientset/versioned/typed/hobbyfarm.io/v1/hobbyfarm.io_client.go @@ -31,7 +31,6 @@ type HobbyfarmV1Interface interface { AccessCodesGetter CoursesGetter DynamicBindConfigurationsGetter - DynamicBindRequestsGetter EnvironmentsGetter ProgressesGetter ScenariosGetter @@ -62,10 +61,6 @@ func (c *HobbyfarmV1Client) DynamicBindConfigurations(namespace string) DynamicB return newDynamicBindConfigurations(c, namespace) } -func (c *HobbyfarmV1Client) DynamicBindRequests(namespace string) DynamicBindRequestInterface { - return newDynamicBindRequests(c, namespace) -} - func (c *HobbyfarmV1Client) Environments(namespace string) EnvironmentInterface { return newEnvironments(c, namespace) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 2b892a89..dbe157db 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -61,8 +61,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Hobbyfarm().V1().Courses().Informer()}, nil case v1.SchemeGroupVersion.WithResource("dynamicbindconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hobbyfarm().V1().DynamicBindConfigurations().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("dynamicbindrequests"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Hobbyfarm().V1().DynamicBindRequests().Informer()}, nil case v1.SchemeGroupVersion.WithResource("environments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hobbyfarm().V1().Environments().Informer()}, nil case v1.SchemeGroupVersion.WithResource("progresses"): diff --git a/pkg/client/informers/externalversions/hobbyfarm.io/v1/dynamicbindrequest.go b/pkg/client/informers/externalversions/hobbyfarm.io/v1/dynamicbindrequest.go deleted file mode 100644 index 5a77f678..00000000 --- a/pkg/client/informers/externalversions/hobbyfarm.io/v1/dynamicbindrequest.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - hobbyfarmiov1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" - versioned "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned" - internalinterfaces "github.com/hobbyfarm/gargantua/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/hobbyfarm/gargantua/pkg/client/listers/hobbyfarm.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// DynamicBindRequestInformer provides access to a shared informer and lister for -// DynamicBindRequests. -type DynamicBindRequestInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.DynamicBindRequestLister -} - -type dynamicBindRequestInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewDynamicBindRequestInformer constructs a new informer for DynamicBindRequest type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewDynamicBindRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredDynamicBindRequestInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredDynamicBindRequestInformer constructs a new informer for DynamicBindRequest type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredDynamicBindRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.HobbyfarmV1().DynamicBindRequests(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.HobbyfarmV1().DynamicBindRequests(namespace).Watch(context.TODO(), options) - }, - }, - &hobbyfarmiov1.DynamicBindRequest{}, - resyncPeriod, - indexers, - ) -} - -func (f *dynamicBindRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredDynamicBindRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *dynamicBindRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&hobbyfarmiov1.DynamicBindRequest{}, f.defaultInformer) -} - -func (f *dynamicBindRequestInformer) Lister() v1.DynamicBindRequestLister { - return v1.NewDynamicBindRequestLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/hobbyfarm.io/v1/interface.go b/pkg/client/informers/externalversions/hobbyfarm.io/v1/interface.go index 816aad72..abce9baf 100644 --- a/pkg/client/informers/externalversions/hobbyfarm.io/v1/interface.go +++ b/pkg/client/informers/externalversions/hobbyfarm.io/v1/interface.go @@ -30,8 +30,6 @@ type Interface interface { Courses() CourseInformer // DynamicBindConfigurations returns a DynamicBindConfigurationInformer. DynamicBindConfigurations() DynamicBindConfigurationInformer - // DynamicBindRequests returns a DynamicBindRequestInformer. - DynamicBindRequests() DynamicBindRequestInformer // Environments returns a EnvironmentInformer. Environments() EnvironmentInformer // Progresses returns a ProgressInformer. @@ -80,11 +78,6 @@ func (v *version) DynamicBindConfigurations() DynamicBindConfigurationInformer { return &dynamicBindConfigurationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// DynamicBindRequests returns a DynamicBindRequestInformer. -func (v *version) DynamicBindRequests() DynamicBindRequestInformer { - return &dynamicBindRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Environments returns a EnvironmentInformer. func (v *version) Environments() EnvironmentInformer { return &environmentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/listers/hobbyfarm.io/v1/dynamicbindrequest.go b/pkg/client/listers/hobbyfarm.io/v1/dynamicbindrequest.go deleted file mode 100644 index dcf4abed..00000000 --- a/pkg/client/listers/hobbyfarm.io/v1/dynamicbindrequest.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// DynamicBindRequestLister helps list DynamicBindRequests. -// All objects returned here must be treated as read-only. -type DynamicBindRequestLister interface { - // List lists all DynamicBindRequests in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.DynamicBindRequest, err error) - // DynamicBindRequests returns an object that can list and get DynamicBindRequests. - DynamicBindRequests(namespace string) DynamicBindRequestNamespaceLister - DynamicBindRequestListerExpansion -} - -// dynamicBindRequestLister implements the DynamicBindRequestLister interface. -type dynamicBindRequestLister struct { - indexer cache.Indexer -} - -// NewDynamicBindRequestLister returns a new DynamicBindRequestLister. -func NewDynamicBindRequestLister(indexer cache.Indexer) DynamicBindRequestLister { - return &dynamicBindRequestLister{indexer: indexer} -} - -// List lists all DynamicBindRequests in the indexer. -func (s *dynamicBindRequestLister) List(selector labels.Selector) (ret []*v1.DynamicBindRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DynamicBindRequest)) - }) - return ret, err -} - -// DynamicBindRequests returns an object that can list and get DynamicBindRequests. -func (s *dynamicBindRequestLister) DynamicBindRequests(namespace string) DynamicBindRequestNamespaceLister { - return dynamicBindRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// DynamicBindRequestNamespaceLister helps list and get DynamicBindRequests. -// All objects returned here must be treated as read-only. -type DynamicBindRequestNamespaceLister interface { - // List lists all DynamicBindRequests in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.DynamicBindRequest, err error) - // Get retrieves the DynamicBindRequest from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.DynamicBindRequest, error) - DynamicBindRequestNamespaceListerExpansion -} - -// dynamicBindRequestNamespaceLister implements the DynamicBindRequestNamespaceLister -// interface. -type dynamicBindRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DynamicBindRequests in the indexer for a given namespace. -func (s dynamicBindRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.DynamicBindRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DynamicBindRequest)) - }) - return ret, err -} - -// Get retrieves the DynamicBindRequest from the indexer for a given namespace and name. -func (s dynamicBindRequestNamespaceLister) Get(name string) (*v1.DynamicBindRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("dynamicbindrequest"), name) - } - return obj.(*v1.DynamicBindRequest), nil -} diff --git a/pkg/client/listers/hobbyfarm.io/v1/expansion_generated.go b/pkg/client/listers/hobbyfarm.io/v1/expansion_generated.go index dfbe785a..9b3208d7 100644 --- a/pkg/client/listers/hobbyfarm.io/v1/expansion_generated.go +++ b/pkg/client/listers/hobbyfarm.io/v1/expansion_generated.go @@ -42,14 +42,6 @@ type DynamicBindConfigurationListerExpansion interface{} // DynamicBindConfigurationNamespaceLister. type DynamicBindConfigurationNamespaceListerExpansion interface{} -// DynamicBindRequestListerExpansion allows custom methods to be added to -// DynamicBindRequestLister. -type DynamicBindRequestListerExpansion interface{} - -// DynamicBindRequestNamespaceListerExpansion allows custom methods to be added to -// DynamicBindRequestNamespaceLister. -type DynamicBindRequestNamespaceListerExpansion interface{} - // EnvironmentListerExpansion allows custom methods to be added to // EnvironmentLister. type EnvironmentListerExpansion interface{} diff --git a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go b/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go deleted file mode 100644 index 068b8924..00000000 --- a/pkg/controllers/dynamicbindcontroller/dynamicbindcontroller.go +++ /dev/null @@ -1,379 +0,0 @@ -package dynamicbindcontroller - -import ( - "context" - "fmt" - "math/rand" - "strings" - "time" - - "github.com/golang/glog" - hfv1 "github.com/hobbyfarm/gargantua/pkg/apis/hobbyfarm.io/v1" - hfClientset "github.com/hobbyfarm/gargantua/pkg/client/clientset/versioned" - hfInformers "github.com/hobbyfarm/gargantua/pkg/client/informers/externalversions" - hfListers "github.com/hobbyfarm/gargantua/pkg/client/listers/hobbyfarm.io/v1" - "github.com/hobbyfarm/gargantua/pkg/util" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/retry" - "k8s.io/client-go/util/workqueue" -) - -type DynamicBindController struct { - hfClientSet hfClientset.Interface - vmtLister hfListers.VirtualMachineTemplateLister - - dynamicBindRequestWorkqueue workqueue.RateLimitingInterface - - dynamicBindRequestLister hfListers.DynamicBindRequestLister - - dynamicBindRequestsSynced cache.InformerSynced - ctx context.Context -} - -func NewDynamicBindController(hfClientSet hfClientset.Interface, hfInformerFactory hfInformers.SharedInformerFactory, ctx context.Context) (*DynamicBindController, error) { - dynamicBindController := DynamicBindController{} - dynamicBindController.hfClientSet = hfClientSet - dynamicBindController.vmtLister = hfInformerFactory.Hobbyfarm().V1().VirtualMachineTemplates().Lister() - - dynamicBindController.dynamicBindRequestsSynced = hfInformerFactory.Hobbyfarm().V1().DynamicBindRequests().Informer().HasSynced - - dynamicBindController.dynamicBindRequestWorkqueue = workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DynamicBindRequest") - - dynamicBindRequestInformer := hfInformerFactory.Hobbyfarm().V1().DynamicBindRequests().Informer() - - dynamicBindRequestInformer.AddEventHandlerWithResyncPeriod(cache.ResourceEventHandlerFuncs{ - AddFunc: dynamicBindController.enqueueDynamicBindRequest, - UpdateFunc: func(old, new interface{}) { - dynamicBindController.enqueueDynamicBindRequest(new) - }, - DeleteFunc: dynamicBindController.enqueueDynamicBindRequest, - }, time.Minute*30) - dynamicBindController.ctx = ctx - - return &dynamicBindController, nil -} - -func (d *DynamicBindController) enqueueDynamicBindRequest(obj interface{}) { - var key string - var err error - if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil { - //utilruntime.HandleError(err) - return - } - glog.V(8).Infof("Enqueueing dynamic bind request %s", key) - d.dynamicBindRequestWorkqueue.AddRateLimited(key) -} - -func (d *DynamicBindController) Run(stopCh <-chan struct{}) error { - defer d.dynamicBindRequestWorkqueue.ShutDown() - - glog.V(4).Infof("Starting dynamic bind controller") - glog.Info("Waiting for informer caches to sync") - if ok := cache.WaitForCacheSync(stopCh, d.dynamicBindRequestsSynced); !ok { - return fmt.Errorf("failed to wait for caches to sync") - } - glog.Info("Dynamic bind controller caches synced, starting controller loops") - go wait.Until(d.runDynamicBindWorker, time.Second, stopCh) - glog.Info("Started Dynamic Bind Controller worker") - <-stopCh - return nil -} - -func (d *DynamicBindController) runDynamicBindWorker() { - for d.processNextDynamicBindRequest() { - - } -} - -func (d *DynamicBindController) processNextDynamicBindRequest() bool { - obj, shutdown := d.dynamicBindRequestWorkqueue.Get() - - glog.V(8).Infof("processing dynamic bind request") - - if shutdown { - return false - } - - err := func() error { - defer d.dynamicBindRequestWorkqueue.Done(obj) - glog.V(4).Infof("processing dynamic bind request in dynamic bind controller: %v", obj) - _, objName, err := cache.SplitMetaNamespaceKey(obj.(string)) // this is actually not necessary because dynamic bind request's are not namespaced yet... - if err != nil { - glog.Errorf("error while splitting meta namespace key %v", err) - //e.vmWorkqueue.AddRateLimited(obj) - return nil - } - - dynamicBindRequest, err := d.hfClientSet.HobbyfarmV1().DynamicBindRequests(util.GetReleaseNamespace()).Get(d.ctx, objName, metav1.GetOptions{}) - if err != nil { - glog.Errorf("error while retrieving dynamic bind request %s, likely deleted %v", objName, err) - d.dynamicBindRequestWorkqueue.Forget(obj) - return nil - } - - if dynamicBindRequest.Status.Fulfilled || dynamicBindRequest.Status.Expired { - d.dynamicBindRequestWorkqueue.Forget(obj) - return nil - } - - err = d.reconcileDynamicBindRequest(dynamicBindRequest) - if err != nil { - d.dynamicBindRequestWorkqueue.AddRateLimited(obj) - glog.Error(err) - } - - d.dynamicBindRequestWorkqueue.Forget(obj) - glog.V(4).Infof("dynamic bind request processed by dynamic bind controller %v", objName) - - return nil - - }() - - if err != nil { - return true - } - - return true -} - -func (d *DynamicBindController) reconcileDynamicBindRequest(dynamicBindRequest *hfv1.DynamicBindRequest) error { - - d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts+1, false, false, "", make(map[string]string), dynamicBindRequest.Name) - - vmClaim, err := d.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Get(d.ctx, dynamicBindRequest.Spec.VirtualMachineClaim, metav1.GetOptions{}) - - if err != nil { - glog.Errorf("error retrieving corresponding virtual machine claim %s for dynamic bind request %s", dynamicBindRequest.Spec.VirtualMachineClaim, dynamicBindRequest.Name) - return err - } - - var dbcSelector metav1.ListOptions - if vmClaim.Spec.RestrictedBind { - dbcSelector = metav1.ListOptions{ - LabelSelector: fmt.Sprintf("restrictedbind=true,restrictedbindvalue=%s", vmClaim.Spec.RestrictedBindValue), - } - } else { - dbcSelector = metav1.ListOptions{ - LabelSelector: "restrictedbind=false", - } - } - - dynamicBindConfigurations, err := d.hfClientSet.HobbyfarmV1().DynamicBindConfigurations(util.GetReleaseNamespace()).List(d.ctx, dbcSelector) - - if err != nil { - glog.Errorf("Error while retrieving dynamic bind configurations, %v", err) - return err - } - - var chosenDynamicBindConfiguration *hfv1.DynamicBindConfiguration - var chosenEnvironment *hfv1.Environment - var dbcChosen bool - var provision bool - dbcChosen = false - provision = true - for _, dynamicBindConfiguration := range dynamicBindConfigurations.Items { - environment, err := d.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Get(d.ctx, dynamicBindConfiguration.Spec.Environment, metav1.GetOptions{}) - - if provisionMethod, ok := environment.Annotations["hobbyfarm.io/provisioner"]; ok { - if provisionMethod == "external" { - provision = false - } - } - if err != nil { - glog.Errorf("Error while retrieving environment %v", err) - return err - } - - suitable := true - - needed := make(map[string]int) - - for _, template := range vmClaim.Spec.VirtualMachines { - if template.VirtualMachineId == "" { - if val, ok := needed[template.Template]; ok { - needed[template.Template] = val + 1 - } else { - needed[template.Template] = 1 - } - } - } - - for vmTemplate, vmsNeeded := range needed { - // first, let's see if the environment itself has capacity - currentVMs, err := d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,%s=%s,template=%s", util.EnvironmentLabel, environment.Name, vmTemplate), - }) - if err != nil { - glog.V(4).Infof("error retrieving current vm list, assuming environment empty") - } - availableVMCount := environment.Spec.CountCapacity[vmTemplate] - len(currentVMs.Items) - - if availableVMCount < vmsNeeded { - // this environment does not suit us. move on. - suitable = false - break - } - - // next check if the dynamicbindconfiguration has capacity - currentVMs, err = d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).List(d.ctx, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("dynamic=true,dynamicbindconfig=%s,template=%s", dynamicBindConfiguration.Name, vmTemplate), - }) - if err != nil { - glog.V(4).Infof("error retrieving current vm list, assuming no machines") - } - availableVMCount = dynamicBindConfiguration.Spec.BurstCountCapacity[vmTemplate] - len(currentVMs.Items) - - if availableVMCount < vmsNeeded { - // this DBC has no more provisioning capacity - suitable = false - break - } - } - - if suitable { - chosenDynamicBindConfiguration = &dynamicBindConfiguration - chosenEnvironment = environment - dbcChosen = true - break - } - } - - if dbcChosen { - virtualMachines := make(map[string]string) - - for vmClaimVMName, vmX := range vmClaim.Spec.VirtualMachines { - vmName := strings.Join([]string{chosenDynamicBindConfiguration.Spec.BaseName, fmt.Sprintf("%08x", rand.Uint32())}, "-") - vm := &hfv1.VirtualMachine{ - ObjectMeta: metav1.ObjectMeta{ - Name: vmName, - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "hobbyfarm.io/v1", - Kind: "DynamicBindRequest", - Name: dynamicBindRequest.Name, - UID: dynamicBindRequest.UID, - }, - }, - Labels: map[string]string{ - "dynamic": "true", - "dynamicbindrequest": dynamicBindRequest.Name, - "dynamicbindconfiguration": chosenDynamicBindConfiguration.Name, - "template": vmX.Template, - util.EnvironmentLabel: chosenDynamicBindConfiguration.Spec.Environment, - "bound": "true", - "ready": "false", - util.ScheduledEventLabel: chosenDynamicBindConfiguration.ObjectMeta.Labels[util.ScheduledEventLabel], - }, - }, - Spec: hfv1.VirtualMachineSpec{ - VirtualMachineTemplateId: vmX.Template, - SecretName: "", - Protocol: "ssh", //default protocol is ssh - VirtualMachineClaimId: dynamicBindRequest.Spec.VirtualMachineClaim, - UserId: vmClaim.Spec.UserId, - Provision: provision, - VirtualMachineSetId: "", - }, - } - - vmt, err := d.vmtLister.VirtualMachineTemplates(util.GetReleaseNamespace()).Get(vmX.Template) - if err != nil { - glog.Errorf("error getting vmt %v", err) - return err - } - - config := util.GetVMConfig(chosenEnvironment,vmt) - - protocol, exists := config["protocol"] - if exists { - vm.Spec.Protocol = protocol - } - - sshUser, exists := config["ssh_username"] - if exists { - vm.Spec.SshUsername = sshUser - } - - // extra label to indicate external provisioning so tfpcontroller ignores this request // - if provisionMethod, ok := chosenEnvironment.Annotations["hobbyfarm.io/provisioner"]; ok { - vm.ObjectMeta.Labels["hobbyfarm.io/provisioner"] = provisionMethod - vm.Spec.Provision = false - } - - // label to indicate which vmtemplate being used for querying reasons - vm.ObjectMeta.Labels["hobbyfarm.io/vmtemplate"] = vm.Spec.VirtualMachineTemplateId - - if chosenDynamicBindConfiguration.Spec.RestrictedBind { - vm.ObjectMeta.Labels["restrictedbind"] = "true" - vm.ObjectMeta.Labels["restrictedbindvalue"] = chosenDynamicBindConfiguration.Spec.RestrictedBindValue - } else { - vm.ObjectMeta.Labels["restrictedbind"] = "false" - } - newVm, err := d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Create(d.ctx, vm, metav1.CreateOptions{}) - - if err != nil { - glog.Error(err) - } - - newVm.Status = hfv1.VirtualMachineStatus{ - Status: hfv1.VmStatusRFP, - Allocated: true, - Tainted: false, - WsEndpoint: chosenEnvironment.Spec.WsEndpoint, - PublicIP: "", - PrivateIP: "", - EnvironmentId: chosenEnvironment.Name, - Hostname: "", - } - - _, err = d.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(d.ctx, newVm, metav1.UpdateOptions{}) - - if err != nil { - glog.Error(err) - } - - virtualMachines[vmClaimVMName] = newVm.Name - } - - d.updateDynamicBindRequestStatus(dynamicBindRequest.Spec.Attempts, false, true, chosenDynamicBindConfiguration.Name, virtualMachines, dynamicBindRequest.Name) - - } else { - // check to see if we're above our attempt threshold - if dynamicBindRequest.Status.CurrentAttempts > dynamicBindRequest.Spec.Attempts { - d.updateDynamicBindRequestStatus(dynamicBindRequest.Status.CurrentAttempts, true, false, "", make(map[string]string), dynamicBindRequest.Name) - } else { - return fmt.Errorf("did not bind dynamic vms for dynamic bind request %s", dynamicBindRequest.Name) - } - } - - return nil -} - -func (d *DynamicBindController) updateDynamicBindRequestStatus(dynamicBindAttempts int, expired bool, fulfilled bool, dynamicBindConfigurationId string, virtualMachineIds map[string]string, dynamicBindRequestId string) error { - - retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - result, getErr := d.hfClientSet.HobbyfarmV1().DynamicBindRequests(util.GetReleaseNamespace()).Get(d.ctx, dynamicBindRequestId, metav1.GetOptions{}) - if getErr != nil { - return fmt.Errorf("error retrieving latest version of DynamicBindRequest %s: %v", dynamicBindRequestId, getErr) - } - - result.Status.CurrentAttempts = dynamicBindAttempts - result.Status.Expired = expired - result.Status.Fulfilled = fulfilled - result.Status.DynamicBindConfigurationId = dynamicBindConfigurationId - result.Status.VirtualMachineIds = virtualMachineIds - - _, updateErr := d.hfClientSet.HobbyfarmV1().DynamicBindRequests(util.GetReleaseNamespace()).UpdateStatus(d.ctx, result, metav1.UpdateOptions{}) - if updateErr != nil { - return updateErr - } - glog.V(4).Infof("updated result for dynamic bind request") - return nil - }) - if retryErr != nil { - return fmt.Errorf("error updating DynamicBindRequest: %s, %v", dynamicBindRequestId, retryErr) - } - return nil -} diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index 2ae13809..2311498a 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -256,6 +256,7 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e if vmc.Status.BindMode == "dynamic" { err = v.submitVirtualMachines(vmc) if err != nil { + // TODO 13.01.2023: Delete VirtualMachineClaim OR Set it to invalid. Same for static mode return err } } else if vmc.Status.BindMode == "static" { @@ -293,6 +294,11 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e return nil } +type VMEnvironment struct { + Environment hfv1.Environment + DynamicBindConfiguration hfv1.DynamicBindConfiguration +} + func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) (err error) { accessCode, ok := vmc.Labels[util.AccessCodeLabel] if !ok { @@ -300,14 +306,28 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) return fmt.Errorf("accessCode label not set on vmc, aborting") } - env, seName, dbc, err := v.findEnvironmentForVM(accessCode) + environments, seName, dbcList, err := v.findEnvironmentsForVM(accessCode, vmc) if err != nil { glog.Errorf("error fetching environment for access code %s %v", accessCode, err) return err } + + // TODO 13.01.2023: Fix issue where provisioning two of the same template in the samce VMC can cause overprovisioning for environments + environmentMap := make(map[string]VMEnvironment) + for vmName, vmDetails := range vmc.Spec.VirtualMachines { + env, dbc, err := v.findSuitableEnvironmentForVMTemplate(environments, dbcList, vmDetails.Template) + if err != nil{ + glog.Errorf("no suitable environment for %s (%s): %v", vmName, vmDetails.Template, err) + return err + } + environmentMap[vmName] = VMEnvironment{env, dbc} + } + vmMap := make(map[string]hfv1.VirtualMachineClaimVM) for vmName, vmDetails := range vmc.Spec.VirtualMachines { genName := fmt.Sprintf("%s-%08x", vmc.Spec.BaseName, rand.Uint32()) + environment := environmentMap[vmName].Environment + dbc := environmentMap[vmName].DynamicBindConfiguration vm := &hfv1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ Name: genName, @@ -323,7 +343,7 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) "dynamic": "true", "vmc": vmc.Name, "template": vmDetails.Template, - "environment": env.Name, + "environment": environment.Name, "bound": "true", "ready": "false", util.ScheduledEventLabel: seName, @@ -351,7 +371,7 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) return err } - config := util.GetVMConfig(env,vmt) + config := util.GetVMConfig(&environment,vmt) protocol, exists := config["protocol"] if exists { @@ -364,7 +384,7 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) } // extra label to indicate external provisioning so tfpcontroller ignores this request // - if provisionMethod, ok := env.Annotations["hobbyfarm.io/provisioner"]; ok { + if provisionMethod, ok := environment.Annotations["hobbyfarm.io/provisioner"]; ok { vm.Labels["hobbyfarm.io/provisioner"] = provisionMethod vm.Spec.Provision = false } @@ -387,8 +407,8 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) Status: hfv1.VmStatusRFP, Allocated: true, Tainted: false, - WsEndpoint: env.Spec.WsEndpoint, - EnvironmentId: env.Name, + WsEndpoint: environment.Spec.WsEndpoint, + EnvironmentId: environment.Name, PublicIP: "", PrivateIP: "", } @@ -409,19 +429,11 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) return nil } -func (v *VMClaimController) findEnvironmentForVM(accessCode string) (env *hfv1.Environment, seName string, dbc *hfv1.DynamicBindConfiguration, err error) { - // find scheduledEvent for this accessCode - var envName string - seName, envName, err = v.findScheduledEvent(accessCode) +// Based on the given VirtualMachineClaim and ScheduledEvent find all suitable Environments (e.g. environment provides required VMTeplate & ScheduledEvents allows this environment and VMTemplate configuration etc.) +func (v *VMClaimController) findEnvironmentsForVM(accessCode string, vmc *hfv1.VirtualMachineClaim) (environments []hfv1.Environment, seName string, dbc []hfv1.DynamicBindConfiguration, err error) { + seName, _, err = v.findScheduledEvent(accessCode) if err != nil { - return env, seName, dbc, err - } - - env, err = v.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Get(v.ctx, envName, metav1.GetOptions{}) - - if err != nil { - glog.Errorf("error fetching environment %v", err) - return env, seName, dbc, err + return environments, seName, dbc, err } dbcList, err := v.hfClientSet.HobbyfarmV1().DynamicBindConfigurations(util.GetReleaseNamespace()).List(v.ctx, metav1.ListOptions{ @@ -430,16 +442,51 @@ func (v *VMClaimController) findEnvironmentForVM(accessCode string) (env *hfv1.E if err != nil { glog.Errorf("error listing dbc %v", err) - return env, seName, dbc, err + return environments, seName, dbc, err + } + + for _ , dbc := range dbcList.Items { + env, err := v.hfClientSet.HobbyfarmV1().Environments(util.GetReleaseNamespace()).Get(v.ctx, dbc.Spec.Environment, metav1.GetOptions{}) + + if err != nil { + glog.Errorf("error fetching environment %v", err) + return environments, seName, dbcList.Items, err + } + environments = append(environments, *env) } - if len(dbcList.Items) != 1 { - return env, seName, dbc, fmt.Errorf("incorrect number of dbc matching sessionName found") + if len(dbcList.Items) < 1 { + return environments, seName, dbc, fmt.Errorf("incorrect number of dbc matching sessionName found") } - dbc = &dbcList.Items[0] - //dbc = &dbcList.Items[0] - return env, seName, dbc, err + return environments, seName, dbcList.Items, err +} + +func (v *VMClaimController) findSuitableEnvironmentForVMTemplate(environments []hfv1.Environment, dbcList []hfv1.DynamicBindConfiguration, template string) (hfv1.Environment, hfv1.DynamicBindConfiguration, error) { + for _, environment := range environments { + count, err := util.CountMachinesPerTemplateAndEnvironment(v.vmLister, template, environment.Name) + if(err != nil){ + continue + } + if(count >= environment.Spec.CountCapacity[template]){ + // Environment has no capacity left for this Template. Skipping + continue + } + // found environment that satisfies capacity for this template + for _, dbc := range dbcList { + if(dbc.Spec.Environment == environment.Name){ + if capacity, found := dbc.Spec.BurstCountCapacity[template]; found { + if(count < capacity){ + // Capacity also satisfied for environment + scheduledEvent via DBC + return environment, dbc, nil + } + } + } + } + + } + + return hfv1.Environment{}, hfv1.DynamicBindConfiguration{}, fmt.Errorf("no suitable environment found. capacity reached") } func (v *VMClaimController) checkVMStatus(vmc *hfv1.VirtualMachineClaim) (ready bool, err error) { @@ -459,26 +506,25 @@ func (v *VMClaimController) checkVMStatus(vmc *hfv1.VirtualMachineClaim) (ready return ready, err } -func (v *VMClaimController) findScheduledEvent(accessCode string) (schedEvent string, envName string, err error) { +func (v *VMClaimController) findScheduledEvent(accessCode string) (schedEvent string, environments map[string]map[string]int, err error) { seList, err := v.hfClientSet.HobbyfarmV1().ScheduledEvents(util.GetReleaseNamespace()).List(v.ctx, metav1.ListOptions{}) if err != nil { - return schedEvent, envName, err + return schedEvent, environments, err } for _, se := range seList.Items { if se.Spec.AccessCode == accessCode { schedEvent = se.Name - for k, _ := range se.Spec.RequiredVirtualMachines { - envName = k - } + environments = se.Spec.RequiredVirtualMachines + break } } if schedEvent == "" { - return schedEvent, envName, fmt.Errorf("no scheduled event matching access code %s found", accessCode) + return schedEvent, environments, fmt.Errorf("no scheduled event matching access code %s found", accessCode) } - return schedEvent, envName, nil + return schedEvent, environments, nil } func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) (err error) { @@ -487,7 +533,7 @@ func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) ( glog.Error("accessCode label not set on vmc, aborting") return fmt.Errorf("accessCode label not set on vmc, aborting") } - _, env, err := v.findScheduledEvent(accessCode) + _, environments, err := v.findScheduledEvent(accessCode) if err != nil { glog.Error("error finding scheduledevent during static bind") @@ -498,7 +544,7 @@ func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) ( for name, vmStruct := range vmc.Spec.VirtualMachines { if vmStruct.VirtualMachineId == "" { glog.Info("assigning a vm") - vmID, err := v.assignNextFreeVM(vmc.Name, vmc.Spec.UserId, vmStruct.Template, env, vmc.Spec.RestrictedBind, vmc.Spec.RestrictedBindValue) + vmID, err := v.assignNextFreeVM(vmc.Name, vmc.Spec.UserId, environments, vmStruct.Template, vmc.Spec.RestrictedBind, vmc.Spec.RestrictedBindValue) if err != nil { return err } @@ -559,11 +605,12 @@ func (v *VMClaimController) assignVM(vmClaimId string, user string, vmId string return vmId, nil } -func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, template string, environmentId string, restrictedBind bool, restrictedBindValue string) (string, error) { +func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, environments map[string]map[string]int, template string, restrictedBind bool, restrictedBindValue string) (string, error) { + + // TODO 13.01.2023: Ability to force the same environment for all VMs from one VMClaim vmLabels := labels.Set{ "bound": "false", - "environment": environmentId, "template": template, } @@ -583,6 +630,17 @@ func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, temp assigned := false vmId := "" for _, vm := range vms { + // Check for Supported environment + if vmts, found := environments[vm.Labels["environment"]]; found { + // This virtualmachine is one of the supported environments + if _, foundVMT := vmts[vm.Spec.VirtualMachineTemplateId]; !foundVMT { + // ... but this environment does not support this virtualmachinetemplate + continue + } + }else{ + // This virtualmachine is in a non supported environment + continue; + } if !vm.Status.Allocated && !vm.Status.Tainted { // we can assign this vm assigned = true diff --git a/pkg/crd/crd.go b/pkg/crd/crd.go index 1e312f47..88349ba5 100644 --- a/pkg/crd/crd.go +++ b/pkg/crd/crd.go @@ -139,17 +139,6 @@ func GenerateCRDs(caBundle string, reference apiextv1.ServiceReference) []crder. IsNamespaced(true). AddVersion("v1", &v1.DynamicBindConfiguration{}, nil) }), - hobbyfarmCRD(&v1.DynamicBindRequest{}, func(c *crder.CRD) { - c. - IsNamespaced(true). - AddVersion("v1", &v1.DynamicBindRequest{}, func(cv *crder.Version) { - cv. - WithColumn("CurrentAttempts", ".status.current_attempts"). - WithColumn("Expired", ".status.expired"). - WithColumn("Fulfilled", ".status.fulfilled"). - WithStatus() - }) - }), terraformCRD(&terraformv1.Module{}, func(c *crder.CRD) { c. IsNamespaced(true). diff --git a/pkg/util/util.go b/pkg/util/util.go index 7469d697..aa8d9cdc 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -20,6 +20,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" + "k8s.io/apimachinery/pkg/labels" "net/http" "os" @@ -434,6 +435,16 @@ func VirtualMachinesUsedDuringPeriod(hfClientset hfClientset.Interface, environm return virtualMachineCount, maximumVirtualMachineCount, nil } +func CountMachinesPerTemplateAndEnvironment(vmLister hfListers.VirtualMachineLister, template string, enviroment string) (int, error) { + vmLabels := labels.Set{ + "environment": enviroment, + "template": template, + } + + vms, err := vmLister.List(vmLabels.AsSelector()) + return len(vms), err +} + func MaxAvailableDuringPeriod(hfClientset hfClientset.Interface, environment string, startString string, endString string, ctx context.Context) (Maximus, error) { _, maximumVirtualMachineCount, err := VirtualMachinesUsedDuringPeriod(hfClientset, environment, startString, endString, ctx); From b39e100978968e06fb5db8f8013da5213089a562 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 16 Jan 2023 16:43:21 +0100 Subject: [PATCH 14/20] Better support for multiple environments --- .../vmclaimcontroller/vmclaimcontroller.go | 95 +++++++++++++++++-- 1 file changed, 85 insertions(+), 10 deletions(-) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index 2311498a..76bda381 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -312,15 +312,54 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) return err } - // TODO 13.01.2023: Fix issue where provisioning two of the same template in the samce VMC can cause overprovisioning for environments - environmentMap := make(map[string]VMEnvironment) - for vmName, vmDetails := range vmc.Spec.VirtualMachines { - env, dbc, err := v.findSuitableEnvironmentForVMTemplate(environments, dbcList, vmDetails.Template) - if err != nil{ - glog.Errorf("no suitable environment for %s (%s): %v", vmName, vmDetails.Template, err) - return err + // Calculate required VMs per template + requiredTemplateCount := make(map[string]int) + for _, vmDetails := range vmc.Spec.VirtualMachines { + if count, found := requiredTemplateCount[vmDetails.Template]; found { + requiredTemplateCount[vmDetails.Template] = count + 1 + }else{ + requiredTemplateCount[vmDetails.Template] = 1 + } + } + + environmentMap := make(map[string]VMEnvironment) // Maps node to the environment it should use + bestDBC, err := v.findBestDBCForVMs(dbcList, requiredTemplateCount) // Try to find if one environment can provision all VMs + + + reservedCapacity := make(map[string]map[string]int) // EnvironmentID -> TemplateID -> Count + // Initialize reservedCapacity with 0 for all environments + associated templates + for _, environment := range environments { + reserved := make(map[string]int) + for template, _ := range environment.Spec.TemplateMapping { + reserved[template] = 0 + } + reservedCapacity[environment.Name] = reserved + } + + if(err != nil) { + // TODO 13.01.2023: Fix issue where provisioning two of the same template in the samce VMC can cause overprovisioning for environments + // We can not provision all VirtualMachines in one environment. Figure out which environments we want to use + for vmName, vmDetails := range vmc.Spec.VirtualMachines { + env, dbc, err := v.findSuitableEnvironmentForVMTemplate(environments, dbcList, vmDetails.Template, reservedCapacity) + if err != nil{ + glog.Errorf("no suitable environment for %s (%s): %v", vmName, vmDetails.Template, err) + return err + } + environmentMap[vmName] = VMEnvironment{env, dbc} + reservedCapacity[env.Name][vmDetails.Template] += 1 + } + }else{ + // One DBC for them all + enviroment := hfv1.Environment{} + for _, e := range environments{ + if e.Name == bestDBC.Spec.Environment { + enviroment = e + break + } + } + for vmName, _ := range vmc.Spec.VirtualMachines { + environmentMap[vmName] = VMEnvironment{enviroment, bestDBC} } - environmentMap[vmName] = VMEnvironment{env, dbc} } vmMap := make(map[string]hfv1.VirtualMachineClaimVM) @@ -462,14 +501,49 @@ func (v *VMClaimController) findEnvironmentsForVM(accessCode string, vmc *hfv1.V return environments, seName, dbcList.Items, err } -func (v *VMClaimController) findSuitableEnvironmentForVMTemplate(environments []hfv1.Environment, dbcList []hfv1.DynamicBindConfiguration, template string) (hfv1.Environment, hfv1.DynamicBindConfiguration, error) { +// Can one DBC provide all VMs when considering the limits? Return the DBC if there exists one +func (v *VMClaimController) findBestDBCForVMs(dbcList []hfv1.DynamicBindConfiguration, requiredTemplateCount map[string]int) (hfv1.DynamicBindConfiguration, error) { + // Try to find best possible environment / DBC = All required VMs can be provisioned here + for _, dbc := range dbcList { + satisfiedDBC := true + for requiredTemplate, requiredCount := range requiredTemplateCount { + if dbcCapacity, found := dbc.Spec.BurstCountCapacity[requiredTemplate]; found { + count, err := util.CountMachinesPerTemplateAndEnvironment(v.vmLister, requiredTemplate, dbc.Spec.Environment) + if(err != nil){ + satisfiedDBC = false + break + } + if requiredCount >= (dbcCapacity - count) { + satisfiedDBC = false + break + } + }else{ + satisfiedDBC = false + break + } + } + + if satisfiedDBC { + // This DBC works for all templates and has the required Counts available! + glog.V(4).Infof("found best environment suitable for all VMs: %s", dbc.Spec.Environment) + return dbc, nil + } + } + return hfv1.DynamicBindConfiguration{}, fmt.Errorf("there is no best environment") +} + +func (v *VMClaimController) findSuitableEnvironmentForVMTemplate(environments []hfv1.Environment, dbcList []hfv1.DynamicBindConfiguration, template string, reservedCapacity map[string]map[string]int) (hfv1.Environment, hfv1.DynamicBindConfiguration, error) { for _, environment := range environments { count, err := util.CountMachinesPerTemplateAndEnvironment(v.vmLister, template, environment.Name) if(err != nil){ continue } + + // We have also reserved capacity for other VMs + count += reservedCapacity[environment.Name][template] + if(count >= environment.Spec.CountCapacity[template]){ - // Environment has no capacity left for this Template. Skipping + // Environment is at limit continue } // found environment that satisfies capacity for this template @@ -481,6 +555,7 @@ func (v *VMClaimController) findSuitableEnvironmentForVMTemplate(environments [] return environment, dbc, nil } } + break } } From f9562b43bbaee3c186d871daa6faab34593cf714 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 16 Jan 2023 16:45:24 +0100 Subject: [PATCH 15/20] Remove TODO comment --- pkg/controllers/vmclaimcontroller/vmclaimcontroller.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index 76bda381..e12f265a 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -337,7 +337,6 @@ func (v *VMClaimController) submitVirtualMachines(vmc *hfv1.VirtualMachineClaim) } if(err != nil) { - // TODO 13.01.2023: Fix issue where provisioning two of the same template in the samce VMC can cause overprovisioning for environments // We can not provision all VirtualMachines in one environment. Figure out which environments we want to use for vmName, vmDetails := range vmc.Spec.VirtualMachines { env, dbc, err := v.findSuitableEnvironmentForVMTemplate(environments, dbcList, vmDetails.Template, reservedCapacity) From 16a3bcf61263438fd17b4759159475d9d04bca9f Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 16 Jan 2023 16:46:09 +0100 Subject: [PATCH 16/20] Remove another TODO --- pkg/controllers/vmclaimcontroller/vmclaimcontroller.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index e12f265a..1797e5e4 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -680,9 +680,6 @@ func (v *VMClaimController) assignVM(vmClaimId string, user string, vmId string } func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, environments map[string]map[string]int, template string, restrictedBind bool, restrictedBindValue string) (string, error) { - - // TODO 13.01.2023: Ability to force the same environment for all VMs from one VMClaim - vmLabels := labels.Set{ "bound": "false", "template": template, From 56be3dbfe7d5af528279cc4274d3ca7e2b195e6e Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Wed, 25 Jan 2023 16:46:46 +0100 Subject: [PATCH 17/20] WIP: Delete VMClainms when they can not be fulfilled --- pkg/controllers/vmclaimcontroller/vmclaimcontroller.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index 1797e5e4..aa5a8519 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -256,14 +256,17 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e if vmc.Status.BindMode == "dynamic" { err = v.submitVirtualMachines(vmc) if err != nil { - // TODO 13.01.2023: Delete VirtualMachineClaim OR Set it to invalid. Same for static mode - return err + // VirtualMachines could not be submitted. Delete Claim + glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) + return v.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Delete(v.ctx, vmc.Name, metav1.DeleteOptions{}) } } else if vmc.Status.BindMode == "static" { err = v.findVirtualMachines(vmc) if err != nil { + // VirtualMachines could not be bound. Delete Claim + // TODO 17.01.2023 delete session? glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) - return err + return v.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Delete(v.ctx, vmc.Name, metav1.DeleteOptions{}) } } else { glog.Errorf("vmc bind mode needs to be either dynamic or static.. ignoring this object %s", vmc.Name) From 38a4f4f653116d746f28c7df02eef6fcfe14f49a Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Fri, 3 Feb 2023 14:10:53 +0100 Subject: [PATCH 18/20] Taint session if VMC can not be fulfilled --- .../scheduledeventcontroller.go | 1 - pkg/controllers/session/sessioncontroller.go | 9 +- .../tfpcontroller/tfpcontroller.go | 512 +++++++++--------- .../vmclaimcontroller/vmclaimcontroller.go | 29 +- pkg/sessionserver/sessionserver.go | 2 +- 5 files changed, 283 insertions(+), 270 deletions(-) diff --git a/pkg/controllers/scheduledevent/scheduledeventcontroller.go b/pkg/controllers/scheduledevent/scheduledeventcontroller.go index 0a4159a3..ee638ff9 100644 --- a/pkg/controllers/scheduledevent/scheduledeventcontroller.go +++ b/pkg/controllers/scheduledevent/scheduledeventcontroller.go @@ -230,7 +230,6 @@ func (s ScheduledEventController) finishSessionsFromScheduledEvent(se *hfv1.Sche result.Status.ExpirationTime = now result.Status.Active = false - result.Status.Finished = false _, updateErr := s.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).UpdateStatus(s.ctx, result, metav1.UpdateOptions{}) glog.V(4).Infof("updated result for session") diff --git a/pkg/controllers/session/sessioncontroller.go b/pkg/controllers/session/sessioncontroller.go index 57fd89a3..29ad6a71 100644 --- a/pkg/controllers/session/sessioncontroller.go +++ b/pkg/controllers/session/sessioncontroller.go @@ -249,16 +249,9 @@ func (s *SessionController) taintVM(vmName string) error { if getErr != nil { return getErr } - result.Labels["ready"] = "false" - - result, updateErr := s.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(s.ctx, result, metav1.UpdateOptions{}) - if updateErr != nil { - return updateErr - } - result.Status.Tainted = true - result, updateErr = s.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(s.ctx, result, metav1.UpdateOptions{}) + result, updateErr := s.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(s.ctx, result, metav1.UpdateOptions{}) if updateErr != nil { return updateErr } diff --git a/pkg/controllers/tfpcontroller/tfpcontroller.go b/pkg/controllers/tfpcontroller/tfpcontroller.go index 04febab0..cbb428f2 100644 --- a/pkg/controllers/tfpcontroller/tfpcontroller.go +++ b/pkg/controllers/tfpcontroller/tfpcontroller.go @@ -173,322 +173,324 @@ func (t *TerraformProvisionerController) processNextVM() bool { // returns an error and a boolean of requeue func (t *TerraformProvisionerController) handleProvision(vm *hfv1.VirtualMachine) (error, bool) { - if vm.Spec.Provision { - //glog.V(5).Infof("vm spec was to provision %s", vm.Name) - if vm.Status.Tainted && vm.DeletionTimestamp == nil { - util.EnsureVMNotReady(t.hfClientSet, t.vmLister, vm.Name, t.ctx) - deleteVMErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Delete(t.ctx, vm.Name, metav1.DeleteOptions{}) - if deleteVMErr != nil { - return fmt.Errorf("there was an error while deleting the virtual machine %s", vm.Name), true - } - t.vmWorkqueue.Add(vm.Name) - return nil, false - } - if vm.DeletionTimestamp != nil { - //glog.V(5).Infof("destroying virtual machine") - util.EnsureVMNotReady(t.hfClientSet, t.vmLister, vm.Name, t.ctx) - if vm.Status.TFState == "" { - // vm already deleted let's delete our finalizer - t.removeFinalizer(vm) - } - stateDel := t.tfClientset.TerraformcontrollerV1().States(util.GetReleaseNamespace()).Delete(t.ctx, vm.Status.TFState, metav1.DeleteOptions{}) - if stateDel != nil { - t.removeFinalizer(vm) - } else { - return nil, true // no error, but need to requeue + // VM shall not be provisioned by internal terraform controller + if ! vm.Spec.Provision { + if provisionMethod, ok := vm.ObjectMeta.Labels["hobbyfarm.io/provisioner"]; ok { + if provisionMethod == "external" { + glog.V(8).Infof("vm %s ignored due to external provisioning label", vm.Name) + t.vmWorkqueue.Done(vm.Name) } - return nil, false } - //Status is ReadyForProvisioning AND No Secret provided (Do not provision VM twice, happens due to vm.status being updated after vm.status) - if vm.Status.Status == hfv1.VmStatusRFP { - vmt, err := t.vmtLister.VirtualMachineTemplates(util.GetReleaseNamespace()).Get(vm.Spec.VirtualMachineTemplateId) - if err != nil { - glog.Errorf("error getting vmt %v", err) - return err, true - } - env, err := t.envLister.Environments(util.GetReleaseNamespace()).Get(vm.Status.EnvironmentId) - if err != nil { - glog.Errorf("error getting env %v", err) - return err, true - } + glog.V(8).Infof("vm %s was not a provisioned vm", vm.Name) + return nil, false + } - _, exists := env.Spec.TemplateMapping[vmt.Name] - if !exists { - glog.Errorf("error pulling environment template info %v", err) - return fmt.Errorf("Error during RFP: environment %s does not support vmt %s.", env.Name, vmt.Name), true - } + //glog.V(5).Infof("vm spec was to provision %s", vm.Name) + if vm.Status.Tainted && vm.DeletionTimestamp == nil { + util.EnsureVMNotReady(t.hfClientSet, t.vmLister, vm.Name, t.ctx) + deleteVMErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Delete(t.ctx, vm.Name, metav1.DeleteOptions{}) + if deleteVMErr != nil { + return fmt.Errorf("there was an error while deleting the virtual machine %s", vm.Name), true + } + t.vmWorkqueue.Add(vm.Name) + return nil, false + } + if vm.DeletionTimestamp != nil { + //glog.V(5).Infof("destroying virtual machine") + util.EnsureVMNotReady(t.hfClientSet, t.vmLister, vm.Name, t.ctx) + if vm.Status.TFState == "" { + // vm already deleted let's delete our finalizer + t.removeFinalizer(vm) + } + stateDel := t.tfClientset.TerraformcontrollerV1().States(util.GetReleaseNamespace()).Delete(t.ctx, vm.Status.TFState, metav1.DeleteOptions{}) + if stateDel != nil { + t.removeFinalizer(vm) + } else { + return nil, true // no error, but need to requeue + } + return nil, false + } + //Status is ReadyForProvisioning AND No Secret provided (Do not provision VM twice, happens due to vm.status being updated after vm.status) + if vm.Status.Status == hfv1.VmStatusRFP { + vmt, err := t.vmtLister.VirtualMachineTemplates(util.GetReleaseNamespace()).Get(vm.Spec.VirtualMachineTemplateId) + if err != nil { + glog.Errorf("error getting vmt %v", err) + return err, true + } + env, err := t.envLister.Environments(util.GetReleaseNamespace()).Get(vm.Status.EnvironmentId) + if err != nil { + glog.Errorf("error getting env %v", err) + return err, true + } - // let's provision the vm - pubKey, privKey, err := util.GenKeyPair() - if err != nil { - glog.Errorf("error generating keypair %v", err) - return err, true - } - config := util.GetVMConfig(env,vmt) + _, exists := env.Spec.TemplateMapping[vmt.Name] + if !exists { + glog.Errorf("error pulling environment template info %v", err) + return fmt.Errorf("Error during RFP: environment %s does not support vmt %s.", env.Name, vmt.Name), true + } - config["name"] = vm.Name - config["public_key"] = pubKey + // let's provision the vm + pubKey, privKey, err := util.GenKeyPair() + if err != nil { + glog.Errorf("error generating keypair %v", err) + return err, true + } + config := util.GetVMConfig(env,vmt) - image, exists := config["image"] - if !exists || image == "" { - return fmt.Errorf("image does not exist or is empty in vm config for vmt %s", vmt.Name), true - } + config["name"] = vm.Name + config["public_key"] = pubKey - moduleName, exists := config["module"] - if !exists || moduleName == "" { - return fmt.Errorf("module name does not exist or is empty in vm config for vmt %s", vmt.Name), true - } + image, exists := config["image"] + if !exists || image == "" { + return fmt.Errorf("image does not exist or is empty in vm config for vmt %s", vmt.Name), true + } - executorImage, exists := config["executor_image"] - if !exists || executorImage == "" { - return fmt.Errorf("executorimage does not exist or is empty in vm config for vmt %s", vmt.Name), true - } + moduleName, exists := config["module"] + if !exists || moduleName == "" { + return fmt.Errorf("module name does not exist or is empty in vm config for vmt %s", vmt.Name), true + } - password, exists := config["password"] - if !exists { - password = "" - } + executorImage, exists := config["executor_image"] + if !exists || executorImage == "" { + return fmt.Errorf("executorimage does not exist or is empty in vm config for vmt %s", vmt.Name), true + } + + password, exists := config["password"] + if !exists { + password = "" + } - r := fmt.Sprintf("%08x", rand.Uint32()) - cm := &k8sv1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: strings.Join([]string{vm.Name + "-cm", r}, "-"), - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "v1", - Kind: "VirtualMachine", - Name: vm.Name, - UID: vm.UID, - }, + r := fmt.Sprintf("%08x", rand.Uint32()) + cm := &k8sv1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: strings.Join([]string{vm.Name + "-cm", r}, "-"), + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "v1", + Kind: "VirtualMachine", + Name: vm.Name, + UID: vm.UID, }, }, - Data: config, - } + }, + Data: config, + } - cm, err = t.k8sClientset.CoreV1().ConfigMaps(util.GetReleaseNamespace()).Create(t.ctx, cm, metav1.CreateOptions{}) + cm, err = t.k8sClientset.CoreV1().ConfigMaps(util.GetReleaseNamespace()).Create(t.ctx, cm, metav1.CreateOptions{}) - if err != nil { - glog.Errorf("error creating configmap %s: %v", cm.Name, err) - } + if err != nil { + glog.Errorf("error creating configmap %s: %v", cm.Name, err) + } - keypair := &k8sv1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: strings.Join([]string{vm.Name + "-secret", r}, "-"), - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: "v1", - Kind: "VirtualMachine", - Name: vm.Name, - UID: vm.UID, - }, + keypair := &k8sv1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: strings.Join([]string{vm.Name + "-secret", r}, "-"), + OwnerReferences: []metav1.OwnerReference{ + { + APIVersion: "v1", + Kind: "VirtualMachine", + Name: vm.Name, + UID: vm.UID, }, }, - Data: map[string][]byte{ - "private_key": []byte(privKey), - "public_key": []byte(pubKey), - "password" : []byte(password), + }, + Data: map[string][]byte{ + "private_key": []byte(privKey), + "public_key": []byte(pubKey), + "password" : []byte(password), + }, + } + + keypair, err = t.k8sClientset.CoreV1().Secrets(util.GetReleaseNamespace()).Create(t.ctx, keypair, metav1.CreateOptions{}) + + if err != nil { + glog.Errorf("error creating secret %s: %v", keypair.Name, err) + } + + tfs := &tfv1.State{ + ObjectMeta: metav1.ObjectMeta{ + Name: strings.Join([]string{vm.Name + "-tfs", r}, "-"), + }, + Spec: tfv1.StateSpec{ + Variables: tfv1.Variables{ + ConfigNames: []string{cm.Name}, }, - } + Image: executorImage, + AutoConfirm: true, + DestroyOnDelete: true, + ModuleName: moduleName, + }, + } + + credentialsSecret, exists := config["cred_secret"] + if !exists { + glog.Errorf("cred secret does not exist in env template") + } + if credentialsSecret != "" { + tfs.Spec.Variables.SecretNames = []string{credentialsSecret} + } + + tfs, err = t.tfClientset.TerraformcontrollerV1().States(util.GetReleaseNamespace()).Create(t.ctx, tfs, metav1.CreateOptions{}) - keypair, err = t.k8sClientset.CoreV1().Secrets(util.GetReleaseNamespace()).Create(t.ctx, keypair, metav1.CreateOptions{}) + if err != nil { + glog.Errorf("error creating tfs %v", err) + } + retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { + toUpdate, err := t.vmLister.VirtualMachines(util.GetReleaseNamespace()).Get(vm.Name) if err != nil { - glog.Errorf("error creating secret %s: %v", keypair.Name, err) + if apierrors.IsNotFound(err) { + return nil + } else { + glog.Errorf("unknown error encountered when setting terminating %v", err) + } } - tfs := &tfv1.State{ - ObjectMeta: metav1.ObjectMeta{ - Name: strings.Join([]string{vm.Name + "-tfs", r}, "-"), - }, - Spec: tfv1.StateSpec{ - Variables: tfv1.Variables{ - ConfigNames: []string{cm.Name}, - }, - Image: executorImage, - AutoConfirm: true, - DestroyOnDelete: true, - ModuleName: moduleName, - }, - } + toUpdate.Status.Status = hfv1.VmStatusProvisioned + toUpdate.Status.TFState = tfs.Name + + toUpdate, updateErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(t.ctx, toUpdate, metav1.UpdateOptions{}) - credentialsSecret, exists := config["cred_secret"] - if !exists { - glog.Errorf("cred secret does not exist in env template") - } - if credentialsSecret != "" { - tfs.Spec.Variables.SecretNames = []string{credentialsSecret} + if(updateErr != nil){ + glog.Errorf("error while updating VirtualMachine status %s", toUpdate.Name) + return updateErr } - tfs, err = t.tfClientset.TerraformcontrollerV1().States(util.GetReleaseNamespace()).Create(t.ctx, tfs, metav1.CreateOptions{}) + toUpdate.Spec.SecretName = keypair.Name + toUpdate.Labels["ready"] = "false" + toUpdate.Finalizers = []string{"tfp.controllers.hobbyfarm.io"} - if err != nil { - glog.Errorf("error creating tfs %v", err) + toUpdate, updateErr = t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(t.ctx, toUpdate, metav1.UpdateOptions{}) + + if(updateErr != nil){ + glog.Errorf("error while updating VirtualMachine %s", toUpdate.Name) + return updateErr } - retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - toUpdate, err := t.vmLister.VirtualMachines(util.GetReleaseNamespace()).Get(vm.Name) - if err != nil { - if apierrors.IsNotFound(err) { - return nil - } else { - glog.Errorf("unknown error encountered when setting terminating %v", err) - } - } + if err := util.VerifyVM(t.vmLister, toUpdate); err != nil { + glog.Errorf("error while verifying machine %s", toUpdate.Name) + } + return updateErr + }) - toUpdate.Status.Status = hfv1.VmStatusProvisioned - toUpdate.Status.TFState = tfs.Name - - toUpdate, updateErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(t.ctx, toUpdate, metav1.UpdateOptions{}) + if retryErr != nil { + return retryErr, true + } + glog.V(6).Infof("provisioned vm %s", vm.Name) + return nil, false - if(updateErr != nil){ - glog.Errorf("error while updating VirtualMachine status %s", toUpdate.Name) - return updateErr - } + } else if vm.Status.Status == hfv1.VmStatusProvisioned { + // let's check the status of our tf provision + /*tfState, err := t.tfsLister.States(util.GetReleaseNamespace()).Get(vm.Status.TFState) + if err != nil { + if apierrors.IsNotFound(err) { + return fmt.Errorf("execution not found") + } + return nil + } */ + // TEMPORARY WORKAROUND UNTIL WE FIGURE OUT A BETTER WAY TO DO THIS - toUpdate.Spec.SecretName = keypair.Name - toUpdate.Labels["ready"] = "false" - toUpdate.Finalizers = []string{"tfp.controllers.hobbyfarm.io"} + if vm.Status.TFState == "" { + return fmt.Errorf("tf state was blank in object"), true + } - toUpdate, updateErr = t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(t.ctx, toUpdate, metav1.UpdateOptions{}) + tfExecs, err := t.tfeLister.List(labels.Set{ + "state": string(vm.Status.TFState), + }.AsSelector()) - if(updateErr != nil){ - glog.Errorf("error while updating VirtualMachine %s", toUpdate.Name) - return updateErr - } + if err != nil { + return err, true + } - if err := util.VerifyVM(t.vmLister, toUpdate); err != nil { - glog.Errorf("error while verifying machine %s", toUpdate.Name) - } - return updateErr - }) + var newestTimestamp *metav1.Time + var tfExec *tfv1.Execution + if len(tfExecs) == 0 { + return fmt.Errorf("no executions found for terraform state"), true + } - if retryErr != nil { - return retryErr, true + newestTimestamp = &tfExecs[0].CreationTimestamp + tfExec = tfExecs[0] + for _, e := range tfExecs { + if newestTimestamp.Before(&e.CreationTimestamp) { + newestTimestamp = &e.CreationTimestamp + tfExec = e } - glog.V(6).Infof("provisioned vm %s", vm.Name) - return nil, false + } + // END TEMPORARY WORKAROUND - } else if vm.Status.Status == hfv1.VmStatusProvisioned { - // let's check the status of our tf provision - /*tfState, err := t.tfsLister.States(util.GetReleaseNamespace()).Get(vm.Status.TFState) + //executionName := tfState.Status.ExecutionName + /* + tfExec, err := t.tfeLister.Executions(util.GetReleaseNamespace()).Get(executionName) if err != nil { + //glog.Error(err) if apierrors.IsNotFound(err) { return fmt.Errorf("execution not found") } return nil - } */ - // TEMPORARY WORKAROUND UNTIL WE FIGURE OUT A BETTER WAY TO DO THIS - - if vm.Status.TFState == "" { - return fmt.Errorf("tf state was blank in object"), true } + */ + if tfExec.Status.Outputs == "" { + return nil, true + } - tfExecs, err := t.tfeLister.List(labels.Set{ - "state": string(vm.Status.TFState), - }.AsSelector()) - - if err != nil { - return err, true - } + var tfOutput map[string]map[string]string - var newestTimestamp *metav1.Time - var tfExec *tfv1.Execution - if len(tfExecs) == 0 { - return fmt.Errorf("no executions found for terraform state"), true - } + err = json.Unmarshal([]byte(tfExec.Status.Outputs), &tfOutput) + if err != nil { + glog.Error(err) + } + env, err := t.envLister.Environments(util.GetReleaseNamespace()).Get(vm.Status.EnvironmentId) + if err != nil { + glog.Error(err) + return fmt.Errorf("error getting environment"), true + } + glog.V(8).Infof("private ip is: %s", tfOutput["private_ip"]["value"]) - newestTimestamp = &tfExecs[0].CreationTimestamp - tfExec = tfExecs[0] - for _, e := range tfExecs { - if newestTimestamp.Before(&e.CreationTimestamp) { - newestTimestamp = &e.CreationTimestamp - tfExec = e - } - } - // END TEMPORARY WORKAROUND - - //executionName := tfState.Status.ExecutionName - /* - tfExec, err := t.tfeLister.Executions(util.GetReleaseNamespace()).Get(executionName) - if err != nil { - //glog.Error(err) - if apierrors.IsNotFound(err) { - return fmt.Errorf("execution not found") - } + retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { + toUpdate, err := t.vmLister.VirtualMachines(util.GetReleaseNamespace()).Get(vm.Name) + old := toUpdate.DeepCopy() + if err != nil { + if apierrors.IsNotFound(err) { return nil + } else { + glog.Errorf("unknown error encountered when setting terminating %v", err) } - */ - if tfExec.Status.Outputs == "" { - return nil, true } - var tfOutput map[string]map[string]string + toUpdate.Labels["ready"] = "true" - err = json.Unmarshal([]byte(tfExec.Status.Outputs), &tfOutput) - if err != nil { - glog.Error(err) - } - env, err := t.envLister.Environments(util.GetReleaseNamespace()).Get(vm.Status.EnvironmentId) - if err != nil { - glog.Error(err) - return fmt.Errorf("error getting environment"), true + if reflect.DeepEqual(old.Status, toUpdate.Status) && reflect.DeepEqual(old.Labels, toUpdate.Labels) { + return nil } - glog.V(8).Infof("private ip is: %s", tfOutput["private_ip"]["value"]) - - retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { - toUpdate, err := t.vmLister.VirtualMachines(util.GetReleaseNamespace()).Get(vm.Name) - old := toUpdate.DeepCopy() - if err != nil { - if apierrors.IsNotFound(err) { - return nil - } else { - glog.Errorf("unknown error encountered when setting terminating %v", err) - } - } - - toUpdate.Labels["ready"] = "true" - - if reflect.DeepEqual(old.Status, toUpdate.Status) && reflect.DeepEqual(old.Labels, toUpdate.Labels) { - return nil - } - - toUpdate, updateErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(t.ctx, toUpdate, metav1.UpdateOptions{}) - - if(updateErr != nil){ - glog.Errorf("error while updating machine: %s", toUpdate.Name) - return updateErr - } - - toUpdate.Status.PrivateIP = tfOutput["private_ip"]["value"] - if _, exists := tfOutput["public_ip"]; exists { - toUpdate.Status.PublicIP = tfOutput["public_ip"]["value"] - } else { - toUpdate.Status.PublicIP = translatePrivToPub(env.Spec.IPTranslationMap, tfOutput["private_ip"]["value"]) - } - toUpdate.Status.Hostname = tfOutput["hostname"]["value"] - toUpdate.Status.Status = hfv1.VmStatusRunning - _, updateErr = t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(t.ctx, toUpdate, metav1.UpdateOptions{}) + toUpdate, updateErr := t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(t.ctx, toUpdate, metav1.UpdateOptions{}) - if err := util.VerifyVM(t.vmLister, toUpdate); err != nil { - glog.Errorf("error while verifying machine!!! %s", toUpdate.Name) - } + if(updateErr != nil){ + glog.Errorf("error while updating machine: %s", toUpdate.Name) return updateErr - }) + } - if retryErr != nil { - return retryErr, true + toUpdate.Status.PrivateIP = tfOutput["private_ip"]["value"] + if _, exists := tfOutput["public_ip"]; exists { + toUpdate.Status.PublicIP = tfOutput["public_ip"]["value"] + } else { + toUpdate.Status.PublicIP = translatePrivToPub(env.Spec.IPTranslationMap, tfOutput["private_ip"]["value"]) } + toUpdate.Status.Hostname = tfOutput["hostname"]["value"] + toUpdate.Status.Status = hfv1.VmStatusRunning - } - } else { - if provisionMethod, ok := vm.ObjectMeta.Labels["hobbyfarm.io/provisioner"]; ok { - if provisionMethod == "external" { - glog.V(8).Infof("vm %s ignored due to external provisioning label", vm.Name) - t.vmWorkqueue.Done(vm.Name) + _, updateErr = t.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(t.ctx, toUpdate, metav1.UpdateOptions{}) + + if err := util.VerifyVM(t.vmLister, toUpdate); err != nil { + glog.Errorf("error while verifying machine!!! %s", toUpdate.Name) } + return updateErr + }) + + if retryErr != nil { + return retryErr, true } - glog.V(8).Infof("vm %s was not a provisioned vm", vm.Name) + } return nil, false } diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index aa5a8519..bfd3b6f1 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -256,17 +256,16 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e if vmc.Status.BindMode == "dynamic" { err = v.submitVirtualMachines(vmc) if err != nil { - // VirtualMachines could not be submitted. Delete Claim + // VirtualMachines could not be submitted. Delete Session glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) - return v.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Delete(v.ctx, vmc.Name, metav1.DeleteOptions{}) + return v.taintSession(vmc.Labels[util.SessionLabel]); } } else if vmc.Status.BindMode == "static" { err = v.findVirtualMachines(vmc) if err != nil { - // VirtualMachines could not be bound. Delete Claim - // TODO 17.01.2023 delete session? + // VirtualMachines could not be bound. Delete Session glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) - return v.hfClientSet.HobbyfarmV1().VirtualMachineClaims(util.GetReleaseNamespace()).Delete(v.ctx, vmc.Name, metav1.DeleteOptions{}) + return v.taintSession(vmc.Labels[util.SessionLabel]); } } else { glog.Errorf("vmc bind mode needs to be either dynamic or static.. ignoring this object %s", vmc.Name) @@ -297,6 +296,26 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e return nil } +func (v *VMClaimController) taintSession(session string) (err error){ + retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { + result, getErr := v.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).Get(v.ctx, session, metav1.GetOptions{}) + if getErr != nil { + return fmt.Errorf("error retrieving latest version of session %s: %v", session, getErr) + } + + // Change the expiration time to now, the sessionController will clean up the session + result.Status.ExpirationTime = time.Now().Format(time.UnixDate) + result.Status.Active = false + + _, updateErr := v.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).UpdateStatus(v.ctx, result, metav1.UpdateOptions{}) + glog.V(4).Infof("updated result for environment") + + return updateErr + }) + + return retryErr +} + type VMEnvironment struct { Environment hfv1.Environment DynamicBindConfiguration hfv1.DynamicBindConfiguration diff --git a/pkg/sessionserver/sessionserver.go b/pkg/sessionserver/sessionserver.go index a295f22b..614d3deb 100644 --- a/pkg/sessionserver/sessionserver.go +++ b/pkg/sessionserver/sessionserver.go @@ -454,9 +454,9 @@ func (sss SessionServer) FinishedSessionFunc(w http.ResponseWriter, r *http.Requ return fmt.Errorf("error retrieving latest version of session %s: %v", sessionId, getErr) } + // Change the expiration time to now, the sessionController will clean up the session result.Status.ExpirationTime = now result.Status.Active = false - result.Status.Finished = false _, updateErr := sss.hfClientSet.HobbyfarmV1().Sessions(util.GetReleaseNamespace()).UpdateStatus(sss.ctx, result, metav1.UpdateOptions{}) glog.V(4).Infof("updated result for environment") From 377e92ece05ff98498615d9774d4ee982703c218 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Fri, 3 Feb 2023 14:36:59 +0100 Subject: [PATCH 19/20] Delete old progresses when there is an error creating the session --- pkg/controllers/vmclaimcontroller/vmclaimcontroller.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index bfd3b6f1..a7254a59 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -313,7 +313,15 @@ func (v *VMClaimController) taintSession(session string) (err error){ return updateErr }) - return retryErr + if(retryErr != nil){ + return retryErr + } + + // Remove outstanding Progresses as there was an error with this session + err = v.hfClientSet.HobbyfarmV1().Progresses(util.GetReleaseNamespace()).DeleteCollection(v.ctx, metav1.DeleteOptions{}, metav1.ListOptions{ + LabelSelector: fmt.Sprintf("%s=%s,finished=false", util.SessionLabel, session)}) + + return err; } type VMEnvironment struct { From e62bedc5f3b8cdf1bf1bab13490aba5ef0156ce7 Mon Sep 17 00:00:00 2001 From: Jan-Gerrit Goebel Date: Mon, 6 Feb 2023 11:26:36 +0100 Subject: [PATCH 20/20] Fix bug where dangling VMs could be produced on odd numbered VMSets --- pkg/controllers/session/sessioncontroller.go | 4 ++ .../vmclaimcontroller/vmclaimcontroller.go | 53 +++++++++++++++++-- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/session/sessioncontroller.go b/pkg/controllers/session/sessioncontroller.go index 29ad6a71..5ae305dc 100644 --- a/pkg/controllers/session/sessioncontroller.go +++ b/pkg/controllers/session/sessioncontroller.go @@ -194,6 +194,10 @@ func (s *SessionController) reconcileSession(ssName string) error { } for _, vm := range vmcObj.Spec.VirtualMachines { + if(len(vm.VirtualMachineId) == 0){ + // VM was not even provisioned / assigned yet. + continue + } taintErr := s.taintVM(vm.VirtualMachineId) if taintErr != nil { glog.Error(taintErr) diff --git a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go index a7254a59..d91a6609 100644 --- a/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go +++ b/pkg/controllers/vmclaimcontroller/vmclaimcontroller.go @@ -257,14 +257,14 @@ func (v *VMClaimController) processVMClaim(vmc *hfv1.VirtualMachineClaim) (err e err = v.submitVirtualMachines(vmc) if err != nil { // VirtualMachines could not be submitted. Delete Session - glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) + glog.Errorf("error processing vmc %s, taint session: %v", vmc.Name, err) return v.taintSession(vmc.Labels[util.SessionLabel]); } } else if vmc.Status.BindMode == "static" { err = v.findVirtualMachines(vmc) if err != nil { // VirtualMachines could not be bound. Delete Session - glog.Errorf("error processing vmc %s - %s", vmc.Name, err.Error()) + glog.Errorf("error processing vmc %s, taint session: %v", vmc.Name, err) return v.taintSession(vmc.Labels[util.SessionLabel]); } } else { @@ -650,6 +650,10 @@ func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) ( glog.Info("assigning a vm") vmID, err := v.assignNextFreeVM(vmc.Name, vmc.Spec.UserId, environments, vmStruct.Template, vmc.Spec.RestrictedBind, vmc.Spec.RestrictedBindValue) if err != nil { + // If we run into any issue assigning a VM we need to unassign the previously assigned VMs + for _, vm := range vmMap { + v.unassignVM(vm.VirtualMachineId) + } return err } vmMap[name] = hfv1.VirtualMachineClaimVM{ @@ -669,7 +673,7 @@ func (v *VMClaimController) findVirtualMachines(vmc *hfv1.VirtualMachineClaim) ( return nil } -func (v *VMClaimController) assignVM(vmClaimId string, user string, vmId string) (string, error) { +func (v *VMClaimController) assignVM(vmClaimId string, user string, vmId string) (error) { retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { result, getErr := v.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Get(v.ctx, vmId, metav1.GetOptions{}) if getErr != nil { @@ -702,6 +706,43 @@ func (v *VMClaimController) assignVM(vmClaimId string, user string, vmId string } return nil }) + if retryErr != nil { + return fmt.Errorf("error updating Virtual Machine: %s, %v", vmId, retryErr) + } + + return nil +} + +func (v *VMClaimController) unassignVM(vmId string) (string, error) { + retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error { + result, getErr := v.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Get(v.ctx, vmId, metav1.GetOptions{}) + if getErr != nil { + return fmt.Errorf("error retrieving latest version of Virtual Machine %s: %v", vmId, getErr) + } + + result.Labels["bound"] = "false" + result.Spec.VirtualMachineClaimId = "" + result.Spec.UserId = "" + + vm, updateErr := v.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).Update(v.ctx, result, metav1.UpdateOptions{}) + if updateErr != nil { + return updateErr + } + + vm.Status.Allocated = false + + _, updateErr = v.hfClientSet.HobbyfarmV1().VirtualMachines(util.GetReleaseNamespace()).UpdateStatus(v.ctx, vm, metav1.UpdateOptions{}) + if updateErr != nil { + return updateErr + } + + verifyErr := util.VerifyVM(v.vmLister, vm) + + if verifyErr != nil { + return verifyErr + } + return nil + }) if retryErr != nil { return "", fmt.Errorf("error updating Virtual Machine: %s, %v", vmId, retryErr) } @@ -728,6 +769,10 @@ func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, envi return "", fmt.Errorf("error while listing all vms %v", err) } + if(len(vms) == 0){ + return "", fmt.Errorf("No static VMs matching template: %s. All static VMs are in use.", template) + } + assigned := false vmId := "" for _, vm := range vms { @@ -755,7 +800,7 @@ func (v *VMClaimController) assignNextFreeVM(vmClaimId string, user string, envi } if assigned { - vmId, err = v.assignVM(vmClaimId, user, vmId) + err = v.assignVM(vmClaimId, user, vmId) if err != nil { return "", err