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:
Tomasz Sęk 2020-06-07 11:19:08 +02:00 committed by GitHub
commit fcfeb309f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -45,15 +45,16 @@ func (c *configurationAsCode) Ensure(jenkins *v1alpha2.Jenkins) (requeue bool, e
}
const applyConfigurationAsCodeGroovyScriptFmt = `
String[] configContent = ['''%s''']
String[] configContent = ['''%s''']
def configSb = new StringBuffer()
for (int i=0; i<configContent.size(); i++) {
configSb << configContent[i]
}
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)
`