Skip to content

Image tag generation not updated when switching from reference to not reference #10402

Closed

Description

@smarterclayton
oc create -f examples/image-streams/image-streams-centos7.json
oc tag --source=docker some/other/tag --reference wildfly:8.1
oc tag --source=docker some/other/tag wildfly:8.1

Generation of spec and status tags for wildfly:8.1 should be equal after this, but status tag was not updated.

Activity

  1. smarterclayton commented on Aug 14, 2016

    @smarterclayton
    ContributorAuthor

    It looks like something with import is not properly setting the generation of status tags to match their import spec. It should be impossible to have a status tag that is != the spec tag generation after an import is processed.

  2. sgallagher commented on Aug 25, 2016

    @sgallagher
    Contributor

    So as I've looked into this, it looks like there is a race. There's a fairly brief (sub-second) settling time where spec and status tags aren't the same (status updates more slowly). I'm adding a test to images_tests.sh to prove this.

  3. smarterclayton commented on Aug 25, 2016

    @smarterclayton
    ContributorAuthor
  4. sgallagher commented on Aug 26, 2016

    @sgallagher
    Contributor

    @smarterclayton In the original report you stated "Generation of spec and status tags for wildfly:8.1 should be equal after this, but status tag was not updated."

    Are you now telling me that it's not expected that spec and status generations should be exactly the same? Should I only be testing that they have increased after each step? I'm not sure how to parse your response.

    As for a race, what I mean is that I wonder if your initial check was due to querying too fast, because I can't reproduce the original issue (unless I pass an invalid tag, in which case an error entry appears and the status generation doesn't get modified).

  5. liggitt commented on Aug 26, 2016

    @liggitt
    Contributor

    Are you now telling me that it's not expected that spec and status generations should be exactly the same?

    Correct. Users only have the ability to set in spec. Once that is done, the import controller attempts to import the tag and updates spec with the results.

  6. sgallagher commented on Aug 26, 2016

    @sgallagher
    Contributor

    @liggitt Right, but should the import controller be setting the generation for the status to be identical to the spec generation or is it only assured that the status generation has a higher value than the previous one?

  7. liggitt commented on Aug 26, 2016

    @liggitt
    Contributor

    There's a fairly brief (sub-second) settling time where spec and status tags aren't the same (status updates more slowly).

    That is expected. Once import completes asynchronously, the status tag generation should match the spec tag generation

  8. smarterclayton commented on Aug 26, 2016

    @smarterclayton
    ContributorAuthor
  9. sgallagher commented on Aug 26, 2016

    @sgallagher
    Contributor

    @smarterclayton OK, so I'm thinking this was either a flake or the input data was incorrect (since that will leave an error in status instead of updating the tag).

    In either case, this will provide a test for this, so if it is a flake, at least we'll start seeing it show up in CI.

  10. smarterclayton commented on Aug 26, 2016

    @smarterclayton
    ContributorAuthor
  11. added a commit that references this issue on Aug 26, 2016
  12. sgallagher commented on Aug 26, 2016

    @sgallagher
    Contributor

    @smarterclayton I can't reproduce it at all and I now have tests to prove it (see #10622 ) so whatever happened, it must have involved a specialized initial condition.

  13. smarterclayton commented on Aug 27, 2016

    @smarterclayton
    ContributorAuthor

    I was able to recreate it locally again.

    oc create -f examples/image-streams/image-streams-centos7.json
    oc tag --alias --reference wildfly:9.0 wildfly:8.1
    oc tag --source=docker openshift/wildfly-90-centos7:latest wildfly:8.1
    

    You may have to delete the wildfly image stream and then run create again (so the importer isn't busy importing other things).

    Looks like changing the source so that it points to the same image has some
    weird interactions.

  14. smarterclayton commented on Aug 27, 2016

    @smarterclayton
    ContributorAuthor
    apiVersion: v1
    kind: ImageStream
    metadata:
      annotations:
        openshift.io/image.dockerRepositoryCheck: 2016-08-27T18:42:49Z
      creationTimestamp: 2016-08-27T18:42:46Z
      generation: 4
      name: wildfly
      namespace: default
      resourceVersion: "27677"
      selfLink: /oapi/v1/namespaces/default/imagestreams/wildfly
      uid: 0c54f82e-6c86-11e6-8a78-7831c1b76042
    spec:
      tags:
      - annotations:
          description: Build and run Java applications on Wildfly 10.0
          iconClass: icon-wildfly
          sampleRepo: https://github.com/bparees/openshift-jee-sample.git
          supports: wildfly:10.0,jee,java
          tags: builder,wildfly,java
          version: "10.0"
        from:
          kind: DockerImage
          name: openshift/wildfly-100-centos7:latest
        generation: 2
        importPolicy: {}
        name: "10.0"
      - annotations: null
        from:
          kind: DockerImage
          name: openshift/wildfly-90-centos7:latest
        generation: 4
        importPolicy: {}
        name: "8.1"
      - annotations:
          description: Build and run Java applications on Wildfly 9.0
          iconClass: icon-wildfly
          sampleRepo: https://github.com/bparees/openshift-jee-sample.git
          supports: wildfly:9.0,jee,java
          tags: builder,wildfly,java
          version: "9.0"
        from:
          kind: DockerImage
          name: openshift/wildfly-90-centos7:latest
        generation: 2
        importPolicy: {}
        name: "9.0"
      - annotations:
          description: Build and run Java applications on Wildfly
          iconClass: icon-wildfly
          sampleRepo: https://github.com/bparees/openshift-jee-sample.git
          supports: jee,java
          tags: builder,wildfly,java
        from:
          kind: ImageStreamTag
          name: "10.0"
        generation: 1
        importPolicy: {}
        name: latest
    status:
      dockerImageRepository: ""
      tags:
      - items:
        - created: 2016-08-27T18:42:49Z
          dockerImageReference: openshift/wildfly-100-centos7@sha256:6fc55d0ed66908c88bb76b06d8879bff6fdac2f16ec8700c042adab811bd43f4
          generation: 2
          image: sha256:6fc55d0ed66908c88bb76b06d8879bff6fdac2f16ec8700c042adab811bd43f4
        tag: latest
      - items:
        - created: 2016-08-27T18:42:49Z
          dockerImageReference: openshift/wildfly-100-centos7@sha256:6fc55d0ed66908c88bb76b06d8879bff6fdac2f16ec8700c042adab811bd43f4
          generation: 2
          image: sha256:6fc55d0ed66908c88bb76b06d8879bff6fdac2f16ec8700c042adab811bd43f4
        tag: "10.0"
      - items:
        - created: 2016-08-27T18:42:49Z
          dockerImageReference: openshift/wildfly-90-centos7@sha256:5b9062261df6bb74f1ff4df0201be701f130979fe503d59910cbfdfb5f5b8198
          generation: 3
          image: sha256:5b9062261df6bb74f1ff4df0201be701f130979fe503d59910cbfdfb5f5b8198
        tag: "9.0"
      - items:
        - created: 2016-08-27T18:42:49Z
          dockerImageReference: openshift/wildfly-90-centos7@sha256:5b9062261df6bb74f1ff4df0201be701f130979fe503d59910cbfdfb5f5b8198
          generation: 3
          image: sha256:5b9062261df6bb74f1ff4df0201be701f130979fe503d59910cbfdfb5f5b8198
        - created: 2016-08-27T18:42:49Z
          dockerImageReference: openshift/wildfly-81-centos7@sha256:cf42a6981be57f2fed27ffed1ef9b4fd776ce8eeedbeb8b438fa75756c30a20c
          generation: 2
          image: sha256:cf42a6981be57f2fed27ffed1ef9b4fd776ce8eeedbeb8b438fa75756c30a20c
        tag: "8.1"
    
  15. smarterclayton commented on Aug 27, 2016

    @smarterclayton
    ContributorAuthor

    The generation of the status tag for 8.1 should be bumped to 4 (without other things changing).

  16. soltysh commented on Aug 29, 2016

    @soltysh
    Contributor

    I'm able to consistently reproduce it, but what's important is that you need to do those actions step by step. If all is executed at once there's no bug. Working on a fix...

  17. soltysh commented on Aug 29, 2016

    @soltysh
    Contributor

    The problem is with this map which keys are created from a pair: registryURL and repoName. Since in your case both are pointing to the same url and the same name, they are overridden during import. I'll try to make the key more unique.

  18. soltysh commented on Aug 29, 2016

    @soltysh
    Contributor

    Or rather I'll fix the code responsible for updating the status based on them 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions