Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shahiddev committed May 8, 2018
2 parents 7707381 + d7c90bc commit 1ea843a
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/config/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var addonsConfigureCmd = &cobra.Command{
awsAccessKey = AskForStaticValue("-- Enter AWS Secret Access Key: ")
awsSessionToken = AskForStaticValueOptional("-- (Optional) Enter AWS Session Token: ")
awsRegion = AskForStaticValue("-- Enter AWS Region: ")
awsAccount = AskForStaticValue("-- Enter 12 digit AWS Account ID (Comma seperated list): ")
awsAccount = AskForStaticValue("-- Enter 12 digit AWS Account ID (Comma separated list): ")
awsRole = AskForStaticValueOptional("-- (Optional) Enter ARN of AWS role to assume: ")
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ func EnableOrDisableAddon(name string, val string) error {
if enable {
for _, addon := range addon.Assets {
if err := cmd.Copy(addon); err != nil {
return errors.Wrapf(err, "error enabling addon %s: %s", addon.AssetName)
return errors.Wrapf(err, "error enabling addon %s", addon.AssetName)
}
}
} else {
for _, addon := range addon.Assets {
if err := cmd.Remove(addon); err != nil {
return errors.Wrapf(err, "error disabling addon %s: %s", addon.AssetName)
return errors.Wrapf(err, "error disabling addon %s", addon.AssetName)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ReplicationController
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: default-http-backend
namespace: kube-system
Expand All @@ -22,8 +22,9 @@ metadata:
spec:
replicas: 1
selector:
app: default-http-backend
addonmanager.kubernetes.io/mode: Reconcile
matchLabels:
app: default-http-backend
addonmanager.kubernetes.io/mode: Reconcile
template:
metadata:
labels:
Expand Down Expand Up @@ -55,8 +56,8 @@ spec:
cpu: 10m
memory: 20Mi
---
apiVersion: v1
kind: ReplicationController
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress-controller
namespace: kube-system
Expand All @@ -66,8 +67,9 @@ metadata:
spec:
replicas: 1
selector:
app: nginx-ingress-controller
addonmanager.kubernetes.io/mode: Reconcile
matchLabels:
app: nginx-ingress-controller
addonmanager.kubernetes.io/mode: Reconcile
template:
metadata:
labels:
Expand All @@ -77,7 +79,7 @@ spec:
spec:
terminationGracePeriodSeconds: 60
containers:
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.14.0
name: nginx-ingress-controller
imagePullPolicy: IfNotPresent
readinessProbe:
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/none/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewDriver(hostName, storePath string) *Driver {
}
}

// PreCreateCheck checks for correct priviledges and dependencies
// PreCreateCheck checks for correct privileges and dependencies
func (d *Driver) PreCreateCheck() error {
// check that docker is on path
_, err := exec.LookPath("docker")
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/assets/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ var Addons = map[string]*Addon{
"ingress-configmap.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/ingress/ingress-rc.yaml",
"deploy/addons/ingress/ingress-dp.yaml",
constants.AddonsPath,
"ingress-rc.yaml",
"ingress-dp.yaml",
"0640"),
NewBinDataAsset(
"deploy/addons/ingress/ingress-svc.yaml",
Expand Down
19 changes: 19 additions & 0 deletions pkg/util/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func setElement(e reflect.Value, v string) error {
case []string:
vals := strings.Split(v, ",")
e.Set(reflect.ValueOf(vals))
case map[string]string:
return convertMap(e, v)
default:
// Last ditch attempt to convert anything based on its underlying kind.
// This covers any types that are aliased to a native type
Expand All @@ -104,6 +106,23 @@ func setElement(e reflect.Value, v string) error {
return nil
}

func convertMap(e reflect.Value, v string) error {
if e.IsNil() {
e.Set(reflect.MakeMap(e.Type()))
}
vals := strings.Split(v, ",")
for _, subitem := range vals {
subvals := strings.FieldsFunc(subitem, func(c rune) bool {
return c == '<' || c == '=' || c == '>'
})
if len(subvals) != 2 {
return fmt.Errorf("Unparsable %s", v)
}
e.SetMapIndex(reflect.ValueOf(subvals[0]), reflect.ValueOf(subvals[1]))
}
return nil
}

func convertInt(e reflect.Value, v string) error {
i, err := strconv.Atoi(v)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions test/integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ func WaitForIngressControllerRunning(t *testing.T) error {
return errors.Wrap(err, "getting kubernetes client")
}

if err := commonutil.WaitForRCToStabilize(client, "kube-system", "nginx-ingress-controller", time.Minute*10); err != nil {
return errors.Wrap(err, "waiting for ingress-controller RC to stabilize")
if err := commonutil.WaitForDeploymentToStabilize(client, "kube-system", "nginx-ingress-controller", time.Minute*10); err != nil {
return errors.Wrap(err, "waiting for ingress-controller deployment to stabilize")
}

selector := labels.SelectorFromSet(labels.Set(map[string]string{"app": "nginx-ingress-controller"}))
Expand All @@ -287,8 +287,8 @@ func WaitForIngressDefaultBackendRunning(t *testing.T) error {
return errors.Wrap(err, "getting kubernetes client")
}

if err := commonutil.WaitForRCToStabilize(client, "kube-system", "default-http-backend", time.Minute*10); err != nil {
return errors.Wrap(err, "waiting for default-http-backend RC to stabilize")
if err := commonutil.WaitForDeploymentToStabilize(client, "kube-system", "default-http-backend", time.Minute*10); err != nil {
return errors.Wrap(err, "waiting for default-http-backend deployment to stabilize")
}

if err := commonutil.WaitForService(client, "kube-system", "default-http-backend", true, time.Millisecond*500, time.Minute*10); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions third_party/go9p/srv_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ type FWstatOp interface {
// If the FReadOp interface is implemented, the Read operation will be called
// to read from the file. If not implemented, "permission denied" error will
// be send back. The operation returns the number of bytes read, or the
// error occured while reading.
// error occurred while reading.
type FReadOp interface {
Read(fid *FFid, buf []byte, offset uint64) (int, error)
}

// If the FWriteOp interface is implemented, the Write operation will be called
// to write to the file. If not implemented, "permission denied" error will
// be send back. The operation returns the number of bytes written, or the
// error occured while writing.
// error occurred while writing.
type FWriteOp interface {
Write(fid *FFid, data []byte, offset uint64) (int, error)
}
Expand All @@ -47,15 +47,15 @@ type FWriteOp interface {
// when the client attempts to create a file in the srvFile implementing the interface.
// If not implemented, "permission denied" error will be send back. If successful,
// the operation should call (*File)Add() to add the created file to the directory.
// The operation returns the created file, or the error occured while creating it.
// The operation returns the created file, or the error occurred while creating it.
type FCreateOp interface {
Create(fid *FFid, name string, perm uint32) (*srvFile, error)
}

// If the FRemoveOp interface is implemented, the Remove operation will be called
// when the client attempts to create a file in the srvFile implementing the interface.
// If not implemented, "permission denied" error will be send back.
// The operation returns nil if successful, or the error that occured while removing
// The operation returns nil if successful, or the error that occurred while removing
// the file.
type FRemoveOp interface {
Remove(*FFid) error
Expand Down

0 comments on commit 1ea843a

Please sign in to comment.