Skip to content

Add YAML sample CRD extension#2889

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
rhamilto:yaml-example
Oct 18, 2019
Merged

Add YAML sample CRD extension#2889
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
rhamilto:yaml-example

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented Oct 2, 2019

Resolves https://jira.coreos.com/browse/CONSOLE-1800

Note: I refactored the styles for the samples a bit to better maintain the visual hierarchy and align the samples with the schema contents. As a bonus, now more samples are visible.

localhost_9000_k8s_ns_default_buildconfigs__new

WIP ConsoleYAMLSample CRD:

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: consoleyamlsamples.console.openshift.io
  annotations:
    displayName: ConsoleYAMLSample
    description: Extension for configuring openshift web console YAML samples.
spec:
  scope: Cluster
  group: console.openshift.io
  versions:
  - name: v1
    served: true
    storage: true
  names:
    plural: consoleyamlsamples
    singular: consoleyamlsample
    kind: ConsoleYAMLSample
    listKind: ConsoleYAMLSampleList
  additionalPrinterColumns:
  - name: Title
    type: string
    JSONPath: .spec.title
  - name: Age
    type: string
    JSONPath: .metadata.creationTimestamp
  - name: Description
    type: string
    JSONPath: .spec.description
  subresources:
    status: {}
  validation:
    openAPIV3Schema:
      properties:
        spec:
          type: object
          description: Represents console YAML sample spec
          required:
          - targetResource
          - title
          - description
          - yaml
          properties:
            targetResource:
              type: object
              description: TBD
              required:
                - apiVersion
                - kind
              properties:
                apiVersion:
                  type: string
                  description: TBD
                kind:
                  type: string
                  description: TBD
            title:
              type: string
              description: Title of the YAML sample
            description:
              type: string
              description: Description of the YAML sample
            yaml:
              type: string
              description: The sample YAML

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. component/core Related to console core functionality labels Oct 2, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2019
@rhamilto rhamilto force-pushed the yaml-example branch 4 times, most recently from 3becc78 to db3ca6a Compare October 3, 2019 14:14
Comment thread frontend/public/models/yaml-templates.ts Outdated
Copy link
Copy Markdown
Member Author

@rhamilto rhamilto Oct 3, 2019

Choose a reason for hiding this comment

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

@sg00dwin: note these buttons have been migrated (they've been moved here from frontend/public/components/sidebars/resource-sidebar.jsx)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@sg00dwin: no need to migrate these buttons (note they've been moved to frontend/public/components/sidebars/resource-sidebar-samples.tsx)

Comment thread frontend/public/components/sidebars/_resource-sidebar.scss Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar.jsx Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't have a great suggestion here, but I worry that having apiVersion repeated will be confusing. Maybe we want something like this to make it more clear.

spec:
  targetResource:
    apiVersion: batch/v1
    kind: Job
  yaml: ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sensto to me :+1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So do we want to go with @spadgett's proposal for targetResource?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added in 4efb01f2814fd1ce08d3f1062e517d6c18231cc7. Will drop the commit if we decide against.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@spadgett spadgett added this to the v4.3 milestone Oct 4, 2019
Copy link
Copy Markdown
Member Author

@rhamilto rhamilto left a comment

Choose a reason for hiding this comment

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

Comments addressed. @spadgett, please take another look.

Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const existingSamples = !_.isEmpty(defaultSamples.get(referenceForModel(kindObj)))
const existingSamples = defaultSamples.get(referenceForModel(kindObj)) || [];

Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Comment thread frontend/public/components/sidebars/resource-sidebar-samples.tsx Outdated
Copy link
Copy Markdown
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@spadgett spadgett changed the title [WIP] Add YAML sample CRD extension Add YAML sample CRD extension Oct 17, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2019
@spadgett
Copy link
Copy Markdown
Member

Removing WIP as the CRD is now available

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@spadgett
Copy link
Copy Markdown
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, spadgett

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

The pull request process is described here

Details 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

1 similar comment
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, spadgett

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

The pull request process is described here

Details 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

@spadgett
Copy link
Copy Markdown
Member

/retest

2 similar comments
@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

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

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@spadgett
Copy link
Copy Markdown
Member

/refresh

@spadgett
Copy link
Copy Markdown
Member

/test e2e-gcp-console

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Oct 18, 2019

@rhamilto: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws-console 7857bdfe71bac72a0ca15b7d7c3d3bd4fc074c73 link /test e2e-aws-console

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

@rhamilto
Copy link
Copy Markdown
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 3ab9092 into openshift:master Oct 18, 2019
@rhamilto rhamilto deleted the yaml-example branch October 21, 2019 13:00
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. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants