Skip to content

Commit

Permalink
TO FIXUP
Browse files Browse the repository at this point in the history
  • Loading branch information
thepabloaguilar committed Mar 27, 2024
1 parent 265dabd commit e059af6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/config/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *StorageConfig) validate() error {
return errors.New("oci storage repository must be specified")
}

if c.OCI.ManifestVersion != "1.0" && c.OCI.ManifestVersion != "1.1" {
if c.OCI.ManifestVersion != OCIManifestVersion10 && c.OCI.ManifestVersion != OCIManifestVersion11 {
return errors.New("wrong manifest version, it should be 1.0 or 1.1")
}

Expand Down Expand Up @@ -295,6 +295,13 @@ func (a SSHAuth) validate() (err error) {
return nil
}

type OCIManifestVersion string

const (
OCIManifestVersion10 OCIManifestVersion = "1.0"
OCIManifestVersion11 OCIManifestVersion = "1.1"
)

// OCI provides configuration support for OCI target registries as a backend store for Flipt.
type OCI struct {
// Repository is the target repository and reference to track.
Expand All @@ -308,7 +315,7 @@ type OCI struct {
Authentication *OCIAuthentication `json:"-,omitempty" mapstructure:"authentication" yaml:"-,omitempty"`
PollInterval time.Duration `json:"pollInterval,omitempty" mapstructure:"poll_interval" yaml:"poll_interval,omitempty"`
// ManifestVersion defines which OCI Manifest version to use.
ManifestVersion string `json:"manifestVersion,omitempty" mapstructure:"manifest_version" yaml:"manifest_version,omitempty"`
ManifestVersion OCIManifestVersion `json:"manifestVersion,omitempty" mapstructure:"manifest_version" yaml:"manifest_version,omitempty"`
}

// OCIAuthentication configures the credentials for authenticating against a target OCI regitstry
Expand Down

0 comments on commit e059af6

Please sign in to comment.