#!/usr/bin/env groovy
// -----------------------------------------------------------------------
// Copyright 2024 Open Networking Foundation (ONF) and the ONF Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// 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.
// -----------------------------------------------------------------------

// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
String getIam(String func) {
    String src = 'vars/dotkube.groovy'
    String iam = [src, func].join('::')
    return iam
}

// -----------------------------------------------------------------------
// Intent: Log progress message
// -----------------------------------------------------------------------
void enter(String name) {
    // Announce ourselves for log usability
    String iam = getIam(name)
    println("${iam}: ENTER")
    return
}

// -----------------------------------------------------------------------
// Intent: Log progress message
// -----------------------------------------------------------------------
void leave(String name) {
    // Announce ourselves for log usability
    String iam = getIam(name)
    println("${iam}: LEAVE")
    return
}

// -----------------------------------------------------------------------
// Intent: Display debug info about .kube/*
// -----------------------------------------------------------------------
def call(Map config) {
    config ?: [:]
    // Boolean debug = config.debug ?: false

    String iam = getIam('main')

    try {
        enter(iam)

        // clusterName: kind-ci
        // config=kind-{clusterName}
        // -------------------------
        // loader.go:223] Config not found: /home/jenkins/.kube/kind-kind-ci
        stage('.kube/ debugging')
        {
            sh("""/bin/ls -ld ~/.kube """)
            sh("""find ~/.kube -print0 | xargs -0 /bin/ls -ld""")
            // if (config['do-something']) {}
        }
    }
    // groovylint-disable-next-line
    catch (Exception err) {
        println("** ${iam}: EXCEPTION ${err}")
        throw err
    }
    finally {
        leave(iam)
    }

    return
}

// [EOF]
