diff --git a/application/comparator.go b/application/comparator.go index 32a99fa0d6..d90732afce 100644 --- a/application/comparator.go +++ b/application/comparator.go @@ -40,48 +40,65 @@ func (ks *KsonnetAppComparator) CompareAppState(appRepoPath string, app *v1alpha return nil, fmt.Errorf("environment '%s' does not exist in ksonnet app '%s'", app.Spec.Source.Environment, appSpec.Name) } - // Generate the manifests for the environment - objs, err := ksApp.Show(app.Spec.Source.Environment) - if err != nil { - return nil, err - } - // Get the REST config for the cluster corresponding to the environment clst, err := ks.clusterService.Get(context.Background(), &cluster.ClusterQuery{Server: env.Destination.Server}) if err != nil { return nil, err } + // Generate the manifests for the environment + targetObjs, err := ksApp.Show(app.Spec.Source.Environment) + if err != nil { + return nil, err + } + // Retrieve the live versions of the objects - liveObjs, err := kubeutil.GetLiveResources(clst.RESTConfig(), objs, env.Destination.Namespace) + liveObjs, err := kubeutil.GetLiveResources(clst.RESTConfig(), targetObjs, env.Destination.Namespace) if err != nil { return nil, err } // Do the actual comparison - diffResults, err := diff.DiffArray(objs, liveObjs) + diffResults, err := diff.DiffArray(targetObjs, liveObjs) if err != nil { return nil, err } - deltaDiffs := make([]string, len(diffResults.Diffs)) - for i, diffRes := range diffResults.Diffs { - deltaDiffs[i] = diffRes.DeltaDiff - } - targetState := make([]string, len(objs)) - for i, obj := range objs { - str, err := json.Marshal(obj.Object) + + resources := make([]v1alpha1.ResourceState, len(targetObjs)) + for i := 0; i < len(targetObjs); i++ { + resState := v1alpha1.ResourceState{} + targetObjBytes, err := json.Marshal(targetObjs[i].Object) if err != nil { return nil, err } - targetState[i] = string(str) + resState.TargetState = string(targetObjBytes) + if liveObjs[i] == nil { + resState.LiveState = "null" + } else { + liveObjBytes, err := json.Marshal(liveObjs[i].Object) + if err != nil { + return nil, err + } + resState.LiveState = string(liveObjBytes) + } + diffResult := diffResults.Diffs[i] + if diffResult.Modified { + if *diffResult.AdditionsOnly { + resState.Status = v1alpha1.ComparisonStatusEqual + } else { + resState.Status = v1alpha1.ComparisonStatusDifferent + } + } else { + resState.Status = v1alpha1.ComparisonStatusEqual + } + resources[i] = resState } compResult := v1alpha1.ComparisonResult{ - TargetState: targetState, - ComparedTo: app.Spec.Source, - ComparedAt: metav1.Time{Time: time.Now().UTC()}, - Server: clst.Server, - Namespace: env.Destination.Namespace, - DeltaDiffs: deltaDiffs, + ComparedTo: app.Spec.Source, + ComparedAt: metav1.Time{Time: time.Now().UTC()}, + Server: clst.Server, + Namespace: env.Destination.Namespace, + Resources: resources, } if diffResults.Modified { if *diffResults.AdditionsOnly { diff --git a/pkg/apis/application/v1alpha1/generated.pb.go b/pkg/apis/application/v1alpha1/generated.pb.go index 989bb779d5..f8c3e8ccc4 100644 --- a/pkg/apis/application/v1alpha1/generated.pb.go +++ b/pkg/apis/application/v1alpha1/generated.pb.go @@ -20,6 +20,7 @@ ComparisonResult Repository RepositoryList + ResourceState TLSClientConfig */ package v1alpha1 @@ -94,9 +95,13 @@ func (m *RepositoryList) Reset() { *m = RepositoryList{} } func (*RepositoryList) ProtoMessage() {} func (*RepositoryList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{11} } +func (m *ResourceState) Reset() { *m = ResourceState{} } +func (*ResourceState) ProtoMessage() {} +func (*ResourceState) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } + func (m *TLSClientConfig) Reset() { *m = TLSClientConfig{} } func (*TLSClientConfig) ProtoMessage() {} -func (*TLSClientConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{12} } +func (*TLSClientConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{13} } func init() { proto.RegisterType((*Application)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application") @@ -111,6 +116,7 @@ func init() { proto.RegisterType((*ComparisonResult)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ComparisonResult") 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") proto.RegisterType((*TLSClientConfig)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.TLSClientConfig") } func (m *Application) Marshal() (dAtA []byte, err error) { @@ -462,34 +468,16 @@ func (m *ComparisonResult) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) i += copy(dAtA[i:], m.Status) - if len(m.TargetState) > 0 { - for _, s := range m.TargetState { + if len(m.Resources) > 0 { + for _, msg := range m.Resources { dAtA[i] = 0x32 i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.DeltaDiffs) > 0 { - for _, s := range m.DeltaDiffs { - dAtA[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i += n } } dAtA[i] = 0x42 @@ -567,6 +555,36 @@ func (m *RepositoryList) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ResourceState) 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 *ResourceState) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TargetState))) + i += copy(dAtA[i:], m.TargetState) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.LiveState))) + i += copy(dAtA[i:], m.LiveState) + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i += copy(dAtA[i:], m.Status) + return i, nil +} + func (m *TLSClientConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -743,15 +761,9 @@ func (m *ComparisonResult) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Status) n += 1 + l + sovGenerated(uint64(l)) - if len(m.TargetState) > 0 { - for _, s := range m.TargetState { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.DeltaDiffs) > 0 { - for _, s := range m.DeltaDiffs { - l = len(s) + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } @@ -786,6 +798,18 @@ func (m *RepositoryList) Size() (n int) { return n } +func (m *ResourceState) Size() (n int) { + var l int + _ = l + l = len(m.TargetState) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.LiveState) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *TLSClientConfig) Size() (n int) { var l int _ = l @@ -933,8 +957,7 @@ func (this *ComparisonResult) String() string { `Server:` + fmt.Sprintf("%v", this.Server) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `TargetState:` + fmt.Sprintf("%v", this.TargetState) + `,`, - `DeltaDiffs:` + fmt.Sprintf("%v", this.DeltaDiffs) + `,`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceState", "ResourceState", 1), `&`, ``, 1) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") @@ -963,6 +986,18 @@ func (this *RepositoryList) String() string { }, "") return s } +func (this *ResourceState) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourceState{`, + `TargetState:` + fmt.Sprintf("%v", this.TargetState) + `,`, + `LiveState:` + fmt.Sprintf("%v", this.LiveState) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `}`, + }, "") + return s +} func (this *TLSClientConfig) String() string { if this == nil { return "nil" @@ -2265,9 +2300,9 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2277,49 +2312,22 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.TargetState = append(m.TargetState, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeltaDiffs", wireType) + m.Resources = append(m.Resources, ResourceState{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DeltaDiffs = append(m.DeltaDiffs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 8: if wireType != 2 { @@ -2619,6 +2627,143 @@ func (m *RepositoryList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ResourceState) 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: ResourceState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiveState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LiveState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = ComparisonStatus(dAtA[iNdEx:postIndex]) + 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 *TLSClientConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2921,78 +3066,80 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 1166 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x23, 0xb5, - 0x17, 0xef, 0xb4, 0x69, 0x9a, 0xbe, 0x74, 0xdb, 0xae, 0xbf, 0xfa, 0x42, 0xd4, 0x43, 0x5a, 0x0d, - 0x02, 0x0a, 0x62, 0x27, 0xb4, 0xfc, 0xe6, 0x80, 0xd4, 0x49, 0x8b, 0x28, 0x2d, 0x65, 0xe5, 0x66, - 0x85, 0x84, 0x10, 0xe0, 0x4e, 0xdc, 0x64, 0x9a, 0xcc, 0x78, 0x64, 0x3b, 0x59, 0xf5, 0x80, 0xb4, - 0x37,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a7, 0x4b, 0x9b, 0xa3, 0x20, 0x0e, 0x00, 0x00, + // 1190 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdf, 0x6b, 0x23, 0x45, + 0x1c, 0xef, 0xb6, 0x69, 0x9a, 0x4c, 0xfa, 0xeb, 0x46, 0xd4, 0xd0, 0x87, 0xb4, 0xac, 0xa8, 0x55, + 0xbc, 0x5d, 0x5b, 0x7f, 0xfb, 0x20, 0x74, 0x63, 0xc5, 0xda, 0x5a, 0x8f, 0x69, 0x0e, 0x41, 0x44, + 0x9d, 0x6e, 0xe6, 0x92, 0x6d, 0xb2, 0x3b, 0xcb, 0xcc, 0x24, 0x47, 0x1e, 0x84, 0x7b, 0x13, 0x04, + 0x41, 0xff, 0x0a, 0xc1, 0x47, 0xfd, 0x1b, 0x84, 0x3e, 0x1e, 0x28, 0x78, 0x88, 0x14, 0x9b, 0x7b, + 0xf1, 0x6f, 0xb8, 0x27, 0x99, 0xd9, 0xd9, 0xdd, 0x49, 0x42, 0xbd, 0x3b, 0x13, 0xee, 0x6d, 0x67, + 0xbe, 0x9f, 0xf9, 0x7c, 0x3f, 0xf3, 0xfd, 0x35, 0x0b, 0x0e, 0x5a, 0x81, 0x68, 0xf7, 0x4e, 0x1d, + 0x9f, 0x86, 0x2e, 0x66, 0x2d, 0x1a, 0x33, 0x7a, 0xa6, 0x3e, 0xae, 0xfb, 0x4d, 0x37, 0xee, 0xb4, + 0x5c, 0x1c, 0x07, 0xdc, 0xc5, 0x71, 0xdc, 0x0d, 0x7c, 0x2c, 0x02, 0x1a, 0xb9, 0xfd, 0x1d, 0xdc, + 0x8d, 0xdb, 0x78, 0xc7, 0x6d, 0x91, 0x88, 0x30, 0x2c, 0x48, 0xd3, 0x89, 0x19, 0x15, 0x14, 0xbe, + 0x93, 0x53, 0x39, 0x29, 0x95, 0xfa, 0xf8, 0xd2, 0x6f, 0x3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2c, 0xc8, 0x40, 0xc1, 0x6d, 0x50, 0xf2, 0x09, 0x13, + 0xef, 0xcb, 0xac, 0x4b, 0xcd, 0xcb, 0xde, 0xb2, 0x64, 0xaf, 0xeb, 0x3d, 0x94, 0x59, 0xe1, 0xf3, + 0x60, 0xa9, 0x43, 0x06, 0x0a, 0x58, 0x50, 0xc0, 0x8a, 0xfc, 0xb5, 0x3c, 0x4c, 0xb6, 0x50, 0x6a, + 0x83, 0x36, 0x28, 0xfa, 0x58, 0xa1, 0x16, 0x15, 0x0a, 0xa8, 0x37, 0x74, 0x4f, 0x81, 0xb4, 0xc5, + 0x73, 0xce, 0x2f, 0x6b, 0x73, 0x77, 0x2f, 0x6b, 0x73, 0xf7, 0x2e, 0x6b, 0x73, 0x77, 0x86, 0x35, + 0xeb, 0x7c, 0x58, 0xb3, 0xee, 0x0e, 0x6b, 0xd6, 0xbd, 0x61, 0xcd, 0xfa, 0x7b, 0x58, 0xb3, 0xbe, + 0xbf, 0x5f, 0x9b, 0xfb, 0xac, 0x94, 0x66, 0xfc, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xd4, + 0xd0, 0x40, 0xee, 0x0e, 0x00, 0x00, } diff --git a/pkg/apis/application/v1alpha1/generated.proto b/pkg/apis/application/v1alpha1/generated.proto index e81565ef29..9305a8722e 100644 --- a/pkg/apis/application/v1alpha1/generated.proto +++ b/pkg/apis/application/v1alpha1/generated.proto @@ -117,9 +117,7 @@ message ComparisonResult { optional string status = 5; - repeated string targetState = 6; - - repeated string deltaDiffs = 7; + repeated ResourceState resources = 6; optional string error = 8; } @@ -140,6 +138,15 @@ message RepositoryList { repeated Repository items = 2; } +// ResourceState holds the target state of a resource and live state of a resource +message ResourceState { + optional string targetState = 1; + + optional string liveState = 2; + + optional string status = 3; +} + // TLSClientConfig contains settings to enable transport layer security message TLSClientConfig { // Server should be accessed without verifying the TLS certificate. For testing only. diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 1c9109d910..0acff04d62 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -74,14 +74,20 @@ type ApplicationStatus struct { // ComparisonResult is a comparison result of application spec and deployed application. type ComparisonResult struct { - ComparedAt metav1.Time `json:"comparedAt" protobuf:"bytes,1,opt,name=comparedAt"` - ComparedTo ApplicationSource `json:"comparedTo" protobuf:"bytes,2,opt,name=comparedTo"` - Server string `json:"server" protobuf:"bytes,3,opt,name=server"` - Namespace string `json:"namespace" protobuf:"bytes,4,opt,name=namespace"` - Status ComparisonStatus `json:"status" protobuf:"bytes,5,opt,name=status,casttype=ComparisonStatus"` - TargetState []string `json:"targetState,omitempty" protobuf:"bytes,6,opt,name=targetState"` - DeltaDiffs []string `json:"deltaDiffs,omitempty" protobuf:"bytes,7,opt,name=deltaDiffs"` - Error string `json:"error,omitempty" protobuf:"bytes,8,opt,name=error"` + ComparedAt metav1.Time `json:"comparedAt" protobuf:"bytes,1,opt,name=comparedAt"` + ComparedTo ApplicationSource `json:"comparedTo" protobuf:"bytes,2,opt,name=comparedTo"` + Server string `json:"server" protobuf:"bytes,3,opt,name=server"` + Namespace string `json:"namespace" protobuf:"bytes,4,opt,name=namespace"` + Status ComparisonStatus `json:"status" protobuf:"bytes,5,opt,name=status,casttype=ComparisonStatus"` + Resources []ResourceState `json:"resources" protobuf:"bytes,6,opt,name=resources"` + Error string `json:"error,omitempty" protobuf:"bytes,8,opt,name=error"` +} + +// ResourceState holds the target state of a resource and live state of a resource +type ResourceState struct { + TargetState string `json:"targetState,omitempty" protobuf:"bytes,1,opt,name=targetState"` + LiveState string `json:"liveState,omitempty" protobuf:"bytes,2,opt,name=liveState"` + Status ComparisonStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // Cluster is the definition of a cluster resource @@ -178,10 +184,10 @@ func (c *Cluster) RESTConfig() *rest.Config { // TargetObjects deserializes the list of target states into unstructured objectss func (cr *ComparisonResult) TargetObjects() ([]*unstructured.Unstructured, error) { - objs := make([]*unstructured.Unstructured, len(cr.TargetState)) - for i, objStr := range cr.TargetState { + objs := make([]*unstructured.Unstructured, len(cr.Resources)) + for i, resState := range cr.Resources { var obj unstructured.Unstructured - err := json.Unmarshal([]byte(objStr), &obj) + err := json.Unmarshal([]byte(resState.TargetState), &obj) if err != nil { return nil, err } diff --git a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go index b752111169..5dea65583d 100644 --- a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go @@ -199,14 +199,9 @@ func (in *ComparisonResult) DeepCopyInto(out *ComparisonResult) { *out = *in in.ComparedAt.DeepCopyInto(&out.ComparedAt) out.ComparedTo = in.ComparedTo - if in.TargetState != nil { - in, out := &in.TargetState, &out.TargetState - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.DeltaDiffs != nil { - in, out := &in.DeltaDiffs, &out.DeltaDiffs - *out = make([]string, len(*in)) + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceState, len(*in)) copy(*out, *in) } return @@ -260,6 +255,22 @@ func (in *RepositoryList) DeepCopy() *RepositoryList { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceState) DeepCopyInto(out *ResourceState) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceState. +func (in *ResourceState) DeepCopy() *ResourceState { + if in == nil { + return nil + } + out := new(ResourceState) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSClientConfig) DeepCopyInto(out *TLSClientConfig) { *out = *in