Skip to content

Commit

Permalink
Fix ImageStream tags in openshift provider mode (kubernetes#1461)
Browse files Browse the repository at this point in the history
* Fix ImageStream tags in openshift provider mode

Signed-off-by: Shivam Sandbhor <[email protected]>
  • Loading branch information
sbs2001 authored Nov 20, 2021
1 parent 40646f4 commit a46582b
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 28 deletions.
3 changes: 1 addition & 2 deletions pkg/transformer/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ func (o *OpenShift) initImageStream(name string, service kobject.ServiceConfig,
if service.Image == "" {
service.Image = name
}

// Retrieve tags and image name for mapping

var importPolicy imageapi.TagImportPolicy
if opt.InsecureRepository {
importPolicy = imageapi.TagImportPolicy{Insecure: true}
Expand All @@ -74,6 +72,7 @@ func (o *OpenShift) initImageStream(name string, service kobject.ServiceConfig,
Name: service.Image,
},
ImportPolicy: importPolicy,
Name: GetImageTag(service.Image),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -264,7 +264,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -260,7 +260,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/configmap-volume/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -254,7 +254,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/expose/output-ocp.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -253,7 +253,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
8 changes: 4 additions & 4 deletions script/test/fixtures/healthcheck/output-healthcheck-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -376,7 +376,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -507,7 +507,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -638,7 +638,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/multiple-files/output-ocp.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -183,7 +183,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/multiple-type-volumes/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -258,7 +258,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/pvc-request-size/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -324,7 +324,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/statefulset/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -481,7 +481,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
2 changes: 1 addition & 1 deletion script/test/fixtures/storage-class-name/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
2 changes: 1 addition & 1 deletion script/test/fixtures/v2/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
4 changes: 2 additions & 2 deletions script/test/fixtures/v3.0/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down Expand Up @@ -233,7 +233,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down
2 changes: 1 addition & 1 deletion script/test/fixtures/volume-mounts/windows/output-os.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
},
"tags": [
{
"name": "",
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
Expand Down

0 comments on commit a46582b

Please sign in to comment.