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

make helper methods available in variables files #55

Merged
merged 1 commit into from
Nov 7, 2021
Merged

Conversation

tongueroo
Copy link
Collaborator

This is a 🐞 bug fix.
This is a πŸ™‹β€β™‚οΈ feature or enhancement.

  • 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

Load custom variables last so helpers are available in variables files https://kubes.guru/docs/variables/basic/

Context

Would be nice to be able to access helpers like google_secret in variables files and keep templates simpler with only variables.

How to Test

.kubes/variables/dev.rb

@cert = google_secret("cert-demo-global", base64: false)

.kubes/resources/web/ingress.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web
  annotations:
    ingress.gcp.kubernetes.io/pre-shared-cert: '<%= @cert %>'
spec:
  defaultBackend:
    service:
      name: web
      port:
        number: 80

Version Changes

Patch

@tongueroo tongueroo merged commit 7fcd0a7 into master Nov 7, 2021
@tongueroo tongueroo deleted the helpers branch November 7, 2021 17:57
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.

1 participant