-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: main
Are you sure you want to change the base?
Conversation
306afeb
to
20136c7
Compare
Thanks @wzshiming for adding this script. Can you add instructions in the README file explaining how to use it, and how it works? Thanks! |
hack/gen_old_scheme.sh
Outdated
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"\""}' |
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.
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?
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.
Yes, I changed it a little, it looks a little better but not much, this hard code can't be avoided. 😄
4f5df1c
to
39d6d2d
Compare
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. import (
oldscheme "github.com/etcd-io/auger/pkg/old/scheme"
"github.com/etcd-io/auger/pkg/scheme"
)
func init() {
oldscheme.AddToScheme(scheme.Scheme)
} |
f40cc28
to
c5401bb
Compare
pkg/old/scheme/scheme.go
Outdated
func AddToScheme(scheme *runtime.Scheme) { | ||
_ = settingsv1alpha1.AddToScheme(scheme) | ||
_ = flowcontrolv1alpha1.AddToScheme(scheme) | ||
_ = auditregistrationv1alpha1.AddToScheme(scheme) | ||
_ = discoveryv1alpha1.AddToScheme(scheme) | ||
_ = batchv2alpha1.AddToScheme(scheme) | ||
_ = resourcev1alpha1.AddToScheme(scheme) | ||
} |
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.
This is the same as pkg/scheme/scheme.go
c5401bb
to
f369b15
Compare
20013cc
to
770e5d2
Compare
Signed-off-by: Shiming Zhang <[email protected]>
Signed-off-by: Shiming Zhang <[email protected]>
Signed-off-by: Shiming Zhang <[email protected]>
Signed-off-by: Shiming Zhang <[email protected]>
770e5d2
to
10b3b2c
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wzshiming 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 |
/cc @jmhbnz |
/cc @henrybear327 can you take a look if you have some time? Thanks! |
Fixes #33
Fixes #10
/cc @tjungblu @siyuanfoundation