Skip to content

Replace Kustomize with a new hypershift CLI - #16

Merged
openshift-merge-robot merged 20 commits into
openshift:mainfrom
ironcladlou:cli
Feb 11, 2021
Merged

Replace Kustomize with a new hypershift CLI#16
openshift-merge-robot merged 20 commits into
openshift:mainfrom
ironcladlou:cli

Conversation

@ironcladlou

@ironcladlou ironcladlou commented Feb 9, 2021

Copy link
Copy Markdown
Contributor

Kustomize was being used for:

  1. Installation
  2. Example cluster generation

In these narrow use cases, it's not clear Kustomize makes things easier, and it
also propagates dependencies downstream as we move into the CI system. This
commit replaces Kustomize entirely by providing a new hypershift CLI tool which
knows how to install the application and also generate example clusters.

This approach should enable a more portable integration point with CI and also
remove dependencies for users wanting to kick the tires of HyperShift. Here are
some other ways users can take advantage:

  1. Use the hypershift binary directly through a release or (potentially) go get
  2. Run hypershift using a container engine
  3. Run hypershift in an OpenShift cluster using oc run

Another side effect of the move to a 100% native Go solution is that the fixtures
representing things like an example cluster can be more clearly shared with the e2e
test infrastructure, which this commit also implements.

As a further simplification and cleanup, the external Ginkgo binary is removed
and the go test tool is now the entrypoint for all testing.

Lastly, this commit adds support for looking up the OCP release image
so that reliable defaults can be used in all contexts (while providing easy
flags to override it.)

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 9, 2021
@openshift-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 9, 2021
@ironcladlou ironcladlou changed the title WIP: Replace Kustomize with a new hypershift CLI Replace Kustomize with a new hypershift CLI Feb 10, 2021
@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 Feb 10, 2021
@ironcladlou
ironcladlou force-pushed the cli branch 2 times, most recently from 7982a40 to 3a48ae1 Compare February 11, 2021 16:55

@csrwng csrwng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @ironcladlou just a couple of comments.
I imagine that the automatic typing of resources for serialization will be done in a follow-up?

Comment thread HACKING.md
Comment thread api/version.go Outdated
@ironcladlou

ironcladlou commented Feb 11, 2021

Copy link
Copy Markdown
Contributor Author

@csrwng

I imagine that the automatic typing of resources for serialization will be done in a follow-up?

are you referring to the TODO in the serializer (https://github.com/openshift/hypershift/pull/16/files#diff-362c8c955f0738a540549420caa66fd217d29fd3b422b6ee45c1da2b4fdfbf91R22)? If so, I think we should do a followup to get to the bottom of it. The possible fixes in the TODO drag in a lot of dependencies, and after talking with David I think there's either some misunderstanding or bug anyway because what we're already doing should work.

@sjenning

Copy link
Copy Markdown
Contributor

This is working for me. Thanks @ironcladlou 👍

@ironcladlou

Copy link
Copy Markdown
Contributor Author

@csrwng had the good idea to default the OCP image based on a lookup to https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/api/v1/releasestream/4-stable/latest which removes the value of baking any sort of OCP image version into the operator itself (as he pointed out, we should be agnostic about the possible deployable versions anyway). So I'm going to make that change now.

Kustomize was being used for:

1. Installation
2. Example cluster generation

In these narrow use cases, it's not clear Kustomize makes things easier, and it
also propagates dependencies downstream as we move into the CI system. This
commit replaces Kustomize entirely by providing a new `hypershift` CLI tool which
knows how to install the application and also generate example clusters.

This approach should enable a more portable integration point with CI and also
remove dependencies for users wanting to kick the tires of HyperShift. Here are
some other ways users can take advantage:

1. Use the `hypershift` binary directly through a release or (potentially) `go get`
2. Run `hypershift` using a container engine
3. Run `hypershift` in an OpenShift cluster using `oc run`

Another side effect of the move to a 100% native Go solution is that the fixtures
representing things like an example cluster can be more clearly shared with the e2e
test infrastructure, which this commit also implements.

As a further simplification and cleanup, the external Ginkgo binary is removed
and the `go test` tool is now the entrypoint for all testing.

Lastly, this commit adds support for looking up the OCP release image
so that reliable defaults can be used in all contexts (while providing easy
flags to override it.)
@csrwng

csrwng commented Feb 11, 2021

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 11, 2021
@openshift-merge-robot
openshift-merge-robot merged commit 64fe062 into openshift:main Feb 11, 2021
zanetworker pushed a commit to zanetworker/hypershift that referenced this pull request Sep 28, 2021
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants