Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 2009664: fix edit ksvc in git import flow #10255

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

debsmita1
Copy link
Contributor

@debsmita1 debsmita1 commented Oct 18, 2021

Fixes:
https://issues.redhat.com/browse/OCPBUGSM-35728

Root analysis:
The new revision failed to come up because it failed to fetch the image from the registry.

Solution description:

  • creating a new image stream only when the git url/image is changed
  • creating a new image stream when the serverless workload (which is created via internal registry flow -> Deployment -> Make serverless) is modified

GIF:
edit-ksvc

@openshift-ci openshift-ci bot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Oct 18, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 18, 2021

@debsmita1: This pull request references Bugzilla bug 2009664, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @sanketpathak

In response to this:

Bug 2009664: fix edit ksvc in git import flow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Oct 18, 2021
@debsmita1
Copy link
Contributor Author

/kind bug

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 18, 2021
@openshift-ci openshift-ci bot added the component/dev-console Related to dev-console label Oct 18, 2021
@debsmita1
Copy link
Contributor Author

/cc @karthikjeeyar
/cc @divyanshiGupta
/assign @invincibleJai

@nemesis09
Copy link
Contributor

/retest

@nemesis09
Copy link
Contributor

e2e tests seem to be failing.
I tried to run it locally but it seems the PR is missing a fix from #10254

@debsmita1
Copy link
Contributor Author

e2e tests seem to be failing. I tried to run it locally but it seems the PR is missing a fix from #10254

@nemesis09 Rebased. PTAL

@invincibleJai
Copy link
Member

invincibleJai commented Oct 21, 2021

I think we need to create a new imagestream only if the image is impacted i.e if url is changed otherwise for any other change in ksvc like change scaling options, labels etc should not create any new image steam. And this behaviour is in deploy image as well so it'll be nice to get the fix there as well as we are created extra imagestreams which can be avoided.

referencePolicy: { type: 'Local' },
},
],
},
};
const imageStream = mergeData(originalImageStream, newImageStream);
return verb === 'update'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verb is always set to true even in edit flow 🤔 , so Imagestreams are getting created everytime.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2021

@debsmita1: This pull request references Bugzilla bug 2009664, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @sanketpathak

In response to this:

Bug 2009664: fix edit ksvc in git import flow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@karthikjeeyar
Copy link
Contributor

karthikjeeyar commented Oct 26, 2021

@debsmita1 I verified locally, By updating the git URL the revisions are now coming up successfully, however a new imagestream is getting created in case of updating just the Scaling Options under Advanced options in GIT import flow. Should we handle the imagestream creation incase of just updating scaling options?

Note: Updating the scaling options is the Deploy Image flow doesn't create new imagestream (expected) and revisions are coming up there as well.

Edit: Make Serverless option creates a new Imagestream for the new KSVC workload and that is expected. Git flow, Deploy Image and Make serverless options work fine.

/lgtm

@karthikjeeyar
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2021
Comment on lines 608 to 612
const originalRepository =
appResources?.buildConfig?.data?.spec?.source?.git?.uri ??
appResources?.pipeline?.data?.spec?.params?.find((param) => param?.name === 'GIT_REPO')
?.default ??
null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have as below as no need to explicitly return null i think

Suggested change
const originalRepository =
appResources?.buildConfig?.data?.spec?.source?.git?.uri ??
appResources?.pipeline?.data?.spec?.params?.find((param) => param?.name === 'GIT_REPO')
?.default ??
null;
const originalRepository =
appResources?.buildConfig?.data?.spec?.source?.git?.uri ??
appResources?.pipeline?.data?.spec?.params?.find((param) => param?.name === 'GIT_REPO')
?.default;

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 29, 2021
@invincibleJai
Copy link
Member

invincibleJai commented Oct 29, 2021

@debsmita1 on edit for ksvc if I change git repo for git import flow or change image for container image flow then revision gets created and it does come up but I still see it's not serving the content from the new image. We need to look into this.

@debsmita1
Copy link
Contributor Author

@debsmita1 on edit for ksvc if I change git repo for git import flow or change image for container image flow then revision gets created and it does come up but I still see it's not serving the content from the new image. We need to look into this.

@invincibleJai tried this out in both the flows
imageupdate
giturlupdate

@invincibleJai
Copy link
Member

@debsmita1 I verified again and could not see above issue and overall looks good, I overserved one issue with the edit of ksvc (which is created via make Serverless flow)

  • edit of ksvc (which is created via make Serverless flow for external image)
    Kapture 2021-11-02 at 16 19 55

  • creation of ksvc via make Serverless flow for internal image fails.

image

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 8, 2021

@debsmita1: This pull request references Bugzilla bug 2009664, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @sanketpathak

In response to this:

Bug 2009664: fix edit ksvc in git import flow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@debsmita1
Copy link
Contributor Author

@debsmita1 I verified again and could not see above issue and overall looks good, I overserved one issue with the edit of ksvc (which is created via make Serverless flow)

  • edit of ksvc (which is created via make Serverless flow for external image)
    Kapture 2021-11-02 at 16 19 55
  • creation of ksvc via make Serverless flow for internal image fails.

image

Fixed! PTAL

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2021
@karthikjeeyar
Copy link
Contributor

karthikjeeyar commented Dec 10, 2021

@debsmita1 I tested the PR locally, Revisions are coming up properly but I observed a strange thing. When I edit the url from a nodejs repo to spring boot repo url, the revisions come up properly but the image the ksvc has is still pointing to the nodejs (old image). After a long time it automatically resets to newly edited image (spring boot). Not sure if this is the default knative behavior.
cc: @invincibleJai

@invincibleJai
Copy link
Member

@debsmita1 I tested the PR locally, Revisions are coming up properly but I observed a strange thing. When I edit the url from a nodejs repo to spring boot repo url, the revisions come up properly but the image the ksvc has is still pointing to the nodejs (old image). After a long time it automatically resets to newly edited image (spring boot). Not sure if this is the default knative behavior. cc: @invincibleJai

@karthikjeeyar yeah this is expected behaviour as if we make a change in git import flow with edit flow then first build (S2I) happens, then image steam get updated and finally serverless pick it up so it takes a while. It will be quick in case of container image flow.

@karthikjeeyar
Copy link
Contributor

@invincibleJai Yes, Container image flow is quick in updating to a new image, only git import took some time. Thanks for clarifying it.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: debsmita1, karthikjeeyar, rohitkrai03

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 13f9c7b into openshift:master Dec 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2021

@debsmita1: All pull requests linked via external trackers have merged:

Bugzilla bug 2009664 has been moved to the MODIFIED state.

In response to this:

Bug 2009664: fix edit ksvc in git import flow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2021

@debsmita1: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console component/knative Related to knative-plugin kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants