diff --git a/controller/state.go b/controller/state.go index 2285f44c1a22c..b9eb784e89023 100644 --- a/controller/state.go +++ b/controller/state.go @@ -168,23 +168,9 @@ func (m *appStateManager) getRepoObjs(app *v1alpha1.Application, sources []v1alp targetObjs := make([]*unstructured.Unstructured, 0) // Store the map of all sources having ref field into a map for applications with sources field - refSources := make(map[string]*appv1.RefTargeRevisionMapping) - if app.Spec.HasMultipleSources() { - // Get Repositories for all sources before generating Manifests - for _, source := range sources { - if source.Ref != "" { - repo, err := m.db.GetRepository(context.Background(), source.RepoURL) - if err != nil { - return nil, nil, err - } - refKey := "$" + source.Ref - refSources[refKey] = &appv1.RefTargeRevisionMapping{ - Repo: *repo, - TargetRevision: source.TargetRevision, - Chart: source.Chart, - } - } - } + refSources, err := argo.GetRefSources(context.Background(), app.Spec, m.db) + if err != nil { + return nil, nil, fmt.Errorf("failed to get ref sources: %v", err) } for i, source := range sources { diff --git a/docs/user-guide/multiple_sources.md b/docs/user-guide/multiple_sources.md index 335af6031964b..342d006acac42 100644 --- a/docs/user-guide/multiple_sources.md +++ b/docs/user-guide/multiple_sources.md @@ -1,10 +1,12 @@ # Multiple Sources for an Application -Argo CD has the ability to specify multiple sources to add services to the Application. Argo CD compiles all the sources and reconciles each source individually for creating the application. +Argo CD has the ability to specify multiple sources to add services to the Application. Argo CD compiles all the sources +and reconciles each source individually for creating the application. -You can provide multiple sources using the `sources` field. When you specify the sources field, Argo CD will ignore the values under `source` field for generating the application. +You can provide multiple sources using the `sources` field. When you specify the `sources` field, Argo CD will ignore +the `source` (singular) field when generating manifests for the application. -See below example for specifying multiple sources: +See the below example for specifying multiple sources: ```yaml apiVersion: argoproj.io/v1alpha1 @@ -25,9 +27,6 @@ spec: namespace: argocd sources: - chart: elasticsearch - helm: - valueFiles: - - values.yaml repoURL: https://helm.elastic.co targetRevision: 7.6.0 - repoURL: https://github.com/argoproj/argocd-example-apps.git @@ -35,31 +34,28 @@ spec: targetRevision: HEAD ``` -The above example has 2 sources specified. Argo CD will reconcile each source separately and combine the resources that are generated for generating the application. +The above example has two sources specified. Argo CD will generate the manifests for each source separately and combine +the resulting manifests. -In case application has multiple entries for the same source (repoURL), Argo CD would pick the source that is mentioned later in the list of sources. For example, consider the below list of sources: +In case an application has multiple entries for the same source (repoURL), Argo CD will pick the source that is +mentioned later in the list of sources. For example, consider the below list of sources: ```yaml sources: - - chart: elasticsearch - helm: - valueFiles: - - values.yaml - repoURL: https://helm.elastic.co - targetRevision: 7.6.0 - - repoURL: https://github.com/argoproj/argocd-example-apps.git - path: guestbook - targetRevision: HEAD - - chart: elasticsearch - helm: - valueFiles: - - values.yaml - repoURL: https://helm.elastic.co - targetRevision: 7.7.0 +- chart: elasticsearch + repoURL: https://helm.elastic.co + targetRevision: 7.6.0 +- repoURL: https://github.com/argoproj/argocd-example-apps.git + path: guestbook + targetRevision: HEAD +- chart: elasticsearch + repoURL: https://helm.elastic.co + targetRevision: 7.7.0 ``` -In the above list, the application has 2 sources referring to the same repoURL. In this case, Argo CD will generate the manifests for source with `targetRevision: 7.6.0` and then append the manifests generated for source with `targetRevision: 7.7.0`. - +In the above list, the application has two sources referring to the same repoURL. In this case, Argo CD will generate +the manifests for source with `targetRevision: 7.6.0` and then append the manifests generated for source with +`targetRevision: 7.7.0`. ## Helm Value files from external Git repository diff --git a/pkg/apis/application/v1alpha1/applicationset_types.go b/pkg/apis/application/v1alpha1/applicationset_types.go index 1c3d657d99781..375799da14753 100644 --- a/pkg/apis/application/v1alpha1/applicationset_types.go +++ b/pkg/apis/application/v1alpha1/applicationset_types.go @@ -536,7 +536,7 @@ const ( // prefix "Info" means informational condition type ApplicationSetConditionType string -//ErrorOccurred / ParametersGenerated / TemplateRendered / ResourcesUpToDate +// ErrorOccurred / ParametersGenerated / TemplateRendered / ResourcesUpToDate const ( ApplicationSetConditionErrorOccurred ApplicationSetConditionType = "ErrorOccurred" ApplicationSetConditionParametersGenerated ApplicationSetConditionType = "ParametersGenerated" diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 115e39faa197d..5773b75ce6df2 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index a334cbed3235a..46f64a49e41e1 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/reposerver/apiclient/repository.pb.go b/reposerver/apiclient/repository.pb.go index 9804737d8a11e..ab5ae98d0c632 100644 --- a/reposerver/apiclient/repository.pb.go +++ b/reposerver/apiclient/repository.pb.go @@ -959,19 +959,20 @@ func (m *AppList) GetApps() map[string]string { // RepoServerAppDetailsQuery contains query information for app details request type RepoServerAppDetailsQuery struct { - Repo *v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` - Source *v1alpha1.ApplicationSource `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - Repos []*v1alpha1.Repository `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"` - KustomizeOptions *v1alpha1.KustomizeOptions `protobuf:"bytes,4,opt,name=kustomizeOptions,proto3" json:"kustomizeOptions,omitempty"` - AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` - NoCache bool `protobuf:"varint,6,opt,name=noCache,proto3" json:"noCache,omitempty"` - NoRevisionCache bool `protobuf:"varint,7,opt,name=noRevisionCache,proto3" json:"noRevisionCache,omitempty"` - TrackingMethod string `protobuf:"bytes,8,opt,name=trackingMethod,proto3" json:"trackingMethod,omitempty"` - EnabledSourceTypes map[string]bool `protobuf:"bytes,9,rep,name=enabledSourceTypes,proto3" json:"enabledSourceTypes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - HelmOptions *v1alpha1.HelmOptions `protobuf:"bytes,10,opt,name=helmOptions,proto3" json:"helmOptions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Repo *v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` + Source *v1alpha1.ApplicationSource `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + Repos []*v1alpha1.Repository `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"` + KustomizeOptions *v1alpha1.KustomizeOptions `protobuf:"bytes,4,opt,name=kustomizeOptions,proto3" json:"kustomizeOptions,omitempty"` + AppName string `protobuf:"bytes,5,opt,name=appName,proto3" json:"appName,omitempty"` + NoCache bool `protobuf:"varint,6,opt,name=noCache,proto3" json:"noCache,omitempty"` + NoRevisionCache bool `protobuf:"varint,7,opt,name=noRevisionCache,proto3" json:"noRevisionCache,omitempty"` + TrackingMethod string `protobuf:"bytes,8,opt,name=trackingMethod,proto3" json:"trackingMethod,omitempty"` + EnabledSourceTypes map[string]bool `protobuf:"bytes,9,rep,name=enabledSourceTypes,proto3" json:"enabledSourceTypes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + HelmOptions *v1alpha1.HelmOptions `protobuf:"bytes,10,opt,name=helmOptions,proto3" json:"helmOptions,omitempty"` + RefSources map[string]*v1alpha1.RefTargeRevisionMapping `protobuf:"bytes,11,rep,name=refSources,proto3" json:"refSources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *RepoServerAppDetailsQuery) Reset() { *m = RepoServerAppDetailsQuery{} } @@ -1077,6 +1078,13 @@ func (m *RepoServerAppDetailsQuery) GetHelmOptions() *v1alpha1.HelmOptions { return nil } +func (m *RepoServerAppDetailsQuery) GetRefSources() map[string]*v1alpha1.RefTargeRevisionMapping { + if m != nil { + return m.RefSources + } + return nil +} + // RepoAppDetailsResponse application details type RepoAppDetailsResponse struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` @@ -1735,6 +1743,7 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "repository.AppList.AppsEntry") proto.RegisterType((*RepoServerAppDetailsQuery)(nil), "repository.RepoServerAppDetailsQuery") proto.RegisterMapType((map[string]bool)(nil), "repository.RepoServerAppDetailsQuery.EnabledSourceTypesEntry") + proto.RegisterMapType((map[string]*v1alpha1.RefTargeRevisionMapping)(nil), "repository.RepoServerAppDetailsQuery.RefSourcesEntry") proto.RegisterType((*RepoAppDetailsResponse)(nil), "repository.RepoAppDetailsResponse") proto.RegisterType((*RepoServerRevisionMetadataRequest)(nil), "repository.RepoServerRevisionMetadataRequest") proto.RegisterType((*HelmAppSpec)(nil), "repository.HelmAppSpec") @@ -1753,120 +1762,121 @@ func init() { } var fileDescriptor_dd8723cfcc820480 = []byte{ - // 1796 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x5b, 0x6f, 0x23, 0x49, - 0x15, 0x4e, 0xdb, 0x8e, 0x63, 0x1f, 0xe7, 0xe2, 0xd4, 0xe4, 0xd2, 0x63, 0xb2, 0x51, 0xb6, 0x81, - 0x51, 0xd8, 0x61, 0x6d, 0x25, 0x23, 0x76, 0xd1, 0x2e, 0xac, 0xe4, 0xcd, 0xce, 0x24, 0xab, 0x4c, - 0x26, 0xa1, 0x13, 0x40, 0x0b, 0x2b, 0x50, 0xa5, 0x5d, 0x6e, 0xd7, 0xba, 0x2f, 0x35, 0x7d, 0x31, - 0xf2, 0x48, 0x3c, 0x20, 0xf1, 0x13, 0x10, 0x3f, 0x81, 0xbf, 0xc0, 0x23, 0x4f, 0xa0, 0x7d, 0x44, - 0xfc, 0x01, 0xd0, 0xbc, 0xf0, 0x37, 0x56, 0x55, 0xd5, 0x37, 0xb7, 0xdb, 0xc9, 0xae, 0x9c, 0xc9, - 0xbc, 0x24, 0x5d, 0xa7, 0xce, 0xad, 0x4e, 0x9f, 0x3a, 0xe7, 0x3b, 0x6d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x65, 0xf3, 0x90, 0x1f, 0x79, 0xa4, 0xe7, 0xab, 0x48, 0xc4, 0xf7, - 0x78, 0xfe, 0x37, 0x28, 0xd4, 0xe9, 0x93, 0xda, 0xb9, 0x63, 0x8e, 0xab, 0x47, 0x37, 0x45, 0xde, - 0x91, 0x07, 0xd2, 0xb1, 0x1c, 0x19, 0x3d, 0x82, 0xd5, 0xc0, 0xc3, 0xc6, 0x90, 0x3a, 0xe6, 0x19, - 0x09, 0x06, 0x6e, 0x4f, 0xdd, 0x10, 0x91, 0xc8, 0x51, 0x91, 0x01, 0x88, 0x38, 0xf8, 0xda, 0x22, - 0x3d, 0x99, 0x8b, 0x57, 0x63, 0x46, 0x7c, 0x75, 0x53, 0x9c, 0xe2, 0x49, 0x3b, 0x53, 0x84, 0x72, - 0x05, 0xa2, 0xfd, 0x74, 0x4a, 0xea, 0xa9, 0x13, 0x78, 0x63, 0xbd, 0x40, 0x1d, 0x1a, 0x42, 0x83, - 0x9f, 0x23, 0x4e, 0x85, 0x2d, 0x91, 0x0a, 0x9f, 0xcf, 0x17, 0xa3, 0x93, 0x54, 0xa1, 0x9e, 0xd5, - 0x8e, 0xda, 0x80, 0x06, 0xd8, 0x3f, 0x0b, 0xad, 0x80, 0x32, 0x8b, 0x48, 0x37, 0x7c, 0x75, 0x5b, - 0x84, 0xa9, 0x60, 0x07, 0x9d, 0x02, 0x78, 0xa4, 0x1f, 0xf3, 0xa9, 0xe2, 0xe4, 0x8f, 0x6f, 0x3a, - 0xb9, 0x9e, 0x70, 0xcb, 0x13, 0x67, 0xc4, 0x5b, 0x4f, 0x61, 0x7b, 0x46, 0x60, 0x50, 0x13, 0xca, - 0x43, 0x32, 0x16, 0x05, 0xb5, 0xae, 0xf3, 0x47, 0xb4, 0x01, 0x8b, 0x23, 0x6c, 0x85, 0x44, 0x94, - 0xc0, 0x9a, 0x2e, 0x17, 0x1f, 0x95, 0x7e, 0xaa, 0xb4, 0xfe, 0xa2, 0xc0, 0x5a, 0xce,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xf8, 0xa8, 0x9f, 0x76, 0xbf, 0x7e, 0xbd, 0xab, 0xfc, 0xfb, 0xf5, 0xae, 0xf2, 0xbf, 0xd7, 0xbb, - 0xca, 0x6f, 0x9e, 0xdc, 0xf2, 0x03, 0x4f, 0xe6, 0x37, 0x23, 0xcc, 0xa8, 0x61, 0x51, 0xe2, 0x04, - 0xd7, 0x55, 0xf1, 0x73, 0xce, 0x93, 0x6f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x97, 0x9b, 0xfc, - 0x52, 0x1a, 0x00, 0x00, + // 1811 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x5b, 0x6f, 0x1b, 0xc7, + 0x15, 0xd6, 0x92, 0x14, 0x45, 0x1e, 0x5a, 0x12, 0x35, 0xd6, 0x65, 0xcd, 0x2a, 0x82, 0xb2, 0x6d, + 0x0d, 0x35, 0x6e, 0x48, 0x48, 0x46, 0x92, 0x22, 0x69, 0x03, 0x30, 0x8a, 0x2d, 0x05, 0xb2, 0x2c, + 0x75, 0xa5, 0xb4, 0x48, 0x1b, 0xb4, 0x18, 0x2d, 0x87, 0xcb, 0x09, 0xf7, 0x32, 0xde, 0x0b, 0x0b, + 0x1a, 0xe8, 0x43, 0x81, 0xfe, 0x84, 0xa2, 0x3f, 0xa1, 0x7f, 0xa1, 0x8f, 0x7d, 0x6a, 0x91, 0xc7, + 0xa2, 0x40, 0x9f, 0x5b, 0xf8, 0x97, 0x14, 0x33, 0xb3, 0x37, 0x2e, 0x97, 0x92, 0x03, 0xca, 0xf2, + 0x43, 0x5f, 0xa4, 0x9d, 0x33, 0xe7, 0x36, 0x67, 0xce, 0x99, 0xf3, 0xcd, 0x10, 0x1e, 0x7a, 0x84, + 0xb9, 0x3e, 0xf1, 0x46, 0xc4, 0xeb, 0x88, 0x4f, 0x1a, 0xb8, 0xde, 0x38, 0xf3, 0xd9, 0x66,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xf2, 0xdf, 0x57, 0x3b, 0xca, + 0xaf, 0x1e, 0xdf, 0xf0, 0x73, 0x56, 0xe6, 0x17, 0x32, 0xcc, 0xa8, 0x61, 0x51, 0xe2, 0x04, 0x57, + 0x55, 0xf1, 0xe3, 0xd5, 0xe3, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x17, 0x3f, 0x57, 0x13, 0x40, + 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3204,6 +3214,32 @@ func (m *RepoServerAppDetailsQuery) MarshalToSizedBuffer(dAtA []byte) (int, erro i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.RefSources) > 0 { + for k := range m.RefSources { + v := m.RefSources[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRepository(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintRepository(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintRepository(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a + } + } if m.HelmOptions != nil { { size, err := m.HelmOptions.MarshalToSizedBuffer(dAtA[:i]) @@ -4332,6 +4368,19 @@ func (m *RepoServerAppDetailsQuery) Size() (n int) { l = m.HelmOptions.Size() n += 1 + l + sovRepository(uint64(l)) } + if len(m.RefSources) > 0 { + for k, v := range m.RefSources { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovRepository(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovRepository(uint64(len(k))) + l + n += mapEntrySize + 1 + sovRepository(uint64(mapEntrySize)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -7493,6 +7542,135 @@ func (m *RepoServerAppDetailsQuery) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RefSources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRepository + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRepository + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RefSources == nil { + m.RefSources = make(map[string]*v1alpha1.RefTargeRevisionMapping) + } + var mapkey string + var mapvalue *v1alpha1.RefTargeRevisionMapping + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthRepository + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthRepository + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRepository + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthRepository + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthRepository + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &v1alpha1.RefTargeRevisionMapping{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipRepository(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRepository + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.RefSources[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRepository(dAtA[iNdEx:]) diff --git a/reposerver/cache/cache.go b/reposerver/cache/cache.go index 417df72280284..9246e5f38653e 100644 --- a/reposerver/cache/cache.go +++ b/reposerver/cache/cache.go @@ -62,17 +62,23 @@ func AddCacheFlagsToCmd(cmd *cobra.Command, opts ...func(client *redis.Client)) } } -func appSourceKey(appSrc *appv1.ApplicationSource) uint32 { - return hash.FNVa(appSourceKeyJSON(appSrc)) +func appSourceKey(appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping) uint32 { + return hash.FNVa(appSourceKeyJSON(appSrc, srcRefs)) } -func appSourceKeyJSON(appSrc *appv1.ApplicationSource) string { +func appSourceKeyJSON(appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping) string { appSrc = appSrc.DeepCopy() if !appSrc.IsHelm() { appSrc.RepoURL = "" // superseded by commitSHA appSrc.TargetRevision = "" // superseded by commitSHA } - appSrcStr, _ := json.Marshal(appSrc) + appSrcStr, _ := json.Marshal(struct { + appSrc *appv1.ApplicationSource + srcRefs map[string]*appv1.RefTargeRevisionMapping + }{ + appSrc: appSrc, + srcRefs: srcRefs, + }) return string(appSrcStr) } @@ -149,9 +155,9 @@ func (c *Cache) GetGitReferences(repo string, references *[]*plumbing.Reference) return nil } -func manifestCacheKey(revision string, appSrc *appv1.ApplicationSource, namespace string, trackingMethod string, appLabelKey string, appName string, info ClusterRuntimeInfo) string { +func manifestCacheKey(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, namespace string, trackingMethod string, appLabelKey string, appName string, info ClusterRuntimeInfo) string { trackingKey := trackingKey(appLabelKey, trackingMethod) - return fmt.Sprintf("mfst|%s|%s|%s|%s|%d", trackingKey, appName, revision, namespace, appSourceKey(appSrc)+clusterRuntimeInfoKey(info)) + return fmt.Sprintf("mfst|%s|%s|%s|%s|%d", trackingKey, appName, revision, namespace, appSourceKey(appSrc, srcRefs)+clusterRuntimeInfoKey(info)) } func trackingKey(appLabelKey string, trackingMethod string) string { @@ -164,11 +170,11 @@ func trackingKey(appLabelKey string, trackingMethod string) string { // LogDebugManifestCacheKeyFields logs all the information included in a manifest cache key. It's intended to be run // before every manifest cache operation to help debug cache misses. -func LogDebugManifestCacheKeyFields(message string, reason string, revision string, appSrc *appv1.ApplicationSource, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string) { +func LogDebugManifestCacheKeyFields(message string, reason string, revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string) { if log.IsLevelEnabled(log.DebugLevel) { log.WithFields(log.Fields{ "revision": revision, - "appSrc": appSourceKeyJSON(appSrc), + "appSrc": appSourceKeyJSON(appSrc, srcRefs), "namespace": namespace, "trackingKey": trackingKey(appLabelKey, trackingMethod), "appName": appName, @@ -178,8 +184,8 @@ func LogDebugManifestCacheKeyFields(message string, reason string, revision stri } } -func (c *Cache) GetManifests(revision string, appSrc *appv1.ApplicationSource, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string, res *CachedManifestResponse) error { - err := c.cache.GetItem(manifestCacheKey(revision, appSrc, namespace, trackingMethod, appLabelKey, appName, clusterInfo), res) +func (c *Cache) GetManifests(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string, res *CachedManifestResponse) error { + err := c.cache.GetItem(manifestCacheKey(revision, appSrc, srcRefs, namespace, trackingMethod, appLabelKey, appName, clusterInfo), res) if err != nil { return err @@ -194,9 +200,9 @@ func (c *Cache) GetManifests(revision string, appSrc *appv1.ApplicationSource, c if hash != res.CacheEntryHash || res.ManifestResponse == nil && res.MostRecentError == "" { log.Warnf("Manifest hash did not match expected value or cached manifests response is empty, treating as a cache miss: %s", appName) - LogDebugManifestCacheKeyFields("deleting manifests cache", "manifest hash did not match or cached response is empty", revision, appSrc, clusterInfo, namespace, trackingMethod, appLabelKey, appName) + LogDebugManifestCacheKeyFields("deleting manifests cache", "manifest hash did not match or cached response is empty", revision, appSrc, srcRefs, clusterInfo, namespace, trackingMethod, appLabelKey, appName) - err = c.DeleteManifests(revision, appSrc, clusterInfo, namespace, trackingMethod, appLabelKey, appName) + err = c.DeleteManifests(revision, appSrc, srcRefs, clusterInfo, namespace, trackingMethod, appLabelKey, appName) if err != nil { return fmt.Errorf("Unable to delete manifest after hash mismatch, %v", err) } @@ -211,7 +217,7 @@ func (c *Cache) GetManifests(revision string, appSrc *appv1.ApplicationSource, c return nil } -func (c *Cache) SetManifests(revision string, appSrc *appv1.ApplicationSource, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string, res *CachedManifestResponse) error { +func (c *Cache) SetManifests(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, clusterInfo ClusterRuntimeInfo, namespace string, trackingMethod string, appLabelKey string, appName string, res *CachedManifestResponse) error { // Generate and apply the cache entry hash, before writing if res != nil { res = res.shallowCopy() @@ -222,26 +228,26 @@ func (c *Cache) SetManifests(revision string, appSrc *appv1.ApplicationSource, c res.CacheEntryHash = hash } - return c.cache.SetItem(manifestCacheKey(revision, appSrc, namespace, trackingMethod, appLabelKey, appName, clusterInfo), res, c.repoCacheExpiration, res == nil) + return c.cache.SetItem(manifestCacheKey(revision, appSrc, srcRefs, namespace, trackingMethod, appLabelKey, appName, clusterInfo), res, c.repoCacheExpiration, res == nil) } -func (c *Cache) DeleteManifests(revision string, appSrc *appv1.ApplicationSource, clusterInfo ClusterRuntimeInfo, namespace, trackingMethod, appLabelKey, appName string) error { - return c.cache.SetItem(manifestCacheKey(revision, appSrc, namespace, trackingMethod, appLabelKey, appName, clusterInfo), "", c.repoCacheExpiration, true) +func (c *Cache) DeleteManifests(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, clusterInfo ClusterRuntimeInfo, namespace, trackingMethod, appLabelKey, appName string) error { + return c.cache.SetItem(manifestCacheKey(revision, appSrc, srcRefs, namespace, trackingMethod, appLabelKey, appName, clusterInfo), "", c.repoCacheExpiration, true) } -func appDetailsCacheKey(revision string, appSrc *appv1.ApplicationSource, trackingMethod appv1.TrackingMethod) string { +func appDetailsCacheKey(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, trackingMethod appv1.TrackingMethod) string { if trackingMethod == "" { trackingMethod = argo.TrackingMethodLabel } - return fmt.Sprintf("appdetails|%s|%d|%s", revision, appSourceKey(appSrc), trackingMethod) + return fmt.Sprintf("appdetails|%s|%d|%s", revision, appSourceKey(appSrc, srcRefs), trackingMethod) } -func (c *Cache) GetAppDetails(revision string, appSrc *appv1.ApplicationSource, res *apiclient.RepoAppDetailsResponse, trackingMethod appv1.TrackingMethod) error { - return c.cache.GetItem(appDetailsCacheKey(revision, appSrc, trackingMethod), res) +func (c *Cache) GetAppDetails(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, res *apiclient.RepoAppDetailsResponse, trackingMethod appv1.TrackingMethod) error { + return c.cache.GetItem(appDetailsCacheKey(revision, appSrc, srcRefs, trackingMethod), res) } -func (c *Cache) SetAppDetails(revision string, appSrc *appv1.ApplicationSource, res *apiclient.RepoAppDetailsResponse, trackingMethod appv1.TrackingMethod) error { - return c.cache.SetItem(appDetailsCacheKey(revision, appSrc, trackingMethod), res, c.repoCacheExpiration, res == nil) +func (c *Cache) SetAppDetails(revision string, appSrc *appv1.ApplicationSource, srcRefs map[string]*appv1.RefTargeRevisionMapping, res *apiclient.RepoAppDetailsResponse, trackingMethod appv1.TrackingMethod) error { + return c.cache.SetItem(appDetailsCacheKey(revision, appSrc, srcRefs, trackingMethod), res, c.repoCacheExpiration, res == nil) } func revisionMetadataKey(repoURL, revision string) string { diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 89b99ede2ad00..5fc378b2a4620 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -414,9 +414,8 @@ func (s *Service) runRepoOperation( func (s *Service) GenerateManifest(ctx context.Context, q *apiclient.ManifestRequest) (*apiclient.ManifestResponse, error) { var res *apiclient.ManifestResponse var err error - cacheFn := func(cacheKey string, firstInvocation bool) (bool, error) { - ok, resp, err := s.getManifestCacheEntry(cacheKey, q, q.ApplicationSource, firstInvocation) + ok, resp, err := s.getManifestCacheEntry(cacheKey, q, firstInvocation) res = resp return ok, err } @@ -661,12 +660,12 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, if err != nil { // If manifest generation error caching is enabled if s.initConstants.PauseGenerationAfterFailedGenerationAttempts > 0 { - cache.LogDebugManifestCacheKeyFields("getting manifests cache", "GenerateManifests error", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("getting manifests cache", "GenerateManifests error", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // Retrieve a new copy (if available) of the cached response: this ensures we are updating the latest copy of the cache, // rather than a copy of the cache that occurred before (a potentially lengthy) manifest generation. innerRes := &cache.CachedManifestResponse{} - cacheErr := s.cache.GetManifests(cacheKey, appSourceCopy, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, innerRes) + cacheErr := s.cache.GetManifests(cacheKey, appSourceCopy, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, innerRes) if cacheErr != nil && cacheErr != reposervercache.ErrCacheMiss { log.Warnf("manifest cache set error %s: %v", appSourceCopy.String(), cacheErr) ch.errCh <- cacheErr @@ -679,12 +678,12 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, innerRes.FirstFailureTimestamp = s.now().Unix() } - cache.LogDebugManifestCacheKeyFields("setting manifests cache", "GenerateManifests error", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("setting manifests cache", "GenerateManifests error", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // Update the cache to include failure information innerRes.NumberOfConsecutiveFailures++ innerRes.MostRecentError = err.Error() - cacheErr = s.cache.SetManifests(cacheKey, appSourceCopy, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, innerRes) + cacheErr = s.cache.SetManifests(cacheKey, appSourceCopy, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, innerRes) if cacheErr != nil { log.Warnf("manifest cache set error %s: %v", appSourceCopy.String(), cacheErr) ch.errCh <- cacheErr @@ -696,7 +695,7 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, return } - cache.LogDebugManifestCacheKeyFields("setting manifests cache", "fresh GenerateManifests response", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("setting manifests cache", "fresh GenerateManifests response", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // Otherwise, no error occurred, so ensure the manifest generation error data in the cache entry is reset before we cache the value manifestGenCacheEntry := cache.CachedManifestResponse{ @@ -708,7 +707,7 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, } manifestGenResult.Revision = commitSHA manifestGenResult.VerifyResult = opContext.verificationResult - err = s.cache.SetManifests(cacheKey, appSourceCopy, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &manifestGenCacheEntry) + err = s.cache.SetManifests(cacheKey, appSourceCopy, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &manifestGenCacheEntry) if err != nil { log.Warnf("manifest cache set error %s/%s: %v", appSourceCopy.String(), cacheKey, err) } @@ -721,11 +720,11 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA, // - If the cache is not empty, but the cache value is an error AND that generation error has expired // and returns true otherwise. // If true is returned, either the second or third parameter (but not both) will contain a value from the cache (a ManifestResponse, or error, respectively) -func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRequest, source *v1alpha1.ApplicationSource, firstInvocation bool) (bool, *apiclient.ManifestResponse, error) { - cache.LogDebugManifestCacheKeyFields("getting manifests cache", "GenerateManifest API call", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) +func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRequest, firstInvocation bool) (bool, *apiclient.ManifestResponse, error) { + cache.LogDebugManifestCacheKeyFields("getting manifests cache", "GenerateManifest API call", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) res := cache.CachedManifestResponse{} - err := s.cache.GetManifests(cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &res) + err := s.cache.GetManifests(cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &res) if err == nil { // The cache contains an existing value @@ -743,10 +742,10 @@ func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRe // After X minutes, reset the cache and retry the operation (e.g. perhaps the error is ephemeral and has passed) if elapsedTimeInMinutes >= s.initConstants.PauseGenerationOnFailureForMinutes { - cache.LogDebugManifestCacheKeyFields("deleting manifests cache", "manifest hash did not match or cached response is empty", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("deleting manifests cache", "manifest hash did not match or cached response is empty", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // We can now try again, so reset the cache state and run the operation below - err = s.cache.DeleteManifests(cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + err = s.cache.DeleteManifests(cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) if err != nil { log.Warnf("manifest cache set error %s/%s: %v", q.ApplicationSource.String(), cacheKey, err) } @@ -759,10 +758,10 @@ func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRe if s.initConstants.PauseGenerationOnFailureForRequests > 0 && res.NumberOfCachedResponsesReturned > 0 { if res.NumberOfCachedResponsesReturned >= s.initConstants.PauseGenerationOnFailureForRequests { - cache.LogDebugManifestCacheKeyFields("deleting manifests cache", "reset after paused generation count", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("deleting manifests cache", "reset after paused generation count", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // We can now try again, so reset the error cache state and run the operation below - err = s.cache.DeleteManifests(cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + err = s.cache.DeleteManifests(cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) if err != nil { log.Warnf("manifest cache set error %s/%s: %v", q.ApplicationSource.String(), cacheKey, err) } @@ -777,12 +776,12 @@ func (s *Service) getManifestCacheEntry(cacheKey string, q *apiclient.ManifestRe cachedErrorResponse := fmt.Errorf(cachedManifestGenerationPrefix+": %s", res.MostRecentError) if firstInvocation { - cache.LogDebugManifestCacheKeyFields("setting manifests cache", "update error count", cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) + cache.LogDebugManifestCacheKeyFields("setting manifests cache", "update error count", cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName) // Increment the number of returned cached responses and push that new value to the cache // (if we have not already done so previously in this function) res.NumberOfCachedResponsesReturned++ - err = s.cache.SetManifests(cacheKey, q.ApplicationSource, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &res) + err = s.cache.SetManifests(cacheKey, q.ApplicationSource, q.RefSources, q, q.Namespace, q.TrackingMethod, q.AppLabelKey, q.AppName, &res) if err != nil { log.Warnf("manifest cache set error %s/%s: %v", q.ApplicationSource.String(), cacheKey, err) } @@ -1822,7 +1821,7 @@ func (s *Service) GetAppDetails(ctx context.Context, q *apiclient.RepoServerAppD return fmt.Errorf("failed to populate plugin app details: %w", err) } } - _ = s.cache.SetAppDetails(revision, q.Source, res, v1alpha1.TrackingMethod(q.TrackingMethod)) + _ = s.cache.SetAppDetails(revision, q.Source, q.RefSources, res, v1alpha1.TrackingMethod(q.TrackingMethod)) return nil } @@ -1834,7 +1833,7 @@ func (s *Service) GetAppDetails(ctx context.Context, q *apiclient.RepoServerAppD func (s *Service) createGetAppDetailsCacheHandler(res *apiclient.RepoAppDetailsResponse, q *apiclient.RepoServerAppDetailsQuery) func(revision string, _ bool) (bool, error) { return func(revision string, _ bool) (bool, error) { - err := s.cache.GetAppDetails(revision, q.Source, res, v1alpha1.TrackingMethod(q.TrackingMethod)) + err := s.cache.GetAppDetails(revision, q.Source, q.RefSources, res, v1alpha1.TrackingMethod(q.TrackingMethod)) if err == nil { log.Infof("app details cache hit: %s/%s", revision, q.Source.Path) return true, nil diff --git a/reposerver/repository/repository.proto b/reposerver/repository/repository.proto index 24b16f204baf0..3c0ac598f4c32 100644 --- a/reposerver/repository/repository.proto +++ b/reposerver/repository/repository.proto @@ -121,6 +121,7 @@ message RepoServerAppDetailsQuery { string trackingMethod = 8; map enabledSourceTypes = 9; github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.HelmOptions helmOptions = 10; + map refSources = 11; } // RepoAppDetailsResponse application details diff --git a/util/argo/argo.go b/util/argo/argo.go index fd574b67f1349..302fda3f30bf3 100644 --- a/util/argo/argo.go +++ b/util/argo/argo.go @@ -312,6 +312,10 @@ func validateRepo(ctx context.Context, } } + refSources, err := GetRefSources(ctx, app.Spec, db) + if err != nil { + return nil, fmt.Errorf("error getting ref sources: %w", err) + } conditions = append(conditions, verifyGenerateManifests( ctx, db, @@ -327,11 +331,34 @@ func validateRepo(ctx context.Context, permittedHelmCredentials, enabledSourceTypes, settingsMgr, - app.Spec.HasMultipleSources())...) + app.Spec.HasMultipleSources(), + refSources)...) return conditions, nil } +func GetRefSources(ctx context.Context, spec argoappv1.ApplicationSpec, db db.ArgoDB) (map[string]*argoappv1.RefTargeRevisionMapping, error) { + refSources := make(map[string]*argoappv1.RefTargeRevisionMapping) + if spec.HasMultipleSources() { + // Get Repositories for all sources before generating Manifests + for _, source := range spec.Sources { + if source.Ref != "" { + repo, err := db.GetRepository(ctx, source.RepoURL) + if err != nil { + return nil, fmt.Errorf("failed to get repository %s: %v", source.RepoURL, err) + } + refKey := "$" + source.Ref + refSources[refKey] = &argoappv1.RefTargeRevisionMapping{ + Repo: *repo, + TargetRevision: source.TargetRevision, + Chart: source.Chart, + } + } + } + } + return refSources, nil +} + // ValidateDestination sets the 'Server' value of the ApplicationDestination, if it is not set. // NOTE: this function WILL write to the object pointed to by the 'dest' parameter. // @@ -571,6 +598,7 @@ func verifyGenerateManifests( enableGenerateManifests map[string]bool, settingsMgr *settings.SettingsManager, hasMultipleSources bool, + refSources map[string]*argoappv1.RefTargeRevisionMapping, ) []argoappv1.ApplicationCondition { var conditions []argoappv1.ApplicationCondition if dest.Server == "" { @@ -628,10 +656,10 @@ func verifyGenerateManifests( EnabledSourceTypes: enableGenerateManifests, NoRevisionCache: true, HasMultipleSources: hasMultipleSources, + RefSources: refSources, } req.Repo.CopyCredentialsFromRepo(repoRes) req.Repo.CopySettingsFrom(repoRes) - req.RefSources = GetRefSources(sources, *req.Repo, hasMultipleSources) // Only check whether we can access the application's path, // and not whether it actually contains any manifests. @@ -727,24 +755,6 @@ func NormalizeSource(source *argoappv1.ApplicationSource) *argoappv1.Application return source } -func GetRefSources(sources []argoappv1.ApplicationSource, repo argoappv1.Repository, hasMultipleSources bool) map[string]*argoappv1.RefTargeRevisionMapping { - refSources := make(map[string]*argoappv1.RefTargeRevisionMapping) - if hasMultipleSources { - // Get Repositories for all sources before generating Manifests - for _, source := range sources { - if source.Ref != "" { - refKey := "$" + source.Ref - refSources[refKey] = &argoappv1.RefTargeRevisionMapping{ - Repo: repo, - TargetRevision: source.TargetRevision, - Chart: source.Chart, - } - } - } - } - return refSources -} - func GetPermittedReposCredentials(proj *argoappv1.AppProject, repoCreds []*argoappv1.RepoCreds) ([]*argoappv1.RepoCreds, error) { var permittedRepoCreds []*argoappv1.RepoCreds for _, v := range repoCreds { diff --git a/util/webhook/webhook.go b/util/webhook/webhook.go index aace58038d7c4..c9d510fcc27e5 100644 --- a/util/webhook/webhook.go +++ b/util/webhook/webhook.go @@ -285,17 +285,21 @@ func (a *ArgoCDWebhookHandler) storePreviouslyCachedManifests(app *v1alpha1.Appl return fmt.Errorf("error getting cluster info: %w", err) } + refSources, err := argo.GetRefSources(context.Background(), app.Spec, a.db) + if err != nil { + return fmt.Errorf("error getting ref sources: %w", err) + } source := app.Spec.GetSource() - cache.LogDebugManifestCacheKeyFields("getting manifests cache", "webhook app revision changed", change.shaBefore, &source, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name) + cache.LogDebugManifestCacheKeyFields("getting manifests cache", "webhook app revision changed", change.shaBefore, &source, refSources, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name) var cachedManifests cache.CachedManifestResponse - if err := a.repoCache.GetManifests(change.shaBefore, &source, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name, &cachedManifests); err != nil { + if err := a.repoCache.GetManifests(change.shaBefore, &source, refSources, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name, &cachedManifests); err != nil { return err } - cache.LogDebugManifestCacheKeyFields("setting manifests cache", "webhook app revision changed", change.shaAfter, &source, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name) + cache.LogDebugManifestCacheKeyFields("setting manifests cache", "webhook app revision changed", change.shaAfter, &source, refSources, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name) - if err = a.repoCache.SetManifests(change.shaAfter, &source, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name, &cachedManifests); err != nil { + if err = a.repoCache.SetManifests(change.shaAfter, &source, refSources, &clusterInfo, app.Spec.Destination.Namespace, trackingMethod, appInstanceLabelKey, app.Name, &cachedManifests); err != nil { return err } return nil