Skip to content

Commit

Permalink
Merge pull request #1095 from openshift-kni/update-to-rte-0.20
Browse files Browse the repository at this point in the history
rte: consume dep v0.20.z
  • Loading branch information
ffromani authored Dec 5, 2024
2 parents 7bab6dc + c2e4db3 commit 33ff8ca
Show file tree
Hide file tree
Showing 48 changed files with 1,934 additions and 732 deletions.
13 changes: 1 addition & 12 deletions controllers/kubeletconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ func (r *KubeletConfigReconciler) syncConfigMap(ctx context.Context, kubeletConf
generatedName := objectnames.GetComponentName(instance.Name, kcHandler.poolName)
klog.V(3).InfoS("generated configMap name", "generatedName", generatedName)

podExcludes := podExcludesListToMap(instance.Spec.PodExcludes)
klog.V(5).InfoS("using podExcludes", "podExcludes", podExcludes)

data, err := rteconfig.Render(kubeletConfig, podExcludes)
data, err := rteconfig.Render(kubeletConfig, instance.Spec.PodExcludes)
if err != nil {
klog.ErrorS(err, "rendering config", "namespace", r.Namespace, "name", generatedName)
return nil, err
Expand Down Expand Up @@ -340,14 +337,6 @@ func removeDeletedOwner(kcKey client.ObjectKey, ownerConfigMaps []*corev1.Config
return ownerConfigMaps
}

func podExcludesListToMap(podExcludes []nropv1.NamespacedName) map[string]string {
ret := make(map[string]string)
for _, pe := range podExcludes {
ret[pe.Namespace] = pe.Name
}
return ret
}

func decodeKCFrom(data []byte, scheme *runtime.Scheme, mcoKc *mcov1.KubeletConfig) error {
yamlSerializer := serializer.NewSerializerWithOptions(
serializer.DefaultMetaFactory, scheme, scheme,
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/k8stopologyawareschedwg/deployer v0.21.0
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.2
github.com/k8stopologyawareschedwg/podfingerprint v0.2.2
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.16.1
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.20.3
github.com/kubevirt/device-plugin-manager v1.19.4
github.com/mdomke/git-semver v1.0.0
github.com/onsi/ginkgo/v2 v2.19.1
Expand Down Expand Up @@ -72,6 +72,7 @@ require (
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect
github.com/jeremywohl/flatten/v2 v2.0.0-20211013061545-07e4a09fb8e4 // 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
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho=
github.com/jaypipes/ghw v0.12.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g=
github.com/jaypipes/pcidb v1.0.0 h1:vtZIfkiCUE42oYbJS0TAq9XSfSmcsgo9IdxSm9qzYU8=
github.com/jaypipes/pcidb v1.0.0/go.mod h1:TnYUvqhPBzCKnH34KrIX22kAeEbDCSRJ9cqLRCuNDfk=
github.com/jeremywohl/flatten/v2 v2.0.0-20211013061545-07e4a09fb8e4 h1:eA9wi6ZzpIRobvXkn/S2Lyw1hr2pc71zxzOPl7Xjs4w=
github.com/jeremywohl/flatten/v2 v2.0.0-20211013061545-07e4a09fb8e4/go.mod h1:s9g9Dfls+aEgucKXKW+i8MRZuLXT2MrD/WjYpMnWfOw=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
Expand All @@ -1806,8 +1808,8 @@ github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.2 h1:uAwqOtyrFY
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.2/go.mod h1:LBzS4n6GX1C69tzSd5EibZ9cGOXFuHP7GxEMDYVe1sM=
github.com/k8stopologyawareschedwg/podfingerprint v0.2.2 h1:iFHPfZInM9pz2neye5RdmORMp1hPmte1EGJYpOOzZVg=
github.com/k8stopologyawareschedwg/podfingerprint v0.2.2/go.mod h1:C23pM15t06dXg/OihGlqBvnYzLr+MXDXJ7zMfbNAyXI=
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.16.1 h1:MOGtEVdtm5mJBjx8dXZqXmbspWil1KosoZ6NaObuLXM=
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.16.1/go.mod h1:nTCBvqGj29Y6iVUDCwo+2gGUKgDTWGatUmQfcr5/N5E=
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.20.3 h1:Klc99kCrNowiILJM7ukup0RP0TOTnfOsVd6J2p+IZcU=
github.com/k8stopologyawareschedwg/resource-topology-exporter v0.20.3/go.mod h1:IgD3i2yfkv5LwTTwvldqCpz4Q8LIpoHBFZ1gQ07hzmM=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
10 changes: 6 additions & 4 deletions internal/wait/machineconfigpool.go → internal/wait/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ func (wt Waiter) ForMachineConfigPoolDeleted(ctx context.Context, mcp *machineco

func (wt Waiter) ForMachineConfigPoolCondition(ctx context.Context, mcp *machineconfigv1.MachineConfigPool, condType machineconfigv1.MachineConfigPoolConditionType) error {
immediate := false
key := ObjectKeyFromObject(mcp)
updatedMcp := machineconfigv1.MachineConfigPool{}
err := k8swait.PollUntilContextTimeout(ctx, wt.PollInterval, wt.PollTimeout, immediate, func(ctx context.Context) (bool, error) {
updatedMcp := machineconfigv1.MachineConfigPool{}
key := ObjectKeyFromObject(mcp)
err := wt.Cli.Get(ctx, key.AsKey(), &updatedMcp)
if err != nil {
return false, err
}
klog.Infof("mcp: updated resourceversion %q (reference: %q)", updatedMcp.ResourceVersion, mcp.ResourceVersion)
if updatedMcp.ResourceVersion == mcp.ResourceVersion {
// nothing yet changed, need to recheck later
return false, nil
Expand All @@ -62,13 +61,16 @@ func (wt Waiter) ForMachineConfigPoolCondition(ctx context.Context, mcp *machine
if cond.Status == corev1.ConditionTrue {
return true, nil
} else {
klog.Infof("mcp: %q condition type: %q status is: %q expected status: %q", updatedMcp.Name, cond.Type, cond.Status, corev1.ConditionTrue)
klog.Infof("mcp: %q conditionType: %q status is: %q resourceversion: updated %q reference %q", updatedMcp.Name, cond.Type, cond.Status, updatedMcp.ResourceVersion, mcp.ResourceVersion)
return false, nil
}
}
}
klog.Infof("mcp: %q condition type: %q was not found", updatedMcp.Name, condType)
return false, nil
})
if err != nil {
klog.Infof("mcp: %q final status: %+v", updatedMcp.Name, updatedMcp.Status)
}
return err
}
File renamed without changes.
Loading

0 comments on commit 33ff8ca

Please sign in to comment.