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

Remove legacy CLI, code, and scaffold templates #3385

Merged
merged 13 commits into from
Jul 13, 2020

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Jul 10, 2020

Description of the change:
Removes:

  • operator-sdk add api (for Go projects)
  • operator-sdk add controller
  • operator-sdk migrate
  • operator-sdk print-deps
  • operator-sdk generate k8s
  • operator-sdk generate crds
  • The legacy scorecard implementation
  • The scorecard proxy image build.
  • The legacy e2e tests
  • Legacy scaffold templates

Motivation for the change:
Remove legacy code in preparation for 1.0 release

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 10, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2020
@joelanford joelanford changed the title WIP: Remove legacy CLI, code, and scaffold templates Remove legacy CLI, code, and scaffold templates Jul 10, 2020
@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 Jul 10, 2020
@joelanford joelanford mentioned this pull request Jul 10, 2020
92 tasks
@joelanford joelanford added this to the v1.0.0 milestone Jul 10, 2020
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

  • remove migrate subcommand and scaffolds
    +1 nicely done
  • remove print-deps and go.mod template
    +1
  • remove legacy go init templates
    +1
  • remove add subscommands for legacy Go projects
    +1 quite a bit of code being removed!
  • internal/scaffod: remove more unused code
    +1 love seeing dead code go away
  • remove legacy scorecard
    +1
  • go mod tidy
    +1
  • remove legacy go e2e tests
    +1
  • remove legacy e2e tests, rename e2e-new, don't require kind
    +1 to not requiring kind
  • remove more unused code
    +1
  • don't run removed generate k8s
    +1
  • remove crds subcommand
    +1
  • remove version checks for go-mod templates
    +1 nicely done

// See the License for the specific language governing permissions and
// limitations under the License.

package scaffold
Copy link
Member

Choose a reason for hiding this comment

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

one of my tests is going bye bye 😭

Comment on lines -237 to -268
# Build and deploy arm64 scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy (arm64)
arch: arm64
script:
- make image-build-scorecard-proxy
- make image-push-scorecard-proxy

# Build and deploy amd64 scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy (amd64)
arch: amd64
script:
- make image-build-scorecard-proxy
- make image-push-scorecard-proxy

# Build and deploy ppc64le scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy (ppc64le)
arch: ppc64le
script:
- make image-build-scorecard-proxy
- make image-push-scorecard-proxy

# Build and deploy s390x scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy (s390x)
arch: s390x
script:
- make image-build-scorecard-proxy
- make image-push-scorecard-proxy

Copy link
Member

Choose a reason for hiding this comment

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

❤️ That's one less set of images to fail during a build :)

Copy link
Contributor

@camilamacedo86 camilamacedo86 Jul 11, 2020

Choose a reason for hiding this comment

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

but do you not need these images? Pinging @jmccormick2001 who is their father just for we sure if it is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

the scorecard-proxy is not used in the new scorecard so its fine to remove.

github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/operator-framework/api v0.3.8
github.com/operator-framework/operator-registry v1.12.6-0.20200611222234-275301b779f8
github.com/pborman/uuid v1.2.0
github.com/pkg/errors v0.9.1
Copy link
Member

Choose a reason for hiding this comment

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

Surprising this must have been used only in a few places.

Makefile Outdated
Comment on lines 286 to 288
test-e2e-go:
./hack/tests/e2e-go.sh $(ARGS)

test-e2e-go-new:
K8S_VERSION=$(K8S_VERSION) ./hack/tests/e2e-go-new.sh
K8S_VERSION=$(K8S_VERSION) ./hack/tests/e2e-go.sh

Copy link
Member

Choose a reason for hiding this comment

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

+1 made sure the targets were repurposed.

@@ -18,5 +18,4 @@ go build ./...
go mod tidy

# Run gen commands
../../build/operator-sdk generate k8s
Copy link
Member

Choose a reason for hiding this comment

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

good idea

Comment on lines -41 to -59
GO_GOMOD="internal/scaffold/go_mod.go"
ANS_GOMOD="internal/scaffold/ansible/go_mod.go"
HELM_GOMOD="internal/scaffold/helm/go_mod.go"
CURR_VER_GO_GOMOD="$(sed -E -n -r 's|.*operator-sdk ([^ \t\n]+).*|\1|p' "$GO_GOMOD" | tail -1 | tr -d ' \t\n')"
if [[ "$VER" != "$CURR_VER_GO_GOMOD" ]]; then
echo "go.mod 'replace' entry version is not set correctly in $GO_GOMOD"
exit 1
fi
CURR_VER_ANS_GOMOD="$(sed -E -n -r 's|.*operator-sdk ([^ \t\n]+).*|\1|p' "$ANS_GOMOD" | tail -1 | tr -d ' \t\n')"
if [[ "$VER" != "$CURR_VER_ANS_GOMOD" ]]; then
echo "go.mod 'replace' entry version is not set correctly in $ANS_GOMOD"
exit 1
fi
CURR_VER_HELM_GOMOD="$(sed -E -n -r 's|.*operator-sdk ([^ \t\n]+).*|\1|p' "$HELM_GOMOD" | tail -1 | tr -d ' \t\n')"
if [[ "$VER" != "$CURR_VER_HELM_GOMOD" ]]; then
echo "go.mod 'replace' entry version is not set correctly in $HELM_GOMOD"
exit 1
fi

Copy link
Member

Choose a reason for hiding this comment

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

Nicely done

@jmrodri
Copy link
Member

jmrodri commented Jul 11, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2020
@@ -51,9 +51,9 @@ x_base_steps:
- make setup-k8s
- export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
after_success:
- echo "Build succeeded, operator was generated, memcached operator is running on $CLUSTER, and unit/integration tests pass"
- echo "Tests passed"
Copy link
Contributor

Choose a reason for hiding this comment

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

great 👍

@@ -13,13 +13,11 @@ require (
github.com/markbates/inflect v1.0.4
github.com/mattn/go-isatty v0.0.12
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.1.2
Copy link
Contributor

Choose a reason for hiding this comment

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

great 👍


// files
DockerfileFile = "Dockerfile"
OperatorYamlFile = "operator.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

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

we will be able to remove the vars related to the legacy layout. However, it is not in the scope of this pr.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Great 👍
/lgtm
/approve

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

@drewwells
Copy link

For the record, I just started using this project 2 months ago and the CLI has completely changed and there was no upgrade path offered in the cli itself. This is a major letdown as a user. We have a scaffolding tool for our internal projects and it suffers the same issues with upgrades. Scaffolding may not be the best way to offer general purpose toolkits for people to build projects on.

@estroz
Copy link
Member

estroz commented Sep 2, 2020

@drewwells I’m sorry to hear that we’ve let you down. We do not enjoy breaking things for users, and didn’t make the decision to do so lightly.

I and many other SDK contributors felt these changes necessary to improve maintainability of scaffolded projects and be better tenants of the k8s community (ex. align with kubebuilder’s scaffolds, use kustomize extensively). Going forward we will not make any breaking changes to operator-sdk’s CLI or project scaffolds in any minor release, and do not plan on making drastic CLI changes in the next major release (which is still far off to begin with).

Unfortunately it isn’t feasible to write a full migration tool due to the complexity of these changes. However we do have a migration guide that covers migrating both CLI and projects to their v1 states. Feel free to open issues for specific questions about the new CLI/project layout too!

@drewwells
Copy link

Thanks for the acknowledgement. We've started the migration and it has gone well. I'll try to find time to commit to the docs to help with some gotchas that I ran into. Thanks for the great work, it's been a great toolkit for us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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