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

fix breaking examples #5024

Merged
merged 2 commits into from
May 24, 2023

Conversation

koba1t
Copy link
Member

@koba1t koba1t commented Feb 2, 2023

fix breaking examples in ./examples dir.
fix #4997

@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 2, 2023
@koba1t koba1t changed the title fix breaking example (#4997) fix breaking examples (#4997) Feb 2, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 2, 2023
@@ -4,12 +4,11 @@ resources:
- https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/examples/wordpress/wordpress/deployment.yaml
- https://github.com/knative/serving/releases/download/v0.12.0/serving.yaml # redirects to s3
patches:
Copy link
Member Author

Choose a reason for hiding this comment

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

removed legacy patch syntax is used.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is used in other examples - is it worth updating those as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

@cailynse

I think I searched and fixed other examples where the removed legacy patch was used.
Could you find other places for it was used?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry! I misunderstood, I was thinking patchesStrategicMerge which is being used in many places

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't worry!

@@ -0,0 +1,8 @@
resources:
Copy link
Member Author

Choose a reason for hiding this comment

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

error caused by kustomization.yaml file is missing.

Copy link
Contributor

@cailyn-codes cailyn-codes Feb 6, 2023

Choose a reason for hiding this comment

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

Does this mean the example in the issue never worked?

Just saw Katrina's comment!

@koba1t koba1t changed the title fix breaking examples (#4997) fix breaking examples (fix https://github.com/kubernetes-sigs/kustomize/issues/4997) Feb 2, 2023
@koba1t koba1t changed the title fix breaking examples (fix https://github.com/kubernetes-sigs/kustomize/issues/4997) fix breaking examples ( fix #4997 ) Feb 2, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 2, 2023
@koba1t koba1t changed the title fix breaking examples ( fix #4997 ) fix breaking examples Feb 2, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Feb 2, 2023
@KnVerey
Copy link
Contributor

KnVerey commented Feb 2, 2023

Are the fixes taken from the tutorial snippets? Should we update them there instead? I don't feel strongly about it, but the tutorial is telling the user to create these files, isn't it? https://github.com/kubernetes-sigs/kustomize/tree/master/examples/springboot

@koba1t
Copy link
Member Author

koba1t commented Feb 3, 2023

@KnVerey

the tutorial is telling the user to create these files

That is right.
So, Do you think better for removing non-snippet files?
Creating a few files is required using commands on the tutorials step, but the files included above dirs. (ex. patch.yaml)

cat <<EOF >$DEMO_HOME/patch.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: sbdemo
spec:
template:
spec:
containers:
- name: sbdemo
env:
- name: spring.profiles.active
value: prod

Copy link

@tonglil tonglil left a comment

Choose a reason for hiding this comment

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

Please fix the examples, thanks!

Copy link
Contributor

@annasong20 annasong20 left a comment

Choose a reason for hiding this comment

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

/lgtm

@KnVerey @cailynse The README.md tutorial works independently of kustomize build on the roots under the springboot folder. The tutorial works because it has the user create the kustomization.yaml file that's missing under base. The tutorial also has the user create the .properties and patch files from scratch, though the content of these files is based on that of the files under overlays/production.

We could, optionally, have the tutorial curl the files from the springboot folders instead of providing the snippets that @koba1t mentions if we find them repetitive. I believe only patch.yaml file has diverged from the tutorial. The tutorial instructions, however, do not contain the legacy fields because they're created using the kustomize edit commands.

@@ -0,0 +1,5 @@
app.name=Staging Kinflate Demo
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The README.md specifies an application.properties that only has 1 line:

app.name=Kustomize Demo

Apparently the justification there is that maintenance is easier if we separate the credentials out into a separate file: https://github.com/kubernetes-sigs/kustomize/blob/master/examples/springboot/README.md?plain=1#L95-L99.

Feel free to ignore this comment. I don't think it's important, only an observation.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 22, 2023
@annasong20
Copy link
Contributor

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 22, 2023
@natasha41575
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: annasong20, koba1t, natasha41575, tonglil

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2023
@k8s-ci-robot k8s-ci-robot merged commit e1c530e into kubernetes-sigs:master May 24, 2023
@koba1t koba1t deleted the fix/examples_springboot branch May 24, 2023 19:01
FrenchBen pushed a commit to FrenchBen/kustomize that referenced this pull request Jul 20, 2023
* fix examples?springboot with no kustomization.yaml

* fix examples/loadHttp with legacy patch syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring Boot example does not work
7 participants