Skip to content

Commit cadeac7

Browse files
authored
Merge pull request #3 from francescofuggitti/main
Add support for missing services
2 parents 8354338 + c5ceee3 commit cadeac7

File tree

149 files changed

+3978
-1722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3978
-1722
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v3
2525
with:
26-
version: v1.51.2
26+
version: v1.56.2
27+
args: --timeout=5m
28+
skip-cache: false
2729
- name: Get dependencies
2830
run: go get -t -d ./...
2931
- name: Build

.gitignore

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,213 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,linux,go,goland+all
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,windows,linux,go,goland+all
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
go.work
26+
27+
### GoLand+all ###
28+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
29+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
30+
31+
# User-specific stuff
32+
.idea/**/workspace.xml
33+
.idea/**/tasks.xml
34+
.idea/**/usage.statistics.xml
35+
.idea/**/dictionaries
36+
.idea/**/shelf
37+
38+
# AWS User-specific
39+
.idea/**/aws.xml
40+
41+
# Generated files
42+
.idea/**/contentModel.xml
43+
44+
# Sensitive or high-churn files
45+
.idea/**/dataSources/
46+
.idea/**/dataSources.ids
47+
.idea/**/dataSources.local.xml
48+
.idea/**/sqlDataSources.xml
49+
.idea/**/dynamic.xml
50+
.idea/**/uiDesigner.xml
51+
.idea/**/dbnavigator.xml
52+
53+
# Gradle
54+
.idea/**/gradle.xml
55+
.idea/**/libraries
56+
57+
# Gradle and Maven with auto-import
58+
# When using Gradle or Maven with auto-import, you should exclude module files,
59+
# since they will be recreated, and may cause churn. Uncomment if using
60+
# auto-import.
61+
# .idea/artifacts
62+
# .idea/compiler.xml
63+
# .idea/jarRepositories.xml
64+
# .idea/modules.xml
65+
# .idea/*.iml
66+
# .idea/modules
67+
# *.iml
68+
# *.ipr
69+
70+
# CMake
71+
cmake-build-*/
72+
73+
# Mongo Explorer plugin
74+
.idea/**/mongoSettings.xml
75+
76+
# File-based project format
77+
*.iws
78+
79+
# IntelliJ
80+
out/
81+
82+
# mpeltonen/sbt-idea plugin
83+
.idea_modules/
84+
85+
# JIRA plugin
86+
atlassian-ide-plugin.xml
87+
88+
# Cursive Clojure plugin
89+
.idea/replstate.xml
90+
91+
# SonarLint plugin
92+
.idea/sonarlint/
93+
94+
# Crashlytics plugin (for Android Studio and IntelliJ)
95+
com_crashlytics_export_strings.xml
96+
crashlytics.properties
97+
crashlytics-build.properties
98+
fabric.properties
99+
100+
# Editor-based Rest Client
101+
.idea/httpRequests
102+
103+
# Android studio 3.1+ serialized cache file
104+
.idea/caches/build_file_checksums.ser
105+
106+
### GoLand+all Patch ###
107+
# Ignore everything but code style settings and run configurations
108+
# that are supposed to be shared within teams.
109+
110+
.idea/*
111+
112+
!.idea/codeStyles
113+
!.idea/runConfigurations
114+
115+
### Linux ###
116+
*~
117+
118+
# temporary files which can be created if a process still has a handle open of a deleted file
119+
.fuse_hidden*
120+
121+
# KDE directory preferences
122+
.directory
123+
124+
# Linux trash folder which might appear on any partition or disk
125+
.Trash-*
126+
127+
# .nfs files are created when an open file is removed but is still being accessed
128+
.nfs*
129+
130+
### macOS ###
131+
# General
132+
.DS_Store
133+
.AppleDouble
134+
.LSOverride
135+
136+
# Icon must end with two \r
137+
Icon
138+
139+
140+
# Thumbnails
141+
._*
142+
143+
# Files that might appear in the root of a volume
144+
.DocumentRevisions-V100
145+
.fseventsd
146+
.Spotlight-V100
147+
.TemporaryItems
148+
.Trashes
149+
.VolumeIcon.icns
150+
.com.apple.timemachine.donotpresent
151+
152+
# Directories potentially created on remote AFP share
153+
.AppleDB
154+
.AppleDesktop
155+
Network Trash Folder
156+
Temporary Items
157+
.apdisk
158+
159+
### macOS Patch ###
160+
# iCloud generated files
161+
*.icloud
162+
163+
### VisualStudioCode ###
164+
.vscode/*
165+
!.vscode/settings.json
166+
!.vscode/tasks.json
167+
!.vscode/launch.json
168+
!.vscode/extensions.json
169+
!.vscode/*.code-snippets
170+
171+
# Local History for Visual Studio Code
172+
.history/
173+
174+
# Built Visual Studio Code Extensions
175+
*.vsix
176+
177+
### VisualStudioCode Patch ###
178+
# Ignore all local history of files
179+
.history
180+
.ionide
181+
182+
### Windows ###
183+
# Windows thumbnail cache files
184+
Thumbs.db
185+
Thumbs.db:encryptable
186+
ehthumbs.db
187+
ehthumbs_vista.db
188+
189+
# Dump file
190+
*.stackdump
191+
192+
# Folder config file
193+
[Dd]esktop.ini
194+
195+
# Recycle Bin used on file shares
196+
$RECYCLE.BIN/
197+
198+
# Windows Installer files
199+
*.cab
200+
*.msi
201+
*.msix
202+
*.msm
203+
*.msp
204+
205+
# Windows shortcuts
206+
*.lnk
207+
208+
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,linux,go,goland+all
209+
210+
## CUSTOM
1211
# Binaries for programs and plugins
2212
*.exe
3213
*.exe~

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ builds:
99
- CGO_ENABLED=1
1010
- GO111MODULE=on
1111
ldflags:
12-
- -s -w -X github.com/github.com/dihedron/cq-source-openstack/resources/plugin.Version={{.Version}}
12+
- -s -w -X github.com/dihedron/cq-source-openstack/plugin/plugin.Version={{.Version}}
1313
goos:
1414
- windows
1515
- linux

Makefile

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,91 @@
1-
.PHONY: local
2-
local:
3-
goreleaser build --single-target --snapshot --clean
1+
NAME := cq-source-openstack
2+
DESCRIPTION := CloudQuery OpenStack source plugin
3+
KIND := source
4+
COPYRIGHT := 2024 © Andrea Funtò
5+
LICENSE := MIT
6+
LICENSE_URL := https://opensource.org/license/mit/
7+
VERSION_MAJOR := 0
8+
VERSION_MINOR := 1
9+
VERSION_PATCH := 0
10+
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
11+
12+
13+
LICENSE="MIT"
14+
RELEASE=1
15+
PRODUCER_URL=https://github.com/dihedron/
16+
DOWNLOAD_URL=$(PRODUCER_URL)cq-source-openstack
17+
18+
SHELL := /bin/bash
19+
20+
platforms="$$(go tool dist list)"
21+
module := $$(grep "module .*" go.mod | sed 's/module //gi')
22+
package := $(module)/version
23+
now := $$(date --rfc-3339=seconds)
24+
# comment this to disable compression; to improve compression
25+
# consider replacing upx -9 with upx --brute (slow!)
26+
strip := -w -s
27+
28+
#
29+
# Linux x86-64 build settings
30+
#
31+
linux/amd64: GOAMD64 = v3
32+
33+
#
34+
# Windows x86-64 build settings
35+
#
36+
windows/amd64: GOAMD64 = v3
37+
38+
.PHONY: default
39+
default: linux/amd64;
40+
41+
%:
42+
@go mod tidy
43+
ifeq (, $(shell which govulncheck))
44+
@go install golang.org/x/vuln/cmd/govulncheck@latest
45+
endif
46+
@govulncheck ./...
47+
@for platform in "$(platforms)"; do \
48+
if test "$(@)" = "$$platform"; then \
49+
echo "Building target $(@)..."; \
50+
mkdir -p dist/$(@); \
51+
GOOS=$(shell echo $(@) | cut -d "/" -f 1) \
52+
GOARCH=$(shell echo $(@) | cut -d "/" -f 2) \
53+
GOAMD64=$(GOAMD64) \
54+
CGO_ENABLED=0 \
55+
go build -v \
56+
-ldflags="\
57+
$(strip) \
58+
-X '$(package).Name=$(NAME)' \
59+
-X '$(package).Description=$(DESCRIPTION)' \
60+
-X '$(package).Kind=$(KIND)' \
61+
-X '$(package).Copyright=$(COPYRIGHT)' \
62+
-X '$(package).License=$(LICENSE)' \
63+
-X '$(package).LicenseURL=$(LICENSE_URL)' \
64+
-X '$(package).BuildTime=$(now)' \
65+
-X '$(package).VersionMajor=$(VERSION_MAJOR)' \
66+
-X '$(package).VersionMinor=$(VERSION_MINOR)' \
67+
-X '$(package).VersionPatch=$(VERSION_PATCH)'" \
68+
-o dist/$(@)/ .;\
69+
echo ...done!; \
70+
fi; \
71+
done
72+
73+
.PHONY: optimise
74+
optimise:
75+
ifeq (, $(shell which upx))
76+
@sudo apt install upx
77+
endif
78+
@for binary in `find dist/ -name 'cq-source-openstack*'`; do \
79+
upx --brute $$binary; \
80+
done;
81+
82+
.PHONY: clean
83+
clean:
84+
@rm -rf dist
85+
86+
# .PHONY: local
87+
# local:
88+
# goreleaser build --single-target --snapshot --clean
489

590
.PHONY: test
691
test:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# CloudQuery OpenStack Source Plugin
22

3-
[![test](https://github.com/github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml/badge.svg)](https://github.com/github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/github.com/dihedron/cq-source-openstack)](https://goreportcard.com/report/github.com/github.com/dihedron/cq-source-openstack)
3+
[![test](https://github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml/badge.svg)](https://github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/dihedron/cq-source-openstack)](https://goreportcard.com/report/github.com/dihedron/cq-source-openstack)
55

66
A source plugin for CloudQuery that loads data from OpenStack to any database, data warehouse or data lake supported by [CloudQuery](https://www.cloudquery.io/), such as PostgreSQL, BigQuery, Athena, and many more.
77

8-
OpenStack is the most widely used open source cloud platform; it powers hundreds of private clouds and some public clouds too;.
8+
OpenStack is the most widely used open source cloud platform; it powers hundreds of private clouds and some public clouds too.
99

1010
## Links
1111

_test/docker-compose.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
version: '3.7'
22
services:
3-
cloudquery:
4-
image: postgres:14
5-
restart: unless-stopped
6-
environment:
7-
- POSTGRES_USER=cloudquery
8-
- POSTGRES_PASSWORD=cloudquery
9-
logging:
10-
options:
11-
max-size: 10m
12-
max-file: "3"
13-
ports:
14-
- '5433:5432'
15-
volumes:
16-
- cloudquery_data:/var/lib/postgresql/data
3+
cloudquery:
4+
image: postgres:14
5+
restart: unless-stopped
6+
environment:
7+
- POSTGRES_USER=cloudquery
8+
- POSTGRES_PASSWORD=cloudquery
9+
logging:
10+
options:
11+
max-size: 10m
12+
max-file: "3"
13+
ports:
14+
- '5433:5432'
15+
volumes:
16+
- cloudquery_data:/var/lib/postgresql/data
1717
volumes:
1818
cloudquery_data:
1919
external: false

0 commit comments

Comments
 (0)