Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
80 changes: 51 additions & 29 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 9 additions & 13 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,27 @@ required = [

[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.12.5"
version = "kubernetes-1.13.4"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.12.5"
version = "kubernetes-1.13.4"

[[constraint]]
name = "k8s.io/client-go"
version = "9.0.0"
version = "10.0.0"

[[constraint]]
name = "k8s.io/code-generator"
version = "kubernetes-1.12.5"
version = "kubernetes-1.13.4"

[[constraint]]
name = "k8s.io/kubelet"
version = "kubernetes-1.12.5"
version = "kubernetes-1.13.4"

[[constraint]]
name = "k8s.io/kubernetes"
revision = "v1.12.5"
revision = "v1.13.4"

# TODO: include why the override is required
[[override]]
Expand All @@ -140,21 +140,17 @@ required = [
# TODO: include why the override is required
[[override]]
name = "k8s.io/gengo"
revision = "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2"
revision = "51747d6e00da1fc578d5a333a93bb2abcbce7a95"

# importing install-config is importing cluster-network-operator which adds sigs.k8s.io/controller-runtime as dependency.
# sigs.k8s.io/controller-runtime needs 1.12.3
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.12.5"
version = "kubernetes-1.13.4"

[[override]]
name = "k8s.io/apiserver"
version = "kubernetes-1.12.5"

[[constraint]]
branch = "release-1.12"
name = "github.com/kubernetes-sigs/cri-o"
version = "kubernetes-1.13.4"

[[constraint]]
revision = "0b67c788f2d234c9fecc3d372d93160869381166"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ type Controller struct {

queue workqueue.RateLimitingInterface
imgQueue workqueue.RateLimitingInterface

// we need this method to mock out patch calls in unit until https://github.com/openshift/machine-config-operator/pull/611#issuecomment-481397185
// which is probably going to be in kube 1.14
patchContainerRuntimeConfigsFunc func(string, []byte) error
}

// New returns a new container runtime config controller
Expand Down Expand Up @@ -143,6 +147,8 @@ func New(
ctrl.clusterVersionLister = clusterVersionInformer.Lister()
ctrl.clusterVersionListerSynced = clusterVersionInformer.Informer().HasSynced

ctrl.patchContainerRuntimeConfigsFunc = ctrl.patchContainerRuntimeConfigs

return ctrl
}

Expand Down Expand Up @@ -685,11 +691,15 @@ func (ctrl *Controller) popFinalizerFromContainerRuntimeConfig(ctrCfg *mcfgv1.Co
if err != nil {
return err
}
_, err = ctrl.client.Machineconfiguration().ContainerRuntimeConfigs().Patch(ctrCfg.Name, types.MergePatchType, patch)
return err
return ctrl.patchContainerRuntimeConfigsFunc(ctrCfg.Name, patch)
})
}

func (ctrl *Controller) patchContainerRuntimeConfigs(name string, patch []byte) error {
_, err := ctrl.client.Machineconfiguration().ContainerRuntimeConfigs().Patch(name, types.MergePatchType, patch)
return err
}

func (ctrl *Controller) addFinalizerToContainerRuntimeConfig(ctrCfg *mcfgv1.ContainerRuntimeConfig, mc *mcfgv1.MachineConfig) error {
return retry.RetryOnConflict(updateBackoff, func() error {
newcfg, err := ctrl.mccrLister.Get(ctrCfg.Name)
Expand Down Expand Up @@ -717,8 +727,7 @@ func (ctrl *Controller) addFinalizerToContainerRuntimeConfig(ctrCfg *mcfgv1.Cont
if err != nil {
return err
}
_, err = ctrl.client.Machineconfiguration().ContainerRuntimeConfigs().Patch(ctrCfg.Name, types.MergePatchType, patch)
return err
return ctrl.patchContainerRuntimeConfigsFunc(ctrCfg.Name, patch)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
fakeconfigv1client "github.com/openshift/client-go/config/clientset/versioned/fake"
configv1informer "github.com/openshift/client-go/config/informers/externalversions"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
"github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake"
"github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake"
informers "github.com/openshift/machine-config-operator/pkg/generated/informers/externalversions"
)

Expand Down Expand Up @@ -173,6 +173,11 @@ func (f *fixture) newController() *Controller {
ci.Config().V1().ClusterVersions(),
k8sfake.NewSimpleClientset(), f.client, f.imgClient)

c.patchContainerRuntimeConfigsFunc = func(name string, patch []byte) error {
f.client.Invokes(core.NewRootPatchAction(schema.GroupVersionResource{Version: "v1", Group: "machineconfiguration.openshift.io", Resource: "containerruntimeconfigs"}, name, types.MergePatchType, patch), nil)
return nil
}

c.mcpListerSynced = alwaysReady
c.mccrListerSynced = alwaysReady
c.ccListerSynced = alwaysReady
Expand Down Expand Up @@ -315,7 +320,7 @@ func (f *fixture) expectUpdateMachineConfigAction(config *mcfgv1.MachineConfig)
}

func (f *fixture) expectPatchContainerRuntimeConfig(config *mcfgv1.ContainerRuntimeConfig, patch []byte) {
f.actions = append(f.actions, core.NewRootPatchAction(schema.GroupVersionResource{Version: "v1", Group: "machineconfiguration.openshift.io", Resource: "containerruntimeconfigs"}, config.Name, patch))
f.actions = append(f.actions, core.NewRootPatchAction(schema.GroupVersionResource{Version: "v1", Group: "machineconfiguration.openshift.io", Resource: "containerruntimeconfigs"}, config.Name, types.MergePatchType, patch))
}

func (f *fixture) expectUpdateContainerRuntimeConfig(config *mcfgv1.ContainerRuntimeConfig) {
Expand Down
Loading