Skip to content

Commit 85aa72e

Browse files
authored
Merge pull request #15 from opengovern/fix_dockerfile
fix: deleted some columns from artifact_dockerfile
2 parents c6da5ea + 5fa38fc commit 85aa72e

File tree

4 files changed

+61
-69
lines changed

4 files changed

+61
-69
lines changed

pkg/sdk/es/resources_clients.go

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7346,17 +7346,13 @@ func (p ArtifactDockerFilePaginator) NextPage(ctx context.Context) ([]ArtifactDo
73467346
}
73477347

73487348
var listArtifactDockerFileFilters = map[string]string{
7349-
"dockerfile_content": "Description.DockerfileContent",
7350-
"dockerfile_content_base64": "Description.DockerfileContentBase64",
7351-
"git_url": "Description.GitURL",
7352-
"html_url": "Description.HTMLURL",
7353-
"images": "Description.Images",
7354-
"last_updated_at": "Description.LastUpdatedAt",
7355-
"name": "Description.Name",
7356-
"path": "Description.Path",
7357-
"repository": "Description.Repository",
7358-
"sha": "Description.Sha",
7359-
"uri": "Description.URI",
7349+
"dockerfile_content": "Description.DockerfileContent",
7350+
"html_url": "Description.HTMLURL",
7351+
"images": "Description.Images",
7352+
"last_updated_at": "Description.LastUpdatedAt",
7353+
"name": "Description.Name",
7354+
"repository": "Description.Repository",
7355+
"sha": "Description.Sha",
73607356
}
73617357

