Skip to content

Commit

Permalink
Pass in otelcol version using CLI arg
Browse files Browse the repository at this point in the history
  • Loading branch information
crobert-1 committed Sep 9, 2024
1 parent bc83d9a commit 05c6527
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
13 changes: 12 additions & 1 deletion deployments/cloudfoundry/tile/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
This script is used to setup your Tanzu environment for testing with the Splunk OpenTelemetry Collector Tanzu Tile. Running
this script will allow you to install the Tanzu Tile in your Tanzu environment.

**Sample usage:**
```shell
$ export TAS_JSON=/path/to/hammer/file
$ ./setup_tanzu.sh
```

## generate_osdf.py

This script is used to generate the open source disclosure file (OSDF). This is a file that discloses all of the Tanzu
Tile's dependencies. The Tanzu team used to provide a website interface that would generate this file in a specific
format but dropped support for it. This script generates the file in the same format as their website did.
format but dropped support for it. This script generates the file in the same format as their website did.

**Sample usage:**
```shell
$ python3 generate_osdf.py --otelcol_version 0.X.0
```
12 changes: 9 additions & 3 deletions deployments/cloudfoundry/tile/scripts/generate_osdf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import io
import subprocess

Expand Down Expand Up @@ -398,14 +399,19 @@ def get_appendix_output():
return output

def main():
otelcol_ver = "0.95.0"
parser = argparse.ArgumentParser(description='Generate open source disclosure file (OSDF) for Tanzu Tile')
parser.add_argument('--otelcol_version', dest="otelcol_ver", type=str,
help='Splunk OpenTelemetry Collector version')
args = parser.parse_args()


parse_dependencies()
output = HEADER.replace("COLLECTOR_VERSION", otelcol_ver)
output = HEADER.replace("COLLECTOR_VERSION", args.otelcol_ver)
output += get_primary_output()
output += get_appendix_output()
output += APPENDIX_CONTENTS

with open("./OSDF V" + otelcol_ver + ".txt", "w") as file:
with open("./OSDF V" + args.otelcol_ver + ".txt", "w") as file:
file.write(output)

if __name__ == '__main__':
Expand Down

0 comments on commit 05c6527

Please sign in to comment.