Linkerd2: Test cleanup does not work on MacOS

Created on 17 Jun 2020  路  4Comments  路  Source: linkerd/linkerd2

Bug Report

What is the issue?

The test cleanup script does not work on a mac

How can it be reproduced?

Run bin/test-cleanup

Logs, error output, etc

$bin/test-cleanup
cleaning up control-plane namespaces in k8s-context []
bin/test-cleanup: line 14: local: -n: invalid option
local: usage: local name[=value] ...
bug

Most helpful comment

I guess it is more choosing which one of the older techniques to use.

I chose the technique used in the Kubernetes utility scripts for my PR.

All 4 comments

Turns out I am using an ancient version of bash. Upgrading fixes that:

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

Do we have any idea what we want to support and what not?

PS: Seems Apple is stuck with older versions of bash due to licencing so we might want to actually make it backwards compatible

Given most people are on Macs I agree we need to support that. Pinging our Bash guru @joakimr-axis :slightly_smiling_face:

Given most people are on Macs I agree we need to support that. Pinging our Bash guru @joakimr-axis

Oh, that is a title I could not claim with a straight face. But I will do my best to help out! I checked who was the person to blame and realized git blame points right back at me. :-)

So what happens there is that a nameref is used. Apparently, namerefs were introduced in bash 4.3. Now, I do like macs and Mac OS ("almost as good as Debian Linux", like my brother says) but was not aware bash there was that old. My apologies. Then this would call for another solution鈥攖hey exist鈥攆or the code in populate_array. I guess it is more choosing which one of the older techniques to use.

I guess it is more choosing which one of the older techniques to use.

I chose the technique used in the Kubernetes utility scripts for my PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wmorgan picture wmorgan  路  3Comments

alpeb picture alpeb  路  3Comments

ihcsim picture ihcsim  路  4Comments

tustvold picture tustvold  路  4Comments

manimaul picture manimaul  路  3Comments