diff --git a/api/config/pg_gateway/config_request.go b/api/config/pg_gateway/config_request.go index 0af6f0c8328..509a045ca0b 100644 --- a/api/config/pg_gateway/config_request.go +++ b/api/config/pg_gateway/config_request.go @@ -41,7 +41,7 @@ func DefaultConfigRequest() *ConfigRequest { c.V1.Sys.Timeouts.Idle = w.Int32(43200) c.V1.Sys.Resolvers.EnableSystemNameservers = w.Bool(false) c.V1.Sys.MaxConnections = w.Int32(350) - + c.V1.Sys.AutomateHaChefManagePg = w.Bool(false) return c } diff --git a/api/config/pg_gateway/config_request.pb.go b/api/config/pg_gateway/config_request.pb.go index 136b956c737..552ff78d5a7 100644 --- a/api/config/pg_gateway/config_request.pb.go +++ b/api/config/pg_gateway/config_request.pb.go @@ -124,13 +124,14 @@ type ConfigRequest_V1_System struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mlsa *shared.Mlsa `protobuf:"bytes,1,opt,name=mlsa,proto3" json:"mlsa,omitempty" toml:"mlsa,omitempty" mapstructure:"mlsa,omitempty"` - Service *ConfigRequest_V1_System_Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty" toml:"service,omitempty" mapstructure:"service,omitempty"` - Tls *shared.TLSCredentials `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty" toml:"tls,omitempty" mapstructure:"tls,omitempty"` - Log *shared.Log `protobuf:"bytes,4,opt,name=log,proto3" json:"log,omitempty" toml:"log,omitempty" mapstructure:"log,omitempty"` - Timeouts *ConfigRequest_V1_System_Timeouts `protobuf:"bytes,5,opt,name=timeouts,proto3" json:"timeouts,omitempty" toml:"timeouts,omitempty" mapstructure:"timeouts,omitempty"` - Resolvers *ConfigRequest_V1_System_Resolvers `protobuf:"bytes,6,opt,name=resolvers,proto3" json:"resolvers,omitempty" toml:"resolvers,omitempty" mapstructure:"resolvers,omitempty"` - MaxConnections *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=max_connections,json=maxConnections,proto3" json:"max_connections,omitempty" toml:"max_connections,omitempty" mapstructure:"max_connections,omitempty"` + Mlsa *shared.Mlsa `protobuf:"bytes,1,opt,name=mlsa,proto3" json:"mlsa,omitempty" toml:"mlsa,omitempty" mapstructure:"mlsa,omitempty"` + Service *ConfigRequest_V1_System_Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty" toml:"service,omitempty" mapstructure:"service,omitempty"` + Tls *shared.TLSCredentials `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty" toml:"tls,omitempty" mapstructure:"tls,omitempty"` + Log *shared.Log `protobuf:"bytes,4,opt,name=log,proto3" json:"log,omitempty" toml:"log,omitempty" mapstructure:"log,omitempty"` + Timeouts *ConfigRequest_V1_System_Timeouts `protobuf:"bytes,5,opt,name=timeouts,proto3" json:"timeouts,omitempty" toml:"timeouts,omitempty" mapstructure:"timeouts,omitempty"` + Resolvers *ConfigRequest_V1_System_Resolvers `protobuf:"bytes,6,opt,name=resolvers,proto3" json:"resolvers,omitempty" toml:"resolvers,omitempty" mapstructure:"resolvers,omitempty"` + MaxConnections *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=max_connections,json=maxConnections,proto3" json:"max_connections,omitempty" toml:"max_connections,omitempty" mapstructure:"max_connections,omitempty"` + AutomateHaChefManagePg *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=automate_ha_chef_manage_pg,json=automateHaChefManagePg,proto3" json:"automate_ha_chef_manage_pg,omitempty" toml:"automate_ha_chef_manage_pg,omitempty" mapstructure:"automate_ha_chef_manage_pg,omitempty"` } func (x *ConfigRequest_V1_System) Reset() { @@ -214,6 +215,13 @@ func (x *ConfigRequest_V1_System) GetMaxConnections() *wrapperspb.Int32Value { return nil } +func (x *ConfigRequest_V1_System) GetAutomateHaChefManagePg() *wrapperspb.BoolValue { + if x != nil { + return x.AutomateHaChefManagePg + } + return nil +} + type ConfigRequest_V1_System_Resolvers struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -476,18 +484,18 @@ var file_config_pg_gateway_config_request_proto_rawDesc = []byte{ 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x32, 0x63, 0x6f, 0x6e, 0x66, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, - 0x0b, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, + 0x0c, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x67, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, 0x52, 0x02, - 0x76, 0x31, 0x1a, 0x82, 0x0b, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x49, 0x0a, 0x03, 0x73, 0x79, 0x73, + 0x76, 0x31, 0x1a, 0xda, 0x0b, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x49, 0x0a, 0x03, 0x73, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x67, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, - 0x03, 0x73, 0x79, 0x73, 0x1a, 0xb0, 0x0a, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, + 0x03, 0x73, 0x79, 0x73, 0x1a, 0x88, 0x0b, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x34, 0x0a, 0x04, 0x6d, 0x6c, 0x73, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4d, 0x6c, 0x73, 0x61, 0x52, @@ -520,62 +528,68 @@ var file_config_pg_gateway_config_request_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xa3, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x73, 0x12, 0x56, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x1a, 0xad, 0x01, 0x0a, - 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x5f, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x69, 0x73, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x70, 0x6f, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xd4, 0x02, 0x0a, - 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x46, - 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, - 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x15, 0xc2, 0xf3, 0x18, 0x11, 0x0a, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0xa1, 0x4f, 0x1a, 0x03, 0x74, 0x63, 0x70, - 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x60, 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, - 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, - 0x65, 0x73, 0x71, 0x6c, 0x52, 0x12, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, - 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x12, 0x63, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x73, - 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, - 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x67, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, - 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x0b, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x04, 0x08, - 0x03, 0x10, 0x04, 0x1a, 0x72, 0x0a, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x73, 0x12, - 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x2f, 0x0a, 0x04, 0x69, 0x64, 0x6c, 0x65, 0x18, 0x02, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x56, 0x0a, 0x1a, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, + 0x74, 0x65, 0x5f, 0x68, 0x61, 0x5f, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x5f, 0x70, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x16, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, + 0x48, 0x61, 0x43, 0x68, 0x65, 0x66, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x50, 0x67, 0x1a, 0xa3, + 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0b, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x56, 0x0a, 0x19, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x17, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x73, 0x1a, 0xad, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x08, 0x69, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, + 0x70, 0x6f, 0x72, 0x74, 0x1a, 0xd4, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x34, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x02, 0x18, 0x01, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x04, 0x69, 0x64, 0x6c, 0x65, 0x3a, 0x19, 0xc2, 0xf3, 0x18, 0x15, 0x0a, 0x13, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2d, 0x70, 0x67, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x70, 0x67, 0x5f, 0x67, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x42, 0x15, 0xc2, 0xf3, 0x18, 0x11, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x10, 0xa1, 0x4f, 0x1a, 0x03, 0x74, 0x63, 0x70, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x60, + 0x0a, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x74, 0x67, + 0x72, 0x65, 0x73, 0x71, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x68, + 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, 0x52, 0x12, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x71, 0x6c, + 0x12, 0x63, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, + 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2e, 0x70, 0x67, 0x5f, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x31, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, + 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x1a, 0x72, 0x0a, 0x08, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x2f, + 0x0a, 0x04, 0x69, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x69, 0x64, 0x6c, 0x65, 0x3a, + 0x19, 0xc2, 0xf3, 0x18, 0x15, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2d, + 0x70, 0x67, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, + 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x70, 0x67, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -603,8 +617,8 @@ var file_config_pg_gateway_config_request_proto_goTypes = []interface{}{ (*shared.TLSCredentials)(nil), // 8: chef.automate.infra.config.TLSCredentials (*shared.Log)(nil), // 9: chef.automate.infra.config.Log (*wrapperspb.Int32Value)(nil), // 10: google.protobuf.Int32Value - (*wrapperspb.StringValue)(nil), // 11: google.protobuf.StringValue - (*wrapperspb.BoolValue)(nil), // 12: google.protobuf.BoolValue + (*wrapperspb.BoolValue)(nil), // 11: google.protobuf.BoolValue + (*wrapperspb.StringValue)(nil), // 12: google.protobuf.StringValue (*shared.External_Postgresql)(nil), // 13: chef.automate.infra.config.External.Postgresql } var file_config_pg_gateway_config_request_proto_depIdxs = []int32{ @@ -617,22 +631,23 @@ var file_config_pg_gateway_config_request_proto_depIdxs = []int32{ 6, // 6: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.timeouts:type_name -> chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Timeouts 3, // 7: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.resolvers:type_name -> chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Resolvers 10, // 8: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.max_connections:type_name -> google.protobuf.Int32Value - 11, // 9: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Resolvers.nameservers:type_name -> google.protobuf.StringValue - 12, // 10: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Resolvers.enable_system_nameservers:type_name -> google.protobuf.BoolValue - 12, // 11: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.is_domain:type_name -> google.protobuf.BoolValue - 11, // 12: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.address:type_name -> google.protobuf.StringValue - 11, // 13: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.port:type_name -> google.protobuf.StringValue - 11, // 14: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.host:type_name -> google.protobuf.StringValue - 10, // 15: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.port:type_name -> google.protobuf.Int32Value - 13, // 16: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.external_postgresql:type_name -> chef.automate.infra.config.External.Postgresql - 4, // 17: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.parsed_nodes:type_name -> chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint - 10, // 18: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Timeouts.connect:type_name -> google.protobuf.Int32Value - 10, // 19: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Timeouts.idle:type_name -> google.protobuf.Int32Value - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 11, // 9: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.automate_ha_chef_manage_pg:type_name -> google.protobuf.BoolValue + 12, // 10: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Resolvers.nameservers:type_name -> google.protobuf.StringValue + 11, // 11: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Resolvers.enable_system_nameservers:type_name -> google.protobuf.BoolValue + 11, // 12: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.is_domain:type_name -> google.protobuf.BoolValue + 12, // 13: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.address:type_name -> google.protobuf.StringValue + 12, // 14: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint.port:type_name -> google.protobuf.StringValue + 12, // 15: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.host:type_name -> google.protobuf.StringValue + 10, // 16: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.port:type_name -> google.protobuf.Int32Value + 13, // 17: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.external_postgresql:type_name -> chef.automate.infra.config.External.Postgresql + 4, // 18: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Service.parsed_nodes:type_name -> chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Endpoint + 10, // 19: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Timeouts.connect:type_name -> google.protobuf.Int32Value + 10, // 20: chef.automate.infra.pg_gateway.ConfigRequest.V1.System.Timeouts.idle:type_name -> google.protobuf.Int32Value + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_config_pg_gateway_config_request_proto_init() } diff --git a/api/config/pg_gateway/config_request.proto b/api/config/pg_gateway/config_request.proto index 921b9655435..e7786451926 100644 --- a/api/config/pg_gateway/config_request.proto +++ b/api/config/pg_gateway/config_request.proto @@ -24,6 +24,7 @@ message ConfigRequest { Timeouts timeouts = 5; Resolvers resolvers = 6; google.protobuf.Int32Value max_connections = 7; + google.protobuf.BoolValue automate_ha_chef_manage_pg = 8; message Resolvers { repeated google.protobuf.StringValue nameservers = 1; @@ -42,6 +43,7 @@ message ConfigRequest { reserved 3; chef.automate.infra.config.External.Postgresql external_postgresql = 4; repeated Endpoint parsed_nodes = 5; + } message Timeouts { diff --git a/components/automate-backend-deployment/README.md b/components/automate-backend-deployment/README.md index 53b1a1df597..9c0d0a5f5a2 100644 --- a/components/automate-backend-deployment/README.md +++ b/components/automate-backend-deployment/README.md @@ -5,3 +5,4 @@ This provides the `automate-backend-deployment` package. This package will build a package using terraform/a2ha-terraform, inspecs, test, certs and Makefile. This is the heart of the a2ha because this component will set up a workspace for a2ha and all the a2ha command will get available after installing this package. + diff --git a/components/automate-cli/habitat/plan.sh b/components/automate-cli/habitat/plan.sh index 3e6f95dc9c0..a23d21f5f15 100644 --- a/components/automate-cli/habitat/plan.sh +++ b/components/automate-cli/habitat/plan.sh @@ -42,6 +42,4 @@ do_after() { ln -sv "${pkg_prefix}/bin/${bin}" "${bin_path}" sha256sum "${bin_path}" | cut -d ' ' -f1 > "${bin_sha_path}" done -} - - +} \ No newline at end of file diff --git a/components/automate-deployment/habitat/plan.sh b/components/automate-deployment/habitat/plan.sh index 70d7b7ff694..63ea4b184c8 100644 --- a/components/automate-deployment/habitat/plan.sh +++ b/components/automate-deployment/habitat/plan.sh @@ -53,3 +53,5 @@ scaffolding_go_binary_list=( do_strip() { return 0 } + + diff --git a/components/automate-pg-gateway/habitat/config/haproxy.conf b/components/automate-pg-gateway/habitat/config/haproxy.conf index cf050a4f002..c74e8eb4f75 100644 --- a/components/automate-pg-gateway/habitat/config/haproxy.conf +++ b/components/automate-pg-gateway/habitat/config/haproxy.conf @@ -55,10 +55,10 @@ backend automate_postgresql {{~#if ../cfg.resolvers.nameservers }} server-template {{node.address}} 8 {{node.address}}:{{node.port}} check resolvers pgdns init-addr none resolve-prefer ipv4 {{else}} - server {{node.address}} {{node.address}}:{{node.port}} maxconn {{../cfg.max_connections}} check port 6432 + server {{node.address}} {{node.address}}:{{node.port}} maxconn {{../cfg.max_connections}} {{~#if ../cfg.automate_ha_chef_manage_pg }} check port 6432 {{~/if}} {{~/if}} {{else}} - server {{node.address}} {{node.address}}:{{node.port}} maxconn {{../cfg.max_connections}} check port 6432 + server {{node.address}} {{node.address}}:{{node.port}} maxconn {{../cfg.max_connections}} {{~#if ../cfg.automate_ha_chef_manage_pg }} check port 6432 {{~/if}} {{~/if}} {{~/each}} {{else~}} diff --git a/components/automate-pg-gateway/habitat/default.toml b/components/automate-pg-gateway/habitat/default.toml index 8ad12de862a..23a4e5e6d79 100644 --- a/components/automate-pg-gateway/habitat/default.toml +++ b/components/automate-pg-gateway/habitat/default.toml @@ -1,5 +1,5 @@ max_connections = 350 - +automate_ha_chef_manage_pg = false [service] host = "0.0.0.0" port = 10145 diff --git a/terraform/a2ha-terraform/modules/automate/files/config.toml.erb b/terraform/a2ha-terraform/modules/automate/files/config.toml.erb index dc6f49d86bd..c2a7fb9d8a4 100644 --- a/terraform/a2ha-terraform/modules/automate/files/config.toml.erb +++ b/terraform/a2ha-terraform/modules/automate/files/config.toml.erb @@ -3399,3 +3399,9 @@ rM2p0kk= base_path = "automate" <% end %> +<% if services[:postgresql][:setup_managed_services] == false && overrides[:setup_self_managed_services] == false -%> +[pg_gateway] + [pg_gateway.v1] + [pg_gateway.v1.sys] + automate_ha_chef_manage_pg = true +<% end %> \ No newline at end of file diff --git a/terraform/a2ha-terraform/modules/automate/templates/provision.sh.tpl b/terraform/a2ha-terraform/modules/automate/templates/provision.sh.tpl index 68d41aa803a..4f120351907 100644 --- a/terraform/a2ha-terraform/modules/automate/templates/provision.sh.tpl +++ b/terraform/a2ha-terraform/modules/automate/templates/provision.sh.tpl @@ -60,36 +60,51 @@ export HAB_SUP_GATEWAY_AUTH_TOKEN=${hab_sup_http_gateway_auth_token} export isSkipRequired=false # Below function is calculating the version of the install version and airgap bundle version # and do comparision in case if both are same it set isSkipRequired=true +semver_version_check() { + installed_version=$1 + airgap_bundle_version=$2 + + IFS='.' read -r major1 minor1 patch1 <<< "$installed_version" + IFS='.' read -r major2 minor2 patch2 <<< "$airgap_bundle_version" + + # Compare major versions + if (( major1 > major2 )); then + echo "$installed_version is greater than $airgap_bundle_version" + isSkipRequired=true + elif (( major1 < major2 )); then + echo "$airgap_bundle_version is greater than $installed_version, proceeding for upgrade" + else + # Compare minor versions + if (( minor1 > minor2 )); then + echo "$installed_version is greater than $airgap_bundle_version" + isSkipRequired=true + elif (( minor1 < minor2 )); then + echo "$airgap_bundle_version is greater than $installed_version, proceeding for upgrade" + else + # Compare patch versions + if (( patch1 > patch2 )); then + echo "$installed_version is greater than $airgap_bundle_version" + isSkipRequired=true + elif (( patch1 < patch2 )); then + echo "$airgap_bundle_version is greater than $installed_version, proceeding for upgrade" + else + echo "Both versions are equal" + isSkipRequired=true + fi + fi + fi +} + version_check_for_addnode() { installed_version=$(chef-automate version 2>/dev/null | grep Server | awk '{print $3}') airgap_bundle_version=$(chef-automate airgap bundle info ${frontend_aib_file} 2>/dev/null | grep "Version" | awk '{print $2}') - # Uncomment this if you want to override the versions for testing - # installed_version=$1 - # airgap_bundle_version=$2 - + # installed_version=$1 4.12.144 + # airgap_bundle_version=$2 4.13.0 echo "Installed Version: $installed_version" echo "Airgap Bundle Version: $airgap_bundle_version" - - # Split the version strings into arrays based on the dot separator - IFS='.' read -ra ver1_arr <<< "$installed_version" - IFS='.' read -ra ver2_arr <<< "$airgap_bundle_version" - - # Determine the number of components in the version strings - num_components1=$${#ver1_arr[@]} - num_components2=$${#ver2_arr[@]} - - # Compare each component of the version strings - for ((i = 0; i < num_components1 && i < num_components2; i++)); do - if [ "$${ver1_arr[i]}" -lt "$${ver2_arr[i]}" ]; then - echo "Airgap bundle version $airgap_bundle_version is greater than installed version $installed_version" - elif [ "$${ver1_arr[i]}" -gt "$${ver2_arr[i]}" ]; then - echo "Installed version $installed_version is greater than airgap bundle $airgap_bundle_version" - isSkipRequired=true - fi - done - -# If we reach this point, the version strings are equal up to the common components. + semver_version_check $installed_version $airgap_bundle_version + # If we reach this point, the version strings are equal up to the common components. if [ $installed_version = $airgap_bundle_version ]; then echo "Both version strings are equal." isSkipRequired=true