73627358
func ListArtifactDockerFile(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) {
@@ -7420,17 +7416,13 @@ func ListArtifactDockerFile(ctx context.Context, d *plugin.QueryData, _ *plugin.
74207416
}
74217417

74227418
var getArtifactDockerFileFilters = map[string]string{
7423-
"dockerfile_content": "Description.DockerfileContent",
7424-
"dockerfile_content_base64": "Description.DockerfileContentBase64",
7425-
"git_url": "Description.GitURL",
7426-
"html_url": "Description.HTMLURL",
7427-
"images": "Description.Images",
7428-
"last_updated_at": "Description.LastUpdatedAt",
7429-
"name": "Description.Name",
7430-
"path": "Description.Path",
7431-
"repository": "Description.Repository",
7432-
"sha": "Description.Sha",
7433-
"uri": "Description.URI",
7419+
"dockerfile_content": "Description.DockerfileContent",
7420+
"html_url": "Description.HTMLURL",
7421+
"images": "Description.Images",
7422+
"last_updated_at": "Description.LastUpdatedAt",
7423+
"name": "Description.Name",
7424+
"repository": "Description.Repository",
7425+
"sha": "Description.Sha",
74347426
}
74357427

74367428
func GetArtifactDockerFile(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) {

provider/describer/artifact_dockerfile.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,21 @@ func GetDockerfile(
219219
}
220220

221221
output := model.ArtifactDockerFileDescription{
222-
Sha: &contentData.Sha,
223-
Name: &contentData.Name,
224-
Path: &contentData.Path,
225-
LastUpdatedAt: &lastUpdatedAt,
226-
GitURL: &contentData.GitURL,
227-
HTMLURL: &contentData.HTMLURL,
228-
URI: &contentData.HTMLURL,
222+
Sha: &contentData.Sha,
223+
Name: &contentData.Name,
224+
//Path: &contentData.Path,
225+
LastUpdatedAt: &lastUpdatedAt,
226+
//GitURL: &contentData.GitURL,
227+
HTMLURL: &contentData.HTMLURL,
228+
//URI: &contentData.HTMLURL,
229229
DockerfileContent: string(decoded),
230230
DockerfileContentBase64: &dockerfileB64,
231231
Repository: repoObj,
232232
Images: images,
233233
}
234234

235235
value := models.Resource{
236-
ID: *output.URI,
236+
ID: contentData.HTMLURL,
237237
Name: *output.Name,
238238
Description: output,
239239
}

provider/model/model.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,21 +1456,21 @@ type Package struct {
14561456

14571457
type ContainerMetadata struct {
14581458
Container struct {
1459-
Tags []string
1460-
}
1459+
Tags []string
1460+
}
14611461
}
14621462

14631463
type ContainerPackageDescription struct {
1464-
ID int
1465-
Digest string
1466-
CreatedAt string
1467-
UpdatedAt string
1468-
PackageURL string
1469-
Name string
1470-
MediaType string
1471-
TotalSize int64
1472-
Metadata ContainerMetadata
1473-
Manifest interface{}
1464+
ID int
1465+
Digest string
1466+
CreatedAt string
1467+
UpdatedAt string
1468+
PackageURL string
1469+
Name string
1470+
MediaType string
1471+
TotalSize int64
1472+
Metadata ContainerMetadata
1473+
Manifest interface{}
14741474

14751475
// -- Add these new fields/methods: --
14761476

@@ -1637,13 +1637,13 @@ type CommitResponse struct {
16371637
}
16381638

16391639
type ArtifactDockerFileDescription struct {
1640-
Sha *string
1641-
Name *string
1642-
Path *string
1643-
LastUpdatedAt *string
1644-
GitURL *string
1645-
HTMLURL *string
1646-
URI *string // Unique identifier
1640+
Sha *string
1641+
Name *string
1642+
//Path *string
1643+
LastUpdatedAt *string
1644+
//GitURL *string
1645+
HTMLURL *string
1646+
//URI *string // Unique identifier
16471647
DockerfileContent string
16481648
DockerfileContentBase64 *string
16491649
Repository map[string]interface{}

steampipe-plugin-github/github/table_github_artifact_dockerfile.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,41 @@ func tableGitHubArtifactDockerFile() *plugin.Table {
2929
Type: proto.ColumnType_STRING,
3030
Transform: transform.FromField("Description.Name"),
3131
Description: "Name of the Dockerfile."},
32-
{
33-
Name: "path",
34-
Type: proto.ColumnType_STRING,
35-
Transform: transform.FromField("Description.Path"),
36-
Description: "Path to the Dockerfile in the repository."},
32+
//{
33+
// Name: "path",
34+
// Type: proto.ColumnType_STRING,
35+
// Transform: transform.FromField("Description.Path"),
36+
// Description: "Path to the Dockerfile in the repository."},
3737
{
3838
Name: "last_updated_at",
3939
Type: proto.ColumnType_STRING,
4040
Transform: transform.FromField("Description.LastUpdatedAt"),
4141
Description: "Last time the dockerfile updated"},
42-
{
43-
Name: "git_url",
44-
Type: proto.ColumnType_STRING,
45-
Transform: transform.FromField("Description.GitURL"),
46-
Description: "Git URL where the Dockerfile can be accessed."},
42+
//{
43+
// Name: "git_url",
44+
// Type: proto.ColumnType_STRING,
45+
// Transform: transform.FromField("Description.GitURL"),
46+
// Description: "Git URL where the Dockerfile can be accessed."},
4747
{
4848
Name: "html_url",
4949
Type: proto.ColumnType_STRING,
5050
Transform: transform.FromField("Description.HTMLURL"),
5151
Description: "HTML URL where the Dockerfile can be accessed."},
52-
{
53-
Name: "uri",
54-
Type: proto.ColumnType_STRING,
55-
Transform: transform.FromField("Description.URI"),
56-
Description: "Unique URI for the Dockerfile."},
52+
//{
53+
// Name: "uri",
54+
// Type: proto.ColumnType_STRING,
55+
// Transform: transform.FromField("Description.URI"),
56+
// Description: "Unique URI for the Dockerfile."},
5757
{
5858
Name: "dockerfile_content",
5959
Type: proto.ColumnType_STRING,
6060
Transform: transform.FromField("Description.DockerfileContent"),
6161
Description: "Dockerfile content."},
62-
{
63-
Name: "dockerfile_content_base64",
64-
Type: proto.ColumnType_STRING,
65-
Transform: transform.FromField("Description.DockerfileContentBase64"),
66-
Description: "Dockerfile content base64."},
62+
//{
63+
// Name: "dockerfile_content_base64",
64+
// Type: proto.ColumnType_STRING,
65+
// Transform: transform.FromField("Description.DockerfileContentBase64"),
66+
// Description: "Dockerfile content base64."},
6767
{
6868
Name: "repository",
6969
Type: proto.ColumnType_JSON,

0 commit comments

Comments
 (0)