migtools / crane-plugin-openshift Goto Github PK
View Code? Open in Web Editor NEWOpenshift plugin for crane
License: Apache License 2.0
Openshift plugin for crane
License: Apache License 2.0
After running crane apply
, if a BuildConfig exists with the DockerStrategy
field but has no from
field, the plugin crashes with the following output:
ERRO[0000] unable to run the plugin binary pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: time="2022-05-18T15:26:36+03:00" level=info msg="found build config, processing" pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: panic: runtime error: invalid memory address or nil pointer dereference pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb6e597] pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: goroutine 1 [running]: pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: main.UpdateBuildConfig(0xc0002becc0, 0xc0002b9100, 0x0, 0x0, 0xc00013b7b0, 0xb, 0x2, 0xc00015fb88, 0x4f981a) pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: /home/runner/work/crane-plugin-openshift/crane-plugin-openshift/main/openshift.go:294 +0xcb7 pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: main.Run(0xc0002becc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x30) pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: /home/runner/work/crane-plugin-openshift/crane-plugin-openshift/main/cmd.go:85 +0x4aa pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: github.com/konveyor/crane-lib/transform/cli.(*customPlugin).Run(0xc0001ddab0, 0xc0002becc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f9c69d19700, ...) pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: /home/runner/go/pkg/mod/github.com/konveyor/[email protected]/transform/cli/cli.go:44 +0x8e pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: github.com/konveyor/crane-lib/transform/cli.RunAndExit(0xd99ae0, 0xc0001ddab0) pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: /home/runner/go/pkg/mod/github.com/konveyor/[email protected]/transform/cli/cli.go:134 +0x545 pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: main.main() pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: /home/runner/work/crane-plugin-openshift/crane-plugin-openshift/main/cmd.go:43 +0x2d6 pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
DEBU[0000] Plugin Log line: pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
ERRO[0000] error running the plugin command pluginPath=/home/nikita/plugins/managed/default/OpenShiftPlugin
Error: error running the plugin command: unable to run the plugin binary, err: exit status 2
It can happen for example when the yaml of the BuildConfig looks like this:
spec:
strategy:
dockerStrategy: {}
or:
spec:
strategy:
dockerStrategy:
dockerfilePath: Dockerfile
type: Docker
The problem is in https://github.com/konveyor/crane-plugin-openshift/blob/b1f4f9be2b32f76b422360461de4c055e74d91b8/openshift.go#L294
There is no validation if the From
field exists at all.
A simple workaround is adding the from field and giving it some object value, like "test: test".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.