mirror of
https://github.com/openshift/image-registry.git
synced 2026-02-05 09:45:55 +01:00
post-rebase tweaks
This commit is contained in:
@@ -16,12 +16,13 @@ import (
|
||||
"github.com/openshift/library-go/pkg/serviceability"
|
||||
|
||||
"github.com/openshift/image-registry/pkg/cmd/dockerregistry"
|
||||
"github.com/openshift/image-registry/pkg/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
logs.InitLogs()
|
||||
defer logs.FlushLogs()
|
||||
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
|
||||
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"), version.Get())()
|
||||
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()
|
||||
startProfiler()
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ type ImageStreamTagInterface interface {
|
||||
var _ ImageStreamSecretInterface = imageclientv1.ImageStreamInterface(nil)
|
||||
|
||||
type ImageStreamSecretInterface interface {
|
||||
Secrets(name string, options metav1.ListOptions) (*corev1.SecretList, error)
|
||||
Secrets(name string, options metav1.GetOptions) (*corev1.SecretList, error)
|
||||
}
|
||||
|
||||
var _ LimitRangeInterface = coreclientv1.LimitRangeInterface(nil)
|
||||
|
||||
@@ -203,7 +203,7 @@ func TestRepositoryBlobStat(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expectedError: distribution.ErrBlobUnknown,
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"get", "images"}, {"list", "imagestreams"}},
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"get", "images"}, {"get", "imagestreams"}},
|
||||
},
|
||||
|
||||
{
|
||||
@@ -231,7 +231,7 @@ func TestRepositoryBlobStat(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expectedError: distribution.ErrBlobUnknown,
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"list", "imagestreams"}},
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"get", "imagestreams"}},
|
||||
},
|
||||
|
||||
{
|
||||
@@ -259,7 +259,7 @@ func TestRepositoryBlobStat(t *testing.T) {
|
||||
},
|
||||
},
|
||||
expectedError: distribution.ErrBlobUnknown,
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"list", "imagestreams"}},
|
||||
expectedActions: []clientAction{{"get", "imagestreams"}, {"get", "imagestreams"}},
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -207,7 +207,7 @@ func (is *imageStream) ImageManifestBlobStored(ctx context.Context, image *image
|
||||
}
|
||||
|
||||
func (is *imageStream) GetSecrets() ([]corev1.Secret, error) {
|
||||
secrets, err := is.registryOSClient.ImageStreamSecrets(is.namespace).Secrets(is.name, metav1.ListOptions{})
|
||||
secrets, err := is.registryOSClient.ImageStreamSecrets(is.namespace).Secrets(is.name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting secrets for repository %s: %v", is.Reference(), err)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package version
|
||||
|
||||
import "github.com/prometheus/client_golang/prometheus"
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"k8s.io/apimachinery/pkg/version"
|
||||
)
|
||||
|
||||
var (
|
||||
// commitFromGit is a constant representing the source version that
|
||||
@@ -17,19 +21,10 @@ var (
|
||||
buildDate string
|
||||
)
|
||||
|
||||
// Info contains versioning information.
|
||||
type Info struct {
|
||||
Major string `json:"major"`
|
||||
Minor string `json:"minor"`
|
||||
GitCommit string `json:"gitCommit"`
|
||||
GitVersion string `json:"gitVersion"`
|
||||
BuildDate string `json:"buildDate"`
|
||||
}
|
||||
|
||||
// Get returns the overall codebase version. It's for detecting
|
||||
// what code a binary was built from.
|
||||
func Get() Info {
|
||||
return Info{
|
||||
func Get() version.Info {
|
||||
return version.Info{
|
||||
Major: majorFromGit,
|
||||
Minor: minorFromGit,
|
||||
GitCommit: commitFromGit,
|
||||
@@ -38,15 +33,6 @@ func Get() Info {
|
||||
}
|
||||
}
|
||||
|
||||
// String returns info as a human-friendly version string.
|
||||
func (info Info) String() string {
|
||||
version := info.GitVersion
|
||||
if version == "" {
|
||||
version = "unknown"
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
||||
func init() {
|
||||
buildInfo := prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
|
||||
Reference in New Issue
Block a user