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

feat:wasm deploy support istiodDeployName arg in command #248

Merged
merged 1 commit into from
Mar 31, 2021
Merged

feat:wasm deploy support istiodDeployName arg in command #248

merged 1 commit into from
Mar 31, 2021

Conversation

tanjunchen
Copy link
Contributor

Description

Please include a summary of the changes.

This bug fixes ... \ This new feature can be used to ...

Context

ref #245

Users ran into this bug doing ... \ Users needed this feature to ...

Checklist:

  • I included a concise, user-facing changelog (for details, see https://github.com/solo-io/go-utils/tree/master/changelogutils) which references the issue that is resolved.
  • If I updated APIs (our protos) or helm values, I ran make install-deps generated-code from tools/wasme/cli to ensure there will be no code diff
  • I followed guidelines laid out in the Gloo contribution guide
  • I opened a draft PR or added the work in progress label if my PR is not ready for review
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@solo-build-bot
Copy link

Waiting for approval from someone in the solo-io org to start testing.

@tanjunchen
Copy link
Contributor Author

/cc @Sodman

Copy link
Member

@Sodman Sodman left a comment

Choose a reason for hiding this comment

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

Thanks for opening a PR for this!

The new flag code is causing a runtime error, StringVarP needs to be updated to StringVar instead.

You'll also need to include a changelog for this feature so that it's documented in our release notes. An example changelog you can use is https://github.com/solo-io/wasm/blob/master/tools/wasme/changelog/v0.0.33/patch-context.yaml. For this change please include a link to the GitHub Issue, the name of the new flag, and the default value. Thanks!


puller pull.ImagePuller // set by load
}

func (opts *istioOpts) addToFlags(flags *pflag.FlagSet) {
flags.StringToStringVarP(&opts.workload.Labels, "labels", "l", nil, "labels of the deployment or daemonset into which to inject the filter. if not set, will apply to all workloads in the target namespace")
flags.StringVarP(&opts.workload.Namespace, "namespace", "n", "default", "namespace of the workload(s) to inject the filter.")
flags.StringVarP(&opts.istiodDeploymentName, "istiod-name", "istiod", "istiod", "deployment name of the istiod")
Copy link
Member

Choose a reason for hiding this comment

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

The StringVarP variant is for when we have a 1-letter shortcut for the flag (eg "namespace" / "n"). Since there's no shorthand we can just use the regular StringVar here.

Suggested change
flags.StringVarP(&opts.istiodDeploymentName, "istiod-name", "istiod", "istiod", "deployment name of the istiod")
flags.StringVar(&opts.istiodDeploymentName, "istiod-name", "istiod", "deployment name of the istiod")

(This is the reason the tests are currently failing, it causes a runtime error).

Copy link
Member

@Sodman Sodman left a comment

Choose a reason for hiding this comment

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

Overall LGTM and we're passing all tests. I had a minor comment about a var name being capitalized for local scope, but once that's fixed I'm happy to merge!

@@ -105,25 +109,26 @@ type Provider struct {
WaitForCacheTimeout time.Duration
}

func NewProvider(ctx context.Context, kubeClient kubernetes.Interface, client ezkube.Ensurer, puller pull.ImagePuller, workload Workload, cache Cache, parentObject ezkube.Object, onWorkload func(workloadMeta metav1.ObjectMeta, err error), istioNamespace string, cacheTimeout time.Duration, ignoreVersionCheck bool) (*Provider, error) {
func NewProvider(ctx context.Context, kubeClient kubernetes.Interface, client ezkube.Ensurer, puller pull.ImagePuller, workload Workload, cache Cache, parentObject ezkube.Object, onWorkload func(workloadMeta metav1.ObjectMeta, err error), istioNamespace, IstiodDeploymentName string, cacheTimeout time.Duration, ignoreVersionCheck bool) (*Provider, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Small nit: can we lowercase IstiodDeploymentName since it's local in scope here?

Suggested change
func NewProvider(ctx context.Context, kubeClient kubernetes.Interface, client ezkube.Ensurer, puller pull.ImagePuller, workload Workload, cache Cache, parentObject ezkube.Object, onWorkload func(workloadMeta metav1.ObjectMeta, err error), istioNamespace, IstiodDeploymentName string, cacheTimeout time.Duration, ignoreVersionCheck bool) (*Provider, error) {
func NewProvider(ctx context.Context, kubeClient kubernetes.Interface, client ezkube.Ensurer, puller pull.ImagePuller, workload Workload, cache Cache, parentObject ezkube.Object, onWorkload func(workloadMeta metav1.ObjectMeta, err error), istioNamespace, istiodDeploymentName string, cacheTimeout time.Duration, ignoreVersionCheck bool) (*Provider, error) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

ParentObject: parentObject,
OnWorkload: onWorkload,
IstioNamespace: istioNamespace,
IstiodDeploymentName: IstiodDeploymentName,
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Suggested change
IstiodDeploymentName: IstiodDeploymentName,
IstiodDeploymentName: istiodDeploymentName,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@Sodman Sodman left a comment

Choose a reason for hiding this comment

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

Thanks for making these changes, looks good to me! I'll try get a release out tomorrow.

@soloio-bulldozer soloio-bulldozer bot merged commit dd7a460 into solo-io:master Mar 31, 2021
@tanjunchen tanjunchen deleted the fix-istiodDeploymentName branch March 31, 2021 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants