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

use deep_merge overwrite_arrays option #48

Merged
merged 1 commit into from
Jun 3, 2021
Merged

use deep_merge overwrite_arrays option #48

merged 1 commit into from
Jun 3, 2021

Conversation

tongueroo
Copy link
Collaborator

This is a 🐞 bug fix.

  • I've added tests (if it's a bug, feature or enhancement)
  • I've adjusted the documentation (if it's a feature or enhancement)
  • The test suite passes (run bundle exec rspec to verify this)

Summary

Fixes #45

Context

When specifying targetPort in a service.rb DSL definition, it adds to the ports array instead of overriding the existing one.

How to Test

$ cat .kubes/resources/web/service.rb 
name "web"
labels(role: "web")

# Optional since default port is 80
# port 80
targetPort 8080 # expose port in Dockerfile

# More docs: kubes.guru/docs/dsl/resources/service/
$ kubes compile ; cat .kubes/output/web/service.yaml
Compiled  .kubes/resources files to .kubes/output
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: demo
    role: web
  namespace: demo-dev
  name: web
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080
  selector:
    app: demo
    role: web
  type: ClusterIP
$ 

Version Changes

Patch

@tongueroo tongueroo merged commit 991cd11 into master Jun 3, 2021
@tongueroo tongueroo deleted the deep-merge branch June 3, 2021 23:22
@tongueroo
Copy link
Collaborator Author

Released in v0.7.5

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.

DSL in service creates always default port 80
1 participant