-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove legacy CLI, code, and scaffold templates #3385
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 😭
# 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 | ||
|
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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 | ||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done
/lgtm |
@@ -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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
/lgtm
/approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
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. |
@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 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! |
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! |
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
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:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs