diff --git a/controller/controller.go b/controller/controller.go index 279407aeac506..e48881990a3eb 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -114,16 +114,15 @@ func (ctrl *ApplicationController) processNextItem() bool { updatedApp := app.DeepCopy() status, err := ctrl.tryRefreshAppStatus(updatedApp) if err != nil { - status = &appv1.ApplicationStatus{ - ComparisonResult: appv1.ComparisonResult{ - Status: appv1.ComparisonStatusError, - Error: fmt.Sprintf("Failed to get application status for application '%s': %v", app.Name, err), - ComparedTo: app.Spec.Source, - ComparedAt: metav1.Time{Time: time.Now().UTC()}, - }, + updatedApp.Status.ComparisonResult = appv1.ComparisonResult{ + Status: appv1.ComparisonStatusError, + Error: fmt.Sprintf("Failed to get application status for application '%s': %v", app.Name, err), + ComparedTo: app.Spec.Source, + ComparedAt: metav1.Time{Time: time.Now().UTC()}, } + } else { + updatedApp.Status = *status } - updatedApp.Status = *status ctrl.persistApp(updatedApp) } diff --git a/pkg/apis/application/v1alpha1/generated.pb.go b/pkg/apis/application/v1alpha1/generated.pb.go index cdb14120f840f..96657caa7eb75 100644 --- a/pkg/apis/application/v1alpha1/generated.pb.go +++ b/pkg/apis/application/v1alpha1/generated.pb.go @@ -19,6 +19,7 @@ ClusterConfig ClusterList ComparisonResult + DeploymentInfo Repository RepositoryList ResourceState @@ -32,6 +33,8 @@ import math "math" import k8s_io_apimachinery_pkg_watch "k8s.io/apimachinery/pkg/watch" +import sortkeys "github.com/gogo/protobuf/sortkeys" + import strings "strings" import reflect "reflect" @@ -92,21 +95,25 @@ func (m *ComparisonResult) Reset() { *m = ComparisonResult{} func (*ComparisonResult) ProtoMessage() {} func (*ComparisonResult) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{10} } +func (m *DeploymentInfo) Reset() { *m = DeploymentInfo{} } +func (*DeploymentInfo) ProtoMessage() {} +func (*DeploymentInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } + func (m *Repository) Reset() { *m = Repository{} } func (*Repository) ProtoMessage() {} -func (*Repository) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } +func (*Repository) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } func (m *RepositoryList) Reset() { *m = RepositoryList{} } func (*RepositoryList) ProtoMessage() {} -func (*RepositoryList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } +func (*RepositoryList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } func (m *ResourceState) Reset() { *m = ResourceState{} } func (*ResourceState) ProtoMessage() {} -func (*ResourceState) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } +func (*ResourceState) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } func (m *TLSClientConfig) Reset() { *m = TLSClientConfig{} } func (*TLSClientConfig) ProtoMessage() {} -func (*TLSClientConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{14} } +func (*TLSClientConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{15} } func init() { proto.RegisterType((*Application)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application") @@ -120,6 +127,7 @@ func init() { proto.RegisterType((*ClusterConfig)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ClusterConfig") proto.RegisterType((*ClusterList)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ClusterList") proto.RegisterType((*ComparisonResult)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ComparisonResult") + proto.RegisterType((*DeploymentInfo)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.DeploymentInfo") proto.RegisterType((*Repository)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository") proto.RegisterType((*RepositoryList)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.RepositoryList") proto.RegisterType((*ResourceState)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceState") @@ -324,6 +332,14 @@ func (m *ApplicationStatus) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n7 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.RecentDeployment.Size())) + n8, err := m.RecentDeployment.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 return i, nil } @@ -349,11 +365,11 @@ func (m *ApplicationWatchEvent) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Application.Size())) - n8, err := m.Application.MarshalTo(dAtA[i:]) + n9, err := m.Application.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n9 return i, nil } @@ -383,11 +399,11 @@ func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Config.Size())) - n9, err := m.Config.MarshalTo(dAtA[i:]) + n10, err := m.Config.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n10 return i, nil } @@ -421,11 +437,11 @@ func (m *ClusterConfig) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.TLSClientConfig.Size())) - n10, err := m.TLSClientConfig.MarshalTo(dAtA[i:]) + n11, err := m.TLSClientConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n11 return i, nil } @@ -447,11 +463,11 @@ func (m *ClusterList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n11, err := m.ListMeta.MarshalTo(dAtA[i:]) + n12, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n11 + i += n12 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -485,19 +501,19 @@ func (m *ComparisonResult) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ComparedAt.Size())) - n12, err := m.ComparedAt.MarshalTo(dAtA[i:]) + n13, err := m.ComparedAt.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n12 + i += n13 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ComparedTo.Size())) - n13, err := m.ComparedTo.MarshalTo(dAtA[i:]) + n14, err := m.ComparedTo.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n14 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Server))) @@ -529,6 +545,46 @@ func (m *ComparisonResult) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *DeploymentInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeploymentInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Params) > 0 { + keysForParams := make([]string, 0, len(m.Params)) + for k := range m.Params { + keysForParams = append(keysForParams, string(k)) + } + sortkeys.Strings(keysForParams) + for _, k := range keysForParams { + dAtA[i] = 0xa + i++ + v := m.Params[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + return i, nil +} + func (m *Repository) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -581,11 +637,11 @@ func (m *RepositoryList) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n14, err := m.ListMeta.MarshalTo(dAtA[i:]) + n15, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n15 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 @@ -755,6 +811,8 @@ func (m *ApplicationStatus) Size() (n int) { _ = l l = m.ComparisonResult.Size() n += 1 + l + sovGenerated(uint64(l)) + l = m.RecentDeployment.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -832,6 +890,20 @@ func (m *ComparisonResult) Size() (n int) { return n } +func (m *DeploymentInfo) Size() (n int) { + var l int + _ = l + if len(m.Params) > 0 { + for k, v := range m.Params { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *Repository) Size() (n int) { var l int _ = l @@ -970,6 +1042,7 @@ func (this *ApplicationStatus) String() string { } s := strings.Join([]string{`&ApplicationStatus{`, `ComparisonResult:` + strings.Replace(strings.Replace(this.ComparisonResult.String(), "ComparisonResult", "ComparisonResult", 1), `&`, ``, 1) + `,`, + `RecentDeployment:` + strings.Replace(strings.Replace(this.RecentDeployment.String(), "DeploymentInfo", "DeploymentInfo", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1037,6 +1110,26 @@ func (this *ComparisonResult) String() string { }, "") return s } +func (this *DeploymentInfo) String() string { + if this == nil { + return "nil" + } + keysForParams := make([]string, 0, len(this.Params)) + for k := range this.Params { + keysForParams = append(keysForParams, k) + } + sortkeys.Strings(keysForParams) + mapStringForParams := "map[string]string{" + for _, k := range keysForParams { + mapStringForParams += fmt.Sprintf("%v: %v,", k, this.Params[k]) + } + mapStringForParams += "}" + s := strings.Join([]string{`&DeploymentInfo{`, + `Params:` + mapStringForParams + `,`, + `}`, + }, "") + return s +} func (this *Repository) String() string { if this == nil { return "nil" @@ -1792,6 +1885,36 @@ func (m *ApplicationStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentDeployment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RecentDeployment.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2595,6 +2718,174 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { } return nil } +func (m *DeploymentInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeploymentInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeploymentInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Params[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Repository) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3311,84 +3602,91 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1257 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x5d, 0x6f, 0x1b, 0x45, - 0x17, 0xce, 0x3a, 0x8e, 0x63, 0x8f, 0x9b, 0x8f, 0xce, 0xab, 0xf6, 0xb5, 0x72, 0xe1, 0x44, 0x8b, - 0x80, 0x80, 0xe8, 0x9a, 0x84, 0x6f, 0x90, 0x90, 0xb2, 0x6e, 0x50, 0x43, 0x42, 0x09, 0x63, 0x57, - 0x48, 0x08, 0x01, 0x93, 0xf5, 0xd4, 0x9e, 0xd8, 0xde, 0x5d, 0x66, 0xc6, 0xae, 0x7c, 0x81, 0xd4, - 0x0b, 0x6e, 0x41, 0xf0, 0x2b, 0x90, 0xb8, 0x84, 0xdf, 0x80, 0xc8, 0x65, 0x25, 0x90, 0xa8, 0x10, - 0x8a, 0x88, 0x7b, 0xc3, 0x6f, 0xe8, 0x15, 0x9a, 0xd9, 0xd9, 0xdd, 0xb1, 0xad, 0x28, 0x29, 0xb6, - 0x7a, 0xb7, 0x73, 0xce, 0x33, 0xcf, 0x39, 0x7b, 0xbe, 0xe6, 0x80, 0xbd, 0x26, 0x15, 0xad, 0xde, - 0x91, 0xe3, 0x05, 0xdd, 0x0a, 0x66, 0xcd, 0x20, 0x64, 0xc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10, - 0x81, 0x5d, 0x78, 0x72, 0xba, 0x3e, 0x37, 0x3c, 0x5d, 0x07, 0xa9, 0x0c, 0x25, 0xac, 0xb0, 0x03, - 0xb2, 0x3c, 0x24, 0x5e, 0x29, 0xa3, 0xd8, 0xdf, 0x77, 0xfe, 0x73, 0xfa, 0x1c, 0xc3, 0xef, 0x5a, - 0x48, 0x3c, 0xf7, 0x8a, 0xb6, 0x9b, 0x95, 0x27, 0xa4, 0xac, 0x40, 0x01, 0x72, 0x5c, 0x60, 0xd1, - 0xe3, 0xa5, 0x79, 0x65, 0xef, 0x60, 0x46, 0xf6, 0x14, 0xa7, 0xbb, 0xac, 0x2d, 0xe6, 0xa2, 0x33, - 0xd2, 0xb6, 0xec, 0x2f, 0xc1, 0x75, 0x03, 0x7c, 0x93, 0x70, 0x41, 0xfd, 0x28, 0xbe, 0xcf, 0x81, - 0x1c, 0x27, 0xac, 0x4f, 0x98, 0x8a, 0x6e, 0xc1, 0x60, 0x50, 0x52, 0xa4, 0xb5, 0xb0, 0x02, 0x0a, - 0x3e, 0xee, 0x12, 0x1e, 0x62, 0x8f, 0xa8, 0x50, 0x15, 0xdc, 0xab, 0x1a, 0x5a, 0xb8, 0x1d, 0x2b, - 0x50, 0x8a, 0xb1, 0xff, 0xb2, 0xc0, 0x8a, 0x61, 0xf3, 0x80, 0x72, 0x01, 0x3f, 0x9d, 0x48, 0xa6, - 0x73, 0xb9, 0x64, 0xca, 0xdb, 0x2a, 0x95, 0xab, 0xda, 0x66, 0x3e, 0x96, 0x18, 0x89, 0x6c, 0x83, - 0x05, 0x2a, 0x48, 0x97, 0x97, 0x32, 0x1b, 0xf3, 0x9b, 0xc5, 0xed, 0xf7, 0x66, 0x13, 0x59, 0x77, - 0x49, 0x9b, 0x5c, 0xd8, 0x93, 0xe4, 0x28, 0xb2, 0x61, 0xff, 0x61, 0x81, 0xab, 0x66, 0xfc, 0x83, - 0x1e, 0xf3, 0x08, 0x7c, 0x01, 0x2c, 0x32, 0x12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fd, 0x61, 0xd9, 0x3a, 0x19, 0x96, 0xad, 0x07, 0xc3, 0xb2, 0xf5, 0x70, 0x58, 0xb6, 0xfe, - 0x1e, 0x96, 0xad, 0xef, 0x1e, 0x95, 0xe7, 0x3e, 0xc9, 0xc7, 0x19, 0xff, 0x37, 0x00, 0x00, 0xff, - 0xff, 0xc8, 0x01, 0xc1, 0x64, 0x25, 0x10, 0x00, 0x00, + // 1363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0x8e, 0x93, 0x3c, 0x37, 0x7f, 0x3a, 0xd0, 0x62, 0xe5, 0xe0, 0x46, 0x8b, 0x80, + 0x82, 0xe8, 0x9a, 0x96, 0x7f, 0x6d, 0x91, 0x90, 0xba, 0x69, 0x50, 0x43, 0x42, 0x09, 0x63, 0x57, + 0x48, 0x08, 0x01, 0x93, 0xf5, 0xd4, 0xde, 0xda, 0xde, 0x5d, 0x66, 0xc6, 0xae, 0x7c, 0xa8, 0xd4, + 0x03, 0x37, 0x04, 0x82, 0xaf, 0xc1, 0x11, 0xc4, 0x47, 0x40, 0x54, 0x9c, 0x2a, 0x81, 0x44, 0x85, + 0x50, 0x45, 0xdd, 0x0b, 0x9f, 0xa1, 0x27, 0x34, 0xb3, 0xb3, 0xbb, 0xb3, 0xb6, 0xa2, 0xa6, 0xd8, + 0xea, 0xcd, 0xf3, 0xde, 0x6f, 0x7e, 0xef, 0xed, 0x9b, 0x37, 0xbf, 0x37, 0x86, 0x9d, 0x96, 0x2f, + 0xda, 0xfd, 0x03, 0xc7, 0x0b, 0x7b, 0x35, 0xc2, 0x5a, 0x61, 0xc4, 0xc2, 0x1b, 0xea, 0xc7, 0x19, + 0xaf, 0x59, 0x8b, 0x3a, 0xad, 0x1a, 0x89, 0x7c, 0x5e, 0x23, 0x51, 0xd4, 0xf5, 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3b, 0xda, 0x8e, 0x53, 0x04, 0x3a, 0x07, 0x10, 0x4b, 0xd0, 0xd5, 0xac, 0xdf, 0x52, + 0x51, 0xab, 0xa7, 0x1e, 0x6c, 0xa0, 0xd0, 0x69, 0x58, 0xf2, 0x28, 0x13, 0x97, 0xe5, 0xa9, 0xcb, + 0x9c, 0x8f, 0xb9, 0xc7, 0x24, 0xfb, 0x96, 0xb6, 0xe1, 0xd4, 0x8b, 0x5e, 0x80, 0xc5, 0x0e, 0x1d, + 0x2a, 0x60, 0x51, 0x01, 0xcb, 0xf2, 0x9f, 0xcb, 0x6e, 0x6c, 0xc2, 0x89, 0x0f, 0xd9, 0x50, 0xf2, + 0x88, 0x42, 0x2d, 0x28, 0x14, 0xa8, 0xd7, 0xc4, 0x25, 0x05, 0xd2, 0x1e, 0xd7, 0xb9, 0xf3, 0xa0, + 0x3a, 0x77, 0xf7, 0x41, 0x75, 0xee, 0xde, 0x83, 0xea, 0xdc, 0xed, 0x51, 0xd5, 0xba, 0x33, 0xaa, + 0x5a, 0x77, 0x47, 0x55, 0xeb, 0xde, 0xa8, 0x6a, 0xfd, 0x33, 0xaa, 0x5a, 0xdf, 0x3d, 0xac, 0xce, + 0x7d, 0xb2, 0x94, 0x9c, 0xf8, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0x93, 0x8a, 0xc3, 0x80, + 0x11, 0x00, 0x00, } diff --git a/pkg/apis/application/v1alpha1/generated.proto b/pkg/apis/application/v1alpha1/generated.proto index db702c4d89474..1722ad706f4a9 100644 --- a/pkg/apis/application/v1alpha1/generated.proto +++ b/pkg/apis/application/v1alpha1/generated.proto @@ -71,6 +71,8 @@ message ApplicationSpec { // ApplicationStatus contains information about application status in target environment. message ApplicationStatus { optional ComparisonResult comparisonResult = 1; + + optional DeploymentInfo deploymentInfo = 2; } // ApplicationWatchEvent contains information about application change. @@ -138,6 +140,11 @@ message ComparisonResult { optional string error = 7; } +// DeploymentInfo contains information relevant to an application deployment +message DeploymentInfo { + map params = 1; +} + // Repository is a Git repository holding application configurations message Repository { optional string repo = 1; diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 20b7915a223ce..f1f564eba9389 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -11,6 +11,11 @@ import ( "k8s.io/client-go/rest" ) +// DeploymentInfo contains information relevant to an application deployment +type DeploymentInfo struct { + Params map[string]string `json:"params" protobuf:"bytes,1,name=params"` +} + // Application is a definition of Application resource. // +genclient // +genclient:noStatus @@ -86,6 +91,7 @@ const ( // ApplicationStatus contains information about application status in target environment. type ApplicationStatus struct { ComparisonResult ComparisonResult `json:"comparisonResult" protobuf:"bytes,1,opt,name=comparisonResult"` + RecentDeployment DeploymentInfo `json:"deploymentInfo" protobuf:"bytes,2,opt,name=deploymentInfo"` } // ComparisonResult is a comparison result of application spec and deployed application. diff --git a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go index df18f61e0ceea..3fc80b637ea18 100644 --- a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go @@ -131,6 +131,7 @@ func (in *ApplicationSpec) DeepCopy() *ApplicationSpec { func (in *ApplicationStatus) DeepCopyInto(out *ApplicationStatus) { *out = *in in.ComparisonResult.DeepCopyInto(&out.ComparisonResult) + in.RecentDeployment.DeepCopyInto(&out.RecentDeployment) return } @@ -242,6 +243,29 @@ func (in *ComparisonResult) DeepCopy() *ComparisonResult { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentInfo) DeepCopyInto(out *DeploymentInfo) { + *out = *in + if in.Params != nil { + in, out := &in.Params, &out.Params + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentInfo. +func (in *DeploymentInfo) DeepCopy() *DeploymentInfo { + if in == nil { + return nil + } + out := new(DeploymentInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Repository) DeepCopyInto(out *Repository) { *out = *in diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 95a9bbb97a94e..5e9d12f74df18 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -34,6 +34,7 @@ func NewService(namespace string, kubeClient kubernetes.Interface, gitClient git } } +// GenerateManifest generate a manifest for application in specified repo name and revision func (s *Service) GenerateManifest(c context.Context, q *ManifestRequest) (*ManifestResponse, error) { appRepoPath := path.Join(os.TempDir(), strings.Replace(q.Repo.Repo, "/", "_", -1)) s.repoLock.Lock(appRepoPath) @@ -77,3 +78,34 @@ func (s *Service) GenerateManifest(c context.Context, q *ManifestRequest) (*Mani Server: env.Destination.Server, }, nil } + +// GetEnvParams retrieves Ksonnet environment params in specified repo name and revision +func (s *Service) GetEnvParams(c context.Context, q *EnvParamsRequest) (*EnvParamsResponse, error) { + appRepoPath := path.Join(os.TempDir(), strings.Replace(q.Repo.Repo, "/", "_", -1)) + s.repoLock.Lock(appRepoPath) + defer s.repoLock.Unlock(appRepoPath) + + err := s.gitClient.CloneOrFetch(q.Repo.Repo, q.Repo.Username, q.Repo.Password, q.Repo.SSHPrivateKey, appRepoPath) + if err != nil { + return nil, err + } + + err = s.gitClient.Checkout(appRepoPath, q.Revision) + if err != nil { + return nil, err + } + appPath := path.Join(appRepoPath, q.Path) + ksApp, err := ksutil.NewKsonnetApp(appPath) + if err != nil { + return nil, err + } + + target, err := ksApp.ListEnvParams(q.Environment) + if err != nil { + return nil, err + } + + return &EnvParamsResponse{ + Params: target, + }, nil +} diff --git a/reposerver/repository/repository.pb.go b/reposerver/repository/repository.pb.go index 2a324828a64ad..5398b34a521df 100644 --- a/reposerver/repository/repository.pb.go +++ b/reposerver/repository/repository.pb.go @@ -10,6 +10,8 @@ It is generated from these files: It has these top-level messages: ManifestRequest ManifestResponse + EnvParamsRequest + EnvParamsResponse */ package repository @@ -110,9 +112,67 @@ func (m *ManifestResponse) GetServer() string { return "" } +type EnvParamsRequest struct { + Repo *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Repository `protobuf:"bytes,1,opt,name=repo" json:"repo,omitempty"` + Revision string `protobuf:"bytes,2,opt,name=revision" json:"revision,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path" json:"path,omitempty"` + Environment string `protobuf:"bytes,4,opt,name=environment" json:"environment,omitempty"` +} + +func (m *EnvParamsRequest) Reset() { *m = EnvParamsRequest{} } +func (m *EnvParamsRequest) String() string { return proto.CompactTextString(m) } +func (*EnvParamsRequest) ProtoMessage() {} +func (*EnvParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *EnvParamsRequest) GetRepo() *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Repository { + if m != nil { + return m.Repo + } + return nil +} + +func (m *EnvParamsRequest) GetRevision() string { + if m != nil { + return m.Revision + } + return "" +} + +func (m *EnvParamsRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *EnvParamsRequest) GetEnvironment() string { + if m != nil { + return m.Environment + } + return "" +} + +type EnvParamsResponse struct { + Params map[string]string `protobuf:"bytes,1,rep,name=params" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *EnvParamsResponse) Reset() { *m = EnvParamsResponse{} } +func (m *EnvParamsResponse) String() string { return proto.CompactTextString(m) } +func (*EnvParamsResponse) ProtoMessage() {} +func (*EnvParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *EnvParamsResponse) GetParams() map[string]string { + if m != nil { + return m.Params + } + return nil +} + func init() { proto.RegisterType((*ManifestRequest)(nil), "repository.ManifestRequest") proto.RegisterType((*ManifestResponse)(nil), "repository.ManifestResponse") + proto.RegisterType((*EnvParamsRequest)(nil), "repository.EnvParamsRequest") + proto.RegisterType((*EnvParamsResponse)(nil), "repository.EnvParamsResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -128,6 +188,8 @@ const _ = grpc.SupportPackageIsVersion4 type RepositoryServiceClient interface { // Generate manifest for application in specified repo name and revision GenerateManifest(ctx context.Context, in *ManifestRequest, opts ...grpc.CallOption) (*ManifestResponse, error) + // Retrieve Ksonnet environment params in specified repo name and revision + GetEnvParams(ctx context.Context, in *EnvParamsRequest, opts ...grpc.CallOption) (*EnvParamsResponse, error) } type repositoryServiceClient struct { @@ -147,11 +209,22 @@ func (c *repositoryServiceClient) GenerateManifest(ctx context.Context, in *Mani return out, nil } +func (c *repositoryServiceClient) GetEnvParams(ctx context.Context, in *EnvParamsRequest, opts ...grpc.CallOption) (*EnvParamsResponse, error) { + out := new(EnvParamsResponse) + err := grpc.Invoke(ctx, "/repository.RepositoryService/GetEnvParams", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for RepositoryService service type RepositoryServiceServer interface { // Generate manifest for application in specified repo name and revision GenerateManifest(context.Context, *ManifestRequest) (*ManifestResponse, error) + // Retrieve Ksonnet environment params in specified repo name and revision + GetEnvParams(context.Context, *EnvParamsRequest) (*EnvParamsResponse, error) } func RegisterRepositoryServiceServer(s *grpc.Server, srv RepositoryServiceServer) { @@ -176,6 +249,24 @@ func _RepositoryService_GenerateManifest_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } +func _RepositoryService_GetEnvParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnvParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryServiceServer).GetEnvParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/repository.RepositoryService/GetEnvParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryServiceServer).GetEnvParams(ctx, req.(*EnvParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _RepositoryService_serviceDesc = grpc.ServiceDesc{ ServiceName: "repository.RepositoryService", HandlerType: (*RepositoryServiceServer)(nil), @@ -184,6 +275,10 @@ var _RepositoryService_serviceDesc = grpc.ServiceDesc{ MethodName: "GenerateManifest", Handler: _RepositoryService_GenerateManifest_Handler, }, + { + MethodName: "GetEnvParams", + Handler: _RepositoryService_GetEnvParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "reposerver/repository/repository.proto", @@ -192,28 +287,35 @@ var _RepositoryService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("reposerver/repository/repository.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xb1, 0x6e, 0xdb, 0x30, - 0x10, 0xad, 0x6a, 0xc3, 0xa8, 0xe9, 0xa1, 0x2e, 0x51, 0x14, 0x82, 0xea, 0x41, 0xd0, 0x50, 0x78, - 0x29, 0x09, 0xdb, 0x4b, 0xe7, 0x02, 0x45, 0x91, 0x21, 0x08, 0xa0, 0x4c, 0xc9, 0x12, 0xd0, 0xd2, - 0x99, 0x66, 0x6c, 0xf1, 0x18, 0x92, 0x16, 0x90, 0x9f, 0xcb, 0xb7, 0x05, 0xa2, 0x65, 0x4b, 0x48, - 0x8c, 0x6c, 0x8f, 0xef, 0x91, 0xf7, 0x1e, 0xef, 0x8e, 0xfc, 0xb2, 0x60, 0xd0, 0x81, 0xad, 0xc1, - 0xf2, 0x00, 0x95, 0x47, 0xfb, 0xdc, 0x83, 0xcc, 0x58, 0xf4, 0x48, 0x49, 0xc7, 0x24, 0xdf, 0x25, - 0x4a, 0x0c, 0x34, 0x6f, 0xd0, 0xf1, 0x46, 0x32, 0x93, 0x88, 0x72, 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 0x15, 0x38, 0x23, 0x0a, 0x68, 0x43, 0x74, 0x04, 0xfd, 0x41, 0x46, 0xc7, 0x29, 0xb7, - 0x39, 0xda, 0xd3, 0xb2, 0x24, 0xdf, 0xba, 0xdf, 0xdc, 0x82, 0xad, 0x55, 0x01, 0xf4, 0x86, 0x4c, - 0xff, 0xb7, 0x0d, 0x3d, 0x85, 0xa0, 0x3f, 0x59, 0x6f, 0x27, 0xde, 0xb4, 0x36, 0x99, 0x5d, 0x16, - 0x8f, 0xb9, 0xb3, 0x4f, 0x7f, 0x57, 0xf7, 0x8b, 0x8f, 0x66, 0x7b, 0x71, 0x07, 0xd7, 0xa3, 0x30, - 0xca, 0xd5, 0x6b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x44, 0x27, 0xd1, 0xa3, 0x02, 0x00, 0x00, + // 472 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0x41, 0x8f, 0xd3, 0x3c, + 0x10, 0xdd, 0x6c, 0xfb, 0x55, 0x5f, 0xa7, 0x48, 0x74, 0xad, 0x15, 0x8a, 0x42, 0x91, 0xaa, 0x1c, + 0x50, 0x39, 0x60, 0xab, 0xdd, 0xcb, 0xc2, 0x0d, 0xa4, 0x6a, 0xc5, 0x61, 0x05, 0x0a, 0x27, 0xb8, + 0x20, 0x6f, 0x3a, 0x9b, 0x9a, 0x36, 0xb6, 0xb1, 0xdd, 0x48, 0xfd, 0x19, 0xfc, 0x16, 0xee, 0xf0, + 0xd7, 0x50, 0x1c, 0xb7, 0x89, 0xd8, 0x65, 0xef, 0xdc, 0xde, 0xbc, 0x71, 0xe6, 0xcd, 0x3c, 0x8f, + 0x03, 0xcf, 0x0d, 0x6a, 0x65, 0xd1, 0x54, 0x68, 0x98, 0x87, 0xc2, 0x29, 0xb3, 0xef, 0x40, 0xaa, + 0x8d, 0x72, 0x8a, 0x40, 0xcb, 0x24, 0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78, 0x89, 0x02, 0x49, 0x04, 0x00, 0x00, } diff --git a/reposerver/repository/repository.proto b/reposerver/repository/repository.proto index cb0c1f981f39f..5ef92859c3f38 100644 --- a/reposerver/repository/repository.proto +++ b/reposerver/repository/repository.proto @@ -23,10 +23,25 @@ message ManifestResponse { string server = 3; } +message EnvParamsRequest { + github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Repository repo = 1; + string revision = 2; + string path = 3; + string environment = 4; +} + +message EnvParamsResponse { + map params = 1; +} + // ManifestService service RepositoryService { // Generate manifest for application in specified repo name and revision rpc GenerateManifest(ManifestRequest) returns (ManifestResponse) { } + + // Retrieve Ksonnet environment params in specified repo name and revision + rpc GetEnvParams(EnvParamsRequest) returns (EnvParamsResponse) { + } } diff --git a/server/application/application.go b/server/application/application.go index 2b8b7910c402a..06928da6ecb00 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -140,6 +140,24 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*Ap revision = app.Spec.Source.TargetRevision } + // set fields in v1alpha/types.go + log.Infof("Retrieving deployment params for application %s", syncReq.Name) + deploymentInfo, err := repoClient.GetEnvParams(ctx, &repository.EnvParamsRequest{ + Repo: repo, + Environment: app.Spec.Source.Environment, + Path: app.Spec.Source.Path, + Revision: revision, + }) + if err != nil { + return nil, err + } + log.Infof("Received deployment params: %s", deploymentInfo.Params) + app.Status.RecentDeployment.Params = deploymentInfo.Params + + if err != nil { + return nil, err + } + manifestInfo, err := repoClient.GenerateManifest(ctx, &repository.ManifestRequest{ Repo: repo, Environment: app.Spec.Source.Environment, @@ -204,6 +222,13 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*Ap } syncRes.Resources = append(syncRes.Resources, &resDetails) } + + // Persist app deployment info + _, err = s.Update(ctx, app) + if err != nil { + return nil, err + } + syncRes.Message = "successfully synced" return &syncRes, nil } diff --git a/util/ksonnet/ksonnet.go b/util/ksonnet/ksonnet.go index 623d2ee4ae003..6b8ba58578410 100644 --- a/util/ksonnet/ksonnet.go +++ b/util/ksonnet/ksonnet.go @@ -4,6 +4,7 @@ import ( "fmt" "os/exec" "regexp" + "strconv" "strings" "github.com/ghodss/yaml" @@ -14,7 +15,8 @@ import ( ) var ( - diffSeparator = regexp.MustCompile("\\n---") + diffSeparator = regexp.MustCompile(`\n---`) + lineSeparator = regexp.MustCompile(`\n`) ) // KsonnetApp represents a ksonnet application directory and provides wrapper functionality around @@ -28,6 +30,7 @@ type KsonnetApp interface { // Show returns a list of unstructured objects that would be applied to an environment Show(environment string) ([]*unstructured.Unstructured, error) + ListEnvParams(environment string) (map[string]string, error) } type ksonnetApp struct { @@ -35,6 +38,7 @@ type ksonnetApp struct { app app.App } +// NewKsonnetApp tries to create a new wrapper to run commands on the `ks` command-line tool. func NewKsonnetApp(path string) (KsonnetApp, error) { ksApp := ksonnetApp{} mgr, err := metadata.Find(path) @@ -78,6 +82,7 @@ func (k *ksonnetApp) App() app.App { return k.app } +// Show generates a concatenated list of Kubernetes manifests in the given environment. func (k *ksonnetApp) Show(environment string) ([]*unstructured.Unstructured, error) { out, err := k.ksCmd("show", environment) if err != nil { @@ -99,3 +104,28 @@ func (k *ksonnetApp) Show(environment string) ([]*unstructured.Unstructured, err // TODO(jessesuen): we need to sort objects based on their dependency order of creation return objs, nil } + +// Show generates a concatenated list of Kubernetes manifests in the given environment. +func (k *ksonnetApp) ListEnvParams(environment string) (params map[string]string, err error) { + // count of rows to skip in command-line output + const skipRows = 2 + out, err := k.ksCmd("param", "list", "--env", environment) + if err != nil { + return + } + params = make(map[string]string) + rows := lineSeparator.Split(out, -1) + for _, row := range rows[skipRows:] { + if strings.TrimSpace(row) == "" { + continue + } + fields := strings.Fields(row) + param, rawValue := fields[1], fields[2] + value, err := strconv.Unquote(rawValue) + if err != nil { + value = rawValue + } + params[param] = value + } + return +} diff --git a/util/ksonnet/ksonnet_test.go b/util/ksonnet/ksonnet_test.go index 366b5570df211..f376a06558180 100644 --- a/util/ksonnet/ksonnet_test.go +++ b/util/ksonnet/ksonnet_test.go @@ -3,6 +3,7 @@ package ksonnet import ( "encoding/json" "path" + "reflect" "runtime" "testing" @@ -45,3 +46,23 @@ func TestShow(t *testing.T) { log.Infof("%v", string(jsonBytes)) } } + +func TestListEnvParams(t *testing.T) { + ksApp, err := NewKsonnetApp(path.Join(testDataDir, testAppName)) + assert.Nil(t, err) + params, err := ksApp.ListEnvParams(testEnvName) + assert.Nil(t, err) + + expected := map[string]string{ + "containerPort": "80", + "image": "gcr.io/kuar-demo/kuard-amd64:1", + "name": "demo", + "replicas": "2", + "servicePort": "80", + "type": "ClusterIP", + } + + if !reflect.DeepEqual(expected, params) { + t.Errorf("Env param maps were not equal! Expected (%s), got (%s).", expected, params) + } +}