Merge pull request #409 from MadsJakobsen/casc-1.41-yamlsouce-api-changes
Check casc version to match changes in YamlSource
This commit is contained in:
commit
fcfeb309f5
|
|
@ -46,14 +46,15 @@ func (c *configurationAsCode) Ensure(jenkins *v1alpha2.Jenkins) (requeue bool, e
|
||||||
|
|
||||||
const applyConfigurationAsCodeGroovyScriptFmt = `
|
const applyConfigurationAsCodeGroovyScriptFmt = `
|
||||||
String[] configContent = ['''%s''']
|
String[] configContent = ['''%s''']
|
||||||
|
|
||||||
def configSb = new StringBuffer()
|
def configSb = new StringBuffer()
|
||||||
for (int i=0; i<configContent.size(); i++) {
|
for (int i=0; i<configContent.size(); i++) {
|
||||||
configSb << configContent[i]
|
configSb << configContent[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
def stream = new ByteArrayInputStream(configSb.toString().getBytes('UTF-8'))
|
def stream = new ByteArrayInputStream(configSb.toString().getBytes('UTF-8'))
|
||||||
|
def source = io.jenkins.plugins.casc.yaml.YamlSource.of(stream)
|
||||||
|
|
||||||
def source = new io.jenkins.plugins.casc.yaml.YamlSource(stream, io.jenkins.plugins.casc.yaml.YamlSource.READ_FROM_INPUTSTREAM)
|
|
||||||
io.jenkins.plugins.casc.ConfigurationAsCode.get().configureWith(source)
|
io.jenkins.plugins.casc.ConfigurationAsCode.get().configureWith(source)
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue