Skip to content

Commit

Permalink
Merge pull request #170 from soltysh/change-version
Browse files Browse the repository at this point in the history
Move v3.11.0 to v4.1.0
  • Loading branch information
openshift-merge-robot committed Sep 6, 2019
2 parents 48ae65c + 7f3b39e commit f042ef2
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 138 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -29,7 +29,7 @@ $(call build-image,origin-$(GO_PACKAGE),./Dockerfile,.)
# $5 - output
# It will generate targets {update,verify}-bindata-$(1) logically grouping them in unsuffixed versions of these targets
# and also hooked into {update,verify}-generated for broader integration.
$(call add-bindata,v3.11.0,./bindata/v3.11.0/...,bindata,v311_00_assets,pkg/operator/v311_00_assets/bindata.go)
$(call add-bindata,v4.1.0,./bindata/v4.1.0/...,bindata,v410_00_assets,pkg/operator/v410_00_assets/bindata.go)

e2e: GO_TEST_PACKAGES :=./test/e2e
e2e: test-unit
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -21,7 +21,7 @@ The metrics are collected from following components:

The configuration for the Kubernetes Scheduler is the result of merging:

* a [default config](https://github.com/openshift/cluster-kube-scheduler-operator/blob/master/bindata/v3.11.0/kube-scheduler/defaultconfig-postbootstrap.yaml)
* a [default config](https://github.com/openshift/cluster-kube-scheduler-operator/blob/master/bindata/v4.1.0/kube-scheduler/defaultconfig-postbootstrap.yaml)
* observed config (compare observed values above) from the spec `schedulers.config.openshift.io`.

All of these are sparse configurations, i.e. unvalidated json snippets which are merged in order to form a valid configuration at the end.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions cmd/render/render.go
Expand Up @@ -5,7 +5,7 @@ import (
"io/ioutil"
"path/filepath"

"github.com/openshift/cluster-kube-scheduler-operator/pkg/operator/v311_00_assets"
"github.com/openshift/cluster-kube-scheduler-operator/pkg/operator/v410_00_assets"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -16,7 +16,7 @@ import (
)

const (
bootstrapVersion = "v3.11.0"
bootstrapVersion = "v4.1.0"
)

// renderOpts holds values to drive the render command.
Expand Down Expand Up @@ -94,7 +94,7 @@ func (r *renderOpts) Run() error {
}
if err := r.generic.ApplyTo(
&renderConfig.FileConfig,
genericrenderoptions.Template{FileName: "defaultconfig.yaml", Content: v311_00_assets.MustAsset(filepath.Join(bootstrapVersion, "kube-scheduler", "defaultconfig.yaml"))},
genericrenderoptions.Template{FileName: "defaultconfig.yaml", Content: v410_00_assets.MustAsset(filepath.Join(bootstrapVersion, "kube-scheduler", "defaultconfig.yaml"))},
mustReadTemplateFile(filepath.Join(r.generic.TemplatesDir, "config", "bootstrap-config-overrides.yaml")),
mustReadTemplateFile(filepath.Join(r.generic.TemplatesDir, "config", "config-overrides.yaml")),
&renderConfig,
Expand Down
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/openshift/cluster-kube-scheduler-operator/pkg/operator/operatorclient"
"github.com/openshift/cluster-kube-scheduler-operator/pkg/operator/v311_00_assets"
"github.com/openshift/cluster-kube-scheduler-operator/pkg/operator/v410_00_assets"
"github.com/openshift/cluster-kube-scheduler-operator/pkg/version"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -33,15 +33,15 @@ const TargetPolicyConfigMapName = "policy-configmap"
func createTargetConfigReconciler_v311_00_to_latest(c TargetConfigReconciler, recorder events.Recorder, operatorConfig *operatorv1.KubeScheduler) (bool, error) {
errors := []error{}

directResourceResults := resourceapply.ApplyDirectly(c.kubeClient, c.eventRecorder, v311_00_assets.Asset,
"v3.11.0/kube-scheduler/ns.yaml",
"v3.11.0/kube-scheduler/kubeconfig-cm.yaml",
"v3.11.0/kube-scheduler/leader-election-rolebinding.yaml",
"v3.11.0/kube-scheduler/scheduler-clusterrolebinding.yaml",
"v3.11.0/kube-scheduler/policyconfigmap-role.yaml",
"v3.11.0/kube-scheduler/policyconfigmap-rolebinding.yaml",
"v3.11.0/kube-scheduler/svc.yaml",
"v3.11.0/kube-scheduler/sa.yaml",
directResourceResults := resourceapply.ApplyDirectly(c.kubeClient, c.eventRecorder, v410_00_assets.Asset,
"v4.1.0/kube-scheduler/ns.yaml",
"v4.1.0/kube-scheduler/kubeconfig-cm.yaml",
"v4.1.0/kube-scheduler/leader-election-rolebinding.yaml",
"v4.1.0/kube-scheduler/scheduler-clusterrolebinding.yaml",
"v4.1.0/kube-scheduler/policyconfigmap-role.yaml",
"v4.1.0/kube-scheduler/policyconfigmap-rolebinding.yaml",
"v4.1.0/kube-scheduler/svc.yaml",
"v4.1.0/kube-scheduler/sa.yaml",
)
for _, currResult := range directResourceResults {
if currResult.Error != nil {
Expand Down Expand Up @@ -86,8 +86,8 @@ func createTargetConfigReconciler_v311_00_to_latest(c TargetConfigReconciler, re
}

func manageKubeSchedulerConfigMap_v311_00_to_latest(lister corev1listers.ConfigMapLister, client coreclientv1.ConfigMapsGetter, recorder events.Recorder, operatorConfig *operatorv1.KubeScheduler) (*corev1.ConfigMap, bool, error) {
configMap := resourceread.ReadConfigMapV1OrDie(v311_00_assets.MustAsset("v3.11.0/kube-scheduler/cm.yaml"))
defaultConfig := v311_00_assets.MustAsset("v3.11.0/kube-scheduler/defaultconfig-postbootstrap.yaml")
configMap := resourceread.ReadConfigMapV1OrDie(v410_00_assets.MustAsset("v4.1.0/kube-scheduler/cm.yaml"))
defaultConfig := v410_00_assets.MustAsset("v4.1.0/kube-scheduler/defaultconfig-postbootstrap.yaml")
requiredConfigMap, _, err := resourcemerge.MergeConfigMap(configMap, "config.yaml", nil, defaultConfig, operatorConfig.Spec.ObservedConfig.Raw, operatorConfig.Spec.UnsupportedConfigOverrides.Raw)
if err != nil {
return nil, false, err
Expand All @@ -96,7 +96,7 @@ func manageKubeSchedulerConfigMap_v311_00_to_latest(lister corev1listers.ConfigM
}

func managePod_v311_00_to_latest(configMapsGetter coreclientv1.ConfigMapsGetter, secretsGetter coreclientv1.SecretsGetter, recorder events.Recorder, operatorConfig *operatorv1.KubeScheduler, imagePullSpec string, featureGateLister configlistersv1.FeatureGateLister) (*corev1.ConfigMap, bool, error) {
required := resourceread.ReadPodV1OrDie(v311_00_assets.MustAsset("v3.11.0/kube-scheduler/pod.yaml"))
required := resourceread.ReadPodV1OrDie(v410_00_assets.MustAsset("v4.1.0/kube-scheduler/pod.yaml"))
if len(imagePullSpec) > 0 {
required.Spec.Containers[0].Image = imagePullSpec
if len(required.Spec.InitContainers) > 0 {
Expand Down Expand Up @@ -130,7 +130,7 @@ func managePod_v311_00_to_latest(configMapsGetter coreclientv1.ConfigMapsGetter,
required.Spec.Containers[0].Args = append(required.Spec.Containers[0].Args, "--tls-private-key-file=/etc/kubernetes/static-pod-resources/secrets/serving-cert/tls.key")
}

configMap := resourceread.ReadConfigMapV1OrDie(v311_00_assets.MustAsset("v3.11.0/kube-scheduler/pod-cm.yaml"))
configMap := resourceread.ReadConfigMapV1OrDie(v410_00_assets.MustAsset("v4.1.0/kube-scheduler/pod-cm.yaml"))
configMap.Data["pod.yaml"] = resourceread.WritePodV1OrDie(required)
configMap.Data["forceRedeploymentReason"] = operatorConfig.Spec.ForceRedeploymentReason
configMap.Data["version"] = version.Get().String()
Expand Down

0 comments on commit f042ef2

Please sign in to comment.