Skip to content

Commit

Permalink
fix: correct feature gates arg format
Browse files Browse the repository at this point in the history
  • Loading branch information
devigned committed Apr 17, 2020
1 parent bbaa483 commit 497709e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ settings = {
"kind_cluster_name": "capz",
"capi_version": "v0.3.3",
"cert_manager_version": "v0.11.0",
"feature_gates": '--feature-gates MachinePool=true'
"feature_gates": '--feature-gates=MachinePool=true'
}

keys = ["AZURE_SUBSCRIPTION_ID_B64", "AZURE_TENANT_ID_B64", "AZURE_CLIENT_SECRET_B64", "AZURE_CLIENT_ID_B64"]
Expand Down Expand Up @@ -59,7 +59,7 @@ def deploy_capi():
args_str = str(local('kubectl get deployments capi-controller-manager -n capi-system -o jsonpath={.spec.template.spec.containers[1].args}'))
if settings.get("feature_gates") not in args_str:
args = args_str[1:-1].split() # "[arg1 arg2 ...]" trim off the first and last, then split
args.append("\"{}\"".format(settings.get("feature_gates")))
args.append("{}".format(settings.get("feature_gates")))
patch = [{
"op": "replace",
"path": "/spec/template/spec/containers/1/args",
Expand All @@ -82,7 +82,7 @@ def append_arg_for_container_in_deployment(yaml_stream, name, namespace, contain
containers = item.get("spec").get("template").get("spec").get("containers")
for container in containers:
if contains_image_name in container.get("image"):
container.get("args").append("\"{}\"".format(arg))
container.get("args").append("{}".format(arg))


def fixup_yaml_empty_arrays(yaml_str):
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"flag"
"fmt"
"net/http"
_ "net/http/pprof" //nolint
"os"
Expand All @@ -40,6 +41,7 @@ import (
expcontrollers "sigs.k8s.io/cluster-api-provider-azure/exp/controllers"

clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha3"
"sigs.k8s.io/cluster-api/feature"
"sigs.k8s.io/cluster-api/util/record"
ctrl "sigs.k8s.io/controller-runtime"
Expand All @@ -59,6 +61,7 @@ func init() {
_ = infrav1alpha2.AddToScheme(scheme)
_ = infrav1alpha3.AddToScheme(scheme)
_ = clusterv1.AddToScheme(scheme)
_ = clusterv1exp.AddToScheme(scheme)
_ = expv1alpha3.AddToScheme(scheme)
_ = infrastructurev1alpha3.AddToScheme(scheme)
// +kubebuilder:scaffold:scheme
Expand Down Expand Up @@ -206,6 +209,7 @@ func main() {
}

// just use CAPI MachinePool feature flag rather than create a new one
setupLog.V(1).Info(fmt.Sprintf("%+v\n", feature.Gates))
if feature.Gates.Enabled(feature.MachinePool) {
if err = (&expcontrollers.AzureMachinePoolReconciler{
Client: mgr.GetClient(),
Expand Down

0 comments on commit 497709e

Please sign in to comment.