github / github/octocatalog-diff

Limitations for files with changing source

Open
#134 4 comments 0 reactions 0 assignees View on GitHub
docs
Dominant language
Ruby
Stars
252
Forks
95
PR merge metrics
No merged PRs in 30d

Description

- What did you do?

Diff two already generated catalogs against each other by using the API functionality:

```
catalog_old.write(getCatalog(@options.merge({:puppetdb_url => 'https://puppetdb-live.example.org:8081'}), logger))
catalog_new.write(getCatalog(@options.merge({:puppetdb_url => 'https://puppetdb-dev.example.org:8081'}), logger))

catalog_diff_result = OctocatalogDiff::API::V1.catalog_diff(
{
:to_catalog => catalog_new.path,
:from_catalog => catalog_old.path,
}
)

diff_printer = OctocatalogDiff::Cli::Printer.new(@options, logger)
diff_printer.printer(catalog_diff_result.diffs)
```
Resource that changed looked like this:

```
file { "${nagios::nrpe::plugindir}/check_ram":
owner => 'root',
group => 'root',
mode => '0555',
source => 'puppet:///modules/ve_base/check_ram',
}
```
The content of the source file "ve_base/check_ram" changed.

- What happened?

octocatalog-diff didn't show any changes

- What did you expect to happen?

Show diffs on the changed content of the file

- How can someone reproduce the problem?

Generate two catalogs with a file {} resource which source file changed.

> Command used and debugging output

> Platform and version information

- Your OS:
Ubuntu 14.04

- Your Ruby version:
2.4.0
- Your version of Puppet:
4.10.1
- Your version of octocatalog-diff:
1.0.1
> Do the tests pass from a clean checkout?
Installed from gem, so hopefully ;)

> Anything else to add that you think will be helpful?

I think this has to do with how Puppet itself operates. Content of a file {} source parameter is retrieve while applying the catalog. My question therefor is: Are you aware of this limitation? Do you know any workaround which could help detect the change?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.