From ad58b73e1c804d5656671704c2063e44a4deff2d Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Wed, 11 Oct 2023 14:03:07 +1100 Subject: [PATCH] Image controller update --- go.mod | 4 +++- go.sum | 10 ++++++---- pkg/reconciler/jbsconfig/jbsconfig.go | 3 +++ .../api/v1alpha1/imagerepository_types.go | 9 ++++++++- vendor/modules.txt | 6 +++++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index fff4af26b..839a11b71 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( require ( github.com/CycloneDX/cyclonedx-go v0.7.1 github.com/google/go-containerregistry v0.15.2 - github.com/redhat-appstudio/image-controller v0.0.0-20230831131151-75d3928646d2 + github.com/redhat-appstudio/image-controller v0.0.0-20231003082540-48893226ba8b go.uber.org/zap v1.24.0 sigs.k8s.io/yaml v1.3.0 ) @@ -76,11 +76,13 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc3 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.8.4 // indirect github.com/vbatts/tar-split v0.11.3 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.10.0 // indirect diff --git a/go.sum b/go.sum index 40389900c..78255e346 100644 --- a/go.sum +++ b/go.sum @@ -431,8 +431,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -460,8 +461,8 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= -github.com/redhat-appstudio/image-controller v0.0.0-20230831131151-75d3928646d2 h1:5ulZ6EVjYCBSXlZ0j6ylZPyn5TcaJ5ev5ffHVkrW29M= -github.com/redhat-appstudio/image-controller v0.0.0-20230831131151-75d3928646d2/go.mod h1:fNP2oUEejlHZUkAz2f0ViKNl0D8w4cD8QVoGy1pri9c= +github.com/redhat-appstudio/image-controller v0.0.0-20231003082540-48893226ba8b h1:kM+t/FZSMVUydXIbii+bduAJov7pcADCybP9u1WSBcw= +github.com/redhat-appstudio/image-controller v0.0.0-20231003082540-48893226ba8b/go.mod h1:fNP2oUEejlHZUkAz2f0ViKNl0D8w4cD8QVoGy1pri9c= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= @@ -506,7 +507,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tektoncd/pipeline v0.47.3 h1:8oh2Yy3duW8wRW8nq0GZdD96Ya9bKELzVSGVxS/oOQo= github.com/tektoncd/pipeline v0.47.3/go.mod h1:7H1DeNuEJFGoExGwQTlRul2IziCPxkjXRdDdirWmoQs= diff --git a/pkg/reconciler/jbsconfig/jbsconfig.go b/pkg/reconciler/jbsconfig/jbsconfig.go index c0f24b446..c4dbd6154 100644 --- a/pkg/reconciler/jbsconfig/jbsconfig.go +++ b/pkg/reconciler/jbsconfig/jbsconfig.go @@ -209,6 +209,9 @@ func (r *ReconcilerJBSConfig) validations(ctx context.Context, log logr.Logger, } if jbsConfig.ImageRegistry().Owner == "" { + if !r.spiPresent { + return fmt.Errorf("image repository not configured") + } err := r.handleNoOwnerSpecified(ctx, log, jbsConfig) if err != nil { return err diff --git a/vendor/github.com/redhat-appstudio/image-controller/api/v1alpha1/imagerepository_types.go b/vendor/github.com/redhat-appstudio/image-controller/api/v1alpha1/imagerepository_types.go index be45e07db..c5bce0550 100644 --- a/vendor/github.com/redhat-appstudio/image-controller/api/v1alpha1/imagerepository_types.go +++ b/vendor/github.com/redhat-appstudio/image-controller/api/v1alpha1/imagerepository_types.go @@ -108,7 +108,7 @@ type CredentialsStatus struct { // PullSecretName is present only if ImageRepository has labels that connect it to Application and Component. // Holds name of the dockerconfig secret with credentials to pull only from the generated repository. - // The secret is not present in the same namespace as ImageRepository, but created in + // The secret might not be present in the same namespace as ImageRepository, but created in other environments. PullSecretName string `json:"pull-secret,omitempty"` // PushRobotAccountName holds name of the quay robot account with write (push and pull) permissions into the generated repository. @@ -117,6 +117,13 @@ type CredentialsStatus struct { // PullRobotAccountName is present only if ImageRepository has labels that connect it to Application and Component. // Holds name of the quay robot account with real (pull only) permissions from the generated repository. PullRobotAccountName string `json:"pull-robot-account,omitempty"` + + // PushRemoteSecretName holds name of RemoteSecret object that manages push Secret and its linking to appstudio-pipeline Service Account. + PushRemoteSecretName string `json:"push-remote-secret,omitempty"` + + // PullRemoteSecretName is present only if ImageRepository has labels that connect it to Application and Component. + // Holds the name of the RemoteSecret object that manages pull Secret. + PullRemoteSecretName string `json:"pull-remote-secret,omitempty"` } //+kubebuilder:object:root=true diff --git a/vendor/modules.txt b/vendor/modules.txt index 13ae1d100..007d76b88 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -235,6 +235,8 @@ github.com/openshift/client-go/quota/clientset/versioned/typed/quota/v1 # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors +# github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 +## explicit # github.com/prometheus/client_golang v1.16.0 ## explicit; go 1.17 github.com/prometheus/client_golang/prometheus @@ -258,7 +260,7 @@ github.com/prometheus/procfs/internal/util ## explicit; go 1.13 github.com/prometheus/statsd_exporter/pkg/mapper github.com/prometheus/statsd_exporter/pkg/mapper/fsm -# github.com/redhat-appstudio/image-controller v0.0.0-20230831131151-75d3928646d2 +# github.com/redhat-appstudio/image-controller v0.0.0-20231003082540-48893226ba8b ## explicit; go 1.19 github.com/redhat-appstudio/image-controller/api/v1alpha1 # github.com/sirupsen/logrus v1.9.0 @@ -267,6 +269,8 @@ github.com/sirupsen/logrus # github.com/spf13/pflag v1.0.5 ## explicit; go 1.12 github.com/spf13/pflag +# github.com/stretchr/testify v1.8.4 +## explicit; go 1.20 # github.com/tektoncd/pipeline v0.47.3 ## explicit; go 1.19 github.com/tektoncd/pipeline/config