Giter VIP home page Giter VIP logo

Comments (2)

 avatar commented on August 18, 2024

Looks like this has to do with the class not carrying over to the function created under the new project

from jenkins-client-plugin.

gabemontero avatar gabemontero commented on August 18, 2024

@xxwassyxx - your def objs = maps.objects( exportable:true ) is in the openshift.withProject( 'test-project' ) { closure and not accessible to the openshift.withProject( 'stage' ) { closure per basic groovy/Java rules.

I ran this test and got the same failure as you:

try {
    timeout(time: 20, unit: 'MINUTES') {
        openshift.withCluster() {
            def foo = 'bar'
        }
        
        echo "GGM ${foo}"
    }
} catch (err) {
    echo "in catch block"
    echo "Caught: ${err}"
    currentBuild.result = 'FAILURE'
    throw err
}

Where as this test passed:

try {
    timeout(time: 20, unit: 'MINUTES') {
        def foo
        openshift.withCluster() {
            foo = 'bar'
        }
        
        echo "GGM ${foo}"
    }
} catch (err) {
    echo "in catch block"
    echo "Caught: ${err}"
    currentBuild.result = 'FAILURE'
    throw err
}

Try adding a def objs right after the withCluster statement, and then have objs = maps.objects( exportable:true ) in withProject('test-project') and continue to have openshift.create( objs ) with the withProject('stage')

Also note, you will need to add make sure the jenkins projects service account has the appropriate roles assigned to it for both the test-project and stage projects, otherwise you'll get permissions errors on the various underlying oc invocations.

Closing out. But certainly post related follow up question here or reopen if you see issues after those corrections.

from jenkins-client-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.