Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Oct 27, 2021
1 parent 4306b85 commit cca83fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/kubefwd/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package services

import (
Expand Down Expand Up @@ -104,6 +105,11 @@ func setAllNamespace(clientSet *kubernetes.Clientset, options metav1.ListOptions
if err != nil {
log.Fatalf("Error get all namespaces by CoreV1: %s\n", err.Error())
}
if nsList == nil {
log.Warn("No namespaces returned.")
return
}

for _, ns := range nsList.Items {
*namespaces = append(*namespaces, ns.Name)
}
Expand Down Expand Up @@ -338,7 +344,6 @@ Try:
log.Infof("Clean exit")
}

// NamespaceOpts
type NamespaceOpts struct {
NamespaceIPLock *sync.Mutex
ListOptions metav1.ListOptions
Expand Down

0 comments on commit cca83fb

Please sign in to comment.