Overriding defined value or whole tpl file included in subchart - helm3

I have the kubernetes ingress controller as a sub chart and I want to override the _params.tpl to add an additional argument to that file. At the moment we have a whole fork of the controller chart that we deploy but I'm trying to get all our customisations out of the fork and change this to a subchart, however, I can't find documentation for this use case.

Related

Can I define new mustache template variables in swagger-codegen?

I have developed a rest-api client (in java) customised to the needs of my product. I wanted to generate tests using my rest api client using swagger-codegen modules based on yaml-file.
I have already extended DefaultCodegenConfig & even tried implementing the CodegenConfig interface to build my custom jar. I have customized the api.mustache and api_test.mustache files and passing them in the constructor and processOpts() method of my CustomCodeGen that extends DefaultCodegenConfig.
However, I want to use the custom/new mustache template variables that I have added in my customised api.mustache.
For e.g. if refer to standard api.mustache, the template variables it typically uses are
- {{classname}}
- {{#operation}}
- {{#contents}}
- {{#parameters}}
etc.
Now, I want to introduce a new template variable, let's say {{custom_param}}. Now I am not clear how do I integrate this new template variable with the implementation.
Looks like from this Mustache-Template-Variables published here, swagger-codegen does not allow adding new template-variables and perhaps we are restricted to only the variables mentioned on this page.
So, is there some way to make the new template variables work ?
Some time ago I added the uniqueItems parameter for bean validation as it was not getting processed by the engine even though it was a part of the implemented JSR.
So I believe codebase needs to be updated to use your own variable which is only possible if you fork the code.
In case it helps, these two were the PRs:
For query parameters: https://github.com/swagger-api/swagger-codegen/pull/10154.
For body parameters: https://github.com/swagger-api/swagger-codegen/pull/10490.

Aurelia compose viewmodel paths

I have components that has dynamic parts with compose. The dynamic parts are in other modules i.e. node projects.
If I want to use a custom element in a page like:
<my-custom-element body.bind="someVariableContainingThePath"></my-custom-element>
I get an error saying that the viewmodel specified in someVariableContainingThePath cannot be found in ./my-custom-element/someVariableContainingThePath.
What is the recommended way to deal with paths when using compose element.
I'm using webpack.
Is there a way to alias a module.
So can set someVariableContainingThePath='moduleA' and then specify
that moduleA = /some/path/my-body-custom-element ?
For webpack bundling you have to give it a hint. Otherwise your view will not get bundled.
you can add your component to globalResourses when configuring aurelia
http://aurelia.io/docs/fundamentals/app-configuration-and-startup#making-resources-global
You have to decorate your module names with PLATFORM.modulename as in .globalResources(PLATFORM.modulename('my-module'))

How can i load config file but not autoload in zf2

I have some config file,they don't need use in everywhere,so i don't want it autoload,can you tell me how to load config file in controller and it can be get in serviceLocator,don't tell me to use zend\config\config, thanks。
First off, it's not advised to ask a question and then directly say that you don't want someone to tell you about XY. What if XY would be the only way?
You could always do something like
$onlyNowConfig = require_once('./config/onlyNowConfig.php');
The current working directory of PHP is the root of your application, as it's set in your public/index.php via the chdir() function.
Other than that, there's no real harm to include the configuration inside your module.config.php. The ModuleManager will check for the existance of the getConfig() function inside your Module class. If it's existant, the Configuration will be loaded. Typically every module has a config that will be loaded. And there's no real speed (dis)advantage of outsourcing 100-200 configuration lines into a separate file. The additional I/O you'd do by only including it on those few actions you need it would actually be higher than the very little time it takes longer to merge the configuration (probably like 1ms total vs. 2-3ms I/O).
I'd advise to just include it in your module.config.php and you'd have it available everywhere via the ServiceLocator, otherwise just include/require the one config file that you need, wherever you are. The include/require parameter would never change, as the working directory of PHP will not change, no matter in what file you are (as long as you don't set it anew via chdir() - which would be highly not recommended).

Overriding plugin views in Grails 2.2

I'm trying to customize the HTML markup of the excellent FilterPane grails plugin, however I'm having some difficulty. FilterPane provides a bunch of tags for rendering the search/filter form, and I would like to override these in my application.
I had thought that I could simply copy the _tagName.gsps that I wanted to override from
plugins/filterpane-2.0.1.1/grails-app/views/filterpane
into
grails-app/views/filterpane
and modify them, however it looks like Grails never checks whether the application is overriding the views of a plugin, if the render method is called with a plugin name property specified.
org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateRenderer.findAndCacheTemplate contains the following code in a private method:
...
GroovyPageScriptSource scriptSource;
if (pluginName == null) {
scriptSource = groovyPageLocator.findTemplateInBinding(templatePath, pageScope);
} else {
scriptSource = groovyPageLocator.findTemplateInBinding(pluginName, templatePath, pageScope);
}
...
so when a non-null pluginName is specified, we just grab the plugin's view and never check whether the application is overriding it.
I thought a simple way to get around this problem would be to just override GrailsConventionGroovyPageLocator.findTemplateInBinding, or some other similar method in GrailsConventionGroovyPageLocator, however it doesn't appear to be possible to do this from within a Grails application either!
I created a simple class overriding GrailsConventionGroovyPageLocator, replacing the findTemplateInBinding method with one that checks the application's view directory before checking that of the plugin. I then modified resources.groovy, adding a doWithSpring closure to replace the beanClass property of the default groovyPageLocator:
def doWithSpring = {
def pageLocator = delegate.getBeanDefinition("groovyPageLocator")
pageLocator.beanClass = MyConventionGroovyPageLocator
}
However this doesn't seem to be called when my application starts up.
I'm really at a loss here. I'd expected this to be straightforward, but it's turned into a bit of a can of worms. Does anyone have any suggestions? All I want to do is override the views provided by a plugin...
You can modify the plugin source, instead of changing the location of the template.
The location is: user_home\.grails\version\projects\project\plugins\plugin-name
I am not a grails expert, but in order to override plugin views you should recreate them in your main projects views folder. For example, I changed the /auth/login.gsp from Spring Security Plugin by simply creating the same thing in my /project/views/auth/login.gsp. If you make changes into the plugin files itself you could potentially lose them if you uninstall the plugin.
In order to change a view in a template of a plugin, perform the command
grails install-templates
source
This will copy the templates of the plugins to your project which you then can customize. What this does with for example the scaffolding plugin, is copy files to src/templates/scaffolding (note, not grails-app/templates/scaffolding). Therefore, in your case, I would try copying the files to src/views/filterpane

Spark Include tag with variable in href

I want to include a spark view in another spark view.
I've tried to use the include tag.
But it doesn't seem to support variables as part of the href attribute.
Eg.
<include href="_group_${groupData.Type}.spark" />
Does anyone know of any workaround to do this?
The <include> tag is part of the Spark language that gets parsed on the first pass and cannot include variables of its own because the view class file has not yet been generated for the variables to be evaluated. Using <include> is a means of including a static resource of some kind.
I think the thing you may be looking for is the <use import="myFile.spark"/> tag for including other Spark files, or you could just use Spark Partials built in. The problem however is that you're trying to have the included spark files dynamically determined at runtime which I don't think will be possible.
Is there any way you can pre-generate the views for each groupData.Type value using the pre-compilation ability in Spark?
The other option potentially (if you really do need these dynamic at runtime) is to create and maintain an InMemoryViewFolder instance and you can add "virtual" files to it as you pull them out of the database but you still won't get away with using variables inside any Spark language elements because variables "don't exist" at that point in the parsing/rendering pipeline.
Hope that helps,
Rob

Resources