Hi, Let's understand about Lint and Test.
Till now, we have seen how to create the template and deploy the template into the cluster
And there are n number of stages where we need to do the testing
For example, immediately after making the templates or creating the templates, I need to do the testing,
whether it is adhering to the standard or not.
as well as after the entities are deployed into the kubernetes cluster we need to verify whether
the deployment happened properly, as expected or not.
For that, we need to do some testing. For that helm provide two options one is lint
where it can verify the template whether it is adhering to the standard or not.
This is like lint option available in any other language and the command is very simple.
All I need to do is invoke Helm lint and then the chart folder location.
For example, I do have n number of charts.
Let me go ahead and run lint.
helm lint and then the chart source.
So that's going to get into the charts and verify whether it is adhering to the standard or not.
In this particular case it provided only one one info where icon is recommended for chart.yaml
file. Other than that there are no error messages.
In case, if I wanted to verify how it's going to give the error messages, I can inject the error.
Let me get into the charts, modify the template.
Let me go ahead and change the template for test purpose.
For example here I'm going to add a dash.
So that it will become an invalid yaml file.
And in the early lecture, we discussed about what this particular dash going to do.
It's going to remove the new line and append this particular content as a part of the labels.
And this will fail to validate to be a valid yaml file. After making the changes
Let me go ahead and run the lint command.
And it identified the error as it's not able to convert the yaml file because it's not a valid yaml file.
And what the value that we had provided is not a valid one.
And this will help us in a big way
while doing the development or constructing the templates.
Let me go ahead and correct the same.
And since it's going to provide the warning message of front, we should be in a position to correct
and get the valid yaml file as a part of the templates and able to get a valid yaml file.
I'm correcting making it as a valid yaml file.
Now I can go ahead and run the lint command.
And this lint can be integrated with other CICD tools, so that the lint run can be automated
and whenever it is getting a new source as a part of GitHub repository or even into
the source control system automatically
This lint can get invoked and validate whether the valid templates are getting checked into the
repository or the source control system.
And there is another option to test whether the entities are deployed properly or not.
That will be achieved using test that we will be seeing it in the next lecture.
So in a quick summary we have seen how to use the lint and how it's going to give the error messages
after validating the templates and the charts.