fabric8-maven-plugin: f8 not setting imagestreams resourceVersion properly.
f8 not setting imagestreams resourceVersion properly.
Description
I wrote the following yml config for an imageStream:
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
environment: develop
name: develop
spec:
dockerImageRepository: <privateRepo>:5000/cbom/develop
lookupPolicy:
local: true
tags:
- from:
kind: DockerImage
name: <privateRepo>:5000/cbom/develop:latest
importPolicy:
scheduled: true
if I run fabric8: resource-Goal it succeeds properly But running fabric8:apply-Goal afterwards fails with:
F8: Failed to create ImageStream from openshift.yml. io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PUT at: <OpenShift Url>/apis/image.openshift.io/v1/namespaces/testpro/imagestreams/develop. Message: imagestreams.image.openshift.io "develop" is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update. Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.resourceVersion, message=Invalid value: 0x0: must be specified for an update, reason=FieldValueInvalid, additionalProperties={})], group=image.openshift.io, kind=imagestreams, name=develop, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=imagestreams.image.openshift.io "develop" is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PUT at: <OpenShift Url>/apis/image.openshift.io/v1/namespaces/testpro/imagestreams/develop. Message: imagestreams.image.openshift.io "develop" is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update. Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.resourceVersion, message=Invalid value: 0x0: must be specified for an update, reason=FieldValueInvalid, additionalProperties={})], group=image.openshift.io, kind=imagestreams, name=develop, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=imagestreams.image.openshift.io "develop" is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).
I tried Setting resourceVersion: 1
in the metadata section but got:
F8: Failed to create ImageStream from openshift.yml. io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: <OpenShift Url>/apis/image.openshift.io/v1/namespaces/testpro/imagestreams. Message: resourceVersion should not be set on objects to be created. Received status: Status(apiVersion=v1, code=500, details=null, kind=Status, message=resourceVersion should not be set on objects to be created, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=null, status=Failure, additionalProperties={}).: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: <OpenShift Url>/apis/image.openshift.io/v1/namespaces/testpro/imagestreams. Message: resourceVersion should not be set on objects to be created. Received status: Status(apiVersion=v1, code=500, details=null, kind=Status, message=resourceVersion should not be set on objects to be created, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=null, status=Failure, additionalProperties={}).
BUT If I went to the Web UI choose Import YAML/JSON
under the Add to Project
-Button and copied the exact same Config above (without the resourceVersion setting) it worked without any problems
Info
- f-m-p version : 4.2.0
- Maven version (
mvn -v
) :
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\Development\apps\Maven
Java version: 1.8.0_102-1-redhat, vendor: Oracle Corporation
Java home: C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.102-1\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
- Kubernetes / OpenShift setup and version : Red Hat OpenShift Version
OpenShift Master:
v3.11.0+3b2d3b6-227
Kubernetes Master:
v1.11.0+d4cacc0
OpenShift Web Console:
v3.11.0+ea42280
- If it’s a bug, how to reproduce : Create a configfile for an ImageStream and try to execute fabric8:resource and afterwards fabric8:apply
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (13 by maintainers)
Commits related to this issue
- Fix #1696: f8 not setting imagestreams resourceVersion properly. — committed to rohanKanojia/fabric8-maven-plugin by rohanKanojia 5 years ago
- Fix #1696: f8 not setting imagestreams resourceVersion properly. (#1705) — committed to fabric8io/fabric8-maven-plugin by rohanKanojia 5 years ago
- Fix #1696: Fix failures in PUT during applying ImageStreams — committed to rohanKanojia/fabric8-maven-plugin by rohanKanojia 5 years ago
- Fix #1696: Fix failures in PUT during applying ImageStreams — committed to fabric8io/fabric8-maven-plugin by rohanKanojia 5 years ago
@nikolaaleks : It is already there: https://search.maven.org/artifact/io.fabric8/fabric8-maven-plugin/4.3.1/maven-plugin
You should start using the official Maven search, and not the “commercial” one. 😉