Skip to content

Commit

Permalink
updates to use pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislovecnm committed Jan 16, 2017
1 parent 60bd9e7 commit 34bc061
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions hack/dev-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ KOPS_BASE_URL="https://${NODEUP_BUCKET}.s3.amazonaws.com/kops/${GIT_VER}/"
echo ==========
echo "Starting build"

make ci && S3_BUCKET=s3://${NODEUP_BUCKET} make upload
#make ci && S3_BUCKET=s3://${NODEUP_BUCKET} make upload

echo ==========
echo "Deleting cluster ${CLUSTER_NAME}. Elle est finie."
Expand All @@ -105,9 +105,11 @@ KOPS_BASE_URL=${KOPS_BASE_URL} kops create cluster \
--master-size $MASTER_SIZE \
--topology $TOPOLOGY \
--networking $NETWORKING \
--kubernetes-version "1.5.2" \
-v $VERBOSITY \
--image $IMAGE \
--yes
--image $IMAGE
#\
#--yes

echo ==========
echo "Your k8s cluster ${CLUSTER_NAME}, awaits your bidding."
echo "Your k8s cluster ${CLUSTER_NAME}, awaits your bidding."
3 changes: 1 addition & 2 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ limitations under the License.

package kops

import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"

import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"

type KubeletConfigSpec struct {
APIServers string `json:"apiServers,omitempty" flag:"api-servers"`
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

package v1alpha1

import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"

type KubeletConfigSpec struct {
APIServers string `json:"apiServers,omitempty" flag:"api-servers"`
Expand Down Expand Up @@ -536,7 +536,6 @@ type KubeControllerManagerConfig struct {
// ReconcilerSyncLoopPeriod is the amount of time the reconciler sync states loop
// wait between successive executions. Is set to 1 min by kops by default
AttachDetachReconcileSyncPeriod *metav1.Duration `json:"attachDetachReconcileSyncPeriod,omitempty" flag:"attach-detach-reconcile-sync-period"`

}

type KubeSchedulerConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

package v1alpha2

import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
import metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"

type KubeletConfigSpec struct {
APIServers string `json:"apiServers,omitempty" flag:"api-servers"`
Expand Down
6 changes: 4 additions & 2 deletions pkg/model/components/kubecontrollermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var _ loader.OptionsBuilder = &KubeControllerManagerOptionsBuilder{}

// BuildOptions tests for options to be added to the model
func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error {

options := o.(*kops.ClusterSpec)

if options.KubeControllerManager == nil {
Expand Down Expand Up @@ -70,11 +71,12 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
// if 1.4.8+ and 1.5.2+
if kubernetesVersion.GTE(*k8sv148) || kubernetesVersion.GTE(*k8sv152) {

glog.Info("k-c-m default-attach-detach-reconcile-sync-period correct version found")
// If not set ... or set to 0s ... which is stupid
if options.KubeControllerManager.AttachDetachReconcileSyncPeriod == nil ||
options.KubeControllerManager.AttachDetachReconcileSyncPeriod.Duration.String() == "0s" {

glog.V(8).Info("k-c-m default-attach-detach-reconcile-sync-period flag is set to defatul")
glog.V(8).Info("k-c-m default-attach-detach-reconcile-sync-period flag is set to default")
options.KubeControllerManager.AttachDetachReconcileSyncPeriod = &metav1.Duration{Duration: defaultAttachDetachReconcileSyncPeriod}

// If less than 1 min and greater than 1 sec ... you get a warning
Expand All @@ -89,7 +91,7 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
}
} else {

glog.V(8).Info("not setting k-c-m default-attach-detach-reconcile-sync-period, k8s version is too low")
glog.Info("not setting k-c-m default-attach-detach-reconcile-sync-period, k8s version is too low")
options.KubeControllerManager.AttachDetachReconcileSyncPeriod = nil
}

Expand Down
1 change: 1 addition & 0 deletions upup/pkg/fi/cloudup/populate_cluster_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func (c *populateClusterSpec) run() error {
codeModels = append(codeModels, &components.DockerOptionsBuilder{Context: optionsContext})
codeModels = append(codeModels, &components.NetworkingOptionsBuilder{Context: optionsContext})
codeModels = append(codeModels, &components.KubeletOptionsBuilder{Context: optionsContext})
codeModels = append(codeModels, &components.KubeControllerManagerOptionsBuilder{Context: optionsContext})
fileModels = append(fileModels, m)

default:
Expand Down

0 comments on commit 34bc061

Please sign in to comment.