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

Add scripts to synchronize old schemes #53

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wzshiming
Copy link
Member

@wzshiming wzshiming changed the title Add scripts to synchronize schemes that have been removed Add scripts to synchronize old schemes May 11, 2024
@wzshiming wzshiming force-pushed the feat/old-scheme branch 3 times, most recently from 306afeb to 20136c7 Compare May 11, 2024 12:55
@siyuanfoundation
Copy link
Contributor

Thanks @wzshiming for adding this script. Can you add instructions in the README file explaining how to use it, and how it works? Thanks!

EOF

for pkg in $(find_package "${ROOT_DIR}/pkg/old/apis"); do
echo "github.com/etcd-io/auger/pkg/old/apis/${pkg}" | awk -F '/' '{print " "$7$8, "\""$1"\/"$2"\/"$3"\/"$4"\/"$5"\/"$6"\/"$7"\/"$8"\""}'
Copy link
Contributor

Choose a reason for hiding this comment

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

I find shell scripts generally not flexible. There could be api files not necessarily follow this exact pattern. I think go scripts with more string manipulation function would be more flexible. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I changed it a little, it looks a little better but not much, this hard code can't be avoided. 😄

@wzshiming wzshiming force-pushed the feat/old-scheme branch 2 times, most recently from 4f5df1c to 39d6d2d Compare May 13, 2024 02:49
@wzshiming
Copy link
Member Author

Thanks @wzshiming for adding this script. Can you add instructions in the README file explaining how to use it, and how it works? Thanks!

Of course, How to update the scheme that has been added to the readme

and it should already be enabled by this PR for cmd, I'm not sure how to describe it better because it's so simple.

https://github.com/etcd-io/auger/blob/4389cfd9abed97c2745d89f1c34e35f274db8811/cmd/init.go

import (
	oldscheme "github.com/etcd-io/auger/pkg/old/scheme"
	"github.com/etcd-io/auger/pkg/scheme"
)

func init() {
	oldscheme.AddToScheme(scheme.Scheme)
}

@wzshiming wzshiming force-pushed the feat/old-scheme branch 2 times, most recently from f40cc28 to c5401bb Compare May 13, 2024 02:52
Comment on lines 31 to 38
func AddToScheme(scheme *runtime.Scheme) {
_ = settingsv1alpha1.AddToScheme(scheme)
_ = flowcontrolv1alpha1.AddToScheme(scheme)
_ = auditregistrationv1alpha1.AddToScheme(scheme)
_ = discoveryv1alpha1.AddToScheme(scheme)
_ = batchv2alpha1.AddToScheme(scheme)
_ = resourcev1alpha1.AddToScheme(scheme)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the same as pkg/scheme/scheme.go

@wzshiming wzshiming force-pushed the feat/old-scheme branch 7 times, most recently from 20013cc to 770e5d2 Compare May 23, 2024 02:53
Signed-off-by: Shiming Zhang <[email protected]>
Signed-off-by: Shiming Zhang <[email protected]>
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wzshiming
Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Kubernetes Code Review Process.

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

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

@wzshiming
Copy link
Member Author

/cc @jmhbnz

@k8s-ci-robot k8s-ci-robot requested a review from jmhbnz August 14, 2024 03:03
@siyuanfoundation
Copy link
Contributor

/cc @henrybear327 can you take a look if you have some time? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema pull at runtime Support for api versions that have been removed
3 participants