From 448b2cdb1282767683e22b50715afe0eb5e7b3ef Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Mon, 15 Dec 2025 21:47:19 +0000 Subject: [PATCH 1/7] As a Diego Client, I can update ImageUsername/ImagePassword Support updating imageUserName and imagePassword. Update specs. --- db/sqldb/desired_lrp_db.go | 42 ++- db/sqldb/desired_lrp_db_test.go | 35 ++ models/desired_lrp.go | 50 +++ models/desired_lrp.pb.go | 544 +++++++++++++++++++++++++------- models/desired_lrp.proto | 8 + models/desired_lrp_test.go | 101 ++++++ 6 files changed, 649 insertions(+), 131 deletions(-) diff --git a/db/sqldb/desired_lrp_db.go b/db/sqldb/desired_lrp_db.go index f72c2838..a327547e 100644 --- a/db/sqldb/desired_lrp_db.go +++ b/db/sqldb/desired_lrp_db.go @@ -105,7 +105,7 @@ func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logge "process_guid = ?", processGuid, ) - desiredLRP, err = db.fetchDesiredLRP(ctx, logger, row, tx) + beforeDesiredLRP, originalRunInfo, err = db.fetchDesiredLRP(ctx, logger, row, tx) return err }) @@ -300,13 +300,14 @@ func (db *SQLDB) UpdateDesiredLRP(ctx context.Context, logger lager.Logger, proc defer logger.Info("complete") var beforeDesiredLRP *models.DesiredLRP + var originalRunInfo *models.DesiredLRPRunInfo err := db.transact(ctx, logger, func(logger lager.Logger, tx helpers.Tx) error { var err error row := db.one(ctx, logger, tx, desiredLRPsTable, desiredLRPColumns, helpers.LockRow, "process_guid = ?", processGuid, ) - beforeDesiredLRP, err = db.fetchDesiredLRP(ctx, logger, row, tx) + beforeDesiredLRP, originalRunInfo, err = db.fetchDesiredLRP(ctx, logger, row, tx) if err != nil { logger.Error("failed-lock-desired", err) @@ -339,6 +340,24 @@ func (db *SQLDB) UpdateDesiredLRP(ctx context.Context, logger lager.Logger, proc updateAttributes["metric_tags"] = encodedData } + if update.ImageUsernameExists() || update.ImagePasswordExists() { + runInfo := *originalRunInfo + + if update.ImageUsernameExists() { + runInfo.ImageUsername = update.GetImageUsername() + } + if update.ImagePasswordExists() { + runInfo.ImagePassword = update.GetImagePassword() + } + + updatedRunInfoData, err := db.serializeModel(logger, &runInfo) + if err != nil { + logger.Error("failed-serializing-run-info", err) + return err + } + updateAttributes["run_info"] = updatedRunInfoData + } + _, err = db.update(ctx, logger, tx, desiredLRPsTable, updateAttributes, `process_guid = ?`, processGuid) if err != nil { logger.Error("failed-executing-query", err) @@ -561,28 +580,29 @@ func (db *SQLDB) fetchDesiredLRPs(ctx context.Context, logger lager.Logger, rows return lrps, nil } -func (db *SQLDB) fetchDesiredLRP(ctx context.Context, logger lager.Logger, scanner helpers.RowScanner, queryable helpers.Queryable) (*models.DesiredLRP, error) { - lrp, guid, err := db.fetchDesiredLRPInternal(logger, scanner) + +func (db *SQLDB) fetchDesiredLRP(ctx context.Context, logger lager.Logger, scanner helpers.RowScanner, queryable helpers.Queryable) (*models.DesiredLRP, *models.DesiredLRPRunInfo, error) { + lrp, runInfo, guid, err := db.fetchDesiredLRPInternalWithRunInfo(logger, scanner) if err == models.ErrDeserialize { deleteErr := db.deleteInvalidLRPs(ctx, logger, queryable, guid) if deleteErr != nil { logger.Error("failed-to-delete-invalid-lrp", deleteErr, lager.Data{"guid": guid}) } } - return lrp, err + return lrp, runInfo, err } -func (db *SQLDB) fetchDesiredLRPInternal(logger lager.Logger, scanner helpers.RowScanner) (*models.DesiredLRP, string, error) { +func (db *SQLDB) fetchDesiredLRPInternal(logger lager.Logger, scanner helpers.RowScanner) (*models.DesiredLRP, *models.DesiredLRPRunInfo, string, error) { var runInfoData, metricTagsData []byte schedulingInfo, err := db.fetchDesiredLRPSchedulingInfoAndMore(logger, scanner, &runInfoData, &metricTagsData) if err != nil { - return nil, "", err + return nil, nil, "", err } var runInfo models.DesiredLRPRunInfo err = db.deserializeModel(logger, runInfoData, &runInfo) if err != nil { - return nil, schedulingInfo.ProcessGuid, models.ErrDeserialize + return nil, nil, schedulingInfo.ProcessGuid, models.ErrDeserialize } // dedup the ports runInfo.Ports = dedupSlice(runInfo.Ports) @@ -591,15 +611,15 @@ func (db *SQLDB) fetchDesiredLRPInternal(logger lager.Logger, scanner helpers.Ro encodedData, err := db.encoder.Decode(metricTagsData) if err != nil { logger.Error("failed-decrypting-metric-tags", err) - return nil, "", err + return nil, nil, "", err } err = json.Unmarshal(encodedData, &metricTags) if err != nil { logger.Error("failed-parsing-metric-tags", err) - return nil, "", err + return nil, nil, "", err } desiredLRP := models.NewDesiredLRP(*schedulingInfo, runInfo, metricTags) - return &desiredLRP, "", nil + return &desiredLRP, &runInfo, "", nil } func (db *SQLDB) deleteInvalidLRPs(ctx context.Context, logger lager.Logger, queryable helpers.Queryable, guids ...string) error { diff --git a/db/sqldb/desired_lrp_db_test.go b/db/sqldb/desired_lrp_db_test.go index 04a8fbd9..881edc61 100644 --- a/db/sqldb/desired_lrp_db_test.go +++ b/db/sqldb/desired_lrp_db_test.go @@ -596,6 +596,41 @@ var _ = Describe("DesiredLRPDB", func() { }) }) + Context("when updating image credentials", func() { + BeforeEach(func() { + expectedDesiredLRP.ImageUsername = "original-username" + expectedDesiredLRP.ImagePassword = "original-password" + }) + + It("updates both image username and password in run_info and maintains other fields", func() { + originalCreatedAt := expectedDesiredLRP.CreatedAt + originalAction := expectedDesiredLRP.Action + originalMonitor := expectedDesiredLRP.Monitor + originalStartTimeout := expectedDesiredLRP.StartTimeout + update = &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + update.SetImagePassword("new-password") + + _, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) + Expect(err).NotTo(HaveOccurred()) + + desiredLRP, err := sqlDB.DesiredLRPByProcessGuid(ctx, logger, expectedDesiredLRP.ProcessGuid) + Expect(err).NotTo(HaveOccurred()) + + Expect(desiredLRP.ImageUsername).To(Equal("new-username")) + Expect(desiredLRP.ImagePassword).To(Equal("new-password")) + expectedDesiredLRP.ImageUsername = "new-username" + expectedDesiredLRP.ImagePassword = "new-password" + expectedDesiredLRP.ModificationTag.Increment() + + Expect(desiredLRP).To(BeEquivalentTo(expectedDesiredLRP)) + Expect(desiredLRP.CreatedAt).To(Equal(originalCreatedAt)) + Expect(desiredLRP.Action).To(Equal(originalAction)) + Expect(desiredLRP.Monitor).To(Equal(originalMonitor)) + Expect(desiredLRP.StartTimeout).To(Equal(originalStartTimeout)) + }) + }) + Context("when routes param is invalid", func() { It("returns a bad request error", func() { routeContent := []byte("bad json") diff --git a/models/desired_lrp.go b/models/desired_lrp.go index 9d20e1b4..65777dce 100644 --- a/models/desired_lrp.go +++ b/models/desired_lrp.go @@ -427,6 +427,16 @@ func (desired *DesiredLRPUpdate) Validate() error { validationError = validationError.Append(err) } + // Validate that image_username and image_password are provided together + usernameExists := desired.ImageUsernameExists() + passwordExists := desired.ImagePasswordExists() + if usernameExists && !passwordExists { + validationError = validationError.Append(ErrInvalidField{"image_password"}) + } + if !usernameExists && passwordExists { + validationError = validationError.Append(ErrInvalidField{"image_username"}) + } + return validationError.ToError() } @@ -493,6 +503,46 @@ func (desired DesiredLRPUpdate) IsMetricTagsUpdated(existingTags map[string]*Met return false } +func (desired *DesiredLRPUpdate) SetImageUsername(imageUsername string) { + desired.OptionalImageUsername = &DesiredLRPUpdate_ImageUsername{ + ImageUsername: imageUsername, + } +} + +func (desired DesiredLRPUpdate) ImageUsernameExists() bool { + _, ok := desired.GetOptionalImageUsername().(*DesiredLRPUpdate_ImageUsername) + return ok +} + +func (desired *DesiredLRPUpdate) SetImagePassword(imagePassword string) { + desired.OptionalImagePassword = &DesiredLRPUpdate_ImagePassword{ + ImagePassword: imagePassword, + } +} + +func (desired DesiredLRPUpdate) ImagePasswordExists() bool { + _, ok := desired.GetOptionalImagePassword().(*DesiredLRPUpdate_ImagePassword) + return ok +} + +func (desired DesiredLRPUpdate) IsImageCredentialsUpdated(existingLRP *DesiredLRP) bool { + updateUsername := desired.ImageUsernameExists() + updatePassword := desired.ImagePasswordExists() + + if !updateUsername && !updatePassword { + return false + } + + existingUsername := existingLRP.GetImageUsername() + existingPassword := existingLRP.GetImagePassword() + + if updateUsername && updatePassword { + return desired.GetImageUsername() != existingUsername || desired.GetImagePassword() != existingPassword + } + + return false +} + type internalDesiredLRPUpdate struct { Instances *int32 `json:"instances,omitempty"` Routes *Routes `json:"routes,omitempty"` diff --git a/models/desired_lrp.pb.go b/models/desired_lrp.pb.go index 123c9d8e..df144db7 100644 --- a/models/desired_lrp.pb.go +++ b/models/desired_lrp.pb.go @@ -409,6 +409,14 @@ type DesiredLRPUpdate struct { // *DesiredLRPUpdate_Annotation OptionalAnnotation isDesiredLRPUpdate_OptionalAnnotation `protobuf_oneof:"optional_annotation"` MetricTags map[string]*MetricTagValue `protobuf:"bytes,4,rep,name=metric_tags,json=metricTags,proto3" json:"metric_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Types that are valid to be assigned to OptionalImageUsername: + // + // *DesiredLRPUpdate_ImageUsername + OptionalImageUsername isDesiredLRPUpdate_OptionalImageUsername `protobuf_oneof:"optional_image_username"` + // Types that are valid to be assigned to OptionalImagePassword: + // + // *DesiredLRPUpdate_ImagePassword + OptionalImagePassword isDesiredLRPUpdate_OptionalImagePassword `protobuf_oneof:"optional_image_password"` } func (m *DesiredLRPUpdate) Reset() { *m = DesiredLRPUpdate{} } @@ -455,6 +463,18 @@ type isDesiredLRPUpdate_OptionalAnnotation interface { MarshalTo([]byte) (int, error) Size() int } +type isDesiredLRPUpdate_OptionalImageUsername interface { + isDesiredLRPUpdate_OptionalImageUsername() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} +type isDesiredLRPUpdate_OptionalImagePassword interface { + isDesiredLRPUpdate_OptionalImagePassword() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} type DesiredLRPUpdate_Instances struct { Instances int32 `protobuf:"varint,1,opt,name=instances,proto3,oneof" json:"instances,omitempty"` @@ -462,9 +482,17 @@ type DesiredLRPUpdate_Instances struct { type DesiredLRPUpdate_Annotation struct { Annotation string `protobuf:"bytes,3,opt,name=annotation,proto3,oneof" json:"annotation,omitempty"` } +type DesiredLRPUpdate_ImageUsername struct { + ImageUsername string `protobuf:"bytes,5,opt,name=image_username,json=imageUsername,proto3,oneof" json:"image_username,omitempty"` +} +type DesiredLRPUpdate_ImagePassword struct { + ImagePassword string `protobuf:"bytes,6,opt,name=image_password,json=imagePassword,proto3,oneof" json:"image_password,omitempty"` +} -func (*DesiredLRPUpdate_Instances) isDesiredLRPUpdate_OptionalInstances() {} -func (*DesiredLRPUpdate_Annotation) isDesiredLRPUpdate_OptionalAnnotation() {} +func (*DesiredLRPUpdate_Instances) isDesiredLRPUpdate_OptionalInstances() {} +func (*DesiredLRPUpdate_Annotation) isDesiredLRPUpdate_OptionalAnnotation() {} +func (*DesiredLRPUpdate_ImageUsername) isDesiredLRPUpdate_OptionalImageUsername() {} +func (*DesiredLRPUpdate_ImagePassword) isDesiredLRPUpdate_OptionalImagePassword() {} func (m *DesiredLRPUpdate) GetOptionalInstances() isDesiredLRPUpdate_OptionalInstances { if m != nil { @@ -478,6 +506,18 @@ func (m *DesiredLRPUpdate) GetOptionalAnnotation() isDesiredLRPUpdate_OptionalAn } return nil } +func (m *DesiredLRPUpdate) GetOptionalImageUsername() isDesiredLRPUpdate_OptionalImageUsername { + if m != nil { + return m.OptionalImageUsername + } + return nil +} +func (m *DesiredLRPUpdate) GetOptionalImagePassword() isDesiredLRPUpdate_OptionalImagePassword { + if m != nil { + return m.OptionalImagePassword + } + return nil +} func (m *DesiredLRPUpdate) GetInstances() int32 { if x, ok := m.GetOptionalInstances().(*DesiredLRPUpdate_Instances); ok { @@ -500,11 +540,27 @@ func (m *DesiredLRPUpdate) GetMetricTags() map[string]*MetricTagValue { return nil } +func (m *DesiredLRPUpdate) GetImageUsername() string { + if x, ok := m.GetOptionalImageUsername().(*DesiredLRPUpdate_ImageUsername); ok { + return x.ImageUsername + } + return "" +} + +func (m *DesiredLRPUpdate) GetImagePassword() string { + if x, ok := m.GetOptionalImagePassword().(*DesiredLRPUpdate_ImagePassword); ok { + return x.ImagePassword + } + return "" +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*DesiredLRPUpdate) XXX_OneofWrappers() []interface{} { return []interface{}{ (*DesiredLRPUpdate_Instances)(nil), (*DesiredLRPUpdate_Annotation)(nil), + (*DesiredLRPUpdate_ImageUsername)(nil), + (*DesiredLRPUpdate_ImagePassword)(nil), } } @@ -986,123 +1042,125 @@ func init() { func init() { proto.RegisterFile("desired_lrp.proto", fileDescriptor_f592e9299b63d68c) } var fileDescriptor_f592e9299b63d68c = []byte{ - // 1845 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xc0, 0xb9, 0xfa, 0x43, 0x8a, 0x43, 0x52, 0xa2, 0x46, 0x94, 0x34, 0xa6, 0x6d, 0x2e, 0xcb, - 0xd8, 0x29, 0xd3, 0x24, 0x0a, 0xe0, 0xa4, 0x68, 0x9a, 0x16, 0x05, 0xb2, 0x76, 0xe2, 0x18, 0x96, - 0x02, 0x61, 0x64, 0xbb, 0x6d, 0x80, 0x62, 0xb1, 0xda, 0x1d, 0xad, 0x16, 0xde, 0xdd, 0x59, 0xec, - 0xcc, 0xca, 0xe1, 0xad, 0xfd, 0x06, 0xed, 0xa9, 0x5f, 0xa1, 0x1f, 0xa0, 0x40, 0xbf, 0x42, 0x8e, - 0x3e, 0x06, 0x3d, 0x10, 0xb1, 0x7c, 0x29, 0x78, 0xca, 0x47, 0x28, 0x66, 0xf6, 0x3f, 0x49, 0x53, - 0x52, 0x6c, 0x03, 0x39, 0x71, 0xe6, 0xbd, 0x37, 0x6f, 0xdf, 0xcc, 0xbc, 0x7d, 0xef, 0xb7, 0x04, - 0x9b, 0x16, 0x61, 0x4e, 0x48, 0x2c, 0xdd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34, 0x97, 0xa2, 0x1c, 0x37, 0x92, 0x99, 0x6c, 0x2d, 0x03, 0x50, 0xb5, 0xa8, - 0x67, 0x38, 0x29, 0xdf, 0x82, 0xc9, 0x58, 0x4d, 0x24, 0x38, 0xf9, 0x85, 0xbf, 0x04, 0x6b, 0xe2, - 0xf5, 0x91, 0x4e, 0xe5, 0xc9, 0x6a, 0xcd, 0xc9, 0x58, 0xcd, 0x64, 0xb8, 0xe6, 0x52, 0x5b, 0x38, - 0x1b, 0xfc, 0x5b, 0x01, 0x70, 0x16, 0x58, 0xe1, 0xaf, 0x40, 0xdd, 0x23, 0x1e, 0x0d, 0x47, 0xba, - 0x77, 0x1c, 0x5f, 0x7c, 0xcc, 0xc5, 0x99, 0x10, 0xaf, 0xc5, 0xc3, 0x83, 0x63, 0x78, 0x0b, 0xd4, - 0x2c, 0x87, 0x3d, 0x15, 0x96, 0x4b, 0xd2, 0xb2, 0x31, 0x19, 0xab, 0xa9, 0x08, 0x57, 0xc5, 0xe0, - 0xe0, 0x18, 0xbe, 0x03, 0x6a, 0x21, 0xa5, 0x5c, 0x3f, 0x61, 0x49, 0x40, 0x32, 0x6c, 0x21, 0x3a, - 0x91, 0x29, 0x41, 0xf9, 0x97, 0x4c, 0x84, 0xed, 0x19, 0xdf, 0xea, 0x81, 0x63, 0x31, 0x09, 0x42, - 0xab, 0x71, 0xd8, 0xa9, 0x0c, 0xd7, 0x3c, 0xe3, 0xdb, 0x43, 0xc7, 0x62, 0x83, 0x7f, 0x6e, 0x02, - 0x90, 0x87, 0xfd, 0xf6, 0xce, 0xf1, 0x52, 0x51, 0x97, 0x3e, 0x22, 0x56, 0x2e, 0xf8, 0x88, 0xf8, - 0xf3, 0xab, 0x70, 0x73, 0xf5, 0x62, 0xdc, 0xac, 0x5d, 0x12, 0x35, 0xab, 0x97, 0x43, 0xcd, 0xda, - 0x42, 0xd4, 0x9c, 0xd7, 0x63, 0xaf, 0x5f, 0xa1, 0xc7, 0x1e, 0x2f, 0x04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, - 0x3a, 0xcb, 0xdf, 0x7e, 0x6d, 0x96, 0x7f, 0xf7, 0x67, 0xca, 0xf2, 0xda, 0x27, 0xcf, 0x5f, 0xf4, - 0x2a, 0xdf, 0xbf, 0xe8, 0x55, 0x7e, 0x7c, 0xd1, 0x53, 0xfe, 0x7a, 0xde, 0x53, 0xfe, 0x75, 0xde, - 0x53, 0xbe, 0x3b, 0xef, 0x29, 0xcf, 0xcf, 0x7b, 0xca, 0x0f, 0xe7, 0x3d, 0xe5, 0x7f, 0xe7, 0xbd, - 0xca, 0x8f, 0xe7, 0x3d, 0xe5, 0xef, 0x2f, 0x7b, 0x95, 0xe7, 0x2f, 0x7b, 0x95, 0xef, 0x5f, 0xf6, - 0x2a, 0xc7, 0x55, 0xf9, 0x47, 0xe9, 0xc7, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x43, 0x41, - 0x1c, 0x97, 0x16, 0x00, 0x00, + // 1881 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, + 0x15, 0xe7, 0x4a, 0x26, 0x29, 0x0e, 0x49, 0x89, 0x1a, 0x51, 0xd2, 0x98, 0xb6, 0xb9, 0x2c, 0x63, + 0xc7, 0x4c, 0x93, 0x28, 0x80, 0x93, 0xa2, 0x69, 0x5a, 0x14, 0xc8, 0xda, 0x89, 0x63, 0x58, 0x0a, + 0x84, 0x91, 0xed, 0xb6, 0x01, 0x8a, 0xc5, 0x6a, 0x77, 0xb4, 0x5a, 0x78, 0x77, 0x67, 0xb1, 0x33, + 0x2b, 0x87, 0xb7, 0xf6, 0x1b, 0xb4, 0xa7, 0x7e, 0x85, 0x7e, 0x80, 0x02, 0xfd, 0x0a, 0x39, 0xfa, + 0x18, 0xf4, 0x40, 0xd4, 0xf2, 0x25, 0xe0, 0x29, 0x1f, 0xa1, 0x98, 0xd9, 0xff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 0x12, 0x2d, 0x1c, 0x81, + 0xba, 0x47, 0x7d, 0x87, 0xd3, 0x30, 0xc1, 0xc9, 0xac, 0x61, 0xaa, 0x86, 0xdf, 0x80, 0x9e, 0x45, + 0x82, 0x90, 0x88, 0x74, 0x63, 0xe9, 0x8c, 0x1b, 0x21, 0xd7, 0xb9, 0xe3, 0x11, 0x1a, 0x71, 0x9d, + 0x49, 0x74, 0xb4, 0xb5, 0x1b, 0xd3, 0x89, 0xba, 0x5b, 0x52, 0xe5, 0x37, 0x81, 0x14, 0xbc, 0x9b, + 0x3b, 0x38, 0x12, 0x46, 0x8f, 0x62, 0x9b, 0x23, 0xf1, 0xca, 0x82, 0xd0, 0x39, 0x73, 0x5c, 0x62, + 0x13, 0x4b, 0xe2, 0x62, 0x2d, 0x7e, 0x65, 0xb9, 0x14, 0x17, 0xc6, 0xf0, 0x43, 0x00, 0xcc, 0x20, + 0xd2, 0x9f, 0x11, 0xc7, 0x3e, 0xe5, 0x68, 0x4d, 0x7e, 0x5b, 0xda, 0xe7, 0x52, 0xdc, 0x30, 0x83, + 0xe8, 0x0f, 0x72, 0x08, 0x11, 0xa8, 0x06, 0x34, 0xe4, 0x0c, 0x35, 0x06, 0xab, 0xa3, 0xb6, 0xb6, + 0xd2, 0xa9, 0xe0, 0x58, 0x00, 0x35, 0xd0, 0x22, 0x76, 0x48, 0x18, 0xd3, 0xc3, 0x48, 0x5c, 0x11, + 0x90, 0x57, 0x74, 0x35, 0x3d, 0x83, 0xa3, 0x24, 0xff, 0xdd, 0x17, 0xe9, 0x0f, 0x47, 0x2e, 0xd1, + 0xae, 0x88, 0x0b, 0xc2, 0xcd, 0x78, 0x91, 0x90, 0x30, 0x11, 0x8c, 0x48, 0x58, 0xc9, 0xdb, 0x6d, + 0xe6, 0x29, 0x22, 0x97, 0xe2, 0x86, 0x4b, 0xed, 0xa3, 0xf8, 0x61, 0xfe, 0x0a, 0xb4, 0xe2, 0x0c, + 0xc8, 0x74, 0x3b, 0x72, 0x2c, 0xd4, 0x92, 0x0b, 0xe0, 0x74, 0xa2, 0x96, 0xe5, 0x0a, 0x6e, 0x26, + 0xf3, 0xfb, 0x91, 0x13, 0x6f, 0x39, 0x24, 0xf2, 0xec, 0x0d, 0x8e, 0xda, 0x03, 0x65, 0xb4, 0x9a, + 0x6c, 0x39, 0x93, 0xe2, 0x46, 0x32, 0xfe, 0x9c, 0xc3, 0x07, 0x60, 0x6b, 0xb6, 0x6e, 0x38, 0x84, + 0xa1, 0x75, 0xb9, 0x3f, 0x94, 0xee, 0xef, 0xae, 0x34, 0xb9, 0x97, 0x55, 0x16, 0x0c, 0xcd, 0xb2, + 0xc4, 0x21, 0x0c, 0x7e, 0x02, 0xba, 0x2e, 0xb1, 0x0d, 0x73, 0xac, 0x5b, 0xf4, 0x99, 0xef, 0x52, + 0xc3, 0xd2, 0x23, 0x46, 0x42, 0xb4, 0x21, 0x03, 0x5f, 0x41, 0x0a, 0x86, 0xb1, 0xfe, 0x5e, 0xa2, + 0x7e, 0xcc, 0x48, 0x08, 0xef, 0x83, 0x01, 0x0f, 0x23, 0x26, 0xb1, 0x32, 0x66, 0x9c, 0x78, 0x7a, + 0xa1, 0x5c, 0x31, 0x3d, 0x30, 0xf8, 0x29, 0xea, 0x08, 0x0f, 0xf8, 0x46, 0x62, 0x77, 0x24, 0xcd, + 0xee, 0x16, 0xac, 0x0e, 0x0d, 0x7e, 0x0a, 0x3f, 0x05, 0xed, 0x62, 0xc1, 0x61, 0x68, 0x53, 0xee, + 0x61, 0xab, 0x9c, 0x36, 0x0e, 0x84, 0x0e, 0xb7, 0xce, 0xf2, 0x09, 0x83, 0xef, 0x81, 0x7a, 0x52, + 0xcf, 0x10, 0x94, 0xd8, 0xde, 0x48, 0xd7, 0x7c, 0x1d, 0x8b, 0x71, 0xaa, 0x87, 0xbf, 0x07, 0x9d, + 0x32, 0xa2, 0x3d, 0x86, 0xb6, 0xe4, 0x19, 0x77, 0xa7, 0x13, 0x75, 0x4e, 0x87, 0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 0x74, 0xc1, 0x45, 0x18, 0xba, 0x2e, 0x3f, 0xda, 0x4a, 0x3d, 0x7c, 0xe9, 0xb8, 0x44, + 0x43, 0xd3, 0x89, 0xba, 0xd0, 0x1a, 0xc3, 0x02, 0x38, 0x89, 0x25, 0x8c, 0x59, 0xef, 0x31, 0xd8, + 0x98, 0xd9, 0x25, 0xec, 0x80, 0xd5, 0xb4, 0xfe, 0x34, 0xb0, 0x18, 0xc2, 0x0f, 0x40, 0xf5, 0xcc, + 0x70, 0x23, 0x22, 0xe9, 0x47, 0xf3, 0xce, 0x4e, 0x56, 0x82, 0xd3, 0x95, 0x4f, 0x84, 0x16, 0xc7, + 0x46, 0x9f, 0xad, 0x7c, 0xaa, 0x0c, 0xff, 0xaa, 0x80, 0x66, 0xa1, 0xce, 0xc3, 0x5f, 0x67, 0x64, + 0x40, 0x91, 0x21, 0xab, 0x0b, 0xc8, 0xc0, 0x5e, 0xfc, 0x23, 0x83, 0x48, 0x89, 0x40, 0xef, 0x37, + 0xa0, 0x59, 0x10, 0x2f, 0x88, 0xad, 0x5b, 0x8c, 0xad, 0x55, 0x8c, 0xe1, 0x87, 0x55, 0xd0, 0xc9, + 0xef, 0xf4, 0x71, 0x60, 0x19, 0x9c, 0xc0, 0x7e, 0x91, 0x1e, 0x09, 0x37, 0xd5, 0xaf, 0x2a, 0x45, + 0x46, 0x94, 0xb3, 0x96, 0x95, 0xe5, 0xac, 0x45, 0x59, 0xc0, 0x5a, 0x06, 0x25, 0xae, 0x26, 0xca, + 0x63, 0xe3, 0x2b, 0xa5, 0xc4, 0xce, 0x1e, 0x94, 0x11, 0x78, 0x45, 0x1e, 0xc6, 0x68, 0x1e, 0x81, + 0x71, 0xb4, 0xb3, 0x00, 0x2c, 0x81, 0xef, 0xf6, 0xdc, 0xab, 0xac, 0xca, 0x0f, 0xae, 0xcc, 0xbe, + 0xcb, 0xdb, 0x73, 0xef, 0xb2, 0x26, 0x0d, 0x57, 0x67, 0x5e, 0xe6, 0x5b, 0xc2, 0x82, 0xd6, 0x05, + 0x90, 0x06, 0x62, 0xf7, 0x86, 0xab, 0x67, 0x07, 0xad, 0x6d, 0x83, 0xad, 0x4c, 0x9a, 0x1f, 0x90, + 0x76, 0x15, 0xec, 0xe6, 0xc6, 0xa5, 0xed, 0x2d, 0x50, 0xa5, 0x1b, 0x1a, 0xfe, 0x5d, 0x01, 0xed, + 0x12, 0x41, 0x82, 0x1f, 0x83, 0x56, 0x10, 0x52, 0x53, 0x14, 0xd6, 0xb8, 0x98, 0xc9, 0x5a, 0xd1, + 0x11, 0x45, 0xae, 0x28, 0xc7, 0xcd, 0x64, 0x26, 0x4b, 0xdc, 0x10, 0xd4, 0x2c, 0xea, 0x19, 0x4e, + 0xca, 0xb3, 0xc1, 0x74, 0xa2, 0x26, 0x12, 0x9c, 0xfc, 0xc2, 0xdb, 0x60, 0x4d, 0x3c, 0x63, 0xe9, + 0x54, 0xde, 0xb0, 0xd6, 0x9a, 0x4e, 0xd4, 0x4c, 0x86, 0xeb, 0x2e, 0xb5, 0x85, 0xb3, 0xe1, 0xbf, + 0x14, 0x00, 0xe7, 0x89, 0x33, 0xfc, 0x25, 0x68, 0x78, 0xc4, 0xa3, 0xe1, 0x58, 0xf7, 0x8e, 0x63, + 0x00, 0xc6, 0xfc, 0x3c, 0x13, 0xe2, 0xb5, 0x78, 0x78, 0x70, 0x0c, 0x6f, 0x82, 0xba, 0xe5, 0xb0, + 0xa7, 0xc2, 0x72, 0x45, 0x5a, 0x36, 0xa7, 0x13, 0x35, 0x15, 0xe1, 0x9a, 0x18, 0x1c, 0x1c, 0xc3, + 0x77, 0x40, 0x3d, 0xa4, 0x94, 0xeb, 0x27, 0x2c, 0x09, 0x48, 0x86, 0x2d, 0x44, 0x27, 0x12, 0x9a, + 0x94, 0x7f, 0x29, 0xd0, 0xb2, 0xe6, 0x19, 0xdf, 0xea, 0x81, 0x63, 0x31, 0x49, 0xc8, 0xaa, 0x71, + 0xd8, 0xa9, 0x0c, 0x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0x05, 0x1d, 0xc3, 0xdc, 0x9f, 0x11, 0xd7, + 0x5f, 0xfb, 0xcf, 0x88, 0x52, 0x55, 0xb8, 0xb1, 0xa4, 0x2a, 0x2c, 0x69, 0x2f, 0xfa, 0x6f, 0xa1, + 0xbd, 0x50, 0x2f, 0xd7, 0x5e, 0x0c, 0x2e, 0xdb, 0x5e, 0xfc, 0xe2, 0x0d, 0xdb, 0x8b, 0xe1, 0xe5, + 0xda, 0x8b, 0xbb, 0x65, 0x72, 0xf7, 0x8e, 0x5c, 0x35, 0x9c, 0x27, 0x77, 0x4b, 0x69, 0x5d, 0xb1, + 0xa7, 0xb8, 0xf9, 0xfa, 0x3d, 0xc5, 0xad, 0x37, 0xee, 0x29, 0xde, 0xfd, 0x3f, 0xed, 0x29, 0xb4, + 0x4f, 0x9e, 0xbf, 0xe8, 0x57, 0xbe, 0x7f, 0xd1, 0xaf, 0xfc, 0xf8, 0xa2, 0xaf, 0xfc, 0xe5, 0xbc, + 0xaf, 0xfc, 0xf3, 0xbc, 0xaf, 0x7c, 0x77, 0xde, 0x57, 0x9e, 0x9f, 0xf7, 0x95, 0xff, 0x9e, 0xf7, + 0x95, 0x1f, 0xce, 0xfb, 0x95, 0x1f, 0xcf, 0xfb, 0xca, 0xdf, 0x5e, 0xf6, 0x2b, 0xcf, 0x5f, 0xf6, + 0x2b, 0xdf, 0xbf, 0xec, 0x57, 0x8e, 0x6b, 0xf2, 0x0f, 0xdb, 0x8f, 0xff, 0x17, 0x00, 0x00, 0xff, + 0xff, 0x88, 0xac, 0x04, 0xf2, 0x1f, 0x17, 0x00, 0x00, } func (this *DesiredLRPSchedulingInfo) Equal(that interface{}) bool { @@ -1386,6 +1444,24 @@ func (this *DesiredLRPUpdate) Equal(that interface{}) bool { return false } } + if that1.OptionalImageUsername == nil { + if this.OptionalImageUsername != nil { + return false + } + } else if this.OptionalImageUsername == nil { + return false + } else if !this.OptionalImageUsername.Equal(that1.OptionalImageUsername) { + return false + } + if that1.OptionalImagePassword == nil { + if this.OptionalImagePassword != nil { + return false + } + } else if this.OptionalImagePassword == nil { + return false + } else if !this.OptionalImagePassword.Equal(that1.OptionalImagePassword) { + return false + } return true } func (this *DesiredLRPUpdate_Instances) Equal(that interface{}) bool { @@ -1436,6 +1512,54 @@ func (this *DesiredLRPUpdate_Annotation) Equal(that interface{}) bool { } return true } +func (this *DesiredLRPUpdate_ImageUsername) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPUpdate_ImageUsername) + if !ok { + that2, ok := that.(DesiredLRPUpdate_ImageUsername) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ImageUsername != that1.ImageUsername { + return false + } + return true +} +func (this *DesiredLRPUpdate_ImagePassword) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DesiredLRPUpdate_ImagePassword) + if !ok { + that2, ok := that.(DesiredLRPUpdate_ImagePassword) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ImagePassword != that1.ImagePassword { + return false + } + return true +} func (this *DesiredLRPKey) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1818,7 +1942,7 @@ func (this *DesiredLRPUpdate) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 10) s = append(s, "&models.DesiredLRPUpdate{") if this.OptionalInstances != nil { s = append(s, "OptionalInstances: "+fmt.Sprintf("%#v", this.OptionalInstances)+",\n") @@ -1840,6 +1964,12 @@ func (this *DesiredLRPUpdate) GoString() string { if this.MetricTags != nil { s = append(s, "MetricTags: "+mapStringForMetricTags+",\n") } + if this.OptionalImageUsername != nil { + s = append(s, "OptionalImageUsername: "+fmt.Sprintf("%#v", this.OptionalImageUsername)+",\n") + } + if this.OptionalImagePassword != nil { + s = append(s, "OptionalImagePassword: "+fmt.Sprintf("%#v", this.OptionalImagePassword)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -1859,6 +1989,22 @@ func (this *DesiredLRPUpdate_Annotation) GoString() string { `Annotation:` + fmt.Sprintf("%#v", this.Annotation) + `}`}, ", ") return s } +func (this *DesiredLRPUpdate_ImageUsername) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&models.DesiredLRPUpdate_ImageUsername{` + + `ImageUsername:` + fmt.Sprintf("%#v", this.ImageUsername) + `}`}, ", ") + return s +} +func (this *DesiredLRPUpdate_ImagePassword) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&models.DesiredLRPUpdate_ImagePassword{` + + `ImagePassword:` + fmt.Sprintf("%#v", this.ImagePassword) + `}`}, ", ") + return s +} func (this *DesiredLRPKey) GoString() string { if this == nil { return "nil" @@ -2487,6 +2633,24 @@ func (m *DesiredLRPUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.OptionalImagePassword != nil { + { + size := m.OptionalImagePassword.Size() + i -= size + if _, err := m.OptionalImagePassword.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.OptionalImageUsername != nil { + { + size := m.OptionalImageUsername.Size() + i -= size + if _, err := m.OptionalImageUsername.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } if len(m.MetricTags) > 0 { for k := range m.MetricTags { v := m.MetricTags[k] @@ -2572,6 +2736,34 @@ func (m *DesiredLRPUpdate_Annotation) MarshalToSizedBuffer(dAtA []byte) (int, er dAtA[i] = 0x1a return len(dAtA) - i, nil } +func (m *DesiredLRPUpdate_ImageUsername) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DesiredLRPUpdate_ImageUsername) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ImageUsername) + copy(dAtA[i:], m.ImageUsername) + i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImageUsername))) + i-- + dAtA[i] = 0x2a + return len(dAtA) - i, nil +} +func (m *DesiredLRPUpdate_ImagePassword) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DesiredLRPUpdate_ImagePassword) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ImagePassword) + copy(dAtA[i:], m.ImagePassword) + i = encodeVarintDesiredLrp(dAtA, i, uint64(len(m.ImagePassword))) + i-- + dAtA[i] = 0x32 + return len(dAtA) - i, nil +} func (m *DesiredLRPKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3333,6 +3525,12 @@ func (m *DesiredLRPUpdate) Size() (n int) { n += mapEntrySize + 1 + sovDesiredLrp(uint64(mapEntrySize)) } } + if m.OptionalImageUsername != nil { + n += m.OptionalImageUsername.Size() + } + if m.OptionalImagePassword != nil { + n += m.OptionalImagePassword.Size() + } return n } @@ -3355,6 +3553,26 @@ func (m *DesiredLRPUpdate_Annotation) Size() (n int) { n += 1 + l + sovDesiredLrp(uint64(l)) return n } +func (m *DesiredLRPUpdate_ImageUsername) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ImageUsername) + n += 1 + l + sovDesiredLrp(uint64(l)) + return n +} +func (m *DesiredLRPUpdate_ImagePassword) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ImagePassword) + n += 1 + l + sovDesiredLrp(uint64(l)) + return n +} func (m *DesiredLRPKey) Size() (n int) { if m == nil { return 0 @@ -3721,6 +3939,8 @@ func (this *DesiredLRPUpdate) String() string { `Routes:` + fmt.Sprintf("%v", this.Routes) + `,`, `OptionalAnnotation:` + fmt.Sprintf("%v", this.OptionalAnnotation) + `,`, `MetricTags:` + mapStringForMetricTags + `,`, + `OptionalImageUsername:` + fmt.Sprintf("%v", this.OptionalImageUsername) + `,`, + `OptionalImagePassword:` + fmt.Sprintf("%v", this.OptionalImagePassword) + `,`, `}`, }, "") return s @@ -3745,6 +3965,26 @@ func (this *DesiredLRPUpdate_Annotation) String() string { }, "") return s } +func (this *DesiredLRPUpdate_ImageUsername) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DesiredLRPUpdate_ImageUsername{`, + `ImageUsername:` + fmt.Sprintf("%v", this.ImageUsername) + `,`, + `}`, + }, "") + return s +} +func (this *DesiredLRPUpdate_ImagePassword) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DesiredLRPUpdate_ImagePassword{`, + `ImagePassword:` + fmt.Sprintf("%v", this.ImagePassword) + `,`, + `}`, + }, "") + return s +} func (this *DesiredLRPKey) String() string { if this == nil { return "nil" @@ -5661,6 +5901,70 @@ func (m *DesiredLRPUpdate) Unmarshal(dAtA []byte) error { } m.MetricTags[mapkey] = mapvalue iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDesiredLrp + } + 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 ErrInvalidLengthDesiredLrp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDesiredLrp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionalImageUsername = &DesiredLRPUpdate_ImageUsername{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImagePassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDesiredLrp + } + 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 ErrInvalidLengthDesiredLrp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDesiredLrp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionalImagePassword = &DesiredLRPUpdate_ImagePassword{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDesiredLrp(dAtA[iNdEx:]) diff --git a/models/desired_lrp.proto b/models/desired_lrp.proto index d079c034..0286785e 100644 --- a/models/desired_lrp.proto +++ b/models/desired_lrp.proto @@ -88,6 +88,14 @@ message DesiredLRPUpdate { string annotation = 3; } map metric_tags = 4; + + oneof optional_image_username { + string image_username = 5; + } + + oneof optional_image_password { + string image_password = 6; + } } message DesiredLRPKey { diff --git a/models/desired_lrp_test.go b/models/desired_lrp_test.go index 8ace1a42..c9ca5233 100644 --- a/models/desired_lrp_test.go +++ b/models/desired_lrp_test.go @@ -1399,6 +1399,28 @@ var _ = Describe("DesiredLRPUpdate", func() { Expect(desiredLRPUpdate.Validate()).To(Succeed()) }) }) + + Context("image credentials", func() { + It("requires both username and password when updating credentials", func() { + desiredLRPUpdate.SetImageUsername("username") + assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "image_password") + + desiredLRPUpdate = models.DesiredLRPUpdate{} + desiredLRPUpdate.SetInstances(2) + desiredLRPUpdate.SetImagePassword("password") + assertDesiredLRPValidationFailsWithMessage(desiredLRPUpdate, "image_username") + }) + + It("is valid when both username and password are provided", func() { + desiredLRPUpdate.SetImageUsername("username") + desiredLRPUpdate.SetImagePassword("password") + Expect(desiredLRPUpdate.Validate()).To(Succeed()) + }) + + It("is valid when neither username nor password are provided", func() { + Expect(desiredLRPUpdate.Validate()).To(Succeed()) + }) + }) }) Describe("serialization", func() { @@ -1471,6 +1493,85 @@ var _ = Describe("DesiredLRPUpdate", func() { }) }) }) + + Describe("IsImageCredentialsUpdated", func() { + var existingLRP *models.DesiredLRP + + BeforeEach(func() { + existingLRP = model_helpers.NewValidDesiredLRP("some-guid") + existingLRP.ImageUsername = "existing-username" + existingLRP.ImagePassword = "existing-password" + }) + + Context("when the update does not contain image credentials", func() { + It("returns false", func() { + update := &models.DesiredLRPUpdate{} + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + }) + + Context("when only username is provided", func() { + It("returns false", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + }) + + Context("when only password is provided", func() { + It("returns false", func() { + update := &models.DesiredLRPUpdate{} + update.SetImagePassword("new-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + }) + + Context("when both username and password are provided and differ", func() { + It("returns true when username differs", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + update.SetImagePassword("existing-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeTrue()) + }) + + It("returns true when password differs", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("existing-username") + update.SetImagePassword("new-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeTrue()) + }) + + It("returns true when both differ", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + update.SetImagePassword("new-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeTrue()) + }) + }) + + Context("when both username and password are provided and are equal", func() { + It("returns false", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("existing-username") + update.SetImagePassword("existing-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + }) + + Context("when existing LRP has no credentials", func() { + BeforeEach(func() { + existingLRP.ImageUsername = "" + existingLRP.ImagePassword = "" + }) + + It("returns true when new credentials are provided", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + update.SetImagePassword("new-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeTrue()) + }) + }) + }) }) func randStringBytes(n int) string { From 6a74671003bc733e5e4d78f8b2c5797eaff1e47f Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Tue, 16 Dec 2025 22:16:33 +0000 Subject: [PATCH 2/7] As a Diego Client, I can update ImageUsername/ImagePassword Fix test issues --- db/sqldb/desired_lrp_db.go | 8 +++++--- db/sqldb/desired_lrp_db_test.go | 6 ++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/sqldb/desired_lrp_db.go b/db/sqldb/desired_lrp_db.go index a327547e..7af0be54 100644 --- a/db/sqldb/desired_lrp_db.go +++ b/db/sqldb/desired_lrp_db.go @@ -97,6 +97,7 @@ func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logge defer logger.Debug("complete") var desiredLRP *models.DesiredLRP + var beforeDesiredLRP *models.DesiredLRP err := db.transact(ctx, logger, func(logger lager.Logger, tx helpers.Tx) error { var err error @@ -105,7 +106,8 @@ func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logge "process_guid = ?", processGuid, ) - beforeDesiredLRP, originalRunInfo, err = db.fetchDesiredLRP(ctx, logger, row, tx) + beforeDesiredLRP, _, err = db.fetchDesiredLRP(ctx, logger, row, tx) + desiredLRP = beforeDesiredLRP return err }) @@ -555,7 +557,7 @@ func (db *SQLDB) fetchDesiredLRPs(ctx context.Context, logger lager.Logger, rows guids := []string{} lrps := []*models.DesiredLRP{} for rows.Next() { - lrp, guid, err := db.fetchDesiredLRPInternal(logger, rows) + lrp, _, guid, err := db.fetchDesiredLRPInternal(logger, rows) if err == models.ErrDeserialize { guids = append(guids, guid) } @@ -582,7 +584,7 @@ func (db *SQLDB) fetchDesiredLRPs(ctx context.Context, logger lager.Logger, rows func (db *SQLDB) fetchDesiredLRP(ctx context.Context, logger lager.Logger, scanner helpers.RowScanner, queryable helpers.Queryable) (*models.DesiredLRP, *models.DesiredLRPRunInfo, error) { - lrp, runInfo, guid, err := db.fetchDesiredLRPInternalWithRunInfo(logger, scanner) + lrp, runInfo, guid, err := db.fetchDesiredLRPInternal(logger, scanner) if err == models.ErrDeserialize { deleteErr := db.deleteInvalidLRPs(ctx, logger, queryable, guid) if deleteErr != nil { diff --git a/db/sqldb/desired_lrp_db_test.go b/db/sqldb/desired_lrp_db_test.go index 881edc61..d4384a88 100644 --- a/db/sqldb/desired_lrp_db_test.go +++ b/db/sqldb/desired_lrp_db_test.go @@ -603,10 +603,9 @@ var _ = Describe("DesiredLRPDB", func() { }) It("updates both image username and password in run_info and maintains other fields", func() { - originalCreatedAt := expectedDesiredLRP.CreatedAt originalAction := expectedDesiredLRP.Action originalMonitor := expectedDesiredLRP.Monitor - originalStartTimeout := expectedDesiredLRP.StartTimeout + originalStartTimeout := expectedDesiredLRP.StartTimeoutMs update = &models.DesiredLRPUpdate{} update.SetImageUsername("new-username") update.SetImagePassword("new-password") @@ -624,10 +623,9 @@ var _ = Describe("DesiredLRPDB", func() { expectedDesiredLRP.ModificationTag.Increment() Expect(desiredLRP).To(BeEquivalentTo(expectedDesiredLRP)) - Expect(desiredLRP.CreatedAt).To(Equal(originalCreatedAt)) Expect(desiredLRP.Action).To(Equal(originalAction)) Expect(desiredLRP.Monitor).To(Equal(originalMonitor)) - Expect(desiredLRP.StartTimeout).To(Equal(originalStartTimeout)) + Expect(desiredLRP.StartTimeoutMs).To(Equal(originalStartTimeout)) }) }) From 49c48ddeb4f46c591cc2733115b8ddde166f143c Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Thu, 18 Dec 2025 02:42:47 +0000 Subject: [PATCH 3/7] As a Diego Client, I can update ImageUsername/ImagePassword Update json marshal and unmarshal --- models/desired_lrp.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/models/desired_lrp.go b/models/desired_lrp.go index 65777dce..54dac893 100644 --- a/models/desired_lrp.go +++ b/models/desired_lrp.go @@ -544,10 +544,12 @@ func (desired DesiredLRPUpdate) IsImageCredentialsUpdated(existingLRP *DesiredLR } type internalDesiredLRPUpdate struct { - Instances *int32 `json:"instances,omitempty"` - Routes *Routes `json:"routes,omitempty"` - Annotation *string `json:"annotation,omitempty"` - MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` + Instances *int32 `json:"instances,omitempty"` + Routes *Routes `json:"routes,omitempty"` + Annotation *string `json:"annotation,omitempty"` + MetricTags map[string]*MetricTagValue `json:"metric_tags,omitempty"` + ImageUsername *string `json:"image_username,omitempty"` + ImagePassword *string `json:"image_password,omitempty"` } func (desired *DesiredLRPUpdate) UnmarshalJSON(data []byte) error { @@ -564,6 +566,12 @@ func (desired *DesiredLRPUpdate) UnmarshalJSON(data []byte) error { desired.SetAnnotation(*update.Annotation) } desired.MetricTags = update.MetricTags + if update.ImageUsername != nil { + desired.SetImageUsername(*update.ImageUsername) + } + if update.ImagePassword != nil { + desired.SetImagePassword(*update.ImagePassword) + } return nil } @@ -580,6 +588,14 @@ func (desired DesiredLRPUpdate) MarshalJSON() ([]byte, error) { update.Annotation = &a } update.MetricTags = desired.MetricTags + if desired.ImageUsernameExists() { + username := desired.GetImageUsername() + update.ImageUsername = &username + } + if desired.ImagePasswordExists() { + password := desired.GetImagePassword() + update.ImagePassword = &password + } return json.Marshal(update) } From 700a4212d08460bd4dade84a14edbb54efccad77 Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Thu, 18 Dec 2025 16:17:05 +0000 Subject: [PATCH 4/7] As a Diego Client, I can update ImageUsername/ImagePassword Update spec for marshal/unmarshal json to include image_username and image_password --- models/desired_lrp_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/desired_lrp_test.go b/models/desired_lrp_test.go index c9ca5233..98461b49 100644 --- a/models/desired_lrp_test.go +++ b/models/desired_lrp_test.go @@ -1344,6 +1344,8 @@ var _ = Describe("DesiredLRPUpdate", func() { BeforeEach(func() { desiredLRPUpdate.SetInstances(2) + desiredLRPUpdate.SetImageUsername("testuser") + desiredLRPUpdate.SetImagePassword("testpass") desiredLRPUpdate.Routes = &models.Routes{ "foo": &json.RawMessage{'"', 'b', 'a', 'r', '"'}, } @@ -1436,7 +1438,9 @@ var _ = Describe("DesiredLRPUpdate", func() { "some-tag": { "static": "some-value" } - } + }, + "image_username": "testuser", + "image_password": "testpass" }` }) From a588df6ecae95fc5b5a72c9a6d1b2717ba419c1b Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Thu, 18 Dec 2025 20:03:18 +0000 Subject: [PATCH 5/7] As a Diego Client, I can update ImageUsername/ImagePassword Update spec --- db/sqldb/desired_lrp_db_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/sqldb/desired_lrp_db_test.go b/db/sqldb/desired_lrp_db_test.go index d4384a88..d033c317 100644 --- a/db/sqldb/desired_lrp_db_test.go +++ b/db/sqldb/desired_lrp_db_test.go @@ -600,6 +600,7 @@ var _ = Describe("DesiredLRPDB", func() { BeforeEach(func() { expectedDesiredLRP.ImageUsername = "original-username" expectedDesiredLRP.ImagePassword = "original-password" + expectedDesiredLRP.cpu_weight = 42 }) It("updates both image username and password in run_info and maintains other fields", func() { @@ -618,6 +619,7 @@ var _ = Describe("DesiredLRPDB", func() { Expect(desiredLRP.ImageUsername).To(Equal("new-username")) Expect(desiredLRP.ImagePassword).To(Equal("new-password")) + Expect(desiredLRP.CpuWeight).To(Equal(42)) expectedDesiredLRP.ImageUsername = "new-username" expectedDesiredLRP.ImagePassword = "new-password" expectedDesiredLRP.ModificationTag.Increment() From 52d7ce1ed646119a431eaf9266badb018ce3ef23 Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Fri, 19 Dec 2025 19:59:20 +0000 Subject: [PATCH 6/7] As a Diego Client, I can update ImageUsername/ImagePassword Update from code review --- db/sqldb/desired_lrp_db.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/db/sqldb/desired_lrp_db.go b/db/sqldb/desired_lrp_db.go index 7af0be54..4fa4b77b 100644 --- a/db/sqldb/desired_lrp_db.go +++ b/db/sqldb/desired_lrp_db.go @@ -106,8 +106,7 @@ func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logge "process_guid = ?", processGuid, ) - beforeDesiredLRP, _, err = db.fetchDesiredLRP(ctx, logger, row, tx) - desiredLRP = beforeDesiredLRP + desiredLRP, _, err = db.fetchDesiredLRP(ctx, logger, row, tx) return err }) @@ -582,7 +581,6 @@ func (db *SQLDB) fetchDesiredLRPs(ctx context.Context, logger lager.Logger, rows return lrps, nil } - func (db *SQLDB) fetchDesiredLRP(ctx context.Context, logger lager.Logger, scanner helpers.RowScanner, queryable helpers.Queryable) (*models.DesiredLRP, *models.DesiredLRPRunInfo, error) { lrp, runInfo, guid, err := db.fetchDesiredLRPInternal(logger, scanner) if err == models.ErrDeserialize { From 9b7d249f239cce267962afa9559254e3e49a37ba Mon Sep 17 00:00:00 2001 From: Sriram Nookala Date: Mon, 22 Dec 2025 21:50:30 +0000 Subject: [PATCH 7/7] As a Diego Client, I can update ImageUsername/ImagePassword Cleanup and additional tests for code review --- db/sqldb/desired_lrp_db.go | 1 - db/sqldb/desired_lrp_db_test.go | 50 +++++++++++++++++++++++- models/desired_lrp_test.go | 69 +++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 3 deletions(-) diff --git a/db/sqldb/desired_lrp_db.go b/db/sqldb/desired_lrp_db.go index 4fa4b77b..44c828ce 100644 --- a/db/sqldb/desired_lrp_db.go +++ b/db/sqldb/desired_lrp_db.go @@ -97,7 +97,6 @@ func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logge defer logger.Debug("complete") var desiredLRP *models.DesiredLRP - var beforeDesiredLRP *models.DesiredLRP err := db.transact(ctx, logger, func(logger lager.Logger, tx helpers.Tx) error { var err error diff --git a/db/sqldb/desired_lrp_db_test.go b/db/sqldb/desired_lrp_db_test.go index d033c317..f78f773d 100644 --- a/db/sqldb/desired_lrp_db_test.go +++ b/db/sqldb/desired_lrp_db_test.go @@ -600,7 +600,7 @@ var _ = Describe("DesiredLRPDB", func() { BeforeEach(func() { expectedDesiredLRP.ImageUsername = "original-username" expectedDesiredLRP.ImagePassword = "original-password" - expectedDesiredLRP.cpu_weight = 42 + expectedDesiredLRP.CpuWeight = 42 }) It("updates both image username and password in run_info and maintains other fields", func() { @@ -619,7 +619,7 @@ var _ = Describe("DesiredLRPDB", func() { Expect(desiredLRP.ImageUsername).To(Equal("new-username")) Expect(desiredLRP.ImagePassword).To(Equal("new-password")) - Expect(desiredLRP.CpuWeight).To(Equal(42)) + Expect(desiredLRP.CpuWeight).To(Equal(uint32(42))) expectedDesiredLRP.ImageUsername = "new-username" expectedDesiredLRP.ImagePassword = "new-password" expectedDesiredLRP.ModificationTag.Increment() @@ -629,6 +629,52 @@ var _ = Describe("DesiredLRPDB", func() { Expect(desiredLRP.Monitor).To(Equal(originalMonitor)) Expect(desiredLRP.StartTimeoutMs).To(Equal(originalStartTimeout)) }) + + It("updates only image username and preserves password", func() { + originalAction := expectedDesiredLRP.Action + originalMonitor := expectedDesiredLRP.Monitor + update = &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username-only") + + _, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) + Expect(err).NotTo(HaveOccurred()) + + desiredLRP, err := sqlDB.DesiredLRPByProcessGuid(ctx, logger, expectedDesiredLRP.ProcessGuid) + Expect(err).NotTo(HaveOccurred()) + + Expect(desiredLRP.ImageUsername).To(Equal("new-username-only")) + Expect(desiredLRP.ImagePassword).To(Equal("original-password")) + Expect(desiredLRP.CpuWeight).To(Equal(uint32(42))) + expectedDesiredLRP.ImageUsername = "new-username-only" + expectedDesiredLRP.ModificationTag.Increment() + + Expect(desiredLRP).To(BeEquivalentTo(expectedDesiredLRP)) + Expect(desiredLRP.Action).To(Equal(originalAction)) + Expect(desiredLRP.Monitor).To(Equal(originalMonitor)) + }) + + It("updates only image password and preserves username", func() { + originalAction := expectedDesiredLRP.Action + originalMonitor := expectedDesiredLRP.Monitor + update = &models.DesiredLRPUpdate{} + update.SetImagePassword("new-password-only") + + _, err := sqlDB.UpdateDesiredLRP(ctx, logger, expectedDesiredLRP.ProcessGuid, update) + Expect(err).NotTo(HaveOccurred()) + + desiredLRP, err := sqlDB.DesiredLRPByProcessGuid(ctx, logger, expectedDesiredLRP.ProcessGuid) + Expect(err).NotTo(HaveOccurred()) + + Expect(desiredLRP.ImageUsername).To(Equal("original-username")) + Expect(desiredLRP.ImagePassword).To(Equal("new-password-only")) + Expect(desiredLRP.CpuWeight).To(Equal(uint32(42))) + expectedDesiredLRP.ImagePassword = "new-password-only" + expectedDesiredLRP.ModificationTag.Increment() + + Expect(desiredLRP).To(BeEquivalentTo(expectedDesiredLRP)) + Expect(desiredLRP.Action).To(Equal(originalAction)) + Expect(desiredLRP.Monitor).To(Equal(originalMonitor)) + }) }) Context("when routes param is invalid", func() { diff --git a/models/desired_lrp_test.go b/models/desired_lrp_test.go index 98461b49..73995bad 100644 --- a/models/desired_lrp_test.go +++ b/models/desired_lrp_test.go @@ -1451,6 +1451,58 @@ var _ = Describe("DesiredLRPUpdate", func() { Expect(json.Unmarshal([]byte(expectedJSON), &testV)).To(Succeed()) Expect(testV).To(Equal(desiredLRPUpdate)) }) + + Context("with image credentials", func() { + var updateWithCredentials models.DesiredLRPUpdate + var expectedJSONWithCredentials string + + BeforeEach(func() { + updateWithCredentials.SetInstances(2) + updateWithCredentials.SetImageUsername("testuser") + updateWithCredentials.SetImagePassword("testpass") + expectedJSONWithCredentials = `{ + "instances": 2, + "image_username": "testuser", + "image_password": "testpass" + }` + }) + + It("can marshal image credentials to JSON", func() { + jsonBytes, err := json.Marshal(updateWithCredentials) + Expect(err).NotTo(HaveOccurred()) + Expect(jsonBytes).To(MatchJSON(expectedJSONWithCredentials)) + }) + + It("can unmarshal image credentials from JSON", func() { + var testV models.DesiredLRPUpdate + Expect(json.Unmarshal([]byte(expectedJSONWithCredentials), &testV)).To(Succeed()) + Expect(testV.ImageUsernameExists()).To(BeTrue()) + Expect(testV.GetImageUsername()).To(Equal("testuser")) + Expect(testV.ImagePasswordExists()).To(BeTrue()) + Expect(testV.GetImagePassword()).To(Equal("testpass")) + }) + + It("can round-trip image credentials through JSON", func() { + jsonBytes, err := json.Marshal(updateWithCredentials) + Expect(err).NotTo(HaveOccurred()) + + var testV models.DesiredLRPUpdate + Expect(json.Unmarshal(jsonBytes, &testV)).To(Succeed()) + Expect(testV.ImageUsernameExists()).To(BeTrue()) + Expect(testV.GetImageUsername()).To(Equal("testuser")) + Expect(testV.ImagePasswordExists()).To(BeTrue()) + Expect(testV.GetImagePassword()).To(Equal("testpass")) + }) + + It("omits image credentials from JSON when not set", func() { + updateWithoutCredentials := models.DesiredLRPUpdate{} + updateWithoutCredentials.SetInstances(2) + jsonBytes, err := json.Marshal(updateWithoutCredentials) + Expect(err).NotTo(HaveOccurred()) + Expect(string(jsonBytes)).NotTo(ContainSubstring("image_username")) + Expect(string(jsonBytes)).NotTo(ContainSubstring("image_password")) + }) + }) }) Describe("IsMetricTagsUpdated", func() { @@ -1568,6 +1620,23 @@ var _ = Describe("DesiredLRPUpdate", func() { existingLRP.ImagePassword = "" }) + It("returns false when no credentials are provided in update", func() { + update := &models.DesiredLRPUpdate{} + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + + It("returns false when only username is provided in update", func() { + update := &models.DesiredLRPUpdate{} + update.SetImageUsername("new-username") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + + It("returns false when only password is provided in update", func() { + update := &models.DesiredLRPUpdate{} + update.SetImagePassword("new-password") + Expect(update.IsImageCredentialsUpdated(existingLRP)).To(BeFalse()) + }) + It("returns true when new credentials are provided", func() { update := &models.DesiredLRPUpdate{} update.SetImageUsername("new-username")