Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
feat(repo): add new fields for docker repositories (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeh90 authored Apr 2, 2020
1 parent c150ef8 commit a0ff7fb
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
24 changes: 24 additions & 0 deletions artifactory/artifactory-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions artifactory/fixtures/repositories/local_repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"calculateYumMetadata" : false,
"yumRootDepth" : 0,
"dockerApiVersion" : "V2",
"blockPushingSchema1" : true,
"enableFileListsIndexing" : "false",
"optionalIndexCompressionFormats" : ["bz2", "lzma", "xz"],
"xrayIndex" : false,
Expand Down
3 changes: 2 additions & 1 deletion artifactory/fixtures/repositories/remote_repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@
"source" : {
"originAbsenceDetection" : true
}
}
},
"blockPushingSchema1" : true
}
3 changes: 2 additions & 1 deletion artifactory/fixtures/repositories/virtual_repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"forceMavenAuthentication" : false,
"externalDependenciesEnabled": false,
"externalDependenciesPatterns": ["**/*microsoft*/**", "**/*github*/**"],
"externalDependenciesRemoteRepo": ""
"externalDependenciesRemoteRepo": "",
"resolveDockerTagsByTimestamp": false
}
3 changes: 3 additions & 0 deletions artifactory/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type LocalRepository struct {
CalculateYumMetadata *bool `json:"calculateYumMetadata,omitempty"`
YumRootDepth *int `json:"yumRootDepth,omitempty"`
DockerAPIVersion *string `json:"dockerApiVersion,omitempty"`
BlockPushingSchema1 *bool `json:"blockPushingSchema1,omitempty"`
EnableFileListsIndexing *bool `json:"enableFileListsIndexing,omitempty"`
OptionalIndexCompressionFormats *[]string `json:"optionalIndexCompressionFormats,omitempty"`
XrayIndex *bool `json:"xrayIndex,omitempty"`
Expand Down Expand Up @@ -136,6 +137,7 @@ type RemoteRepository struct {
ListRemoteFolderItems *bool `json:"listRemoteFolderItems,omitempty"`
EnableTokenAuthentication *bool `json:"enableTokenAuthentication,omitempty"`
ContentSynchronisation *ContentSynchronisation `json:"contentSynchronisation,omitempty"`
BlockPushingSchema1 *bool `json:"blockPushingSchema1,omitempty"`
}

// ContentSynchronisation represents smart remote repository configuration
Expand Down Expand Up @@ -172,6 +174,7 @@ type VirtualRepository struct {
ExternalDependenciesEnabled *bool `json:"externalDependenciesEnabled,omitempty"`
ExternalDependenciesPatterns *[]string `json:"externalDependenciesPatterns,omitempty"`
ExternalDependenciesRemoteRepo *string `json:"externalDependenciesRemoteRepo,omitempty"`
ResolveDockerTagsByTimestamp *bool `json:"resolveDockerTagsByTimestamp,omitempty"`
}

func (v VirtualRepository) String() string {
Expand Down
3 changes: 3 additions & 0 deletions artifactory/repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func Test_Repositories(t *testing.T) {
CalculateYumMetadata: Bool(false),
YumRootDepth: Int(0),
DockerAPIVersion: String("V2"),
BlockPushingSchema1: Bool(true),
EnableFileListsIndexing: Bool(false),
OptionalIndexCompressionFormats: &[]string{"bz2", "lzma", "xz"},
XrayIndex: Bool(false),
Expand Down Expand Up @@ -204,6 +205,7 @@ func Test_Repositories(t *testing.T) {
OriginAbsenceDetection *bool `json:"originAbsenceDetection,omitempty"`
}{OriginAbsenceDetection: Bool(true)},
},
BlockPushingSchema1: Bool(true),
}

data, _ := ioutil.ReadFile("fixtures/repositories/remote_repository.json")
Expand Down Expand Up @@ -235,6 +237,7 @@ func Test_Repositories(t *testing.T) {
ExternalDependenciesEnabled: Bool(false),
ExternalDependenciesPatterns: &[]string{"**/*microsoft*/**", "**/*github*/**"},
ExternalDependenciesRemoteRepo: String(""),
ResolveDockerTagsByTimestamp: Bool(false),
}

data, _ := ioutil.ReadFile("fixtures/repositories/virtual_repository.json")
Expand Down

0 comments on commit a0ff7fb

Please sign in to comment.